/** * Stop */ @Override public void stop(final StopContext context) { stopAsync(context, deploymentName, ConnectorServices.RESOURCE_ADAPTER_ACTIVATOR_SERVICE); }
@Override public CommonDeployment doDeploy() throws Throwable { this.setConfiguration(getConfig().getValue()); //never validate bean for services activated in this way (JMS) this.getConfiguration().setBeanValidation(false); this.start(); CommonDeployment dep = this.createObjectsAndInjectValue(url, deploymentName, root, cl, cmd, activation); return dep; }
ResourceAdapterActivator activator = new ResourceAdapterActivator(context.getChildTarget(), new URL(pathname), deploymentName, new File(pathname), cl, cmd, activation); activator.setConfiguration(getConfig().getValue()); deploymentMD = activator.doDeploy(); } finally { Thread.currentThread().setContextClassLoader(old); ServiceName raServiceName = ConnectorServices.getResourceAdapterServiceName(raName); value = new ResourceAdapterDeployment(deploymentMD, raName, raServiceName); registry.getValue().registerResourceAdapterDeployment(value); managementRepository.getValue().getConnectors().add(value.getDeployment().getConnector()); new ResourceAdapterService(raServiceName, value.getDeployment().getResourceAdapter())).setInitialMode(Mode.ACTIVE) .install(); DEPLOYMENT_CONNECTOR_LOGGER.debugf("Started service %s", ConnectorServices.RESOURCE_ADAPTER_ACTIVATOR_SERVICE); cleanupStartAsync(context, deploymentName, raServiceName, t);
org.jboss.jca.common.api.metadata.resourceadapter.ConnectionDefinition cd = new org.jboss.jca.common.metadata.resourceadapter.ConnectionDefinitionImpl(mcfConfigProperties, mcfClass, jndiName, poolName(cfInterface), Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Defaults.CONNECTABLE, Defaults.TRACKING, Defaults.MCP, Defaults.ENLISTMENT_TRACE, pool, null, null, security, null, isXA); ResourceAdapterActivatorService activator = new ResourceAdapterActivatorService(cmd, activation, module.getClassLoader(), serviceName); activator.setCreateBinderService(false); activator.setBindInfo(bindInfo); org.jboss.msc.service.ServiceTarget serviceTarget = context.getChildTarget(); org.jboss.msc.service.ServiceName activatorServiceName = ConnectorServices.RESOURCE_ADAPTER_ACTIVATOR_SERVICE.append(serviceName); .addService(activatorServiceName, activator) .addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, activator.getMdrInjector()) .addDependency(ConnectorServices.RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, activator.getRaRepositoryInjector()) .addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE, ManagementRepository.class, activator.getManagementRepositoryInjector()) .addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE, ResourceAdapterDeploymentRegistry.class, activator.getRegistryInjector()) .addDependency(ConnectorServices.CONNECTOR_CONFIG_SERVICE, JcaSubsystemConfiguration.class, activator.getConfigInjector()) .addDependency(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, activator.getCcmInjector()) .addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class, activator.getTxIntegrationInjector()); connectionFactoryServiceBuilder.requires(NamingService.SERVICE_NAME); connectionFactoryServiceBuilder.requires(ConnectorServices.getLocalTransactionProviderServiceName()); connectionFactoryServiceBuilder
org.jboss.jca.common.api.metadata.resourceadapter.AdminObject ao = new AdminObjectImpl(aoConfigProperties, aoClass, jndiName, poolName(aoClass, className), Boolean.TRUE, Boolean.TRUE); serviceName = serviceName.replace('/', '_'); ResourceAdapterActivatorService activator = new ResourceAdapterActivatorService(cmd, activation, module.getClassLoader(), serviceName); activator.setCreateBinderService(false); activator.setBindInfo(bindInfo); ServiceTarget serviceTarget = context.getChildTarget(); .addService(ConnectorServices.RESOURCE_ADAPTER_ACTIVATOR_SERVICE.append(serviceName), activator) .addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, activator.getMdrInjector()) .addDependency(ConnectorServices.RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, activator.getRaRepositoryInjector()) .addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE, ManagementRepository.class, activator.getManagementRepositoryInjector()) .addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE, ResourceAdapterDeploymentRegistry.class, activator.getRegistryInjector()) .addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class, activator.getTxIntegrationInjector()) .addDependency(ConnectorServices.CONNECTOR_CONFIG_SERVICE, JcaSubsystemConfiguration.class, activator.getConfigInjector()) activator.getCcmInjector()); adminObjectServiceBuilder.requires(NamingService.SERVICE_NAME); adminObjectServiceBuilder.requires(ConnectorServices.getLocalTransactionProviderServiceName());
final boolean fromModule = duServiceName.getParent().equals(RaOperationUtil.RAR_MODULE); final WildFLyRaDeployer raDeployer = new WildFLyRaDeployer(context.getChildTarget(), url, deploymentName, root, classLoader, cmd, activation, deploymentServiceName, fromModule); raDeployer.setConfiguration(config.getValue()); WritableServiceBasedNamingStore.pushOwner(duServiceName); WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(classLoader); raDeployment = raDeployer.doDeploy(); deploymentName = raDeployment.getDeploymentName(); } finally { if (raDeployer.checkActivation(cmd, activation)) { DEPLOYMENT_CONNECTOR_LOGGER.debugf("Activating: %s", deploymentName); ServiceName raServiceName = ConnectorServices.getResourceAdapterServiceName(deploymentName); value = new ResourceAdapterDeployment(raDeployment, deploymentName, raServiceName); managementRepository.getValue().getConnectors().add(value.getDeployment().getConnector()); registry.getValue().registerResourceAdapterDeployment(value); ServiceTarget serviceTarget = context.getChildTarget(); serviceTarget .addService(raServiceName, new ResourceAdapterService(raServiceName, value.getDeployment().getResourceAdapter())).setInitialMode(Mode.ACTIVE) .install(); final ServiceName deployerServiceName = ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(connectorXmlDescriptor.getDeploymentName()); IronJacamarActivationResourceService ijResourceService = new IronJacamarActivationResourceService(registration, deploymentResource, false); .addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, ijResourceService.getMdrInjector()) .addDependency(deployerServiceName, ResourceAdapterDeployment.class, ijResourceService.getResourceAdapterDeploymentInjector()) .setInitialMode(Mode.PASSIVE)
ResourceAdapterActivator activator = new ResourceAdapterActivator(context.getChildTarget(), new URL(pathname), deploymentName, new File(pathname), cl, cmd, ijmd); activator.setConfiguration(getConfig().getValue()); deploymentMD = activator.doDeploy(); } finally { Thread.currentThread().setContextClassLoader(old); unregisterAll(deploymentName); throw MESSAGES.failedToStartRaDeployment(e, deploymentName); registry.getValue().registerResourceAdapterDeployment(value); managementRepository.getValue().getConnectors().add(value.getDeployment().getConnector()); new ResourceAdapterService(raName, raServiceName, value.getDeployment().getResourceAdapter())).setInitialMode(Mode.ACTIVE) .install();
File root = mdr.getValue().getRoot(deployment); Activation localRaXml = getRaxml(); cmd = (new Merger()).mergeConnectorWithCommonIronJacamar(localRaXml, cmd); this.connectorServicesRegistrationName = id; final WildFlyRaXmlDeployer raDeployer = new WildFlyRaXmlDeployer(context.getChildTarget(), connectorXmlDescriptor.getUrl(), raName, root, module.getClassLoader(), cmd, localRaXml, deploymentServiceName); raDeployer.setConfiguration(config.getValue()); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader()); raxmlDeployment = raDeployer.doDeploy(); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(old); registry.getValue().registerResourceAdapterDeployment(value); final ServiceBuilder raServiceSB = context.getChildTarget() .addService(raServiceName, new ResourceAdapterService(raServiceName, value.getDeployment().getResourceAdapter())); raServiceSB.requires(deploymentServiceName); raServiceSB.setInitialMode(ServiceController.Mode.ACTIVE).install(); } catch (Throwable t) { cleanupStartAsync(context, raName, deploymentServiceName, t);
final AdminObjectService adminObjectService = new AdminObjectService(ao); final ContextNames.BindInfo bindInfo = getBindInfo(jndi); final AdminObjectReferenceFactoryService referenceFactoryService = new AdminObjectReferenceFactoryService(); final ServiceName referenceFactoryServiceName = AdminObjectReferenceFactoryService.SERVICE_NAME_BASE.append(bindInfo.getBinderServiceName()); serviceTarget.addService(referenceFactoryServiceName, referenceFactoryService) .addDependency(adminObjectServiceName, Object.class, referenceFactoryService.getAdminObjectInjector()) .setInitialMode(ServiceController.Mode.ACTIVE).install(); if (isCreateBinderService()) { final BinderService binderService = new BinderService(bindInfo.getBindName()); final ServiceName binderServiceName = bindInfo.getBinderServiceName();
final ConnectionFactoryService connectionFactoryService = new ConnectionFactoryService(cf); final ContextNames.BindInfo bindInfo = getBindInfo(jndi); final ConnectionFactoryReferenceFactoryService referenceFactoryService = new ConnectionFactoryReferenceFactoryService(deployment); final ServiceName referenceFactoryServiceName = ConnectionFactoryReferenceFactoryService.SERVICE_NAME_BASE .append(bindInfo.getBinderServiceName()); serviceTarget.addService(referenceFactoryServiceName, referenceFactoryService) .addDependency(connectionFactoryServiceName, Object.class, referenceFactoryService.getConnectionFactoryInjector()) .setInitialMode(ServiceController.Mode.ACTIVE).install(); if (isCreateBinderService()) { final BinderService binderService = new BinderService(bindInfo.getBindName()); serviceTarget .install(); installJNDIAliases(bindInfo, serviceTarget);
final AdminObjectService adminObjectService = new AdminObjectService(ao); .install(); final AdminObjectReferenceFactoryService referenceFactoryService = new AdminObjectReferenceFactoryService(); final ServiceName referenceFactoryServiceName = AdminObjectReferenceFactoryService.SERVICE_NAME_BASE.append(jndi); serviceTarget.addService(referenceFactoryServiceName, referenceFactoryService) .addDependency(adminObjectServiceName, Object.class, referenceFactoryService.getAdminObjectInjector()) .setInitialMode(ServiceController.Mode.ACTIVE).install();
final ConnectionFactoryService connectionFactoryService = new ConnectionFactoryService(cf); final ConnectionFactoryReferenceFactoryService referenceFactoryService = new ConnectionFactoryReferenceFactoryService(); final ServiceName referenceFactoryServiceName = ConnectionFactoryReferenceFactoryService.SERVICE_NAME_BASE .append(jndi); serviceTarget.addService(referenceFactoryServiceName, referenceFactoryService) .addDependency(connectionFactoryServiceName, Object.class, referenceFactoryService.getDataSourceInjector()) .setInitialMode(ServiceController.Mode.ACTIVE).install();
DirectAdminObjectActivatorService service = new DirectAdminObjectActivatorService(jndiName, className, resourceAdapter, raId, properties, module, bindInfo); ServiceName serviceName = DirectAdminObjectActivatorService.SERVICE_NAME_BASE.append(jndiName); final ServiceBuilder sb = phaseContext.getServiceTarget().addService(serviceName, service); sb.addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, service.getMdrInjector()); sb.requires(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(deployerServiceName)); sb.setInitialMode(ServiceController.Mode.ACTIVE).install();
DirectConnectionFactoryActivatorService service = new DirectConnectionFactoryActivatorService(jndiName, interfaceName, resourceAdapter, raId, maxPoolSize, minPoolSize, properties, transactionSupport, ServiceName serviceName = DirectConnectionFactoryActivatorService.SERVICE_NAME_BASE.append(jndiName); final ServiceBuilder sb = phaseContext.getServiceTarget().addService(serviceName, service); sb.addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, service.getMdrInjector()); sb.requires(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(deployerServiceName)); sb.setInitialMode(ServiceController.Mode.ACTIVE).install();
/** * Stop */ @Override public void stop(StopContext context) { DEPLOYMENT_CONNECTOR_LOGGER.debugf("Stopping service %s", ConnectorServices.RESOURCE_ADAPTER_ACTIVATOR_SERVICE); unregisterAll(deploymentName); } @Override
ResourceAdapterActivator activator = new ResourceAdapterActivator(context.getChildTarget(), new URL(pathname), deploymentName, new File(pathname), cl, cmd, activation); activator.setConfiguration(getConfig().getValue()); deploymentMD = activator.doDeploy(); } finally { Thread.currentThread().setContextClassLoader(old); ServiceName raServiceName = ConnectorServices.getResourceAdapterServiceName(raName); value = new ResourceAdapterDeployment(deploymentMD, raName, raServiceName); registry.getValue().registerResourceAdapterDeployment(value); managementRepository.getValue().getConnectors().add(value.getDeployment().getConnector()); new ResourceAdapterService(raServiceName, value.getDeployment().getResourceAdapter())).setInitialMode(Mode.ACTIVE) .install(); DEPLOYMENT_CONNECTOR_LOGGER.debugf("Started service %s", ConnectorServices.RESOURCE_ADAPTER_ACTIVATOR_SERVICE); cleanupStartAsync(context, deploymentName, raServiceName, t);
@Override public CommonDeployment doDeploy() throws Throwable { this.setConfiguration(getConfig().getValue()); //never validate bean for services activated in this way (JMS) this.getConfiguration().setBeanValidation(false); this.start(); CommonDeployment dep = this.createObjectsAndInjectValue(url, deploymentName, root, cl, cmd, activation); return dep; }
final AdminObjectService adminObjectService = new AdminObjectService(ao); final ContextNames.BindInfo bindInfo = getBindInfo(jndi); final AdminObjectReferenceFactoryService referenceFactoryService = new AdminObjectReferenceFactoryService(); final ServiceName referenceFactoryServiceName = AdminObjectReferenceFactoryService.SERVICE_NAME_BASE.append(bindInfo.getBinderServiceName()); serviceTarget.addService(referenceFactoryServiceName, referenceFactoryService) .addDependency(adminObjectServiceName, Object.class, referenceFactoryService.getAdminObjectInjector()) .setInitialMode(ServiceController.Mode.ACTIVE).install(); if (isCreateBinderService()) { final BinderService binderService = new BinderService(bindInfo.getBindName()); final ServiceName binderServiceName = bindInfo.getBinderServiceName();
/** * Stop */ @Override public void stop(final StopContext context) { stopAsync(context, deploymentName, ConnectorServices.RESOURCE_ADAPTER_ACTIVATOR_SERVICE); }
@Override public CommonDeployment doDeploy() throws Throwable { this.setConfiguration(getConfig().getValue()); //never validate bean for services activated in this way (JMS) this.getConfiguration().setBeanValidation(false); this.start(); CommonDeployment dep = this.createObjectsAndInjectValue(url, deploymentName, root, cl, cmd, ijmd); return dep; }