Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start to factor out the Bootstrap API
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1561 1c488680-804c-0410-94cd-c6b725194a0e
- Loading branch information
Showing
19 changed files
with
522 additions
and
461 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
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
85 changes: 85 additions & 0 deletions
85
webbeans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/api/Bootstrap.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,85 @@ | ||
package org.jboss.webbeans.bootstrap.api; | ||
|
||
import javax.inject.manager.Manager; | ||
|
||
import org.jboss.webbeans.bootstrap.spi.EjbDiscovery; | ||
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery; | ||
import org.jboss.webbeans.ejb.spi.EjbResolver; | ||
import org.jboss.webbeans.resources.spi.NamingContext; | ||
import org.jboss.webbeans.resources.spi.ResourceLoader; | ||
|
||
/** | ||
* Bootstrap API for Web Beans. | ||
* | ||
* @author Pete Muir | ||
* | ||
*/ | ||
public interface Bootstrap | ||
{ | ||
|
||
/** | ||
* Set the Web Bean Discovery to use | ||
* | ||
* @param webBeanDiscovery | ||
*/ | ||
public void setWebBeanDiscovery(WebBeanDiscovery webBeanDiscovery); | ||
|
||
/** | ||
* Set the EjbDiscovery to use | ||
* | ||
* @param ejbDiscovery | ||
*/ | ||
public void setEjbDiscovery(EjbDiscovery ejbDiscovery); | ||
|
||
/** | ||
* Set the EjbResolver to use | ||
* | ||
* @param ejbResolver | ||
*/ | ||
public void setEjbResolver(EjbResolver ejbResolver); | ||
|
||
/** | ||
* Set the NamingContext to use. | ||
* | ||
* By default @{link org.jboss.webbeans.resources.DefaultNamingContext} will | ||
* be used | ||
* | ||
* @param namingContext | ||
*/ | ||
public void setNamingContext(NamingContext namingContext); | ||
|
||
/** | ||
* Set the ResourceLoader to use. By default @{link | ||
* org.jboss.webbeans.resources.DefaultResourceLoader} will be used | ||
* | ||
* @param resourceLoader | ||
*/ | ||
public void setResourceLoader(ResourceLoader resourceLoader); | ||
|
||
/** | ||
* Initialize the bootstrap: | ||
* <ul> | ||
* <li>Create the manager and bind it to JNDI</li> | ||
* </ul> | ||
*/ | ||
public void initialize(); | ||
|
||
/** | ||
* Get the manager being used for bootstrap. | ||
* | ||
* @return the manager. Unless {@link #initialize()} has been called, this | ||
* method will return null. | ||
*/ | ||
public Manager getManager(); | ||
|
||
/** | ||
* Starts the boot process. | ||
* | ||
* Discovers the beans and registers them with the getManager(). Also | ||
* resolves the injection points. Before running {@link #boot()} the contexts | ||
* should be available | ||
* | ||
*/ | ||
public void boot(); | ||
|
||
} |
69 changes: 69 additions & 0 deletions
69
...eans-ri-spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/AbstractBootstrap.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,69 @@ | ||
package org.jboss.webbeans.bootstrap.api.helpers; | ||
|
||
import org.jboss.webbeans.bootstrap.api.Bootstrap; | ||
import org.jboss.webbeans.bootstrap.spi.EjbDiscovery; | ||
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery; | ||
import org.jboss.webbeans.ejb.spi.EjbResolver; | ||
import org.jboss.webbeans.resources.spi.NamingContext; | ||
import org.jboss.webbeans.resources.spi.ResourceLoader; | ||
|
||
public abstract class AbstractBootstrap implements Bootstrap | ||
{ | ||
|
||
private WebBeanDiscovery webBeanDiscovery; | ||
private ResourceLoader resourceLoader; | ||
private NamingContext namingContext; | ||
private EjbResolver ejbResolver; | ||
private EjbDiscovery ejbDiscovery; | ||
|
||
public void setEjbDiscovery(EjbDiscovery ejbDiscovery) | ||
{ | ||
this.ejbDiscovery = ejbDiscovery; | ||
} | ||
|
||
public void setEjbResolver(EjbResolver ejbResolver) | ||
{ | ||
this.ejbResolver = ejbResolver; | ||
} | ||
|
||
public void setNamingContext(NamingContext namingContext) | ||
{ | ||
this.namingContext = namingContext; | ||
} | ||
|
||
public void setResourceLoader(ResourceLoader resourceLoader) | ||
{ | ||
this.resourceLoader = resourceLoader; | ||
} | ||
|
||
public void setWebBeanDiscovery(WebBeanDiscovery webBeanDiscovery) | ||
{ | ||
this.webBeanDiscovery = webBeanDiscovery; | ||
} | ||
|
||
public WebBeanDiscovery getWebBeanDiscovery() | ||
{ | ||
return webBeanDiscovery; | ||
} | ||
|
||
public ResourceLoader getResourceLoader() | ||
{ | ||
return resourceLoader; | ||
} | ||
|
||
public NamingContext getNamingContext() | ||
{ | ||
return namingContext; | ||
} | ||
|
||
public EjbResolver getEjbResolver() | ||
{ | ||
return ejbResolver; | ||
} | ||
|
||
public EjbDiscovery getEjbDiscovery() | ||
{ | ||
return ejbDiscovery; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.