transactions/src/main/java/org/jboss/as/txn/deployment/TransactionJndiBindingProcessor.java
private void bindServices(DeploymentUnit deploymentUnit, ServiceTarget serviceTarget, ServiceName contextServiceName) {

        final ServiceName userTransactionServiceName = contextServiceName.append("UserTransaction");
        final UserTransactionBindingService userTransactionBindingService = new UserTransactionBindingService("UserTransaction");
        serviceTarget.addService(userTransactionServiceName, userTransactionBindingService)
            .addDependency(UserTransactionAccessControlService.SERVICE_NAME, UserTransactionAccessControlService.class,userTransactionBindingService.getUserTransactionAccessControlServiceInjector())
            .addDependency(UserTransactionService.INTERNAL_SERVICE_NAME, UserTransaction.class,
                    new ManagedReferenceInjector<UserTransaction>(userTransactionBindingService.getManagedObjectInjector()))
            .addDependency(contextServiceName, ServiceBasedNamingStore.class, userTransactionBindingService.getNamingStoreInjector())
            .install();
        final Map<ServiceName, Set<ServiceName>> jndiComponentDependencies = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPONENT_JNDI_DEPENDENCIES);
        Set<ServiceName> jndiDependencies = jndiComponentDependencies.get(contextServiceName);
        if (jndiDependencies == null) {
            jndiComponentDependencies.put(contextServiceName, jndiDependencies = new HashSet<>());
        }
        jndiDependencies.add(userTransactionServiceName);

        final ServiceName transactionSynchronizationRegistryName = contextServiceName.append("TransactionSynchronizationRegistry");
        BinderService transactionSyncBinderService = new BinderService("TransactionSynchronizationRegistry");
        serviceTarget.addService(transactionSynchronizationRegistryName, transactionSyncBinderService)
            .addDependency(TransactionSynchronizationRegistryService.INTERNAL_SERVICE_NAME, TransactionSynchronizationRegistry.class,
                    new ManagedReferenceInjector<TransactionSynchronizationRegistry>(transactionSyncBinderService.getManagedObjectInjector()))
            .addDependency(contextServiceName, ServiceBasedNamingStore.class, transactionSyncBinderService.getNamingStoreInjector())
            .install();
        jndiDependencies.add(transactionSynchronizationRegistryName);
    }
private void bindServices(DeploymentUnit deploymentUnit, ServiceTarget serviceTarget, ServiceName contextServiceName) {

        final ServiceName userTransactionServiceName = contextServiceName.append("UserTransaction");
        final UserTransactionBindingService userTransactionBindingService = new UserTransactionBindingService("UserTransaction");
        serviceTarget.addService(userTransactionServiceName, userTransactionBindingService)
            .addDependency(UserTransactionAccessControlService.SERVICE_NAME, UserTransactionAccessControlService.class,userTransactionBindingService.getUserTransactionAccessControlServiceInjector())
            .addDependency(UserTransactionService.INTERNAL_SERVICE_NAME, UserTransaction.class,
                    new ManagedReferenceInjector<UserTransaction>(userTransactionBindingService.getManagedObjectInjector()))
            .addDependency(contextServiceName, ServiceBasedNamingStore.class, userTransactionBindingService.getNamingStoreInjector())
            .install();
        final Map<ServiceName, Set<ServiceName>> jndiComponentDependencies = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.COMPONENT_JNDI_DEPENDENCIES);
        Set<ServiceName> jndiDependencies = jndiComponentDependencies.get(contextServiceName);
        if (jndiDependencies == null) {
            jndiComponentDependencies.put(contextServiceName, jndiDependencies = new HashSet<>());
        }
        jndiDependencies.add(userTransactionServiceName);

        final ServiceName transactionSynchronizationRegistryName = contextServiceName.append("TransactionSynchronizationRegistry");
        BinderService transactionSyncBinderService = new BinderService("TransactionSynchronizationRegistry");
        serviceTarget.addService(transactionSynchronizationRegistryName, transactionSyncBinderService)
            .addDependency(TransactionSynchronizationRegistryService.INTERNAL_SERVICE_NAME, TransactionSynchronizationRegistry.class,
                    new ManagedReferenceInjector<TransactionSynchronizationRegistry>(transactionSyncBinderService.getManagedObjectInjector()))
            .addDependency(contextServiceName, ServiceBasedNamingStore.class, transactionSyncBinderService.getNamingStoreInjector())
            .install();
        jndiDependencies.add(transactionSynchronizationRegistryName);
    }
private void bindServices ( DeploymentUnit deploymentUnit , ServiceTarget serviceTarget , ServiceName contextServiceName ) { final ServiceName userTransactionServiceName = contextServiceName . append ( "UserTransaction" ) ; final UserTransactionBindingService userTransactionBindingService = new UserTransactionBindingService ( "UserTransaction" ) ; serviceTarget . addService ( userTransactionServiceName , userTransactionBindingService ) . addDependency ( UserTransactionAccessControlService . SERVICE_NAME , UserTransactionAccessControlService . class , userTransactionBindingService . getUserTransactionAccessControlServiceInjector ( ) ) . addDependency ( UserTransactionService . INTERNAL_SERVICE_NAME , UserTransaction . class , new ManagedReferenceInjector < UserTransaction > ( userTransactionBindingService . getManagedObjectInjector ( ) ) ) . addDependency ( contextServiceName , ServiceBasedNamingStore . class , userTransactionBindingService . getNamingStoreInjector ( ) ) . install ( ) ; final Map < ServiceName , Set < ServiceName > > jndiComponentDependencies = deploymentUnit . getAttachment ( org . jboss . as . server . deployment . Attachments . COMPONENT_JNDI_DEPENDENCIES ) ; Set < ServiceName > jndiDependencies = jndiComponentDependencies . get ( contextServiceName ) ; if ( jndiDependencies == null ) { jndiComponentDependencies . put ( contextServiceName , jndiDependencies = new HashSet <> ( ) ) ; } jndiDependencies . add ( userTransactionServiceName ) ; final ServiceName transactionSynchronizationRegistryName = contextServiceName . append ( "TransactionSynchronizationRegistry" ) ; BinderService transactionSyncBinderService = new BinderService ( "TransactionSynchronizationRegistry" ) ; serviceTarget . addService ( transactionSynchronizationRegistryName , transactionSyncBinderService ) . addDependency ( TransactionSynchronizationRegistryService . INTERNAL_SERVICE_NAME , TransactionSynchronizationRegistry . class , new ManagedReferenceInjector < TransactionSynchronizationRegistry > ( transactionSyncBinderService . getManagedObjectInjector ( ) ) ) . addDependency ( contextServiceName , ServiceBasedNamingStore . class , transactionSyncBinderService . getNamingStoreInjector ( ) ) . install ( ) ; jndiDependencies . add ( transactionSynchronizationRegistryName ) ; }
Binds the java:comp/UserTransaction service and the java:comp/TransactionSynchronizationRegistry

@param deploymentUnit The deployment unit
@param serviceTarget The service target
@param contextServiceName The service name of the context to bind to
Binds the java : comp / UserTransaction service and the java : comp / TransactionSynchronizationRegistry