Search in sources :

Example 11 with JndiNameEnvironment

use of com.sun.enterprise.deployment.JndiNameEnvironment in project Payara by payara.

the class JCDIServiceImpl method isCurrentModuleJCDIEnabled.

@Override
public boolean isCurrentModuleJCDIEnabled() {
    BundleDescriptor bundle = null;
    ComponentInvocation inv = invocationManager.getCurrentInvocation();
    if (inv == null) {
        return false;
    }
    JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());
    if (componentEnv != null) {
        if (componentEnv instanceof BundleDescriptor) {
            bundle = (BundleDescriptor) componentEnv;
        } else if (componentEnv instanceof EjbDescriptor) {
            bundle = ((EjbDescriptor) componentEnv).getEjbBundleDescriptor();
        }
    }
    return (bundle != null) ? isJCDIEnabled(bundle) : false;
}
Also used : BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) JndiNameEnvironment(com.sun.enterprise.deployment.JndiNameEnvironment) ComponentInvocation(org.glassfish.api.invocation.ComponentInvocation) EjbDescriptor(com.sun.enterprise.deployment.EjbDescriptor)

Example 12 with JndiNameEnvironment

use of com.sun.enterprise.deployment.JndiNameEnvironment in project Payara by payara.

the class InjectionManagerImpl method injectInstance.

public void injectInstance(Object instance, String componentId, boolean invokePostConstruct) throws InjectionException {
    ComponentInvocation invocation = invocationMgr.getCurrentInvocation();
    if (invocation == null) {
        throw new InjectionException(localStrings.getLocalString("injection-manager.null-invocation-context", "Null invocation context"));
    }
    JndiNameEnvironment componentEnvironment = compEnvManager.getJndiNameEnvironment(componentId);
    if (componentEnvironment == null) {
        throw new InjectionException(localStrings.getLocalString("injection-manager.no-descriptor-registered-for-component", "No descriptor registered for componentId: {0}", componentId));
    }
    inject(instance.getClass(), instance, componentEnvironment, componentId, invokePostConstruct);
}
Also used : InjectionException(com.sun.enterprise.container.common.spi.util.InjectionException) JndiNameEnvironment(com.sun.enterprise.deployment.JndiNameEnvironment) ComponentInvocation(org.glassfish.api.invocation.ComponentInvocation)

Example 13 with JndiNameEnvironment

use of com.sun.enterprise.deployment.JndiNameEnvironment in project Payara by payara.

the class WeldDeployer method createComponentInvocation.

private ComponentInvocation createComponentInvocation(ApplicationInfo applicationInfo) {
    BundleDescriptor bundleDescriptor = getCurrentBundleForContext(deployment.getCurrentDeploymentContext());
    ComponentInvocation componentInvocation = new ComponentInvocation(getComponentEnvId((JndiNameEnvironment) bundleDescriptor), SERVLET_INVOCATION, applicationInfo, applicationInfo.getName(), applicationInfo.getName());
    componentInvocation.setJNDIEnvironment(bundleDescriptor);
    return componentInvocation;
}
Also used : WebBundleDescriptor(com.sun.enterprise.deployment.WebBundleDescriptor) EjbBundleDescriptor(com.sun.enterprise.deployment.EjbBundleDescriptor) BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) JndiNameEnvironment(com.sun.enterprise.deployment.JndiNameEnvironment) ComponentInvocation(org.glassfish.api.invocation.ComponentInvocation)

Example 14 with JndiNameEnvironment

use of com.sun.enterprise.deployment.JndiNameEnvironment in project Payara by payara.

the class ModuleContentLinker method accept.

public void accept(BundleDescriptor bundle) {
    for (Iterator<WebService> itr = bundle.getWebServices().getWebServices().iterator(); itr.hasNext(); ) {
        WebService aWebService = itr.next();
        accept(aWebService);
    }
    if (bundle instanceof JndiNameEnvironment) {
        for (Iterator<ServiceReferenceDescriptor> itr = ((JndiNameEnvironment) bundle).getServiceReferenceDescriptors().iterator(); itr.hasNext(); ) {
            accept(itr.next());
        }
    }
    if (bundle instanceof EjbBundleDescriptor) {
        EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) bundle;
        for (EjbDescriptor anEjb : ejbBundle.getEjbs()) {
            for (Iterator<ServiceReferenceDescriptor> itr = anEjb.getServiceReferenceDescriptors().iterator(); itr.hasNext(); ) {
                accept(itr.next());
            }
        }
    }
}
Also used : JndiNameEnvironment(com.sun.enterprise.deployment.JndiNameEnvironment) WebService(com.sun.enterprise.deployment.WebService) EjbBundleDescriptor(com.sun.enterprise.deployment.EjbBundleDescriptor) ServiceReferenceDescriptor(com.sun.enterprise.deployment.ServiceReferenceDescriptor) EjbDescriptor(com.sun.enterprise.deployment.EjbDescriptor)

Aggregations

JndiNameEnvironment (com.sun.enterprise.deployment.JndiNameEnvironment)14 ComponentInvocation (org.glassfish.api.invocation.ComponentInvocation)8 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)7 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)6 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)5 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)4 InjectionException (com.sun.enterprise.container.common.spi.util.InjectionException)3 ComponentEnvManager (com.sun.enterprise.container.common.spi.util.ComponentEnvManager)2 NamingException (javax.naming.NamingException)2 WeldBootstrap (org.jboss.weld.bootstrap.WeldBootstrap)2 BeanDeploymentArchive (org.jboss.weld.bootstrap.spi.BeanDeploymentArchive)2 EjbInterceptor (com.sun.enterprise.deployment.EjbInterceptor)1 EjbMessageBeanDescriptor (com.sun.enterprise.deployment.EjbMessageBeanDescriptor)1 ManagedBeanDescriptor (com.sun.enterprise.deployment.ManagedBeanDescriptor)1 ServiceReferenceDescriptor (com.sun.enterprise.deployment.ServiceReferenceDescriptor)1 WebComponentDescriptor (com.sun.enterprise.deployment.WebComponentDescriptor)1 WebService (com.sun.enterprise.deployment.WebService)1 WebServicesDescriptor (com.sun.enterprise.deployment.WebServicesDescriptor)1 SecurityContext (com.sun.enterprise.security.SecurityContext)1 SystemHandlerDelegate (com.sun.xml.rpc.spi.runtime.SystemHandlerDelegate)1