}
}
}
if (!need) return;
Policy ppc = null;
if (pp != null) {
try {
ppc = (Policy)Class.forName(pp).newInstance();
} catch (Exception e) {
throw new BrokerException(e.getClass().getName()+": "+
e.getMessage()+" - "+
AccessController.PROP_ACCESSCONTROL_PREFIX+
JAASAccessControlModel.PROP_POLICY_PROVIDER+"="+pp);
}
}
synchronized(System.class) {
if (System.getSecurityManager() == null) {
String val = System.getProperty("java.security.policy");
if (val == null) {
/*
logger.log(logger.INFO, "Set java.security.policy to MQ default policy file");
System.setProperty("java.security.policy",
"file:"+Globals.getInstanceEtcDir()+File.separator+DEFAULT_POLICY_FILENAME);
*/
} else {
logger.log(logger.INFO, "java.security.policy="+val);
}
System.setSecurityManager(new SecurityManager());
logger.log(logger.INFO, Globals.getBrokerResources().getKString(
BrokerResources.I_SET_DEFAULT_SECURITY_MANAGER));
}
}
if (ppc != null) {
logger.log(logger.INFO, AccessController.PROP_ACCESSCONTROL_PREFIX+
JAASAccessControlModel.PROP_POLICY_PROVIDER+"="+pp);
Policy.setPolicy(ppc);
logger.log(logger.INFO, Globals.getBrokerResources().getKString(
BrokerResources.I_SET_JAVA_POLICY_PROVIDER, ppc.getClass().getName()));
}
}