Package org.jboss.as.connector.metadata.xmldescriptors

Examples of org.jboss.as.connector.metadata.xmldescriptors.ConnectorXmlDescriptor


     * JBossService} for this ResourceAdapter.
     * @param phaseContext the deployment unit context
     * @throws DeploymentUnitProcessingException
     */
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final ConnectorXmlDescriptor connectorXmlDescriptor = phaseContext.getDeploymentUnit().getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY);
        if(connectorXmlDescriptor == null) {
            return// Skip non ra deployments
        }

        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final IronJacamarXmlDescriptor ironJacamarXmlDescriptor = deploymentUnit
                .getAttachment(IronJacamarXmlDescriptor.ATTACHMENT_KEY);

        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        if (module == null)
            throw new DeploymentUnitProcessingException("Failed to get module attachment for " + phaseContext.getDeploymentUnit());

        final ClassLoader classLoader = module.getClassLoader();

        Connector cmd = connectorXmlDescriptor != null ? connectorXmlDescriptor.getConnector() : null;
        final IronJacamar ijmd = ironJacamarXmlDescriptor != null ? ironJacamarXmlDescriptor.getIronJacamar() : null;

        try {
            // Annotation merging
            Annotations annotator = new Annotations();
            Map<ResourceRoot, Index> indexes = AnnotationIndexUtils.getAnnotationIndexes(deploymentUnit);
            for (Entry<ResourceRoot, Index> entry : indexes.entrySet()) {
                AnnotationRepository repository = new JandexAnnotationRepositoryImpl(entry.getValue(), classLoader);
                    cmd = annotator.merge(cmd, repository, classLoader);
            }
            // FIXME: when the connector is null the Iron Jacamar data is ignored
            if (cmd != null) {
                // Validate metadata
                cmd.validate();

                // Merge metadata
                cmd = (new Merger()).mergeConnectorWithCommonIronJacamar(ijmd, cmd);
            }

            final ResourceAdapterDeploymentService raDeployementService = new ResourceAdapterDeploymentService(connectorXmlDescriptor, cmd, ijmd, module);

            final ServiceTarget serviceTarget = phaseContext.getServiceTarget();

            // Create the service
            serviceTarget.addService(ConnectorServices.RESOURCE_ADAPTER_SERVICE_PREFIX.append(connectorXmlDescriptor.getDeploymentName()), raDeployementService)
                    .addDependency(ConnectorServices.IRONJACAMAR_MDR, MetadataRepository.class, raDeployementService.getMdrInjector())
                    .addDependency(ConnectorServices.RA_REPOSISTORY_SERVICE, ResourceAdapterRepository.class, raDeployementService.getRaRepositoryInjector())
                    .addDependency(ConnectorServices.MANAGEMENT_REPOSISTORY_SERVICE, ManagementRepository.class, raDeployementService.getManagementRepositoryInjector())
                    .addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE, ResourceAdapterDeploymentRegistry.class, raDeployementService.getRegistryInjector())
                    .addDependency(ConnectorServices.TRANSACTION_INTEGRATION_SERVICE, TransactionIntegration.class, raDeployementService.getTxIntegrationInjector())
View Full Code Here


     * @param phaseContext the deployment unit context
     * @throws DeploymentUnitProcessingException
     */
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ConnectorXmlDescriptor connectorXmlDescriptor = deploymentUnit
                .getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY);
        if (connectorXmlDescriptor == null) {
            return; // Skip non ra deployments
        }

View Full Code Here

                    throw new DeploymentUnitProcessingException("Failed to parse service xml [" + serviceXmlFile + "]");
            }
            File root = deploymentRoot.getPhysicalFile();
            URL url = root.toURI().toURL();
            String deploymentName = deploymentRoot.getName().substring(0, deploymentRoot.getName().indexOf(".rar"));
            ConnectorXmlDescriptor xmlDescriptor = new ConnectorXmlDescriptor(result, root, url, deploymentName);
            context.putAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY, xmlDescriptor);

        } catch (Exception e) {
            throw new DeploymentUnitProcessingException("Failed to parse service xml [" + serviceXmlFile + "]", e);
        } finally {
View Full Code Here

     * Deploy datasources
     * @param context the deployment unit context
     * @throws DeploymentUnitProcessingException
     */
    public void processDeployment(DeploymentUnitContext context) throws DeploymentUnitProcessingException {
        final ConnectorXmlDescriptor connectorXmlDescriptor = context.getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY);

        Module module = context.getAttachment(ModuleDeploymentProcessor.MODULE_ATTACHMENT_KEY);

        String deploymentName = connectorXmlDescriptor == null ? null : connectorXmlDescriptor.getDeploymentName();

        DataSources datasources = null;

        datasources = dsValue.getValue();

View Full Code Here

     * JBossService} for this ResourceAdapter.
     * @param context the deployment unit context
     * @throws DeploymentUnitProcessingException
     */
    public void processDeployment(DeploymentUnitContext context) throws DeploymentUnitProcessingException {
        final ConnectorXmlDescriptor connectorXmlDescriptor = context.getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY);
        final IronJacamarXmlDescriptor ironJacamarXmlDescriptor = context
                .getAttachment(IronJacamarXmlDescriptor.ATTACHMENT_KEY);

        final Module module = context.getAttachment(ModuleDeploymentProcessor.MODULE_ATTACHMENT_KEY);
        if (module == null)
            throw new DeploymentUnitProcessingException("Failed to get module attachment for deployment: " + context.getName());

        final ClassLoader classLoader = module.getClassLoader();

        Connector cmd = connectorXmlDescriptor != null ? connectorXmlDescriptor.getConnector() : null;
        final IronJacamar ijmd = ironJacamarXmlDescriptor != null ? ironJacamarXmlDescriptor.getIronJacamar() : null;

        try {
            // Annotation merging
            Annotations annotator = new Annotations();
            AnnotationRepository repository = new JandexAnnotationRepositoryImpl(
                    context.getAttachment(AnnotationIndexProcessor.ATTACHMENT_KEY), classLoader);
            cmd = annotator.merge(cmd, repository, classLoader);

            // Validate metadata
            cmd.validate();

            // Merge metadata
            cmd = (new Merger()).mergeConnectorWithCommonIronJacamar(ijmd, cmd);

            AS7RaDeployer raDeployer = new AS7RaDeployer();

            raDeployer.setConfiguration(config.getValue());
            URL url = connectorXmlDescriptor == null ? null : connectorXmlDescriptor.getUrl();
            String deploymentName = connectorXmlDescriptor == null ? null : connectorXmlDescriptor.getDeploymentName();
            File root = connectorXmlDescriptor == null ? null : connectorXmlDescriptor.getRoot();
            CommonDeployment raDeployment = raDeployer.doDeploy(url, deploymentName, root, classLoader, cmd, ijmd);

            final BatchBuilder batchBuilder = context.getBatchBuilder();

            ResourceAdapterDeployment dply = new ResourceAdapterDeployment(module.getIdentifier(), raDeployment);
            ResourceAdapterDeploymentService raDeployementService = new ResourceAdapterDeploymentService(dply);
            // Create the service
            batchBuilder
                    .addService(
                            ConnectorServices.RESOURCE_ADAPTER_SERVICE_PREFIX
                                    .append(connectorXmlDescriptor.getDeploymentName()),
                            raDeployementService)
                    .addDependency(ConnectorServices.IRONJACAMAR_MDR, MetadataRepository.class, raDeployementService.getMdrInjector())
                    .addDependency(ConnectorServices.RESOURCE_ADAPTER_REGISTRY_SERVICE,
                            ResourceAdapterDeploymentRegistry.class, raDeployementService.getRegistryInjector())
                    .addDependency(ConnectorServices.JNDI_STRATEGY_SERVICE,
View Full Code Here

     * JBossService} for this ResourceAdapter.
     * @param context the deployment unit context
     * @throws DeploymentUnitProcessingException
     */
    public void processDeployment(DeploymentUnitContext context) throws DeploymentUnitProcessingException {
        final ConnectorXmlDescriptor connectorXmlDescriptor = context.getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY);
        ResourceAdapters raxmls = null;

        raxmls = raxmlValue.getValue();

        if (raxmls == null)
            return;

        log.tracef("processing Raxml");
        Module module = context.getAttachment(ModuleDeploymentProcessor.MODULE_ATTACHMENT_KEY);

        if (module == null)
            throw new DeploymentUnitProcessingException("Failed to get module attachment for deployment: " + context.getName());

        try {
            final ClassLoader classLoader = module.getClassLoader();

            final BatchBuilder batchBuilder = context.getBatchBuilder();

            for (org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapter raxml : raxmls.getResourceAdapters()) {

                String archive = raxml.getArchive();
                URL deployment = null;
                Set<String> deployments = mdr.getValue().getResourceAdapters();

                for (String s : deployments) {
                    if (s.endsWith(archive) || s.endsWith(archive.substring(0, archive.indexOf(".rar"))))
                        deployment = new URL(s);
                }

                if (deployment != null) {

                    Connector cmd = mdr.getValue().getResourceAdapter(deployment.toExternalForm());
                    IronJacamar ijmd = mdr.getValue().getIronJacamar(deployment.toExternalForm());
                    File root = mdr.getValue().getRoot(deployment.toExternalForm());

                    cmd = (new Merger()).mergeConnectorWithCommonIronJacamar(raxml, cmd);

                    String deploymentName = archive.substring(0, archive.indexOf(".rar"));

                    AS7RaDeployer raDeployer = new AS7RaDeployer();

                    raDeployer.setConfiguration(config.getValue());

                    CommonDeployment raxmlDeployment = raDeployer.doDeploy(connectorXmlDescriptor.getUrl(), deploymentName,
                            root, classLoader, cmd, ijmd, raxml);

                    ResourceAdapterDeployment dply = new ResourceAdapterDeployment(module.getIdentifier(), raxmlDeployment);
                    ResourceAdapterXmlDeploymentService service = new ResourceAdapterXmlDeploymentService(dply);
                    // Create the service
View Full Code Here

    public static final Logger log = Logger.getLogger("org.jboss.as.connector.deployer.dsdeployer");

    private final InjectedValue<DataSources> dsValue = new InjectedValue<DataSources>();

    public void processDeployment(DeploymentUnitContext context) throws DeploymentUnitProcessingException {
        final ConnectorXmlDescriptor connectorXmlDescriptor = context.getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY);

        final String deploymentName = connectorXmlDescriptor == null ? null : connectorXmlDescriptor.getDeploymentName();

        final DataSources datasources = dsValue.getValue();

        if (datasources == null || deploymentName == null || !deploymentName.startsWith("jdbc"))
            return;
View Full Code Here

     * @throws DeploymentUnitProcessingException
     *
     */
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ConnectorXmlDescriptor connectorXmlDescriptor = deploymentUnit
                .getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY);
        if (connectorXmlDescriptor == null) {
            return; // Skip non ra deployments
        }

        ResourceAdapters raxmls = null;
        // getResourceAdaptersAttachment(deploymentUnit);
        final ServiceController<?> raService = phaseContext.getServiceRegistry().getService(
                ConnectorServices.RESOURCEADAPTERS_SERVICE);
        if (raService != null)
            raxmls = ((ResourceAdapters) raService.getValue());
        if (raxmls == null)
            return;

        log.tracef("processing Raxml");
        Module module = deploymentUnit.getAttachment(Attachments.MODULE);

        if (module == null)
            throw new DeploymentUnitProcessingException("Failed to get module attachment for " + deploymentUnit);

        try {
            final ServiceTarget serviceTarget = phaseContext.getServiceTarget();

            for (org.jboss.jca.common.api.metadata.resourceadapter.ResourceAdapter raxml : raxmls.getResourceAdapters()) {
                if (deploymentUnit.getName().equals(raxml.getArchive())) {

                    final String deployment;
                    if (deploymentUnit.getName().lastIndexOf('.') == -1) {
                        deployment = deploymentUnit.getName();
                    } else {
                        deployment = deploymentUnit.getName().substring(0, deploymentUnit.getName().lastIndexOf('.'));
                    }

                    ResourceAdapterXmlDeploymentService service = new ResourceAdapterXmlDeploymentService(connectorXmlDescriptor,
                            raxml, module, deployment);
                    // Create the service
                    ServiceName serviceName = ConnectorServices.getNextValidResourceAdapterXmlServiceName(connectorXmlDescriptor.getDeploymentName());
                     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(NamingService.SERVICE_NAME)
                            .addDependencies(
                                    ConnectorServices.RESOURCE_ADAPTER_SERVICE_PREFIX.append(connectorXmlDescriptor
                                            .getDeploymentName())).setInitialMode(Mode.ACTIVE).install();
                }
            }
        } catch (Throwable t) {
            throw new DeploymentUnitProcessingException(t);
View Full Code Here

TOP

Related Classes of org.jboss.as.connector.metadata.xmldescriptors.ConnectorXmlDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.