use of org.apache.openejb.jee.KeyedCollection 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;
}
use of org.apache.openejb.jee.KeyedCollection 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.KeyedCollection in project tomee by apache.
the class ConvertDataSourceDefinitions method deploy.
@Override
public AppModule deploy(final AppModule appModule) throws OpenEJBException {
final List<JndiConsumer> jndiConsumers = collectConsumers(appModule);
final KeyedCollection<String, DataSource> dataSources = new KeyedCollection<String, DataSource>();
for (final JndiConsumer consumer : jndiConsumers) {
if (consumer == null) {
continue;
}
dataSources.addAll(consumer.getDataSource());
}
for (final DataSource dataSource : dataSources) {
appModule.getResources().add(toResource(dataSource));
}
return appModule;
}
Aggregations