* throw an exception.
*/
public static void generatePolicyFile(String name) throws IASSecurityException {
assert name != null;
if (name == null) {
throw new IASSecurityException("Invalid Module Name");
}
try {
boolean inService =
PolicyConfigurationFactory.getPolicyConfigurationFactory().
inService(name);
if (!inService) {
// find the PolicyConfig using remove=false to ensure policy stmts
// are retained.
// Note that it is presumed that the pc exists, and that
// it is populated with the desired policy statements.
// If this is not true, the call to commit will not
// result in the correct policy statements being made
// available to the policy module.
PolicyConfigurationFactory pcf =
PolicyConfigurationFactory.getPolicyConfigurationFactory();
PolicyConfiguration pc =
pcf.getPolicyConfiguration(name, false);
pc.commit();
if (_logger.isLoggable(Level.FINE)){
_logger.fine("JACC: committed policy for context: "+name);
}
}
Policy.getPolicy().refresh();
} catch(java.lang.ClassNotFoundException cnfe){
//String msg = localStrings.getLocalString("enterprise.security.securityutil.classnotfound","Could not find PolicyConfigurationFactory class. Check javax.security.jacc.PolicyConfigurationFactory.provider property");
throw new IASSecurityException(cnfe);
} catch(javax.security.jacc.PolicyContextException pce){
throw new IASSecurityException(pce);
}
}