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.ProxyBeanClassUpdate
           
static class ConfigurationFactory.ResourceInfoComparator
           
 
Field Summary
static String ADDITIONAL_DEPLOYMENTS
           
static String OPENEJB_JDBC_DATASOURCE_CREATOR
           
protected static String VALIDATION_SKIP_PROPERTY
           
 
Constructor Summary
ConfigurationFactory()
           
ConfigurationFactory(boolean offline)
           
ConfigurationFactory(boolean offline, ConfigurationFactory.Chain deployerChain, OpenEjbConfiguration configuration)
           
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)
          embedded usage
 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 services.
<T extends ServiceInfo>
T
configureService(String id, Class<? extends T> type)
           
 ContainerInfo createContainerInfo(Container container)
           
static void fillOpenEjb(Openejb openejb, Properties sysProps)
           
protected  List<String> getContainerIds()
           
protected  List<ContainerInfo> getContainerInfos()
           
protected static Class<? extends ContainerInfo> getContainerInfoType(String ctype)
           
 ArrayList<File> getModulesFromClassPath(List<File> declaredApps, ClassLoader classLoader)
           
 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.

 OpenEjbConfiguration getOpenEjbConfiguration(File configuartionFile)
           
 OpenEjbConfiguration getOpenEjbConfiguration(Openejb providedConf)
           
protected static Properties getOverrides(Properties properties, String serviceId, String serviceType)
           
protected  List<String> getResourceIds()
           
protected  List<String> getResourceIds(String type)
           
 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)
           
static boolean isResourceType(String service, List<String> types, String type)
           
 AppModule loadApplication(ClassLoader classLoader, String id, List<File> jarFiles)
           
static void loadPropertiesDeclaredConfiguration(Openejb openejb)
           
static URI[] resolveClasspath(String rawstring)
          Takes a raw unparsed string expected to be in jvm classpath syntax and parses it, producing a collection of URIs representing the absolute file paths of the classpath to be created.
protected static Object toConfigDeclaration(String name, String value)
           
static 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

OPENEJB_JDBC_DATASOURCE_CREATOR

public static final String OPENEJB_JDBC_DATASOURCE_CREATOR
See Also:
Constant Field Values

ADDITIONAL_DEPLOYMENTS

public static final String ADDITIONAL_DEPLOYMENTS
See Also:
Constant Field Values

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)

ConfigurationFactory

public ConfigurationFactory(boolean offline,
                            ConfigurationFactory.Chain deployerChain,
                            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(File configuartionFile)
                                             throws OpenEJBException
Throws:
OpenEJBException

getOpenEjbConfiguration

public OpenEjbConfiguration getOpenEjbConfiguration(Openejb providedConf)
                                             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:
OpenEjbConfiguration
Throws:
OpenEJBException

getModulesFromClassPath

public ArrayList<File> getModulesFromClassPath(List<File> declaredApps,
                                               ClassLoader classLoader)

createContainerInfo

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

loadPropertiesDeclaredConfiguration

public static void loadPropertiesDeclaredConfiguration(Openejb openejb)

fillOpenEjb

public static void fillOpenEjb(Openejb openejb,
                               Properties sysProps)

toConfigDeclaration

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

toConfigDeclaration

public static 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
embedded usage

Parameters:
classLoader - classloader
id - id supplied from embedded properties or null
jarFiles - list of ejb modules
Returns:
configured AppInfo
Throws:
OpenEJBException - on error

loadApplication

public AppModule loadApplication(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 services. 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 - infoType
Parameters:
service - Service
infoType - Class
Returns:
ServiceInfo
Throws:
OpenEJBException - On error

resolveClasspath

public static URI[] resolveClasspath(String rawstring)
                              throws IOException
Takes a raw unparsed string expected to be in jvm classpath syntax and parses it, producing a collection of URIs representing the absolute file paths of the classpath to be created.

OS specific delimiters are supported.

Parameters:
rawstring - unparsed string in "classpath" syntax
Returns:
URI array
Throws:
IOException - if path cannot be resolved or file referenced does not exist

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

Parameters:
type - Class T
serviceId - String
declaredProperties - Properties
providerId - String
serviceType - String
Returns:
ServiceInfo T
Throws:
OpenEJBException

getSystemProperties

protected static Properties getSystemProperties(String serviceId,
                                                String serviceType)

getOverrides

protected static Properties getOverrides(Properties properties,
                                         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

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

getResourceInfo

protected ResourceInfo getResourceInfo(String id)

isResourceType

public static boolean isResourceType(String service,
                                     List<String> types,
                                     String type)

getContainerIds

protected List<String> getContainerIds()

getContainerInfos

protected List<ContainerInfo> getContainerInfos()


Copyright © 1999–2015 The Apache Software Foundation. All rights reserved.