SecurityManager sm = System.getSecurityManager();
if (sm == null) {
if (securityManager.length() == 0)
sm = new SecurityManager(); // use the default one from java
else if (securityManager.equals(SECURITY_OSGI))
sm = new EquinoxSecurityManager(); // use an OSGi enabled manager that understands postponed conditions
else {
// try to use a specific classloader by classname
try {
Class<?> clazz = Class.forName(securityManager);
sm = (SecurityManager) clazz.newInstance();