public ExtensionRegistrationContext(ExtensionContext context) { this.runtimeOnlyRegistrationValid = context.isRuntimeOnlyRegistrationValid(); this.pathManager = context.getProcessType().isServer() ? Optional.of(context.getPathManager()) : Optional.empty(); }
/** * {@inheritDoc} */ @Override public void initialize(ExtensionContext context) { final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); subsystem.registerXMLElementWriter(EJB3SubsystemXMLPersister.INSTANCE); PathManager pathManager = context.getProcessType().isServer() ? context.getPathManager() : null; subsystem.registerSubsystemModel(new EJB3SubsystemRootResourceDefinition(registerRuntimeOnly, pathManager)); if (registerRuntimeOnly) { ResourceDefinition deploymentsDef = new SimpleResourceDefinition(new Parameters(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME), getResourceDescriptionResolver("deployed")).setFeature(false)); final ManagementResourceRegistration deploymentsRegistration = subsystem.registerDeploymentModel(deploymentsDef); deploymentsRegistration.registerSubModel(MessageDrivenBeanResourceDefinition.INSTANCE); deploymentsRegistration.registerSubModel(SingletonBeanDeploymentResourceDefinition.INSTANCE); deploymentsRegistration.registerSubModel(StatelessSessionBeanDeploymentResourceDefinition.INSTANCE); deploymentsRegistration.registerSubModel(StatefulSessionBeanDeploymentResourceDefinition.INSTANCE); } }
/** * {@inheritDoc} */ public void initialize(ExtensionContext context) { TransactionLogger.ROOT_LOGGER.debug("Initializing Transactions Extension"); final LogStoreResource resource = new LogStoreResource(); final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); final TransactionSubsystemRootResourceDefinition rootResourceDefinition = new TransactionSubsystemRootResourceDefinition(registerRuntimeOnly); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(rootResourceDefinition); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); // Create the path resolver handlers if (context.getProcessType().isServer()) { // It's less than ideal to create a separate operation here, but this extension contains two relative-to attributes final ResolvePathHandler objectStorePathHandler = ResolvePathHandler.Builder.of(RESOLVE_OBJECT_STORE_PATH, context.getPathManager()) .setPathAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH) .setRelativeToAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO) .build(); registration.registerOperationHandler(objectStorePathHandler.getOperationDefinition(), objectStorePathHandler); } ManagementResourceRegistration logStoreChild = registration.registerSubModel(new LogStoreDefinition(resource, registerRuntimeOnly)); if (registerRuntimeOnly) { ManagementResourceRegistration transactionChild = logStoreChild.registerSubModel(new LogStoreTransactionDefinition(resource)); transactionChild.registerSubModel(LogStoreTransactionParticipantDefinition.INSTANCE); } subsystem.registerXMLElementWriter(TransactionSubsystemXMLPersister.INSTANCE); }
public ExtensionRegistrationContext(ExtensionContext context) { this.runtimeOnlyRegistrationValid = context.isRuntimeOnlyRegistrationValid(); this.pathManager = context.getProcessType().isServer() ? Optional.of(context.getPathManager()) : Optional.empty(); }
@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.SERVER_MANAGEMENT_LOGGER.ignoringUnsupportedLegacyExtension(subsystemNames, extensionName); return; } else if (context.getProcessType() == ProcessType.STANDALONE_SERVER) { throw new UnsupportedOperationException(ControllerMessages.MESSAGES.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)); } }
@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)); } }
/** * {@inheritDoc} */ @Override public void initialize(ExtensionContext context) { final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); // Register the root subsystem resource. final ManagementResourceRegistration rootResource = subsystem.registerSubsystemModel(new JSR77ManagementRootResource(context.getProcessType() == ProcessType.APPLICATION_CLIENT)); // Mandatory describe operation rootResource.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); subsystem.registerXMLElementWriter(parser); }
@Override public void initialize(ExtensionContext context) { SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(1)); subsystem.setHostCapable(); subsystem.registerSubsystemModel(new OperationTypesSubsystemResourceDefinition(context.getProcessType())); subsystem.registerXMLElementWriter(PARSER); }
@Override public void initialize(ExtensionContext context) { SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(1)); subsystem.setHostCapable(); subsystem.registerSubsystemModel(new BlockerSubsystemResourceDefinition(context.getProcessType().isHostController())); subsystem.registerXMLElementWriter(PARSER); }
@Override public void initialize(ExtensionContext context) { SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, ModelVersion.create(1)); subsystem.setHostCapable(); subsystem.registerSubsystemModel(new BlockerSubsystemResourceDefinition(context.getProcessType().isHostController())); subsystem.registerXMLElementWriter(PARSER); }
protected static void registerResolveOperationHandler(ExtensionContext context, ManagementResourceRegistration registry) { if (context.getProcessType().isServer()) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setPathAttribute(PATHS.get(registry.getPathAddress().getLastElement().getValue())) .setRelativeToAttribute(PathDefinition.RELATIVE_TO) .setCheckAbsolutePath(true) .build(); registry.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler); } }
protected static void registerResolveOperationHandler(ExtensionContext context, ManagementResourceRegistration registry) { if (context.getProcessType().isServer()) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setPathAttribute(PATHS.get(registry.getPathAddress().getLastElement().getValue())) .setRelativeToAttribute(PathDefinition.RELATIVE_TO) .setCheckAbsolutePath(true) .build(); registry.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler); } }
/** * {@inheritDoc} */ @Override public void initialize(ExtensionContext context) { ROOT_LOGGER.debug("Initializing Deployment Scanner Extension"); if (context.getProcessType() == ProcessType.HOST_CONTROLLER) { throw DeploymentScannerMessages.MESSAGES.deploymentScannerNotForDomainMode(); } final SubsystemRegistration subsystem = context.registerSubsystem(CommonAttributes.DEPLOYMENT_SCANNER, MANAGEMENT_API_MAJOR_VERSION, MANAGEMENT_API_MINOR_VERSION, MANAGEMENT_API_MICRO_VERSION); subsystem.registerXMLElementWriter(DeploymentScannerParser_1_1.INSTANCE); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new DeploymentScannerSubsystemDefinition()); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); final ManagementResourceRegistration scanner = registration.registerSubModel(new DeploymentScannerDefinition(context.getPathManager())); if (context.getProcessType().isServer()) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setRelativeToAttribute(DeploymentScannerDefinition.RELATIVE_TO) .setPathAttribute(DeploymentScannerDefinition.PATH) .build(); scanner.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler); } }
/** * {@inheritDoc} */ @Override public void initialize(ExtensionContext context) { ROOT_LOGGER.debug("Initializing Deployment Scanner Extension"); if (context.getProcessType().isHostController()) { throw DeploymentScannerLogger.ROOT_LOGGER.deploymentScannerNotForDomainMode(); } final SubsystemRegistration subsystem = context.registerSubsystem(CommonAttributes.DEPLOYMENT_SCANNER, CURRENT_VERSION); subsystem.registerXMLElementWriter(DeploymentScannerParser_2_0::new); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new DeploymentScannerSubsystemDefinition()); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); final ManagementResourceRegistration scanner = registration.registerSubModel(new DeploymentScannerDefinition(context.getPathManager())); if (context.getProcessType().isServer()) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setRelativeToAttribute(DeploymentScannerDefinition.RELATIVE_TO) .setPathAttribute(DeploymentScannerDefinition.PATH) .build(); scanner.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler); } }
/** * {@inheritDoc} */ @Override public void initialize(ExtensionContext context) { ROOT_LOGGER.debug("Initializing Deployment Scanner Extension"); if (context.getProcessType().isHostController()) { throw DeploymentScannerLogger.ROOT_LOGGER.deploymentScannerNotForDomainMode(); } final SubsystemRegistration subsystem = context.registerSubsystem(CommonAttributes.DEPLOYMENT_SCANNER, CURRENT_VERSION); subsystem.registerXMLElementWriter(DeploymentScannerParser_2_0::new); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(new DeploymentScannerSubsystemDefinition()); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); final ManagementResourceRegistration scanner = registration.registerSubModel(new DeploymentScannerDefinition(context.getPathManager())); if (context.getProcessType().isServer()) { final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setRelativeToAttribute(DeploymentScannerDefinition.RELATIVE_TO) .setPathAttribute(DeploymentScannerDefinition.PATH) .build(); scanner.registerOperationHandler(resolvePathHandler.getOperationDefinition(), resolvePathHandler); } }
/** * {@inheritDoc} * @see org.jboss.as.controller.Extension#initialize(org.jboss.as.controller.ExtensionContext) */ @Override public void initialize(ExtensionContext context) { // IMPORTANT: Management API version != xsd version! Not all Management API changes result in XSD changes SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, InfinispanSchema.CURRENT.getVersion()); // Create the path resolver handler final ResolvePathHandler resolvePathHandler; final PathManager pathManager; if (context.getProcessType().isServer()) { resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()) .setPathAttribute(FileStoreResource.PATH) .setRelativeToAttribute(FileStoreResource.RELATIVE_TO) .build(); pathManager = context.getPathManager(); } else { resolvePathHandler = null; pathManager = null; } subsystem.registerSubsystemModel(InfinispanSubsystemRootResource.create(resolvePathHandler, pathManager, context.isRuntimeOnlyRegistrationValid())); subsystem.registerXMLElementWriter(InfinispanSubsystemXMLWriter::new); }
@Override public void initialize(ExtensionContext context) { // Register the remoting subsystem final SubsystemRegistration registration = context.registerSubsystem(SUBSYSTEM_NAME, MANAGEMENT_API_MAJOR_VERSION, MANAGEMENT_API_MINOR_VERSION, MANAGEMENT_API_MICRO_VERSION); registration.registerXMLElementWriter(RemotingSubsystem11Parser.INSTANCE); final ManagementResourceRegistration subsystem = registration.registerSubsystemModel(new RemotingSubsystemRootResource(context.getProcessType())); subsystem.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); final ManagementResourceRegistration connector = subsystem.registerSubModel(ConnectorResource.INSTANCE); connector.registerSubModel(PropertyResource.INSTANCE_CONNECTOR); final ManagementResourceRegistration sasl = connector.registerSubModel(SaslResource.INSTANCE); sasl.registerSubModel(SaslPolicyResource.INSTANCE); sasl.registerSubModel(PropertyResource.INSTANCE_CONNECTOR); // remote outbound connection subsystem.registerSubModel(RemoteOutboundConnectionResourceDefinition.INSTANCE); // local outbound connection subsystem.registerSubModel(LocalOutboundConnectionResourceDefinition.INSTANCE); // (generic) outbound connection subsystem.registerSubModel(GenericOutboundConnectionResourceDefinition.INSTANCE); if (context.isRegisterTransformers()) { registerTransformers_1_1(registration); } }
/** * {@inheritDoc} */ public void initialize(ExtensionContext context) { TransactionLogger.ROOT_LOGGER.debug("Initializing Transactions Extension"); final LogStoreResource resource = new LogStoreResource(); final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); final TransactionSubsystemRootResourceDefinition rootResourceDefinition = new TransactionSubsystemRootResourceDefinition(registerRuntimeOnly); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(rootResourceDefinition); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); // Create the path resolver handlers if (context.getProcessType().isServer()) { // It's less than ideal to create a separate operation here, but this extension contains two relative-to attributes final ResolvePathHandler objectStorePathHandler = ResolvePathHandler.Builder.of(RESOLVE_OBJECT_STORE_PATH, context.getPathManager()) .setPathAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH) .setRelativeToAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO) .build(); registration.registerOperationHandler(objectStorePathHandler.getOperationDefinition(), objectStorePathHandler); } ManagementResourceRegistration logStoreChild = registration.registerSubModel(new LogStoreDefinition(resource, registerRuntimeOnly)); if (registerRuntimeOnly) { ManagementResourceRegistration transactionChild = logStoreChild.registerSubModel(new LogStoreTransactionDefinition(resource)); transactionChild.registerSubModel(LogStoreTransactionParticipantDefinition.INSTANCE); } subsystem.registerXMLElementWriter(TransactionSubsystemXMLPersister.INSTANCE); }
/** * {@inheritDoc} */ public void initialize(ExtensionContext context) { TransactionLogger.ROOT_LOGGER.debug("Initializing Transactions Extension"); final LogStoreResource resource = new LogStoreResource(); final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); final TransactionSubsystemRootResourceDefinition rootResourceDefinition = new TransactionSubsystemRootResourceDefinition(registerRuntimeOnly); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(rootResourceDefinition); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); // Create the path resolver handlers if (context.getProcessType().isServer()) { // It's less than ideal to create a separate operation here, but this extension contains two relative-to attributes final ResolvePathHandler objectStorePathHandler = ResolvePathHandler.Builder.of(RESOLVE_OBJECT_STORE_PATH, context.getPathManager()) .setPathAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH) .setRelativeToAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO) .build(); registration.registerOperationHandler(objectStorePathHandler.getOperationDefinition(), objectStorePathHandler); } ManagementResourceRegistration logStoreChild = registration.registerSubModel(new LogStoreDefinition(resource, registerRuntimeOnly)); if (registerRuntimeOnly) { ManagementResourceRegistration transactionChild = logStoreChild.registerSubModel(new LogStoreTransactionDefinition(resource)); transactionChild.registerSubModel(LogStoreTransactionParticipantDefinition.INSTANCE); } subsystem.registerXMLElementWriter(TransactionSubsystemXMLPersister.INSTANCE); }