1 17 18 package org.apache.geronimo.connector.outbound; 19 20 import javax.resource.ResourceException ; 21 22 import org.apache.geronimo.transaction.manager.WrapperNamedXAResource; 23 24 30 public class XAResourceInsertionInterceptor implements ConnectionInterceptor { 31 32 private final ConnectionInterceptor next; 33 private final String name; 34 35 public XAResourceInsertionInterceptor(final ConnectionInterceptor next, final String name) { 36 this.next = next; 37 this.name = name; 38 } 39 40 public void getConnection(ConnectionInfo connectionInfo) throws ResourceException { 41 next.getConnection(connectionInfo); 42 ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo(); 43 mci.setXAResource(new WrapperNamedXAResource(mci.getManagedConnection().getXAResource(), name)); 44 } 45 46 public void returnConnection(ConnectionInfo connectionInfo, ConnectionReturnAction connectionReturnAction) { 47 next.returnConnection(connectionInfo, connectionReturnAction); 48 } 49 50 public void destroy() { 51 next.destroy(); 52 } 53 54 } 55 | Popular Tags |