1 17 package org.apache.geronimo.connector.outbound.connectiontracking; 18 19 import java.util.Collections ; 20 import java.util.HashMap ; 21 import java.util.Map ; 22 import java.util.Set ; 23 24 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContext; 25 26 29 public class SharedConnectorInstanceContext implements ConnectorInstanceContext { 30 31 private Map connectionManagerMap = new HashMap (); 32 33 private final Set unshareableResources; 34 private final Set applicationManagedSecurityResources; 35 36 private boolean hide = false; 37 38 public SharedConnectorInstanceContext(Set unshareableResources, Set applicationManagedSecurityResources, boolean share) { 39 this.unshareableResources = unshareableResources; 40 this.applicationManagedSecurityResources = applicationManagedSecurityResources; 41 if (!share) { 42 connectionManagerMap = new HashMap (); 43 } 44 } 45 46 public void share(SharedConnectorInstanceContext context) { 47 connectionManagerMap = context.connectionManagerMap; 48 } 49 50 public void hide() { 51 this.hide = true; 52 } 53 54 public Map getConnectionManagerMap() { 55 if (hide) { 56 return Collections.EMPTY_MAP; 57 } 58 return connectionManagerMap; 59 } 60 61 public Set getUnshareableResources() { 62 return unshareableResources; 63 } 64 65 public Set getApplicationManagedSecurityResources() { 66 return applicationManagedSecurityResources; 67 } 68 } 69 | Popular Tags |