1 23 24 29 30 package com.sun.enterprise.security.factory; 31 32 import java.util.Map ; 33 import java.util.HashMap ; 34 35 import com.sun.enterprise.SecurityManager; 36 import com.sun.enterprise.security.factory.SecurityManagerFactory; 37 import com.sun.enterprise.deployment.Descriptor; 38 import java.util.logging.*; 39 import com.sun.logging.LogDomains; 40 45 public abstract class AbstractSecurityManagerFactory 46 implements SecurityManagerFactory { 47 48 protected static Logger _logger = 49 Logger.getLogger(LogDomains.SECURITY_LOGGER); 50 51 protected static SecurityManagerFactory _theFactory = null; 52 protected Map _securityManagerPool = new HashMap (); 53 54 public abstract SecurityManager getSecurityManager(String contextId); 55 56 public abstract SecurityManager createSecurityManager(Descriptor descriptor); 57 58 63 protected boolean _poolHas(String contextId){ 64 return _securityManagerPool.containsKey(contextId); 65 } 66 67 protected void _poolPut(String contextId, SecurityManager smf){ 68 synchronized(_securityManagerPool){ 69 _securityManagerPool.put(contextId, smf); 70 } 71 } 72 protected SecurityManager _poolGet(String contextId){ 73 return (SecurityManager )_securityManagerPool.get(contextId); 74 } 75 76 public void removeSecurityManager(String contextId){ 77 synchronized (_securityManagerPool){ 78 _securityManagerPool.remove(contextId); 79 } 80 } 81 } 82 | Popular Tags |