Search in sources :

Example 1 with ResourceAdapterXmlDeploymentService

use of org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService in project wildfly by wildfly.

the class RaServicesFactory method createDeploymentService.

public static void createDeploymentService(final ManagementResourceRegistration registration, ConnectorXmlDescriptor connectorXmlDescriptor, Module module, ServiceTarget serviceTarget, final String deploymentUnitName, ServiceName deploymentUnitServiceName, String deployment, Activation raxml, final Resource deploymentResource, final ServiceRegistry serviceRegistry) {
    // Create the service
    ServiceName serviceName = ConnectorServices.getDeploymentServiceName(deploymentUnitName, raxml);
    ResourceAdapterXmlDeploymentService service = new ResourceAdapterXmlDeploymentService(connectorXmlDescriptor, raxml, module, deployment, serviceName, deploymentUnitServiceName);
    String bootStrapCtxName = DEFAULT_NAME;
    if (raxml.getBootstrapContext() != null && !raxml.getBootstrapContext().equals("undefined")) {
        bootStrapCtxName = raxml.getBootstrapContext();
    }
    ServiceBuilder<ResourceAdapterDeployment> builder = Services.addServerExecutorDependency(serviceTarget.addService(serviceName, service), service.getExecutorServiceInjector(), false).addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, service.getMdrInjector()).addDependency(ConnectorServices.RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, service.getRaRepositoryInjector()).addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_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(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, service.getCcmInjector()).addDependency(ConnectorServices.IDLE_REMOVER_SERVICE).addDependency(ConnectorServices.CONNECTION_VALIDATOR_SERVICE).addDependency(NamingService.SERVICE_NAME).addDependency(ConnectorServices.BOOTSTRAP_CONTEXT_SERVICE.append(bootStrapCtxName)).addDependency(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(connectorXmlDescriptor.getDeploymentName()));
    if (ActivationSecurityUtil.isLegacySecurityRequired(raxml)) {
        builder.addDependency(SubjectFactoryService.SERVICE_NAME, SubjectFactory.class, service.getSubjectFactoryInjector()).addDependency(SimpleSecurityManagerService.SERVICE_NAME, ServerSecurityManager.class, service.getServerSecurityManager());
    }
    String raName = deployment;
    if (raxml.getId() != null) {
        raName = raxml.getId();
    }
    ServiceName parentName = ServiceName.of(ConnectorServices.RA_SERVICE, raName);
    for (ServiceName subServiceName : serviceRegistry.getServiceNames()) {
        if (parentName.isParentOf(subServiceName) && !subServiceName.getSimpleName().equals(ConnectorServices.STATISTICS_SUFFIX)) {
            builder.addDependency(subServiceName);
        }
    }
    if (registration != null && deploymentResource != null) {
        if (registration.isAllowsOverride() && registration.getOverrideModel(deploymentUnitName) == null) {
            registration.registerOverrideModel(deploymentUnitName, new OverrideDescriptionProvider() {

                @Override
                public Map<String, ModelNode> getAttributeOverrideDescriptions(Locale locale) {
                    return Collections.emptyMap();
                }

                @Override
                public Map<String, ModelNode> getChildTypeOverrideDescriptions(Locale locale) {
                    return Collections.emptyMap();
                }
            });
        }
    }
    builder.setInitialMode(ServiceController.Mode.ACTIVE).install();
}
Also used : ResourceAdapterDeployment(org.jboss.as.connector.metadata.deployment.ResourceAdapterDeployment) Locale(java.util.Locale) TransactionIntegration(org.jboss.jca.core.spi.transaction.TransactionIntegration) SubjectFactory(org.jboss.security.SubjectFactory) ResourceAdapterXmlDeploymentService(org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService) OverrideDescriptionProvider(org.jboss.as.controller.descriptions.OverrideDescriptionProvider) AS7MetadataRepository(org.jboss.as.connector.services.mdr.AS7MetadataRepository) CachedConnectionManager(org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager) ManagementRepository(org.jboss.jca.core.api.management.ManagementRepository) ServiceName(org.jboss.msc.service.ServiceName) Map(java.util.Map)

Example 2 with ResourceAdapterXmlDeploymentService

use of org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService in project wildfly by wildfly.

the class RaServicesFactory method createDeploymentService.

public static void createDeploymentService(final ManagementResourceRegistration registration, ConnectorXmlDescriptor connectorXmlDescriptor, Module module, ServiceTarget serviceTarget, final String deploymentUnitName, ServiceName deploymentUnitServiceName, String deployment, Activation raxml, final Resource deploymentResource, final ServiceRegistry serviceRegistry, final CapabilityServiceSupport support) {
    // Create the service
    ServiceName serviceName = ConnectorServices.getDeploymentServiceName(deploymentUnitName, raxml);
    ResourceAdapterXmlDeploymentService service = new ResourceAdapterXmlDeploymentService(connectorXmlDescriptor, raxml, module, deployment, serviceName, deploymentUnitServiceName);
    String bootStrapCtxName = DEFAULT_NAME;
    if (raxml.getBootstrapContext() != null && !raxml.getBootstrapContext().equals("undefined")) {
        bootStrapCtxName = raxml.getBootstrapContext();
    }
    ServiceBuilder<ResourceAdapterDeployment> builder = Services.addServerExecutorDependency(serviceTarget.addService(serviceName, service), service.getExecutorServiceInjector()).addDependency(ConnectorServices.IRONJACAMAR_MDR, AS7MetadataRepository.class, service.getMdrInjector()).addDependency(ConnectorServices.RA_REPOSITORY_SERVICE, ResourceAdapterRepository.class, service.getRaRepositoryInjector()).addDependency(ConnectorServices.MANAGEMENT_REPOSITORY_SERVICE, ManagementRepository.class, service.getManagementRepositoryInjector()).addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE, ResourceAdapterDeploymentRegistry.class, service.getRegistryInjector()).addDependency(support.getCapabilityServiceName(ConnectorServices.TRANSACTION_INTEGRATION_CAPABILITY_NAME), TransactionIntegration.class, service.getTxIntegrationInjector()).addDependency(ConnectorServices.CONNECTOR_CONFIG_SERVICE, JcaSubsystemConfiguration.class, service.getConfigInjector()).addDependency(ConnectorServices.CCM_SERVICE, CachedConnectionManager.class, service.getCcmInjector());
    builder.requires(ConnectorServices.IDLE_REMOVER_SERVICE);
    builder.requires(ConnectorServices.CONNECTION_VALIDATOR_SERVICE);
    builder.requires(support.getCapabilityServiceName(NamingService.CAPABILITY_NAME));
    builder.requires(ConnectorServices.BOOTSTRAP_CONTEXT_SERVICE.append(bootStrapCtxName));
    builder.requires(ConnectorServices.RESOURCE_ADAPTER_DEPLOYER_SERVICE_PREFIX.append(connectorXmlDescriptor.getDeploymentName()));
    String raName = deployment;
    if (raxml.getId() != null) {
        raName = raxml.getId();
    }
    ServiceName parentName = ServiceName.of(ConnectorServices.RA_SERVICE, raName);
    for (ServiceName subServiceName : serviceRegistry.getServiceNames()) {
        if (parentName.isParentOf(subServiceName) && !subServiceName.getSimpleName().equals(ConnectorServices.STATISTICS_SUFFIX)) {
            builder.requires(subServiceName);
        }
    }
    if (registration != null && deploymentResource != null && registration.isAllowsOverride() && registration.getOverrideModel(deploymentUnitName) == null) {
        registration.registerOverrideModel(deploymentUnitName, new OverrideDescriptionProvider() {

            @Override
            public Map<String, ModelNode> getAttributeOverrideDescriptions(Locale locale) {
                return Collections.emptyMap();
            }

            @Override
            public Map<String, ModelNode> getChildTypeOverrideDescriptions(Locale locale) {
                return Collections.emptyMap();
            }
        });
    }
    builder.setInitialMode(ServiceController.Mode.ACTIVE).install();
}
Also used : ResourceAdapterDeployment(org.jboss.as.connector.metadata.deployment.ResourceAdapterDeployment) Locale(java.util.Locale) ServiceName(org.jboss.msc.service.ServiceName) ResourceAdapterXmlDeploymentService(org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService) JcaSubsystemConfiguration(org.jboss.as.connector.subsystems.jca.JcaSubsystemConfiguration) ResourceAdapterRepository(org.jboss.jca.core.spi.rar.ResourceAdapterRepository) OverrideDescriptionProvider(org.jboss.as.controller.descriptions.OverrideDescriptionProvider) Map(java.util.Map) ResourceAdapterDeploymentRegistry(org.jboss.as.connector.services.resourceadapters.deployment.registry.ResourceAdapterDeploymentRegistry)

Aggregations

Locale (java.util.Locale)2 Map (java.util.Map)2 ResourceAdapterDeployment (org.jboss.as.connector.metadata.deployment.ResourceAdapterDeployment)2 ResourceAdapterXmlDeploymentService (org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService)2 OverrideDescriptionProvider (org.jboss.as.controller.descriptions.OverrideDescriptionProvider)2 ServiceName (org.jboss.msc.service.ServiceName)2 AS7MetadataRepository (org.jboss.as.connector.services.mdr.AS7MetadataRepository)1 ResourceAdapterDeploymentRegistry (org.jboss.as.connector.services.resourceadapters.deployment.registry.ResourceAdapterDeploymentRegistry)1 JcaSubsystemConfiguration (org.jboss.as.connector.subsystems.jca.JcaSubsystemConfiguration)1 CachedConnectionManager (org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager)1 ManagementRepository (org.jboss.jca.core.api.management.ManagementRepository)1 ResourceAdapterRepository (org.jboss.jca.core.spi.rar.ResourceAdapterRepository)1 TransactionIntegration (org.jboss.jca.core.spi.transaction.TransactionIntegration)1 SubjectFactory (org.jboss.security.SubjectFactory)1