Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stop exposing the Scanner API at all, javadoc, add helper classes for…
… creating BDAs and Deployments, cleanup now that we don't expose the scanner api
- Loading branch information
Showing
10 changed files
with
283 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ain/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEBeanDeploymentArchive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.jboss.weld.environment.se.discovery; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
import org.jboss.weld.bootstrap.api.ServiceRegistry; | ||
import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry; | ||
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive; | ||
import org.jboss.weld.ejb.spi.EjbDescriptor; | ||
|
||
/** | ||
* Implements the basic requirements of a {@link BeanDeploymentArchive} (bean | ||
* archive id and service registry). | ||
* | ||
* Suitable for extension by those who need to build custom | ||
* {@link BeanDeploymentArchive} implementations. | ||
* | ||
* @see MutableBeanDeploymentArchive | ||
* @see ImmutableBeanDeploymentArchive | ||
* | ||
* @author Pete Muir | ||
* | ||
*/ | ||
public abstract class AbstractWeldSEBeanDeploymentArchive implements BeanDeploymentArchive | ||
{ | ||
|
||
private final ServiceRegistry serviceRegistry; | ||
private final String id; | ||
|
||
public AbstractWeldSEBeanDeploymentArchive(String id) | ||
{ | ||
this.id = id; | ||
this.serviceRegistry = new SimpleServiceRegistry(); | ||
} | ||
|
||
public Collection<EjbDescriptor<?>> getEjbs() | ||
{ | ||
return Collections.emptyList(); | ||
} | ||
|
||
public String getId() | ||
{ | ||
return id; | ||
} | ||
|
||
public ServiceRegistry getServices() | ||
{ | ||
return serviceRegistry; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/org/jboss/weld/environment/se/discovery/AbstractWeldSEDeployment.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.jboss.weld.environment.se.discovery; | ||
|
||
import org.jboss.weld.bootstrap.api.ServiceRegistry; | ||
import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry; | ||
import org.jboss.weld.bootstrap.spi.Deployment; | ||
|
||
/** | ||
* Implements the basic requirements of a {@link Deployment}. Provides a service | ||
* registry. | ||
* | ||
* Suitable for extension by those who need to build custom {@link Deployment} | ||
* implementations. | ||
* | ||
* @author Pete Muir | ||
* | ||
*/ | ||
public abstract class AbstractWeldSEDeployment implements Deployment | ||
{ | ||
|
||
public static final String[] RESOURCES = { "META-INF/beans.xml" }; | ||
|
||
private final ServiceRegistry serviceRegistry; | ||
|
||
public AbstractWeldSEDeployment() | ||
{ | ||
this.serviceRegistry = new SimpleServiceRegistry(); | ||
} | ||
|
||
public ServiceRegistry getServices() | ||
{ | ||
return serviceRegistry; | ||
} | ||
|
||
} |
75 changes: 75 additions & 0 deletions
75
src/main/java/org/jboss/weld/environment/se/discovery/ImmutableBeanDeploymentArchive.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* JBoss, Home of Professional Open Source | ||
* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual | ||
* contributors by the @authors tag. See the copyright.txt in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jboss.weld.environment.se.discovery; | ||
|
||
import java.net.URL; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive; | ||
import org.jboss.weld.bootstrap.spi.Deployment; | ||
|
||
/** | ||
* An immutable implementation of {@link BeanDeploymentArchive} which must have | ||
* classes and beans.xml resources added to it via | ||
* {@link ImmutableBeanDeploymentArchive#ImmutableBeanDeploymentArchive(String, Collection, Collection, List)} | ||
* or | ||
* {@link ImmutableBeanDeploymentArchive#ImmutableBeanDeploymentArchive(String, Collection, Collection)} | ||
* | ||
* See {@link Deployment} for more detailed information on creating deployment | ||
* structures. | ||
* | ||
* @author Pete Muir | ||
* | ||
*/ | ||
public class ImmutableBeanDeploymentArchive extends AbstractWeldSEBeanDeploymentArchive | ||
{ | ||
|
||
private final Collection<Class<?>> beanClasses; | ||
private final Collection<URL> beansXml; | ||
private final Collection<BeanDeploymentArchive> beanDeploymentArchives; | ||
|
||
public ImmutableBeanDeploymentArchive(String id, Collection<Class<?>> beanClasses, Collection<URL> beansXml, Collection<BeanDeploymentArchive> beanDeploymentArchives) | ||
{ | ||
super(id); | ||
this.beanClasses = beanClasses; | ||
this.beansXml = beansXml; | ||
this.beanDeploymentArchives = beanDeploymentArchives; | ||
} | ||
|
||
public ImmutableBeanDeploymentArchive(String id, Collection<Class<?>> beanClasses, Collection<URL> beansXml) | ||
{ | ||
this(id, beanClasses, beansXml, new ArrayList<BeanDeploymentArchive>()); | ||
} | ||
|
||
public Collection<Class<?>> getBeanClasses() | ||
{ | ||
return Collections.unmodifiableCollection(beanClasses); | ||
} | ||
|
||
public Collection<BeanDeploymentArchive> getBeanDeploymentArchives() | ||
{ | ||
return Collections.unmodifiableCollection(beanDeploymentArchives); | ||
} | ||
|
||
public Collection<URL> getBeansXml() | ||
{ | ||
return Collections.unmodifiableCollection(beansXml); | ||
} | ||
} |
Oops, something went wrong.