@Override public void initialize(ExtensionContext context) { if (context.getProcessType() == ProcessType.DOMAIN_SERVER) { // Do nothing. This allows an extension=cmp:add op that's really targeted // to legacy servers to work ControllerLogger.MGMT_OP_LOGGER.ignoringUnsupportedLegacyExtension(subsystemNames, extensionName); return; } else if (context.getProcessType() == ProcessType.STANDALONE_SERVER) { if (context.getRunningMode() == RunningMode.ADMIN_ONLY) { //log a message, but fall through and register the model ControllerLogger.MGMT_OP_LOGGER.removeUnsupportedLegacyExtension(subsystemNames, extensionName); } else { throw new UnsupportedOperationException(ControllerLogger.ROOT_LOGGER.unsupportedLegacyExtension(extensionName)); } } Set<ManagementResourceRegistration> subsystemRoots = initializeLegacyModel(context); for (ManagementResourceRegistration subsystemRoot : subsystemRoots) { subsystemRoot.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, new UnsupportedSubsystemDescribeHandler(extensionName)); } }
@Override public void initialize(ExtensionContext context) { if (context.getProcessType() == ProcessType.DOMAIN_SERVER) { // Do nothing. This allows an extension=cmp:add op that's really targeted // to legacy servers to work ControllerLogger.MGMT_OP_LOGGER.ignoringUnsupportedLegacyExtension(subsystemNames, extensionName); return; } else if (context.getProcessType() == ProcessType.STANDALONE_SERVER) { if (context.getRunningMode() == RunningMode.ADMIN_ONLY) { //log a message, but fall through and register the model ControllerLogger.MGMT_OP_LOGGER.removeUnsupportedLegacyExtension(subsystemNames, extensionName); } else { throw new UnsupportedOperationException(ControllerLogger.ROOT_LOGGER.unsupportedLegacyExtension(extensionName)); } } Set<ManagementResourceRegistration> subsystemRoots = initializeLegacyModel(context); for (ManagementResourceRegistration subsystemRoot : subsystemRoots) { subsystemRoot.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, new UnsupportedSubsystemDescribeHandler(extensionName)); } }