org.apache.openejb.config
Class DeploymentLoader

java.lang.Object
  extended by org.apache.openejb.config.DeploymentLoader
All Implemented Interfaces:
DeploymentFilterable

public class DeploymentLoader
extends Object
implements DeploymentFilterable

Version:
$Revision: 1458601 $ $Date: 2013-03-20 01:17:44 +0000 (Wed, 20 Mar 2013) $

Field Summary
static String EAR_WEBAPP_PERSISTENCE_XML_JARS
           
static Logger logger
           
static String OPENEJB_ALTDD_PREFIX
           
static String RAR_URLS_KEY
           
static String URLS_KEY
           
 
Fields inherited from interface org.apache.openejb.config.DeploymentFilterable
CLASSPATH_EXCLUDE, CLASSPATH_FILTER_DESCRIPTORS, CLASSPATH_FILTER_SYSTEMAPPS, CLASSPATH_INCLUDE, CLASSPATH_REQUIRE_DESCRIPTOR, DEPLOYMENTS_CLASSPATH_PROPERTY, PACKAGE_EXCLUDE, PACKAGE_INCLUDE, SEARCH_CLASSPATH_FOR_DEPLOYMENTS_PROPERTY
 
Constructor Summary
DeploymentLoader()
           
 
Method Summary
protected static Collection<URL> addPersistenceUnits(AppModule appModule, URL... urls)
           
 void addWebModule(AppModule appModule, URL warUrl, ClassLoader parentClassLoader, String contextRoot, String moduleName)
           
static EjbModule addWebModule(WebModule webModule, AppModule appModule)
           
static Map<String,URL> altDDSources(Map<String,URL> map, boolean log)
          Modifies the map passed in with all the alt dd URLs found
protected  AppModule createAppModule(File jarFile, String jarPath)
           
protected  ClientModule createClientModule(URL clientUrl, String absolutePath, ClassLoader appClassLoader, String moduleName)
           
protected  ClientModule createClientModule(URL clientUrl, String absolutePath, ClassLoader appClassLoader, String moduleName, boolean log)
           
protected static ConnectorModule createConnectorModule(String appId, String rarPath, ClassLoader parentClassLoader, String moduleId)
           
protected static ConnectorModule createConnectorModule(String appId, String rarPath, ClassLoader parentClassLoader, String moduleId, URL raXmlUrl)
           
protected  EjbModule createEjbModule(URL baseUrl, String jarPath, ClassLoader classLoader)
           
 WebModule createWebModule(String appId, String warPath, ClassLoader parentClassLoader, String contextRoot, String moduleName)
           
 Class<? extends DeploymentModule> discoverModuleType(URL baseUrl, ClassLoader classLoader, boolean searchForDescriptorlessApplications)
           
 Class<? extends DeploymentModule> discoverModuleType(URL baseUrl, ClassLoader classLoader, Set<RequireDescriptors> requireDescriptor)
           
static List<URL> filterWebappUrls(URL[] webUrls, URL exclusions)
           
protected  String getContextRoot()
           
static Map<String,URL> getDescriptors(URL moduleUrl)
           
protected  File getFile(URL warUrl)
           
protected static URL getFileUrl(File jarFile)
           
protected  String getModuleName()
           
protected  ClassLoader getOpenEJBClassLoader()
           
static URL[] getWebappUrls(File warFile)
           
static Map<String,URL[]> getWebappUrlsAndRars(File warFile)
           
protected  Map<String,URL> getWebDescriptors(File warFile)
           
 AppModule load(File jarFile)
           
static Map<String,URL> mapDescriptors(org.apache.xbean.finder.ResourceFinder finder)
           
static void reloadAltDD()
           
static void scanDir(File dir, Map<String,URL> files, String path)
           
static void scanDir(File dir, Map<String,URL> files, String path, boolean recursive)
           
static
<T> T
unmarshal(Class<T> type, String descriptor, URL url)
           
static File unpack(File jarFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final Logger logger

OPENEJB_ALTDD_PREFIX

public static final String OPENEJB_ALTDD_PREFIX
See Also:
Constant Field Values

EAR_WEBAPP_PERSISTENCE_XML_JARS

public static final String EAR_WEBAPP_PERSISTENCE_XML_JARS
See Also:
Constant Field Values

RAR_URLS_KEY

public static final String RAR_URLS_KEY
See Also:
Constant Field Values

URLS_KEY

public static final String URLS_KEY
See Also:
Constant Field Values
Constructor Detail

DeploymentLoader

public DeploymentLoader()
Method Detail

load

public AppModule load(File jarFile)
               throws OpenEJBException
Throws:
OpenEJBException

getOpenEJBClassLoader

protected ClassLoader getOpenEJBClassLoader()

createAppModule

protected AppModule createAppModule(File jarFile,
                                    String jarPath)
                             throws OpenEJBException
Throws:
OpenEJBException

createClientModule

protected ClientModule createClientModule(URL clientUrl,
                                          String absolutePath,
                                          ClassLoader appClassLoader,
                                          String moduleName)
                                   throws OpenEJBException
Throws:
OpenEJBException

createClientModule

protected ClientModule createClientModule(URL clientUrl,
                                          String absolutePath,
                                          ClassLoader appClassLoader,
                                          String moduleName,
                                          boolean log)
                                   throws OpenEJBException
Throws:
OpenEJBException

createEjbModule

protected EjbModule createEjbModule(URL baseUrl,
                                    String jarPath,
                                    ClassLoader classLoader)
                             throws OpenEJBException
Throws:
OpenEJBException

addWebModule

public void addWebModule(AppModule appModule,
                         URL warUrl,
                         ClassLoader parentClassLoader,
                         String contextRoot,
                         String moduleName)
                  throws OpenEJBException
Throws:
OpenEJBException

addWebModule

public static EjbModule addWebModule(WebModule webModule,
                                     AppModule appModule)
                              throws OpenEJBException
Throws:
OpenEJBException

createWebModule

public WebModule createWebModule(String appId,
                                 String warPath,
                                 ClassLoader parentClassLoader,
                                 String contextRoot,
                                 String moduleName)
                          throws OpenEJBException
Throws:
OpenEJBException

filterWebappUrls

public static List<URL> filterWebappUrls(URL[] webUrls,
                                         URL exclusions)

getContextRoot

protected String getContextRoot()

getModuleName

protected String getModuleName()

getWebappUrlsAndRars

public static Map<String,URL[]> getWebappUrlsAndRars(File warFile)

getWebappUrls

public static URL[] getWebappUrls(File warFile)

createConnectorModule

protected static ConnectorModule createConnectorModule(String appId,
                                                       String rarPath,
                                                       ClassLoader parentClassLoader,
                                                       String moduleId)
                                                throws OpenEJBException
Throws:
OpenEJBException

createConnectorModule

protected static ConnectorModule createConnectorModule(String appId,
                                                       String rarPath,
                                                       ClassLoader parentClassLoader,
                                                       String moduleId,
                                                       URL raXmlUrl)
                                                throws OpenEJBException
Throws:
OpenEJBException

addPersistenceUnits

protected static Collection<URL> addPersistenceUnits(AppModule appModule,
                                                     URL... urls)
                                              throws OpenEJBException
Throws:
OpenEJBException

getDescriptors

public static Map<String,URL> getDescriptors(URL moduleUrl)
                                      throws OpenEJBException
Throws:
OpenEJBException

mapDescriptors

public static Map<String,URL> mapDescriptors(org.apache.xbean.finder.ResourceFinder finder)
                                      throws IOException
Throws:
IOException

altDDSources

public static Map<String,URL> altDDSources(Map<String,URL> map,
                                           boolean log)
Modifies the map passed in with all the alt dd URLs found

Parameters:
map - Map
log - boolean
Returns:
the same map instance updated with alt dds

getWebDescriptors

protected Map<String,URL> getWebDescriptors(File warFile)
                                     throws IOException
Throws:
IOException

getFile

protected File getFile(URL warUrl)

unmarshal

public static <T> T unmarshal(Class<T> type,
                              String descriptor,
                              URL url)
                   throws OpenEJBException
Throws:
OpenEJBException

scanDir

public static void scanDir(File dir,
                           Map<String,URL> files,
                           String path)

scanDir

public static void scanDir(File dir,
                           Map<String,URL> files,
                           String path,
                           boolean recursive)

discoverModuleType

public Class<? extends DeploymentModule> discoverModuleType(URL baseUrl,
                                                            ClassLoader classLoader,
                                                            boolean searchForDescriptorlessApplications)
                                                     throws IOException,
                                                            UnknownModuleTypeException
Throws:
IOException
UnknownModuleTypeException

discoverModuleType

public Class<? extends DeploymentModule> discoverModuleType(URL baseUrl,
                                                            ClassLoader classLoader,
                                                            Set<RequireDescriptors> requireDescriptor)
                                                     throws IOException,
                                                            UnknownModuleTypeException
Throws:
IOException
UnknownModuleTypeException

unpack

public static File unpack(File jarFile)
                   throws OpenEJBException
Throws:
OpenEJBException

getFileUrl

protected static URL getFileUrl(File jarFile)
                         throws OpenEJBException
Throws:
OpenEJBException

reloadAltDD

public static void reloadAltDD()


Copyright © 1999-2013 The Apache Software Foundation. All Rights Reserved.