private static final SecuritySubsystemParser PARSER = SecuritySubsystemParser.getInstance();
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME);
final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(SecuritySubsystemDescriptions.SUBSYSTEM);
registration.registerOperationHandler(ADD, SecuritySubsystemAdd.INSTANCE, SecuritySubsystemDescriptions.SUBSYSTEM_ADD,
false);
registration.registerOperationHandler(DESCRIBE, SecurityDescribeHandler.INSTANCE,
SecuritySubsystemDescriptions.SUBSYSTEM_DESCRIBE, false, OperationEntry.EntryType.PRIVATE);
// security domains
final ManagementResourceRegistration securityDomain = registration.registerSubModel(PathElement.pathElement(SECURITY_DOMAIN),
SecuritySubsystemDescriptions.SECURITY_DOMAIN);
securityDomain.registerOperationHandler(SecurityDomainAdd.OPERATION_NAME, SecurityDomainAdd.INSTANCE,
SecuritySubsystemDescriptions.SECURITY_DOMAIN_ADD, false);
securityDomain.registerOperationHandler(SecurityDomainRemove.OPERATION_NAME, SecurityDomainRemove.INSTANCE,
SecuritySubsystemDescriptions.SECURITY_DOMAIN_REMOVE, false);
// add operations to the security domain
securityDomain.registerOperationHandler(SecurityDomainOperations.LIST_CACHED_PRINCIPALS,
SecurityDomainOperations.LIST_CACHED_PRINCIPALS_OP, SecuritySubsystemDescriptions.LIST_CACHED_PRINCIPALS);
securityDomain.registerOperationHandler(SecurityDomainOperations.FLUSH_CACHE, SecurityDomainOperations.FLUSH_CACHE_OP,
SecuritySubsystemDescriptions.FLUSH_CACHE);
subsystem.registerXMLElementWriter(PARSER);
}