Search in sources :

Example 1 with Parameters

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);
    }
}
Also used : PathManager(org.jboss.as.controller.services.path.PathManager) Parameters(org.jboss.as.controller.SimpleResourceDefinition.Parameters) StatelessSessionBeanDeploymentResourceDefinition(org.jboss.as.ejb3.subsystem.deployment.StatelessSessionBeanDeploymentResourceDefinition) SimpleResourceDefinition(org.jboss.as.controller.SimpleResourceDefinition) SingletonBeanDeploymentResourceDefinition(org.jboss.as.ejb3.subsystem.deployment.SingletonBeanDeploymentResourceDefinition) ResourceDefinition(org.jboss.as.controller.ResourceDefinition) MessageDrivenBeanResourceDefinition(org.jboss.as.ejb3.subsystem.deployment.MessageDrivenBeanResourceDefinition) StatefulSessionBeanDeploymentResourceDefinition(org.jboss.as.ejb3.subsystem.deployment.StatefulSessionBeanDeploymentResourceDefinition) SimpleResourceDefinition(org.jboss.as.controller.SimpleResourceDefinition) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration)

Example 2 with Parameters

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);
    }
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) JMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition) ExternalJMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSTopicDefinition) Parameters(org.jboss.as.controller.SimpleResourceDefinition.Parameters) SimpleResourceDefinition(org.jboss.as.controller.SimpleResourceDefinition) BroadcastCommandDispatcherFactoryInstaller(org.wildfly.extension.messaging.activemq.broadcast.BroadcastCommandDispatcherFactoryInstaller) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration) ExternalConnectionFactoryDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalConnectionFactoryDefinition) ExternalJMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSTopicDefinition) ExternalJMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSQueueDefinition) ExternalJMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSQueueDefinition) JMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition)

Aggregations

SimpleResourceDefinition (org.jboss.as.controller.SimpleResourceDefinition)2 Parameters (org.jboss.as.controller.SimpleResourceDefinition.Parameters)2 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)2 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)2 OperationContext (org.jboss.as.controller.OperationContext)1 ResourceDefinition (org.jboss.as.controller.ResourceDefinition)1 PathManager (org.jboss.as.controller.services.path.PathManager)1 MessageDrivenBeanResourceDefinition (org.jboss.as.ejb3.subsystem.deployment.MessageDrivenBeanResourceDefinition)1 SingletonBeanDeploymentResourceDefinition (org.jboss.as.ejb3.subsystem.deployment.SingletonBeanDeploymentResourceDefinition)1 StatefulSessionBeanDeploymentResourceDefinition (org.jboss.as.ejb3.subsystem.deployment.StatefulSessionBeanDeploymentResourceDefinition)1 StatelessSessionBeanDeploymentResourceDefinition (org.jboss.as.ejb3.subsystem.deployment.StatelessSessionBeanDeploymentResourceDefinition)1 BroadcastCommandDispatcherFactoryInstaller (org.wildfly.extension.messaging.activemq.broadcast.BroadcastCommandDispatcherFactoryInstaller)1 ExternalConnectionFactoryDefinition (org.wildfly.extension.messaging.activemq.jms.ExternalConnectionFactoryDefinition)1 ExternalJMSQueueDefinition (org.wildfly.extension.messaging.activemq.jms.ExternalJMSQueueDefinition)1 ExternalJMSTopicDefinition (org.wildfly.extension.messaging.activemq.jms.ExternalJMSTopicDefinition)1 JMSQueueDefinition (org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition)1 JMSTopicDefinition (org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition)1