container/common/src/main/java/org/mobicents/slee/container/security/Utility.java
public static ClassLoader switchSafelyClassLoader(final ClassLoader cl,final ProfileObject po)
	{
		ClassLoader _cl = null;
		if(System.getSecurityManager()!=null)
		{
			_cl =	(ClassLoader) AccessController.doPrivileged(new PrivilegedAction(){

				public Object run() {
					
					return _switchSafelyClassLoader(cl,po);
				}});
		}else
		{
			_cl = _switchSafelyClassLoader(cl, po);
		}
		
		return _cl;
		
	}
public static ClassLoader switchSafelyClassLoader(final ClassLoader cl,final ProfileObject po)
	{
		ClassLoader _cl = null;
		if(System.getSecurityManager()!=null)
		{
			_cl =	(ClassLoader) AccessController.doPrivileged(new PrivilegedAction(){

				public Object run() {
					
					return _switchSafelyClassLoader(cl,po);
				}});
		}else
		{
			_cl = _switchSafelyClassLoader(cl, po);
		}
		
		return _cl;
		
	}
public static ClassLoader switchSafelyClassLoader ( final ClassLoader cl , final ProfileObject po ) { ClassLoader _cl = null ; if ( System . getSecurityManager ( ) != null ) { _cl = ( ClassLoader ) AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { return _switchSafelyClassLoader ( cl , po ) ; } } ) ; } else { _cl = _switchSafelyClassLoader ( cl , po ) ; } return _cl ; }
This method depending if SecurityManger is present switches class loader using priviledged action,
this is requried as some action may be initiated by unsecure domains.
@param cl
@param po
@return
This method depending if SecurityManger is present switches class loader using priviledged action this is requried as some action may be initiated by unsecure domains .