public class RaServicesFactory {
public static void createDeploymentService(final ManagementResourceRegistration registration, ConnectorXmlDescriptor connectorXmlDescriptor, Module module, ServiceTarget serviceTarget, final String deploymentUnitName, String deployment, ResourceAdapter raxml) {
// Create the service
ServiceName serviceName = ConnectorServices.registerDeployment(raxml.getArchive());
ResourceAdapterXmlDeploymentService service = new ResourceAdapterXmlDeploymentService(connectorXmlDescriptor,
raxml, module, deployment, serviceName);
ServiceBuilder builder = serviceTarget
.addService(serviceName, service)
.addDependency(ConnectorServices.IRONJACAMAR_MDR, MetadataRepository.class, service.getMdrInjector())
.addDependency(ConnectorServices.RA_REPOSISTORY_SERVICE, ResourceAdapterRepository.class,
service.getRaRepositoryInjector())
.addDependency(ConnectorServices.MANAGEMENT_REPOSISTORY_SERVICE, ManagementRepository.class,
service.getManagementRepositoryInjector())
.addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE,
ResourceAdapterDeploymentRegistry.class, service.getRegistryInjector())
.addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class,
service.getTxIntegrationInjector())
.addDependency(ConnectorServices.CONNECTOR_CONFIG_SERVICE, JcaSubsystemConfiguration.class,
service.getConfigInjector())
.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class,
service.getSubjectFactoryInjector())
.addDependency(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, service.getCcmInjector())
.addDependency(ConnectorServices.IDLE_REMOVER_SERVICE)
.addDependency(ConnectorServices.CONNECTION_VALIDATOR_SERVICE)
.addDependency(NamingService.SERVICE_NAME)
.addDependency(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(connectorXmlDescriptor.getDeploymentName()));
builder.addListener(new AbstractServiceListener<Object>() {