use of org.apache.activemq.ra.MessageActivationSpec in project tomee by apache.
the class ActiveMQResourceAdapter method endpointActivation.
@Override
public void endpointActivation(final MessageEndpointFactory endpointFactory, final ActivationSpec activationSpec) throws ResourceException {
final BeanContext current = MdbContainer.current();
if (current != null && "false".equalsIgnoreCase(current.getProperties().getProperty("MdbActiveOnStartup"))) {
if (!equals(activationSpec.getResourceAdapter())) {
throw new ResourceException("Activation spec not initialized with this ResourceAdapter instance (" + activationSpec.getResourceAdapter() + " != " + this + ")");
}
if (!(activationSpec instanceof MessageActivationSpec)) {
throw new NotSupportedException("That type of ActivationSpec not supported: " + activationSpec.getClass());
}
final ActiveMQEndpointActivationKey key = new ActiveMQEndpointActivationKey(endpointFactory, MessageActivationSpec.class.cast(activationSpec));
Map.class.cast(Reflections.get(this, "endpointWorkers")).put(key, new ActiveMQEndpointWorker(this, key) {
});
// we dont want that worker.start();
} else {
super.endpointActivation(endpointFactory, activationSpec);
}
if (current != null) {
addJMxControl(current, current.getProperties().getProperty("MdbJMXControl"));
}
}
Aggregations