Methods Summary |
---|
public java.lang.String[] | getAndRemoveContextIdForWebAppName(java.lang.String appName)valid for standalone web apps
synchronized(CONTEXT_ID) {
String [] rvalue = getContextIdsOfApp(appName);
CONTEXT_ID.remove(appName);
return rvalue;
}
|
public java.lang.String[] | getContextIdsOfApp(java.lang.String appName)valid for standalone web apps
synchronized(CONTEXT_ID) {
List contextId = (List) CONTEXT_ID.get(appName);
if(contextId == null)
return null;
String[] arrayContext = new String[contextId.size()];
arrayContext = (String[])contextId.toArray(arrayContext);
return arrayContext;
}
|
public static synchronized com.sun.web.security.WebSecurityManagerFactory | getInstance()
if (factory == null){
factory = new WebSecurityManagerFactory();
}
return factory;
|
public WebSecurityManager | getWebSecurityManager(java.lang.String contextId)
synchronized (securityManagerPool) {
return (WebSecurityManager)securityManagerPool.get(contextId);
}
|
public WebSecurityManager | newWebSecurityManager(com.sun.enterprise.deployment.WebBundleDescriptor wbd)
String contextId = WebSecurityManager.getContextID(wbd);
String appname = wbd.getApplication().getRegistrationName();
synchronized (CONTEXT_ID) {
List lst = (List)CONTEXT_ID.get(appname);
if(lst == null){
lst = new ArrayList();
CONTEXT_ID.put(appname, lst);
}
if (!lst.contains(contextId)) {
lst.add(contextId);
}
}
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE, "[Web-Security] Web Security:Creating WebSecurityManager for contextId = "+contextId);
}
WebSecurityManager wsManager = getWebSecurityManager(contextId);
if (wsManager == null) {
// we should see if it is safe to do the security manager
// construction within the synchronize block.
// for the time being, we will just make sure that we
// synchronize access to the pool.
try{
wsManager = new WebSecurityManager(wbd);
} catch (javax.security.jacc.PolicyContextException e){
logger.log(Level.FINE, "[Web-Security] FATAl Exception. Unable to create WebSecurityManager: " + e.getMessage() );
throw new RuntimeException(e);
}
synchronized (securityManagerPool) {
WebSecurityManager other =
(WebSecurityManager)securityManagerPool.get(contextId);
if (other == null) {
securityManagerPool.put(contextId, wsManager);
} else {
wsManager = other;
}
}
}
return wsManager;
|
public void | removeWebSecurityManager(java.lang.String contextId)
synchronized (securityManagerPool){
securityManagerPool.remove(contextId);
}
|