1 17 18 package org.apache.geronimo.connector.outbound; 19 20 import javax.resource.ResourceException ; 21 22 29 public class LocalXAResourceInsertionInterceptor 30 implements ConnectionInterceptor { 31 32 private final ConnectionInterceptor next; 33 private final String name; 34 35 public LocalXAResourceInsertionInterceptor(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( 44 new LocalXAResource(mci.getManagedConnection().getLocalTransaction(), name)); 45 } 46 47 public void returnConnection( 48 ConnectionInfo connectionInfo, 49 ConnectionReturnAction connectionReturnAction) { 50 next.returnConnection(connectionInfo, connectionReturnAction); 51 } 52 53 public void destroy() { 54 next.destroy(); 55 } 56 } 57 | Popular Tags |