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;
}
}
}
});
}
Aggregations