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