private void removeRef(WebApp webApp, String name) { webApp.getEnvEntryMap().remove(name); webApp.getEjbRefMap().remove(name); webApp.getEjbLocalRefMap().remove(name); webApp.getMessageDestinationRefMap().remove(name); webApp.getPersistenceContextRefMap().remove(name); webApp.getPersistenceUnitRefMap().remove(name); webApp.getResourceRefMap().remove(name); webApp.getResourceEnvRefMap().remove(name); }
/** * Remove jndi references from related info map. * * @param webApp web application instance * @param name jndi reference name */ private void removeRef(final WebApp webApp, final String name) { webApp.getEnvEntryMap().remove(name); webApp.getEjbRefMap().remove(name); webApp.getEjbLocalRefMap().remove(name); webApp.getMessageDestinationRefMap().remove(name); webApp.getPersistenceContextRefMap().remove(name); webApp.getPersistenceUnitRefMap().remove(name); webApp.getResourceRefMap().remove(name); webApp.getResourceEnvRefMap().remove(name); }
/** * Remove jndi references from related info map. * * @param webApp web application instance * @param name jndi reference name */ private void removeRef(WebApp webApp, String name) { webApp.getEnvEntryMap().remove(name); webApp.getEjbRefMap().remove(name); webApp.getEjbLocalRefMap().remove(name); webApp.getMessageDestinationRefMap().remove(name); webApp.getPersistenceContextRefMap().remove(name); webApp.getPersistenceUnitRefMap().remove(name); webApp.getResourceRefMap().remove(name); webApp.getResourceEnvRefMap().remove(name); }
@Override public AppModule deploy(final AppModule appModule) throws OpenEJBException { for (final WebModule webModule : appModule.getWebModules()) { if (webModule.getFinder() == null) { continue; } for (final EjbModule ejbModule : appModule.getEjbModules()) { // If they are the same module, they'll have the same finder if (ejbModule.getFinder() != webModule.getFinder()) { final String forceMerge = ejbModule.getProperties().getProperty("openejb.ejbmodule.MergeWebappJndiContext"); // always true is not null if (forceMerge != null) { // default resource propagation for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) { copy(webModule.getWebApp().getResourceEnvRefMap(), bean.getResourceEnvRefMap()); } } continue; } merge(ejbModule, webModule); } } return appModule; }
resEnvMap.putAll(webApp.getResourceEnvRefMap()); resEnvMap.putAll(webApp.getMessageDestinationRefMap());
resEnvMap.putAll(webApp.getResourceEnvRefMap()); resEnvMap.putAll(webApp.getMessageDestinationRefMap());
resEnvMap.putAll(webApp.getResourceEnvRefMap()); resEnvMap.putAll(webApp.getMessageDestinationRefMap());
private void mergeWebFragments(final WebModule webModule) { // web-fragment.xml, to get jndi entries to merge, other stuff is done by tomcat ATM final Collection<URL> urls = Collection.class.cast(webModule.getAltDDs().get("web-fragment.xml")); if (urls != null) { for (final URL rawUrl : urls) { if (rawUrl != null) { final Source url = getSource(rawUrl); try { final WebFragment webFragment = WebFragment.class.cast(JaxbJavaee.unmarshal(WebFragment.class, url.get(), false)); // in tomcat if the env entry is already don't override it mergeOnlyMissingEntries(webModule.getWebApp().getPersistenceContextRefMap(), webFragment.getPersistenceContextRef()); mergeOnlyMissingEntries(webModule.getWebApp().getPersistenceUnitRefMap(), webFragment.getPersistenceUnitRef()); mergeOnlyMissingEntries(webModule.getWebApp().getMessageDestinationRefMap(), webFragment.getMessageDestinationRef()); mergeOnlyMissingEntries(webModule.getWebApp().getDataSourceMap(), webFragment.getDataSource()); mergeOnlyMissingEntries(webModule.getWebApp().getEjbLocalRefMap(), webFragment.getEjbLocalRef()); mergeOnlyMissingEntries(webModule.getWebApp().getEjbRefMap(), webFragment.getEjbRef()); mergeOnlyMissingEntries(webModule.getWebApp().getServiceRefMap(), webFragment.getServiceRef()); mergeOnlyMissingEntries(webModule.getWebApp().getEnvEntryMap(), webFragment.getEnvEntry()); mergeOnlyMissingEntries(webModule.getWebApp().getResourceEnvRefMap(), webFragment.getResourceEnvRef()); mergeOnlyMissingEntries(webModule.getWebApp().getResourceRefMap(), webFragment.getResourceRef()); } catch (final Exception e) { logger.warning("can't read " + url.toString(), e); } } } } }
private void mergeWebFragments(final WebModule webModule) { // web-fragment.xml, to get jndi entries to merge, other stuff is done by tomcat ATM final Collection<URL> urls = Collection.class.cast(webModule.getAltDDs().get("web-fragment.xml")); if (urls != null) { for (final URL rawUrl : urls) { if (rawUrl != null) { final Source url = getSource(rawUrl); try { final WebFragment webFragment = WebFragment.class.cast(JaxbJavaee.unmarshal(WebFragment.class, url.get(), false)); // in tomcat if the env entry is already don't override it mergeOnlyMissingEntries(webModule.getWebApp().getPersistenceContextRefMap(), webFragment.getPersistenceContextRef()); mergeOnlyMissingEntries(webModule.getWebApp().getPersistenceUnitRefMap(), webFragment.getPersistenceUnitRef()); mergeOnlyMissingEntries(webModule.getWebApp().getMessageDestinationRefMap(), webFragment.getMessageDestinationRef()); mergeOnlyMissingEntries(webModule.getWebApp().getDataSourceMap(), webFragment.getDataSource()); mergeOnlyMissingEntries(webModule.getWebApp().getJMSConnectionFactoriesMap(), webFragment.getJMSConnectionFactories()); mergeOnlyMissingEntries(webModule.getWebApp().getEjbLocalRefMap(), webFragment.getEjbLocalRef()); mergeOnlyMissingEntries(webModule.getWebApp().getEjbRefMap(), webFragment.getEjbRef()); mergeOnlyMissingEntries(webModule.getWebApp().getServiceRefMap(), webFragment.getServiceRef()); mergeOnlyMissingEntries(webModule.getWebApp().getEnvEntryMap(), webFragment.getEnvEntry()); mergeOnlyMissingEntries(webModule.getWebApp().getResourceEnvRefMap(), webFragment.getResourceEnvRef()); mergeOnlyMissingEntries(webModule.getWebApp().getResourceRefMap(), webFragment.getResourceRef()); } catch (final Exception e) { logger.warning("can't read " + url.toString(), e); } } } } }