Package org.jboss.as.naming

Examples of org.jboss.as.naming.ContextManagedReferenceFactory


        this.fullName = fullName;
    }

    @Override
    public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException {
        final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name);
        final ServiceName contextServiceName;
        if(fullName.startsWith("java:app")) {
            contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName());
        } else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) {
            contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName());
        } else if(fullName.startsWith("java:comp")) {
            contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName());
        } else {
            throw NamingMessages.MESSAGES.invalidNameForContextBinding(fullName);
        }
        serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue());
        injector.inject(managedReferenceFactory);
    }
View Full Code Here


        this.fullName = fullName;
    }

    @Override
    public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException {
        final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name);
        final ServiceName contextServiceName;
        if(fullName.startsWith("java:app")) {
            contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName());
        } else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) {
            contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName());
        } else if(fullName.startsWith("java:comp")) {
            contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName());
        } else {
            throw NamingLogger.ROOT_LOGGER.invalidNameForContextBinding(fullName);
        }
        serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue());
        injector.inject(managedReferenceFactory);
    }
View Full Code Here

        this.fullName = fullName;
    }

    @Override
    public void getResourceValue(final ResolutionContext resolutionContext, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException {
        final ContextManagedReferenceFactory managedReferenceFactory = new ContextManagedReferenceFactory(name);
        final ServiceName contextServiceName;
        if(fullName.startsWith("java:app")) {
            contextServiceName = ContextNames.contextServiceNameOfApplication(resolutionContext.getApplicationName());
        } else if (fullName.startsWith("java:module") || (fullName.startsWith("java:comp") && resolutionContext.isCompUsesModule())) {
            contextServiceName = ContextNames.contextServiceNameOfModule(resolutionContext.getApplicationName(), resolutionContext.getModuleName());
        } else if(fullName.startsWith("java:comp")) {
            contextServiceName = ContextNames.contextServiceNameOfComponent(resolutionContext.getApplicationName(), resolutionContext.getModuleName(), resolutionContext.getComponentName());
        } else {
            throw NamingMessages.MESSAGES.invalidNameForContextBinding(fullName);
        }
        serviceBuilder.addDependency(contextServiceName, NamingStore.class, managedReferenceFactory.getNamingStoreInjectedValue());
        injector.inject(managedReferenceFactory);
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.naming.ContextManagedReferenceFactory

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.