private AuthorizationModule instantiateModule(String name,
Map<String,Object> map, RoleGroup subjectRoles)
throws PrivilegedActionException
{
AuthorizationModule am = null;
ClassLoader tcl = SecurityActions.getContextClassLoader();
try
{
Class<?> clazz = tcl.loadClass(name);
am = (AuthorizationModule)clazz.newInstance();
}
catch ( Exception e)
{
log.debug("Error instantiating AuthorizationModule:",e);
}
if(am == null)
throw new IllegalStateException("AuthorizationModule has not " +
"been instantiated");
am.initialize(this.authenticatedSubject, this.callbackHandler,
this.sharedState,map, subjectRoles);
return am;
}