org.apache.openejb.config
Class ConfigurationFactory

java.lang.Object
  extended by org.apache.openejb.config.ConfigurationFactory
All Implemented Interfaces:
OpenEjbConfigurationFactory

public class ConfigurationFactory
extends Object
implements OpenEjbConfigurationFactory


Nested Class Summary
static class ConfigurationFactory.Chain
           
static class ConfigurationFactory.ResourceInfoComparator
           
 
Field Summary
protected static String VALIDATION_SKIP_PROPERTY
           
 
Constructor Summary
ConfigurationFactory()
           
ConfigurationFactory(boolean offline)
           
ConfigurationFactory(boolean offline, DynamicDeployer preAutoConfigDeployer)
           
ConfigurationFactory(boolean offline, DynamicDeployer preAutoConfigDeployer, OpenEjbConfiguration configuration)
           
ConfigurationFactory(boolean offline, OpenEjbConfiguration configuration)
           
 
Method Summary
 AppInfo configureApplication(AppModule appModule)
           
 AppInfo configureApplication(ClassLoader classLoader, String id, List<File> jarFiles)
           
 ClientInfo configureApplication(ClientModule clientModule)
           
 ConnectorInfo configureApplication(ConnectorModule connectorModule)
           
 EjbJarInfo configureApplication(EjbJar ejbJar)
           
 EjbJarInfo configureApplication(EjbModule ejbModule)
           
 AppInfo configureApplication(File jarFile)
           
 WebAppInfo configureApplication(WebModule webModule)
           
<T extends ServiceInfo>
T
configureService(Class<? extends T> type)
           
<T extends ServiceInfo>
T
configureService(Class<? extends T> type, String serviceId, Properties declaredProperties, String providerId, String serviceType)
          Resolving the provider for a particular service follows this algorithm: 1.
<T extends ServiceInfo>
T
configureService(Service service, Class<? extends T> infoType)
          This is the major piece of code that configures servics It merges the data from the declaration with the data from the openejb.xml file (say ) The end result is a canonical (i.e.
<T extends ServiceInfo>
T
configureService(String id, Class<? extends T> type)
           
 ContainerInfo createContainerInfo(Container container)
           
protected  List<String> getContainerIds()
           
protected  List<ContainerInfo> getContainerInfos()
           
protected static Class<? extends ContainerInfo> getContainerInfoType(String ctype)
           
 OpenEjbConfiguration getOpenEjbConfiguration()
          Main loop that gets executed when OpenEJB starts up Reads config files and produces the basic "AST" the assembler needs to actually build the contianer system This method is called by the Assembler once at startup.
protected  List<String> getResourceIds()
           
protected  List<String> getResourceIds(String type)
           
protected  List<String> getResourceIds(String type, Properties required)
           
protected  ResourceInfo getResourceInfo(String id)
           
protected static Properties getSystemProperties(String serviceId, String serviceType)
           
 void init(Properties props)
           
protected  void install(ContainerInfo serviceInfo)
           
protected  void install(ResourceInfo serviceInfo)
           
protected  Object toConfigDeclaration(String name, String value)
           
 Object toConfigDeclaration(String id, URI uri)
           
static List<HandlerChainInfo> toHandlerChainInfo(HandlerChains chains)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATION_SKIP_PROPERTY

protected static final String VALIDATION_SKIP_PROPERTY
See Also:
Constant Field Values
Constructor Detail

ConfigurationFactory

public ConfigurationFactory()

ConfigurationFactory

public ConfigurationFactory(boolean offline)

ConfigurationFactory

public ConfigurationFactory(boolean offline,
                            DynamicDeployer preAutoConfigDeployer)

ConfigurationFactory

public ConfigurationFactory(boolean offline,
                            OpenEjbConfiguration configuration)

ConfigurationFactory

public ConfigurationFactory(boolean offline,
                            DynamicDeployer preAutoConfigDeployer,
                            OpenEjbConfiguration configuration)
Method Detail

toHandlerChainInfo

public static List<HandlerChainInfo> toHandlerChainInfo(HandlerChains chains)

init

public void init(Properties props)
          throws OpenEJBException
Specified by:
init in interface OpenEjbConfigurationFactory
Throws:
OpenEJBException

install

protected void install(ContainerInfo serviceInfo)
                throws OpenEJBException
Throws:
OpenEJBException

install

protected void install(ResourceInfo serviceInfo)
                throws OpenEJBException
Throws:
OpenEJBException

getOpenEjbConfiguration

public OpenEjbConfiguration getOpenEjbConfiguration()
                                             throws OpenEJBException
Main loop that gets executed when OpenEJB starts up Reads config files and produces the basic "AST" the assembler needs to actually build the contianer system This method is called by the Assembler once at startup.

Specified by:
getOpenEjbConfiguration in interface OpenEjbConfigurationFactory
Returns:
Throws:
OpenEJBException

createContainerInfo

public ContainerInfo createContainerInfo(Container container)
                                  throws OpenEJBException
Throws:
OpenEJBException

toConfigDeclaration

protected Object toConfigDeclaration(String name,
                                     String value)
                              throws URISyntaxException,
                                     OpenEJBException
Throws:
URISyntaxException
OpenEJBException

toConfigDeclaration

public Object toConfigDeclaration(String id,
                                  URI uri)
                           throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public AppInfo configureApplication(File jarFile)
                             throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public AppInfo configureApplication(ClassLoader classLoader,
                                    String id,
                                    List<File> jarFiles)
                             throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public EjbJarInfo configureApplication(EjbJar ejbJar)
                                throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public EjbJarInfo configureApplication(EjbModule ejbModule)
                                throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public ClientInfo configureApplication(ClientModule clientModule)
                                throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public ConnectorInfo configureApplication(ConnectorModule connectorModule)
                                   throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public WebAppInfo configureApplication(WebModule webModule)
                                throws OpenEJBException
Throws:
OpenEJBException

configureApplication

public AppInfo configureApplication(AppModule appModule)
                             throws OpenEJBException
Throws:
OpenEJBException

configureService

public <T extends ServiceInfo> T configureService(Class<? extends T> type)
                                       throws OpenEJBException
Throws:
OpenEJBException

configureService

public <T extends ServiceInfo> T configureService(Service service,
                                                  Class<? extends T> infoType)
                                       throws OpenEJBException
This is the major piece of code that configures servics It merges the data from the declaration with the data from the openejb.xml file (say ) The end result is a canonical (i.e. flattened) ServiceInfo The ServiceInfo will be of a specific type (ContainerInfo, ResourceInfo, etc)

Type Parameters:
T -
Parameters:
service -
infoType -
Returns:
Throws:
OpenEJBException

configureService

public <T extends ServiceInfo> T configureService(String id,
                                                  Class<? extends T> type)
                                       throws OpenEJBException
Throws:
OpenEJBException

configureService

public <T extends ServiceInfo> T configureService(Class<? extends T> type,
                                                  String serviceId,
                                                  Properties declaredProperties,
                                                  String providerId,
                                                  String serviceType)
                                       throws OpenEJBException
Resolving the provider for a particular service follows this algorithm: 1. Attempt to load the provider specified by the 'providerId'. 2. If this fails, throw NoSuchProviderException 3. If providerId is null, attempt to load the specified provider using the 'serviceId' as the 'providerId' 4. If this fails, check the hardcoded defaults for a default providerId using the supplied 'type' 5. If this fails, throw NoSuchProviderException

Throws:
OpenEJBException

getSystemProperties

protected static Properties getSystemProperties(String serviceId,
                                                String serviceType)

getContainerInfoType

protected static Class<? extends ContainerInfo> getContainerInfoType(String ctype)

getResourceIds

protected List<String> getResourceIds()

getResourceIds

protected List<String> getResourceIds(String type)

getResourceIds

protected List<String> getResourceIds(String type,
                                      Properties required)

getResourceInfo

protected ResourceInfo getResourceInfo(String id)

getContainerIds

protected List<String> getContainerIds()

getContainerInfos

protected List<ContainerInfo> getContainerInfos()


Copyright © 1999-2013 The Apache OpenEJB development community. All Rights Reserved.