use of org.apache.openejb.resource.activemq.jms2.TomEEConnectionFactory in project tomee by apache.
the class ActiveMQResourceAdapter method createConnectionFactory.
@Override
protected ActiveMQConnectionFactory createConnectionFactory(final ActiveMQConnectionRequestInfo connectionRequestInfo, final MessageActivationSpec activationSpec) {
if (TomEEMessageActivationSpec.class.isInstance(activationSpec)) {
final TomEEMessageActivationSpec s = TomEEMessageActivationSpec.class.cast(activationSpec);
if (s.getConnectionFactoryLookup() != null) {
try {
final Object lookup = SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup("openejb:Resource/" + s.getConnectionFactoryLookup());
if (ActiveMQConnectionFactory.class.isInstance(lookup)) {
return ActiveMQConnectionFactory.class.cast(lookup);
}
// already handled
return ActiveMQConnectionFactory.class.cast(lookup);
} catch (final NamingException e) {
throw new IllegalArgumentException("");
}
}
}
final ActiveMQConnectionFactory factory = new TomEEConnectionFactory();
connectionRequestInfo.configure(factory, activationSpec);
return factory;
}
Aggregations