1 17 18 package org.apache.geronimo.connector.outbound.connectiontracking; 19 20 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContext; 21 import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator; 22 23 29 public class DefaultComponentInterceptor implements DefaultInterceptor { 30 31 private final DefaultInterceptor next; 32 private final TrackedConnectionAssociator trackedConnectionAssociator; 33 34 public DefaultComponentInterceptor(DefaultInterceptor next, TrackedConnectionAssociator trackedConnectionAssociator) { 35 this.next = next; 36 this.trackedConnectionAssociator = trackedConnectionAssociator; 37 } 38 39 public Object invoke(ConnectorInstanceContext newConnectorInstanceContext) throws Throwable { 40 ConnectorInstanceContext oldConnectorInstanceContext = trackedConnectionAssociator.enter(newConnectorInstanceContext); 41 try { 42 return next.invoke(newConnectorInstanceContext); 43 } finally { 44 trackedConnectionAssociator.exit(oldConnectorInstanceContext); 45 } 46 } 47 } 48 | Popular Tags |