Search in sources :

Example 1 with KeyedCollection

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;
}
Also used : KeyedCollection(org.apache.openejb.jee.KeyedCollection) JndiConsumer(org.apache.openejb.jee.JndiConsumer) JMSConnectionFactory(org.apache.openejb.jee.JMSConnectionFactory)

Example 2 with KeyedCollection

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;
}
Also used : JMSDestination(org.apache.openejb.jee.JMSDestination) KeyedCollection(org.apache.openejb.jee.KeyedCollection) JndiConsumer(org.apache.openejb.jee.JndiConsumer)

Example 3 with KeyedCollection

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;
}
Also used : KeyedCollection(org.apache.openejb.jee.KeyedCollection) JndiConsumer(org.apache.openejb.jee.JndiConsumer) DataSource(org.apache.openejb.jee.DataSource)

Aggregations

JndiConsumer (org.apache.openejb.jee.JndiConsumer)3 KeyedCollection (org.apache.openejb.jee.KeyedCollection)3 DataSource (org.apache.openejb.jee.DataSource)1 JMSConnectionFactory (org.apache.openejb.jee.JMSConnectionFactory)1 JMSDestination (org.apache.openejb.jee.JMSDestination)1