use of org.jboss.as.controller.SimpleResourceDefinition.Parameters in project wildfly by wildfly.
the class EJB3Extension method initialize.
/**
* {@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);
}
}
use of org.jboss.as.controller.SimpleResourceDefinition.Parameters in project wildfly by wildfly.
the class MessagingExtension method initialize.
@Override
public void initialize(ExtensionContext context) {
// Initialize the Netty logger factory
InternalLoggerFactory.setDefaultFactory(JdkLoggerFactory.INSTANCE);
final SubsystemRegistration subsystemRegistration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
subsystemRegistration.registerXMLElementWriter(CURRENT_PARSER);
boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid();
BiConsumer<OperationContext, String> broadcastCommandDispatcherFactoryInstaller = new BroadcastCommandDispatcherFactoryInstaller();
// Root resource
final ManagementResourceRegistration subsystem = subsystemRegistration.registerSubsystemModel(new MessagingSubsystemRootResourceDefinition(broadcastCommandDispatcherFactoryInstaller));
subsystem.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
// WFLY-10518 - register new client resources under subsystem
subsystem.registerSubModel(new DiscoveryGroupDefinition(registerRuntimeOnly, true));
subsystem.registerSubModel(new JGroupsDiscoveryGroupDefinition(registerRuntimeOnly, true));
subsystem.registerSubModel(new SocketDiscoveryGroupDefinition(registerRuntimeOnly, true));
subsystem.registerSubModel(GenericTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
subsystem.registerSubModel(InVMTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
subsystem.registerSubModel(RemoteTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
subsystem.registerSubModel(new HTTPConnectorDefinition(registerRuntimeOnly));
subsystem.registerSubModel(new ExternalConnectionFactoryDefinition(registerRuntimeOnly));
subsystem.registerSubModel(ExternalPooledConnectionFactoryDefinition.INSTANCE);
subsystem.registerSubModel(new ExternalJMSQueueDefinition(registerRuntimeOnly));
subsystem.registerSubModel(new ExternalJMSTopicDefinition(registerRuntimeOnly));
// ActiveMQ Servers
final ManagementResourceRegistration server = subsystem.registerSubModel(new ServerDefinition(broadcastCommandDispatcherFactoryInstaller, 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(new Parameters(SUBSYSTEM_PATH, getResourceDescriptionResolver("deployed")).setFeature(false)));
deployment.registerSubModel(new ExternalConnectionFactoryDefinition(registerRuntimeOnly));
deployment.registerSubModel(ExternalPooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE);
deployment.registerSubModel(new ExternalJMSQueueDefinition(registerRuntimeOnly));
deployment.registerSubModel(new ExternalJMSTopicDefinition(registerRuntimeOnly));
final ManagementResourceRegistration deployedServer = deployment.registerSubModel(new SimpleResourceDefinition(new Parameters(SERVER_PATH, getResourceDescriptionResolver(SERVER)).setFeature(false)));
deployedServer.registerSubModel(new JMSQueueDefinition(true, registerRuntimeOnly));
deployedServer.registerSubModel(new JMSTopicDefinition(true, registerRuntimeOnly));
deployedServer.registerSubModel(PooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE);
}
}
Aggregations