messaging-activemq/src/main/java/org/wildfly/extension/messaging/activemq/BinderServiceUtil.java
public static void installBinderService(final ServiceTarget serviceTarget,
                                            final String name,
                                            final Service<?> service,
                                            final ServiceName dependency) {
        final BindInfo bindInfo = ContextNames.bindInfoFor(name);
        final BinderService binderService = new BinderService(bindInfo.getBindName());
        binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(service));
        final ServiceBuilder serviceBuilder = serviceTarget.addService(bindInfo.getBinderServiceName(), binderService)
                .addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                // we set it in passive mode so that missing dependencies (which is possible/valid when it's a backup HornetQ server and the services
                // haven't been activated on it due to the presence of a different live server) don't cause jms-topic/jms-queue add operations
                // to fail
                .setInitialMode(ServiceController.Mode.PASSIVE);
        if (dependency != null) {
            serviceBuilder.requires(dependency);
        }
        serviceBuilder.install();
    }
public static void installBinderService(final ServiceTarget serviceTarget,
                                            final String name,
                                            final Service<?> service,
                                            final ServiceName dependency) {
        final BindInfo bindInfo = ContextNames.bindInfoFor(name);
        final BinderService binderService = new BinderService(bindInfo.getBindName());
        binderService.getManagedObjectInjector().inject(new ValueManagedReferenceFactory(service));
        final ServiceBuilder serviceBuilder = serviceTarget.addService(bindInfo.getBinderServiceName(), binderService)
                .addDependency(bindInfo.getParentContextServiceName(), ServiceBasedNamingStore.class, binderService.getNamingStoreInjector())
                // we set it in passive mode so that missing dependencies (which is possible/valid when it's a backup HornetQ server and the services
                // haven't been activated on it due to the presence of a different live server) don't cause jms-topic/jms-queue add operations
                // to fail
                .setInitialMode(ServiceController.Mode.PASSIVE);
        if (dependency != null) {
            serviceBuilder.requires(dependency);
        }
        serviceBuilder.install();
    }
public static void installBinderService ( final ServiceTarget serviceTarget , final String name , final Service < ? > service , final ServiceName dependency ) { final BindInfo bindInfo = ContextNames . bindInfoFor ( name ) ; final BinderService binderService = new BinderService ( bindInfo . getBindName ( ) ) ; binderService . getManagedObjectInjector ( ) . inject ( new ValueManagedReferenceFactory ( service ) ) ; final ServiceBuilder serviceBuilder = serviceTarget . addService ( bindInfo . getBinderServiceName ( ) , binderService ) . addDependency ( bindInfo . getParentContextServiceName ( ) , ServiceBasedNamingStore . class , binderService . getNamingStoreInjector ( ) ) // we set it in passive mode so that missing dependencies (which is possible/valid when it's a backup HornetQ server and the services // haven't been activated on it due to the presence of a different live server) don't cause jms-topic/jms-queue add operations // to fail . setInitialMode ( ServiceController . Mode . PASSIVE ) ; if ( dependency != null ) { serviceBuilder . requires ( dependency ) ; } serviceBuilder . install ( ) ; }
Install a binder service to bind the value of the {@code service} using the binding {@code name}.

@param serviceTarget
@param name the binding name
@param service the service whose value must be bound
Install a binder service to bind the value of the { @code service } using the binding { @code name } .