Search in sources :

Example 51 with ServiceController

use of org.jboss.msc.service.ServiceController in project wildfly by wildfly.

the class JMSDestinationDefinitionInjectionSource method inject.

private <D extends Destination> void inject(ServiceBuilder<?> serviceBuilder, Injector<ManagedReferenceFactory> injector, Service<D> destinationService) {
    final ContextListAndJndiViewManagedReferenceFactory referenceFactoryService = new MessagingJMSDestinationManagedReferenceFactory(destinationService);
    serviceBuilder.addInjection(injector, referenceFactoryService).addListener(new AbstractServiceListener<Object>() {

        public void transition(final ServiceController<? extends Object> controller, final ServiceController.Transition transition) {
            switch(transition) {
                case STARTING_to_UP:
                    {
                        ROOT_LOGGER.boundJndiName(jndiName);
                        break;
                    }
                case START_REQUESTED_to_DOWN:
                    {
                        ROOT_LOGGER.unboundJndiName(jndiName);
                        break;
                    }
                case REMOVING_to_REMOVED:
                    {
                        ROOT_LOGGER.debugf("Removed messaging object [%s]", jndiName);
                        break;
                    }
            }
        }
    });
}
Also used : ServiceController(org.jboss.msc.service.ServiceController) ContextListAndJndiViewManagedReferenceFactory(org.jboss.as.naming.ContextListAndJndiViewManagedReferenceFactory)

Aggregations

ServiceController (org.jboss.msc.service.ServiceController)51 ServiceName (org.jboss.msc.service.ServiceName)20 ModelNode (org.jboss.dmr.ModelNode)17 OperationFailedException (org.jboss.as.controller.OperationFailedException)15 OperationContext (org.jboss.as.controller.OperationContext)12 ServiceRegistry (org.jboss.msc.service.ServiceRegistry)12 BinderService (org.jboss.as.naming.service.BinderService)9 PathAddress (org.jboss.as.controller.PathAddress)8 ContextNames (org.jboss.as.naming.deployment.ContextNames)8 HttpHandler (io.undertow.server.HttpHandler)7 PathHandler (io.undertow.server.handlers.PathHandler)7 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)7 FilterService (org.wildfly.extension.undertow.filters.FilterService)7 ServiceBasedNamingStore (org.jboss.as.naming.ServiceBasedNamingStore)6 ArrayList (java.util.ArrayList)5 Resource (org.jboss.as.controller.registry.Resource)5 ManagedReferenceFactory (org.jboss.as.naming.ManagedReferenceFactory)5 AbstractServiceListener (org.jboss.msc.service.AbstractServiceListener)5 List (java.util.List)4 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)4