Source:
public void initialize(ExtensionContext context) { final SubsystemRegistration subsystemRegistration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); subsystemRegistration.registerXMLElementWriter(MessagingSubsystemParser_3_0::new); boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final ManagementResourceRegistration subsystem = subsystemRegistration.registerSubsystemModel(MessagingSubsystemRootResourceDefinition.INSTANCE); subsystem.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); final ManagementResourceRegistration server = subsystem.registerSubModel(new ServerDefinition(registerRuntimeOnly)); for (PathDefinition path : new PathDefinition[] { PathDefinition.JOURNAL_INSTANCE, PathDefinition.BINDINGS_INSTANCE, PathDefinition.LARGE_MESSAGES_INSTANCE, PathDefinition.PAGING_INSTANCE }) { ManagementResourceRegistration pathRegistry = server.registerSubModel(path); PathDefinition.registerResolveOperationHandler(context, pathRegistry); } subsystem.registerSubModel(JMSBridgeDefinition.INSTANCE); if (registerRuntimeOnly) { final ManagementResourceRegistration deployment = subsystemRegistration.registerDeploymentModel(new SimpleResourceDefinition(SUBSYSTEM_PATH, getResourceDescriptionResolver("deployed"))); final ManagementResourceRegistration deployedServer = deployment.registerSubModel(new SimpleResourceDefinition(SERVER_PATH, getResourceDescriptionResolver(SERVER))); deployedServer.registerSubModel(new JMSQueueDefinition(true, registerRuntimeOnly)); deployedServer.registerSubModel(new JMSTopicDefinition(true, registerRuntimeOnly)); deployedServer.registerSubModel(PooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE); } }

Target:
public void initialize(ExtensionContext context) { final SubsystemRegistration subsystemRegistration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); subsystemRegistration.registerXMLElementWriter(PARSER); boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final ManagementResourceRegistration subsystem = subsystemRegistration.registerSubsystemModel(MessagingSubsystemRootResourceDefinition.INSTANCE); subsystem.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); final ManagementResourceRegistration server = subsystem.registerSubModel(new ServerDefinition(registerRuntimeOnly)); for (PathDefinition path : new PathDefinition[] { PathDefinition.JOURNAL_INSTANCE, PathDefinition.BINDINGS_INSTANCE, PathDefinition.LARGE_MESSAGES_INSTANCE, PathDefinition.PAGING_INSTANCE }) { ManagementResourceRegistration pathRegistry = server.registerSubModel(path); PathDefinition.registerResolveOperationHandler(context, pathRegistry); } subsystem.registerSubModel(JMSBridgeDefinition.INSTANCE); if (registerRuntimeOnly) { final ManagementResourceRegistration deployment = subsystemRegistration.registerDeploymentModel(new SimpleResourceDefinition(SUBSYSTEM_PATH, getResourceDescriptionResolver("deployed"))); final ManagementResourceRegistration deployedServer = deployment.registerSubModel(new SimpleResourceDefinition(SERVER_PATH, getResourceDescriptionResolver(SERVER))); deployedServer.registerSubModel(new JMSQueueDefinition(true, registerRuntimeOnly)); deployedServer.registerSubModel(new JMSTopicDefinition(true, registerRuntimeOnly)); deployedServer.registerSubModel(PooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE); } }