Search in sources :

Example 11 with ManagedBeanDescriptor

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

the class ManagedBeanManagerImpl method createManagedBean.

public <T> T createManagedBean(Class<T> managedBeanClass) throws Exception {
    ManagedBeanDescriptor managedBeanDesc = null;
    try {
        BundleDescriptor bundle = getBundle();
        managedBeanDesc = bundle.getManagedBeanByBeanClass(managedBeanClass.getName());
    } catch (Exception e) {
    // OK.  Can mean that it's not annotated with @ManagedBean but 299 can handle it.
    }
    return createManagedBean(managedBeanDesc, managedBeanClass);
}
Also used : BundleDescriptor(com.sun.enterprise.deployment.BundleDescriptor) WebBundleDescriptor(com.sun.enterprise.deployment.WebBundleDescriptor) EjbBundleDescriptor(com.sun.enterprise.deployment.EjbBundleDescriptor) ManagedBeanDescriptor(com.sun.enterprise.deployment.ManagedBeanDescriptor)

Example 12 with ManagedBeanDescriptor

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

the class ComponentValidator method accept.

@Override
protected void accept(ResourceEnvReferenceDescriptor resourceEnvRef) {
    if (resourceEnvRef.getJndiName() == null || resourceEnvRef.getJndiName().length() == 0) {
        Map<String, ManagedBeanDescriptor> managedBeanMap = getManagedBeanMap();
        String refType = resourceEnvRef.getRefType();
        if (managedBeanMap.containsKey(refType)) {
            ManagedBeanDescriptor desc = managedBeanMap.get(refType);
            // In app-client, keep lookup local to JVM so it doesn't need to access
            // server's global JNDI namespace for managed bean.
            String jndiName = (bundleDescriptor.getModuleType() == DOLUtils.carType()) ? desc.getAppJndiName() : desc.getGlobalJndiName();
            resourceEnvRef.setJndiName(jndiName);
            resourceEnvRef.setIsManagedBean(true);
            resourceEnvRef.setManagedBeanDescriptor(desc);
        }
    }
    computeRuntimeDefault(resourceEnvRef);
}
Also used : ManagedBeanDescriptor(com.sun.enterprise.deployment.ManagedBeanDescriptor)

Aggregations

ManagedBeanDescriptor (com.sun.enterprise.deployment.ManagedBeanDescriptor)12 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)10 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)8 WebBundleDescriptor (com.sun.enterprise.deployment.WebBundleDescriptor)8 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)4 JCDIService (com.sun.enterprise.container.common.spi.JCDIService)3 ApplicationClientDescriptor (com.sun.enterprise.deployment.ApplicationClientDescriptor)3 InterceptorInvoker (com.sun.enterprise.container.common.spi.InterceptorInvoker)2 JavaEEInterceptorBuilder (com.sun.enterprise.container.common.spi.JavaEEInterceptorBuilder)2 HashMap (java.util.HashMap)2 JavaEEInterceptorBuilderFactory (com.sun.enterprise.container.common.spi.JavaEEInterceptorBuilderFactory)1 ComponentEnvManager (com.sun.enterprise.container.common.spi.util.ComponentEnvManager)1 InterceptorInfo (com.sun.enterprise.container.common.spi.util.InterceptorInfo)1 Application (com.sun.enterprise.deployment.Application)1 ConnectorDescriptor (com.sun.enterprise.deployment.ConnectorDescriptor)1 EjbInterceptor (com.sun.enterprise.deployment.EjbInterceptor)1 EjbMessageBeanDescriptor (com.sun.enterprise.deployment.EjbMessageBeanDescriptor)1 JndiNameEnvironment (com.sun.enterprise.deployment.JndiNameEnvironment)1 Field (java.lang.reflect.Field)1 Method (java.lang.reflect.Method)1