ConfigurationFactory implements OpenEjbConfigurationFactory { public AppInfo configureApplication(final File jarFile) throws OpenEJBException { logger.debug("Beginning load: " + jarFile.getAbsolutePath()); try { final AppModule appModule = deploymentLoader.load(jarFile); final AppInfo appInfo = configureApplication(appModule); appInfo.paths.add(appInfo.path); appInfo.paths.add(jarFile.getAbsolutePath()); return appInfo; } catch (ValidationFailedException e) { logger.warning("configureApplication.loadFailed", jarFile.getAbsolutePath(), e.getMessage()); throw e; } catch (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); static List<HandlerChainInfo> toHandlerChainInfo(final HandlerChains chains); @Override void init(final Properties props); @Override OpenEjbConfiguration getOpenEjbConfiguration(); ArrayList<File> getModulesFromClassPath(final List<File> declaredApps, final ClassLoader classLoader); ContainerInfo createContainerInfo(final Container container); 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); 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); static boolean isResourceType(final String service, final List<String> types, final String type); static final String OPENEJB_JDBC_DATASOURCE_CREATOR; static final String ADDITIONAL_DEPLOYMENTS; }
@Test public void testConfigureApplicationEjbJar() throws OpenEJBException { SystemInstance.get().setProperty(ConfigurationFactory.VALIDATION_SKIP_PROPERTY, "true"); final boolean offline = true; ConfigurationFactory factory = new ConfigurationFactory(offline); final String id = "testConfigureApplicationEjbJar"; EjbJar ejbJar = new EjbJar(id); ejbJar.setMetadataComplete(true); EjbJarInfo info = factory.configureApplication(ejbJar); assertEquals(id, info.moduleName); }
@Test public void testConfigureApplicationWebModule() throws OpenEJBException { 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"); ConfigurationFactory factory = new ConfigurationFactory(); WebApp webApp = new WebApp(); webApp.setMetadataComplete(true); WebModule webModule = new WebModule(webApp, null, null, fileSeparator + "some" + fileSeparator+ "where.war", moduleId); WebAppInfo info = factory.configureApplication(webModule); assertEquals(moduleId, info.moduleId); }