use of org.apache.activemq.ra.ActiveMQManagedConnection in project tomee by apache.
the class ActiveMQResourceAdapter method getActiveMQConnection.
private ActiveMQConnection getActiveMQConnection(MessageActivationSpec activationSpec, InvocationHandler invocationHandler) {
if (AutoConnectionTracker.ConnectionInvocationHandler.class.isInstance(invocationHandler)) {
final Object handle = Reflections.get(invocationHandler, "handle");
if (TomEEManagedConnectionProxy.class.isInstance(handle)) {
final ActiveMQManagedConnection c = ActiveMQManagedConnection.class.cast(Reflections.get(handle, "connection"));
final ActiveMQConnection physicalConnection = ActiveMQConnection.class.cast(Reflections.get(c, "physicalConnection"));
final RedeliveryPolicy redeliveryPolicy = activationSpec.redeliveryPolicy();
if (redeliveryPolicy != null) {
physicalConnection.setRedeliveryPolicy(redeliveryPolicy);
}
return physicalConnection;
}
}
return null;
}
Aggregations