use of org.apache.openejb.jee.JndiConsumer in project tomee by apache.
the class BuiltInEnvironmentEntries method deploy.
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
for (final ClientModule module : appModule.getClientModules()) {
final JndiConsumer consumer = module.getApplicationClient();
if (consumer == null) {
continue;
}
add(consumer, module, appModule, false);
}
for (final WebModule module : appModule.getWebModules()) {
final JndiConsumer consumer = module.getWebApp();
if (consumer == null) {
continue;
}
add(consumer, module, appModule, addDefaults);
}
for (final EjbModule module : appModule.getEjbModules()) {
final EjbJar ejbJar = module.getEjbJar();
if (ejbJar == null) {
continue;
}
for (final EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
add(consumer, module, appModule, addDefaults && BeanContext.Comp.class.getName().equals(consumer.getEjbClass()));
}
}
return appModule;
}
use of org.apache.openejb.jee.JndiConsumer in project tomee by apache.
the class CleanEnvEntries method removeUnsetEnvEntries.
public AppModule removeUnsetEnvEntries(final AppModule appModule) throws OpenEJBException {
final Map<String, EnvEntry> appEnvEntryMap = getAppEnvEntryMap(appModule);
for (final ClientModule module : appModule.getClientModules()) {
final JndiConsumer consumer = module.getApplicationClient();
if (consumer == null) {
continue;
}
removeUnsetEnvEntries(appEnvEntryMap, consumer);
}
for (final WebModule module : appModule.getWebModules()) {
final JndiConsumer consumer = module.getWebApp();
if (consumer == null) {
continue;
}
removeUnsetEnvEntries(appEnvEntryMap, consumer);
}
for (final EjbModule module : appModule.getEjbModules()) {
final EjbJar ejbJar = module.getEjbJar();
if (ejbJar == null) {
continue;
}
for (final EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
if (CompManagedBean.class.isInstance(consumer)) {
// unused can be used by CDI (ear lib using webapp contextual binding)
continue;
}
removeUnsetEnvEntries(appEnvEntryMap, consumer);
}
}
return appModule;
}
use of org.apache.openejb.jee.JndiConsumer in project tomee by apache.
the class CleanEnvEntries method fillInMissingType.
public AppModule fillInMissingType(final AppModule appModule) throws OpenEJBException {
for (final ClientModule module : appModule.getClientModules()) {
final JndiConsumer consumer = module.getApplicationClient();
if (consumer == null) {
continue;
}
fillInMissingType(consumer, module);
}
for (final WebModule module : appModule.getWebModules()) {
final JndiConsumer consumer = module.getWebApp();
if (consumer == null) {
continue;
}
fillInMissingType(consumer, module);
}
for (final EjbModule module : appModule.getEjbModules()) {
final EjbJar ejbJar = module.getEjbJar();
if (ejbJar == null) {
continue;
}
for (final EnterpriseBean consumer : ejbJar.getEnterpriseBeans()) {
fillInMissingType(consumer, module);
}
}
return appModule;
}
use of org.apache.openejb.jee.JndiConsumer in project tomee by apache.
the class ConvertJMSDestinationDefinitions method deploy.
@Override
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
final List<JndiConsumer> jndiConsumers = collectConsumers(appModule);
final KeyedCollection<String, JMSDestination> destinations = new KeyedCollection<>();
for (final JndiConsumer consumer : jndiConsumers) {
if (consumer != null) {
destinations.addAll(consumer.getJMSDestination());
}
}
for (final JMSDestination destination : destinations) {
appModule.getResources().add(toResource(destination));
}
return appModule;
}
use of org.apache.openejb.jee.JndiConsumer in project tomee by apache.
the class ConvertJMSConnectionFactoryDefinitions method deploy.
@Override
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
final List<JndiConsumer> jndiConsumers = collectConsumers(appModule);
final KeyedCollection<String, JMSConnectionFactory> factories = new KeyedCollection<>();
for (final JndiConsumer consumer : jndiConsumers) {
if (consumer != null) {
factories.addAll(consumer.getJMSConnectionFactories());
}
}
for (final JMSConnectionFactory factory : factories) {
appModule.getResources().add(toResource(factory));
}
return appModule;
}
Aggregations