use of org.jboss.security.plugins.JBossSecuritySubjectFactory in project wildfly by wildfly.
the class SubjectFactoryService method start.
/** {@inheritDoc} */
@Override
public synchronized void start(StartContext context) throws StartException {
SecurityLogger.ROOT_LOGGER.debugf("Starting SubjectFactoryService");
final ISecurityManagement injectedSecurityManagement = securityManagementValue.getValue();
int i = subjectFactoryClassName.lastIndexOf(":");
if (i == -1)
throw SecurityLogger.ROOT_LOGGER.missingModuleName("subject-factory-class-name attribute");
String moduleSpec = subjectFactoryClassName.substring(0, i);
String className = subjectFactoryClassName.substring(i + 1);
JBossSecuritySubjectFactory subjectFactory = null;
try {
Class<?> subjectFactoryClazz = SecurityActions.getModuleClassLoader(moduleSpec).loadClass(className);
subjectFactory = (JBossSecuritySubjectFactory) subjectFactoryClazz.newInstance();
} catch (Exception e) {
throw SecurityLogger.ROOT_LOGGER.unableToStartException("SubjectFactoryService", e);
}
subjectFactory.setSecurityManagement(injectedSecurityManagement);
this.subjectFactory = subjectFactory;
}
Aggregations