Package org.jboss.as.server.deployment

Examples of org.jboss.as.server.deployment.ServicesAttachment


        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        if (module == null) {
            return;
        }
        final ServicesAttachment services = deploymentUnit.getAttachment(Attachments.SERVICES);
        final List<String> implementations = services.getServiceImplementations(ExpressionFactory.class.getName());
        if (implementations != null && implementations.size() > 0) {
            FactoryFinderCache.addCacheEntry(module.getClassLoader(), FACTORY_ID, implementations.get(0));
        }

View Full Code Here


    /** {@inheritDoc} */
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        final ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES);
        if (module != null && servicesAttachment != null) {
            final ModuleClassLoader classLoader = module.getClassLoader();
            final List<String> providerNames = servicesAttachment.getServiceImplementations(PersistenceProvider.class.getName());
            for (String providerName : providerNames) {
                try {
                    final Class<? extends PersistenceProvider> providerClass = classLoader.loadClass(providerName).asSubclass(PersistenceProvider.class);
                    final Constructor<? extends PersistenceProvider> constructor = providerClass.getConstructor();
                    final PersistenceProvider provider = constructor.newInstance();
View Full Code Here

    @Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit du = phaseContext.getDeploymentUnit();
        if (GateInWSRPKey.isGateInWSRPArchive(du)) {
            // Only process if we have a META-INF/services ServiceLoader directory in the archive
            final ServicesAttachment services = du.getAttachment(Attachments.SERVICES);
            if (services != null) {
                // get the module class loader
                final Module module = du.getAttachment(Attachments.MODULE);
                final ModuleClassLoader classLoader;
                if (module != null) {
                    classLoader = module.getClassLoader();
                } else {
                    classLoader = null;
                }

                for (String interfaceName : KNOWN_PLUGIN_INTERFACE_NAMES) {
                    // retrieve all service implementations for each known plugin interface and add them if they exist
                    final List<String> serviceImplementations = services.getServiceImplementations(interfaceName);
                    plugins.addPluginImplementations(interfaceName, serviceImplementations);

                    if (classLoader != null) {
                        // remember the module for each service implementation
                        for (String implementation : serviceImplementations) {
View Full Code Here

        // we attach extensions directly to the top level deployment
        final DeploymentUnit topLevelDeployment = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit
                .getParent();

        final ServicesAttachment services = deploymentUnit.getAttachment(Attachments.SERVICES);

        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        ClassLoader oldCl = SecurityActions.getContextClassLoader();
        try {
            SecurityActions.setContextClassLoader(module.getClassLoader());
View Full Code Here

    @Override
    public void deploy(DeploymentPhaseContext ctx) throws DeploymentUnitProcessingException {
        DeploymentUnit deploymentUnit = ctx.getDeploymentUnit();
        Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES);
        if (module != null && servicesAttachment != null)
            addServices(ctx, servicesAttachment, module);
    }
View Full Code Here

     * {@inheritDoc}
     */
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        final ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES);
        if (module != null && servicesAttachment != null) {
            final ModuleClassLoader classLoader = module.getClassLoader();
            final List<String> providerNames = servicesAttachment.getServiceImplementations(PersistenceProvider.class.getName());
            for (String providerName : providerNames) {
                try {
                    final Class<? extends PersistenceProvider> providerClass = classLoader.loadClass(providerName).asSubclass(PersistenceProvider.class);
                    final Constructor<? extends PersistenceProvider> constructor = providerClass.getConstructor();
                    final PersistenceProvider provider = constructor.newInstance();
View Full Code Here

        final ResourceRoot deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT);
        final ModuleSpecification moduleSpecification = phaseContext.getDeploymentUnit().getAttachment(
                Attachments.MODULE_SPECIFICATION);
        if(deploymentRoot == null)
            return;
        final ServicesAttachment servicesAttachments = phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVICES);
        if(servicesAttachments != null && !servicesAttachments.getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
            moduleSpecification.addDependency(MSC_DEP);
        }
    }
View Full Code Here

        final ResourceRoot deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT);
        final ModuleSpecification moduleSpecification = phaseContext.getDeploymentUnit().getAttachment(
                Attachments.MODULE_SPECIFICATION);
        if(deploymentRoot == null)
            return;
        final ServicesAttachment servicesAttachments = phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVICES);
        if(servicesAttachments != null && !servicesAttachments.getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
            moduleSpecification.addSystemDependency(MSC_DEP);
        }
    }
View Full Code Here

        }
    }

    private boolean hasInfinispanExtensions(DeploymentPhaseContext ctx) {
        DeploymentUnit deploymentUnit = ctx.getDeploymentUnit();
        ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES);
        if (servicesAttachment != null) {
            List<String> factories = servicesAttachment.getServiceImplementations(KeyValueFilterFactory.class.getName());
            return !factories.isEmpty();
        }
        return false;
    }
View Full Code Here

    @Override
    public void deploy(DeploymentPhaseContext ctx) throws DeploymentUnitProcessingException {
        DeploymentUnit deploymentUnit = ctx.getDeploymentUnit();
        Module module = deploymentUnit.getAttachment(Attachments.MODULE);
        ServicesAttachment servicesAttachment = deploymentUnit.getAttachment(Attachments.SERVICES);
        if (module != null && servicesAttachment != null)
            addServices(ctx, servicesAttachment, module);
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.server.deployment.ServicesAttachment

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.