private final ThreadLocal currentInstanceContexts = new ThreadLocal();
private final ThreadLocal currentUnshareableResources = new ThreadLocal();
public TrackedConnectionAssociator.ConnectorContextInfo enter(InstanceContext newInstanceContext, Set newUnshareableResources)
throws ResourceException {
InstanceContext oldInstanceContext = (InstanceContext) currentInstanceContexts.get();
Set oldUnshareableResources = (Set)currentUnshareableResources.get();
notifyConnections(newInstanceContext, newUnshareableResources);
currentInstanceContexts.set(newInstanceContext);
currentUnshareableResources.set(newUnshareableResources);
return new TrackedConnectionAssociator.ConnectorContextInfo(oldInstanceContext, oldUnshareableResources);