private WebModule extractWebApp(final URI moduleUri) { if (module == null || module.getJarLocation() == null) { return null; } final File appModuleFile = new File(module.getJarLocation()); File moduleFile; try { moduleFile = URLs.toFile(moduleUri.toURL()); } catch (final MalformedURLException e) { return null; } catch (final IllegalArgumentException iae) { final File f = new File(appModuleFile, moduleUri.getPath()); if (f.exists()) { moduleFile = f; } else { LOGGER.warning("Illegal uri: " + moduleUri, iae); return null; } } for (final WebModule webModule : module.getWebModules()) { if (webModule.getJarLocation() != null && isParent(new File(webModule.getJarLocation()), moduleFile, appModuleFile)) { return webModule; } } return null; }
private WebModule extractWebApp(final URI moduleUri) { if (module == null || module.getJarLocation() == null) { return null; } final File appModuleFile = new File(module.getJarLocation()); File moduleFile; try { moduleFile = URLs.toFile(moduleUri.toURL()); } catch (final MalformedURLException e) { return null; } catch (final IllegalArgumentException iae) { final File f = new File(appModuleFile, moduleUri.getPath()); if (f.exists()) { moduleFile = f; } else { LOGGER.warning("Illegal uri: " + moduleUri, iae); return null; } } for (final WebModule webModule : module.getWebModules()) { if (webModule.getJarLocation() != null && isParent(new File(webModule.getJarLocation()), moduleFile, appModuleFile)) { return webModule; } } return null; }
public void addWebModule(final AppModule appModule, final URL warUrl, final ClassLoader parentClassLoader, final String contextRoot, final String moduleName) throws OpenEJBException { final WebModule webModule = createWebModule(appModule.getJarLocation(), URLs.toFilePath(warUrl), parentClassLoader, contextRoot, moduleName, null); addWebModule(webModule, appModule); }
public void addWebModule(final AppModule appModule, final URL warUrl, final ClassLoader parentClassLoader, final String contextRoot, final String moduleName) throws OpenEJBException { final WebModule webModule = createWebModule(appModule.getJarLocation(), URLs.toFilePath(warUrl), parentClassLoader, contextRoot, moduleName, null); addWebModule(webModule, appModule); }
public AppInfo configureApplication(AppModule appModule) throws OpenEJBException { logger.info("config.configApp", appModule.getJarLocation()); deployer.deploy(appModule); AppInfoBuilder appInfoBuilder = new AppInfoBuilder(this); return appInfoBuilder.build(appModule); }
protected static void addWebModule(AppModule appModule, String warPath, ClassLoader parentClassLoader, String contextRoot, String moduleName) throws OpenEJBException { WebModule webModule = createWebModule(appModule.getJarLocation(), warPath, parentClassLoader, contextRoot, moduleName); appModule.getWebModules().add(webModule);
DeploymentLoader.logger.error("Unable to load Persistence Unit from EAR: " + appModule.getJarLocation() + ", module: " + moduleName + ". Exception: " + e1.getMessage(), e1);
private void readEjbJar(EjbModule ejbModule, AppModule appModule) throws OpenEJBException { if (ejbModule.getEjbJar() != null) return; Object data = ejbModule.getAltDDs().get("ejb-jar.xml"); if (data instanceof EjbJar) { ejbModule.setEjbJar((EjbJar) data); } else if (data instanceof URL) { URL url = (URL) data; EjbJar ejbJar = readEjbJar(url); ejbModule.setEjbJar(ejbJar); } else { DeploymentLoader.logger.debug("No ejb-jar.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + ejbModule.getModuleId()); ejbModule.setEjbJar(new EjbJar()); } }
final String location = appModule.getJarLocation(); logger.info("config.configApp", null != location ? location : appModule.getModuleId()); deployer.deploy(appModule);
private void readConnector(ConnectorModule connectorModule, AppModule appModule) throws OpenEJBException { if (connectorModule.getConnector() != null) return; Object data = connectorModule.getAltDDs().get("ra.xml"); if (data instanceof Connector) { connectorModule.setConnector((Connector) data); } else if (data instanceof URL) { URL url = (URL) data; Connector connector = readConnector(url); connectorModule.setConnector(connector); } else { DeploymentLoader.logger.debug("No ra.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + connectorModule.getModuleId()); connectorModule.setConnector(new Connector()); } }
private void readWebApp(WebModule webModule, AppModule appModule) throws OpenEJBException { if (webModule.getWebApp() != null) return; Object data = webModule.getAltDDs().get("web.xml"); if (data instanceof WebApp) { webModule.setWebApp((WebApp) data); } else if (data instanceof URL) { URL url = (URL) data; WebApp webApp = readWebApp(url); webModule.setWebApp(webApp); } else { DeploymentLoader.logger.debug("No web.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + webModule.getModuleId()); webModule.setWebApp(new WebApp()); } }
private void readConnector(final ConnectorModule connectorModule, final AppModule appModule) throws OpenEJBException { if (connectorModule.getConnector() != null) { return; } final Object data = connectorModule.getAltDDs().get("ra.xml"); if (data instanceof Connector) { connectorModule.setConnector((Connector) data); } else if (data instanceof URL) { final URL url = (URL) data; final Connector connector = readConnector(url); connectorModule.setConnector(connector); } else { DeploymentLoader.logger.debug("No ra.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + connectorModule.getModuleId()); connectorModule.setConnector(new Connector()); } }
private void readConnector(final ConnectorModule connectorModule, final AppModule appModule) throws OpenEJBException { if (connectorModule.getConnector() != null) { return; } final Object data = connectorModule.getAltDDs().get("ra.xml"); if (data instanceof Connector) { connectorModule.setConnector((Connector) data); } else if (data instanceof URL) { final URL url = (URL) data; final Connector connector = readConnector(url); connectorModule.setConnector(connector); } else { DeploymentLoader.logger.debug("No ra.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + connectorModule.getModuleId()); connectorModule.setConnector(new Connector()); } }
public void readEjbJar(final EjbModule ejbModule, final AppModule appModule) throws OpenEJBException { if (ejbModule.getEjbJar() != null) { return; } final Source data = getSource(ejbModule.getAltDDs().get("ejb-jar.xml")); if (data != null) { try { final EjbJar ejbJar = readEjbJar(data.get()); ejbModule.setEjbJar(ejbJar); } catch (final IOException e) { throw new OpenEJBException(e); } } else { DeploymentLoader.logger.debug("No ejb-jar.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + ejbModule.getModuleId()); ejbModule.setEjbJar(new EjbJar()); } }
private void readAppClient(ClientModule clientModule, AppModule appModule) throws OpenEJBException { if (clientModule.getApplicationClient() != null) return; Object data = clientModule.getAltDDs().get("application-client.xml"); if (data instanceof ApplicationClient) { clientModule.setApplicationClient((ApplicationClient) data); } else if (data instanceof URL) { URL url = (URL) data; ApplicationClient applicationClient = readApplicationClient(url); clientModule.setApplicationClient(applicationClient); } else { if (!clientModule.isEjbModuleGenerated()) { DeploymentLoader.logger.debug("No application-client.xml found assuming annotations present: " + appModule.getJarLocation() + ", module: " + clientModule.getModuleId()); clientModule.setApplicationClient(new ApplicationClient()); } } }
private void readAppClient(final ClientModule clientModule, final AppModule appModule) throws OpenEJBException { if (clientModule.getApplicationClient() != null) { return; } final Object data = clientModule.getAltDDs().get("application-client.xml"); if (data instanceof ApplicationClient) { clientModule.setApplicationClient((ApplicationClient) data); } else if (data instanceof URL) { final URL url = (URL) data; final ApplicationClient applicationClient = readApplicationClient(url); clientModule.setApplicationClient(applicationClient); } else { if (!clientModule.isEjbModuleGenerated()) { DeploymentLoader.logger.debug("No application-client.xml found assuming annotations present: " + appModule.getJarLocation() + ", module: " + clientModule.getModuleId()); clientModule.setApplicationClient(new ApplicationClient()); } } }
private void readAppClient(final ClientModule clientModule, final AppModule appModule) throws OpenEJBException { if (clientModule.getApplicationClient() != null) { return; } final Object data = clientModule.getAltDDs().get("application-client.xml"); if (data instanceof ApplicationClient) { clientModule.setApplicationClient((ApplicationClient) data); } else if (data instanceof URL) { final URL url = (URL) data; final ApplicationClient applicationClient = readApplicationClient(url); clientModule.setApplicationClient(applicationClient); } else { if (!clientModule.isEjbModuleGenerated()) { DeploymentLoader.logger.debug("No application-client.xml found assuming annotations present: " + appModule.getJarLocation() + ", module: " + clientModule.getModuleId()); clientModule.setApplicationClient(new ApplicationClient()); } } }
public void readEjbJar(final EjbModule ejbModule, final AppModule appModule) throws OpenEJBException { if (ejbModule.getEjbJar() != null) { return; } final Source data = getSource(ejbModule.getAltDDs().get("ejb-jar.xml")); if (data != null) { try { final EjbJar ejbJar = readEjbJar(data.get()); ejbModule.setEjbJar(ejbJar); } catch (final IOException e) { throw new OpenEJBException(e); } } else { DeploymentLoader.logger.debug("No ejb-jar.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + ejbModule.getModuleId()); ejbModule.setEjbJar(new EjbJar()); } }
private void readWebApp(final WebModule webModule, final AppModule appModule) throws OpenEJBException { if (webModule.getWebApp() != null) { mergeWebFragments(webModule); return; } final Object data = webModule.getAltDDs().get("web.xml"); if (data instanceof WebApp) { webModule.setWebApp((WebApp) data); } else if (data instanceof URL) { final URL url = (URL) data; final WebApp webApp = readWebApp(url); webModule.setWebApp(webApp); } else { DeploymentLoader.logger.debug("No web.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + webModule.getModuleId()); webModule.setWebApp(new WebApp()); } mergeWebFragments(webModule); }
private void readWebApp(final WebModule webModule, final AppModule appModule) throws OpenEJBException { if (webModule.getWebApp() != null) { mergeWebFragments(webModule); return; } final Object data = webModule.getAltDDs().get("web.xml"); if (data instanceof WebApp) { webModule.setWebApp((WebApp) data); } else if (data instanceof URL) { final URL url = (URL) data; final WebApp webApp = readWebApp(url); webModule.setWebApp(webApp); } else { DeploymentLoader.logger.debug("No web.xml found assuming annotated beans present: " + appModule.getJarLocation() + ", module: " + webModule.getModuleId()); webModule.setWebApp(new WebApp()); } mergeWebFragments(webModule); }