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);
}
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);
}
Aggregations