Methods Summary |
---|
public com.sun.enterprise.SecurityManager | createSecurityManager(com.sun.enterprise.deployment.Descriptor descriptor)
SecurityManager ejbSM = null;
String contextId = null;
String appName = null;
try {
ejbSM = EJBSecurityManager.getInstance(descriptor);
// if the descriptor is not a EjbDescriptor the EJBSM will
// throw an exception. So the following will always work.
EjbDescriptor ejbdes = (EjbDescriptor) descriptor;
appName = ejbdes.getApplication().getRegistrationName();
contextId = EJBSecurityManager.getContextID(ejbdes);
if(_logger.isLoggable(Level.FINE)){
_logger.log(Level.FINE,
"[EJB-Security] EJB Security:Creating EJBSecurityManager for contextId = "
+contextId);
}
} catch (Exception e){
_logger.log(Level.FINE,
"[EJB-Security] FATAl Exception. Unable to create EJBSecurityManager: "
+ e.getMessage() );
throw new RuntimeException(e);
}
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);
}
}
_poolPut(contextId, ejbSM);
return ejbSM;
|
public java.lang.String[] | getAndRemoveContextIdForEjbAppName(java.lang.String appName)
synchronized(CONTEXT_ID) {
List contextId = (List) CONTEXT_ID.get(appName);
if (contextId == null) {
return null;
}
String[] rvalue = new String[contextId.size()];
rvalue = (String[])contextId.toArray(rvalue);
CONTEXT_ID.remove(appName);
return rvalue;
}
|
public static SecurityManagerFactory | getInstance()
try {
rwLock.readLock().lock();
if (_theFactory != null) {
return _theFactory;
}
} finally {
rwLock.readLock().unlock();
}
try {
rwLock.writeLock().lock();
if (_theFactory == null) {
_theFactory =
(SecurityManagerFactory)new EJBSecurityManagerFactory();
}
return _theFactory;
} finally {
rwLock.writeLock().unlock();
}
|
public com.sun.enterprise.SecurityManager | getSecurityManager(java.lang.String contextId)
if (_poolHas(contextId)){
return (SecurityManager)_poolGet(contextId);
}
return null;
|