@Test public void testConfigureApplicationWebModule() throws OpenEJBException { SystemInstance.get().setProperty("openejb.environment.default", "false"); final String moduleId = "testConfigureApplicationWebModule"; final String fileSeparator = System.getProperty("file.separator"); SystemInstance.get().setProperty(ConfigurationFactory.VALIDATION_SKIP_PROPERTY, "false"); SystemInstance.get().setProperty(DeploymentsResolver.SEARCH_CLASSPATH_FOR_DEPLOYMENTS_PROPERTY, "false"); final ConfigurationFactory factory = new ConfigurationFactory(); final WebApp webApp = new WebApp(); webApp.setMetadataComplete(true); final WebModule webModule = new WebModule(webApp, null, null, fileSeparator + "some" + fileSeparator + "where.war", moduleId); final WebAppInfo info = factory.configureApplication(webModule); assertEquals(moduleId, info.moduleId); SystemInstance.get().getProperties().remove("openejb.environment.default"); }
public AppInfo configureApplication(final File jarFile) throws OpenEJBException { logger.debug("Beginning load: " + jarFile.getAbsolutePath()); try { final AppModule appModule = deploymentLoader.load(jarFile, null); final AppInfo appInfo = configureApplication(appModule); if (!appModule.getWebModules().isEmpty()) { for (final WebAppInfo info : appInfo.webApps) { for (final EjbModule ejbModule : appModule.getEjbModules()) { if (ejbModule.getModuleId().equals(info.moduleId) && ejbModule.getFinder() != null) { appInfo.properties.put(info, ejbModule); } } } } appInfo.paths.add(appInfo.path); appInfo.paths.add(jarFile.getAbsolutePath()); return appInfo; } catch (final ValidationFailedException e) { logger.warning("configureApplication.loadFailed", jarFile.getAbsolutePath(), e.getMessage()); throw e; } catch (final OpenEJBException e) { logger.warning("configureApplication.loadFailed", e, jarFile.getAbsolutePath(), e.getMessage()); throw e; } }
ConfigurationFactory implements OpenEjbConfigurationFactory { public AppInfo configureApplication(final File jarFile) throws OpenEJBException { logger.debug("Beginning load: " + jarFile.getAbsolutePath()); try { final AppModule appModule = deploymentLoader.load(jarFile, null); final AppInfo appInfo = configureApplication(appModule); if (!appModule.getWebModules().isEmpty()) { for (final WebAppInfo info : appInfo.webApps) { for (final EjbModule ejbModule : appModule.getEjbModules()) { if (ejbModule.getModuleId().equals(info.moduleId) && ejbModule.getFinder() != null) { appInfo.properties.put(info, ejbModule); } } } } appInfo.paths.add(appInfo.path); appInfo.paths.add(jarFile.getAbsolutePath()); return appInfo; } catch (final ValidationFailedException e) { logger.warning("configureApplication.loadFailed", jarFile.getAbsolutePath(), e.getMessage()); throw e; } catch (final OpenEJBException e) { logger.warning("configureApplication.loadFailed", e, jarFile.getAbsolutePath(), e.getMessage()); throw e; } } }
ConfigurationFactory implements OpenEjbConfigurationFactory { public AppInfo configureApplication(final File jarFile) throws OpenEJBException { logger.debug("Beginning load: " + jarFile.getAbsolutePath()); try { final AppModule appModule = deploymentLoader.load(jarFile, null); final AppInfo appInfo = configureApplication(appModule); if (!appModule.getWebModules().isEmpty()) { for (final WebAppInfo info : appInfo.webApps) { for (final EjbModule ejbModule : appModule.getEjbModules()) { if (ejbModule.getModuleId().equals(info.moduleId) && ejbModule.getFinder() != null) { appInfo.properties.put(info, ejbModule); } } } } appInfo.paths.add(appInfo.path); appInfo.paths.add(jarFile.getAbsolutePath()); return appInfo; } catch (final ValidationFailedException e) { logger.warning("configureApplication.loadFailed", jarFile.getAbsolutePath(), e.getMessage()); throw e; } catch (final OpenEJBException e) { logger.warning("configureApplication.loadFailed", e, jarFile.getAbsolutePath(), e.getMessage()); throw e; } } ConfigurationFactory();  ConfigurationFactory(final boolean offline);  ConfigurationFactory(final boolean offline, final DynamicDeployer preAutoConfigDeployer);  ConfigurationFactory(final boolean offline, final OpenEjbConfiguration configuration);  ConfigurationFactory(final boolean offline,
                                final DynamicDeployer preAutoConfigDeployer,
                                final OpenEjbConfiguration configuration);  ConfigurationFactory(final boolean offline, final Chain deployerChain, final OpenEjbConfiguration configuration); }
ConfigurationFactory implements OpenEjbConfigurationFactory { public AppInfo configureApplication(final File jarFile) throws OpenEJBException { logger.debug("Beginning load: " + jarFile.getAbsolutePath()); try { final AppModule appModule = deploymentLoader.load(jarFile, null); final AppInfo appInfo = configureApplication(appModule); if (!appModule.getWebModules().isEmpty()) { for (final WebAppInfo info : appInfo.webApps) { for (final EjbModule ejbModule : appModule.getEjbModules()) { if (ejbModule.getModuleId().equals(info.moduleId) && ejbModule.getFinder() != null) { appInfo.properties.put(info, ejbModule); } } } } appInfo.paths.add(appInfo.path); appInfo.paths.add(jarFile.getAbsolutePath()); return appInfo; } catch (final ValidationFailedException e) { logger.warning("configureApplication.loadFailed", jarFile.getAbsolutePath(), e.getMessage()); throw e; } catch (final OpenEJBException e) { logger.warning("configureApplication.loadFailed", e, jarFile.getAbsolutePath(), e.getMessage()); throw e; } } ConfigurationFactory();  ConfigurationFactory(final boolean offline);  ConfigurationFactory(final boolean offline, final DynamicDeployer preAutoConfigDeployer);  ConfigurationFactory(final boolean offline, final OpenEjbConfiguration configuration);  ConfigurationFactory(final boolean offline,
                                final DynamicDeployer preAutoConfigDeployer,
                                final OpenEjbConfiguration configuration);  ConfigurationFactory(final boolean offline, final Chain deployerChain, final OpenEjbConfiguration configuration); boolean isOffline(); static List<HandlerChainInfo> toHandlerChainInfo(final HandlerChains chains); @Override void init(final Properties props); OpenEjbConfiguration getOpenEjbConfiguration(final File configuartionFile); OpenEjbConfiguration getOpenEjbConfiguration(final Openejb providedConf); @Override OpenEjbConfiguration getOpenEjbConfiguration(); ArrayList<File> getModulesFromClassPath(final List<File> declaredApps, final ClassLoader classLoader); ContainerInfo createContainerInfo(final Container container); static void loadPropertiesDeclaredConfiguration(final Openejb openejb); static void fillOpenEjb(final Openejb openejb, final Properties sysProps); static Object toConfigDeclaration(final String id, final URI uri); AppInfo configureApplication(final File jarFile); AppInfo configureApplication(final ClassLoader classLoader, final String id, final List<File> jarFiles); @SuppressWarnings("unchecked") AppModule loadApplication(final ClassLoader classLoader, String id, final List<File> jarFiles); EjbJarInfo configureApplication(final EjbJar ejbJar); EjbJarInfo configureApplication(final EjbModule ejbModule); ClientInfo configureApplication(final ClientModule clientModule); ConnectorInfo configureApplication(final ConnectorModule connectorModule); WebAppInfo configureApplication(final WebModule webModule); AppInfo configureApplication(final AppModule appModule); T configureService(final Class<? extends T> type); T configureService(org.apache.openejb.config.Service service, final Class<? extends T> infoType); static URI[] resolveClasspath(final String rawstring); T configureService(final String id, final Class<? extends T> type); T configureService(final Class<? extends T> type, final String serviceId, final Properties declaredProperties, final String providerId, final String serviceType); List<String> getResourceIds(final String type, Properties required); static boolean isResourceType(final String service, final List<String> types, final String type); static List<ResourceInfo> sort(final List<ResourceInfo> infos, final String prefix); }
ConfigurationFactory implements OpenEjbConfigurationFactory { public AppInfo configureApplication(final File jarFile) throws OpenEJBException { logger.debug("Beginning load: " + jarFile.getAbsolutePath()); try { final AppModule appModule = deploymentLoader.load(jarFile, null); final AppInfo appInfo = configureApplication(appModule); if (!appModule.getWebModules().isEmpty()) { for (final WebAppInfo info : appInfo.webApps) { for (final EjbModule ejbModule : appModule.getEjbModules()) { if (ejbModule.getModuleId().equals(info.moduleId) && ejbModule.getFinder() != null) { appInfo.properties.put(info, ejbModule); } } } } appInfo.paths.add(appInfo.path); appInfo.paths.add(jarFile.getAbsolutePath()); return appInfo; } catch (final ValidationFailedException e) { logger.warning("configureApplication.loadFailed", jarFile.getAbsolutePath(), e.getMessage()); throw e; } catch (final OpenEJBException e) { logger.warning("configureApplication.loadFailed", e, jarFile.getAbsolutePath(), e.getMessage()); throw e; } } ConfigurationFactory();  ConfigurationFactory(final boolean offline);  ConfigurationFactory(final boolean offline, final DynamicDeployer preAutoConfigDeployer);  ConfigurationFactory(final boolean offline, final OpenEjbConfiguration configuration);  ConfigurationFactory(final boolean offline,
                                final DynamicDeployer preAutoConfigDeployer,
                                final OpenEjbConfiguration configuration);  ConfigurationFactory(final boolean offline, final Chain deployerChain, final OpenEjbConfiguration configuration); boolean isOffline(); static List<HandlerChainInfo> toHandlerChainInfo(final HandlerChains chains); @Override void init(final Properties props); OpenEjbConfiguration getOpenEjbConfiguration(final File configuartionFile); OpenEjbConfiguration getOpenEjbConfiguration(final Openejb providedConf); @Override OpenEjbConfiguration getOpenEjbConfiguration(); ArrayList<File> getModulesFromClassPath(final List<File> declaredApps, final ClassLoader classLoader); ContainerInfo createContainerInfo(final Container container); static void loadPropertiesDeclaredConfiguration(final Openejb openejb); static void fillOpenEjb(final Openejb openejb, final Properties sysProps); static Object toConfigDeclaration(final String id, final URI uri); AppInfo configureApplication(final File jarFile); AppInfo configureApplication(final ClassLoader classLoader, final String id, final List<File> jarFiles); @SuppressWarnings("unchecked") AppModule loadApplication(final ClassLoader classLoader, String id, final List<File> jarFiles); EjbJarInfo configureApplication(final EjbJar ejbJar); EjbJarInfo configureApplication(final EjbModule ejbModule); ClientInfo configureApplication(final ClientModule clientModule); ConnectorInfo configureApplication(final ConnectorModule connectorModule); WebAppInfo configureApplication(final WebModule webModule); AppInfo configureApplication(final AppModule appModule); T configureService(final Class<? extends T> type); T configureService(org.apache.openejb.config.Service service, final Class<? extends T> infoType); static URI[] resolveClasspath(final String rawstring); T configureService(final String id, final Class<? extends T> type); T configureService(final Class<? extends T> type, final String serviceId, final Properties declaredProperties, final String providerId, final String serviceType); List<String> getResourceIds(final String type, Properties required); static boolean isResourceType(final String service, final List<String> types, final String type); static List<ResourceInfo> sort(final List<ResourceInfo> infos, final String prefix); static final String OPENEJB_JDBC_DATASOURCE_CREATOR; static final String ADDITIONAL_DEPLOYMENTS; }