String moduleName = null; if (invocation != null) { componentId = invocation.getComponentId(); appName = invocation.getAppName(); moduleName = invocation.getModuleName();
/** * Get the component id from the Invocation Manager. * * @return the component id as a string. */ private String getComponentId() throws NamingException { String id; ComponentInvocation ci; if (invMgr==null) { ci= habitat.<InvocationManager>getService(InvocationManager.class).getCurrentInvocation(); } else { ci= invMgr.getCurrentInvocation(); } if (ci == null) { throw new NamingException("Invocation exception: Got null ComponentInvocation "); } try { id = ci.getComponentId(); if (id == null) { throw new NamingException("Invocation exception: ComponentId is null"); } } catch (Throwable th) { NamingException ine = new NamingException("Invocation exception: " + th); ine.initCause(th); throw ine; } return id; }
id = ci.getComponentId(); if (id == null) { NamingException nameEx = new NamingException(
public void invokeInstancePreDestroy(Object instance, boolean validate) throws InjectionException { ComponentInvocation inv = invocationMgr.getCurrentInvocation(); //if ComponentInv is null and validate is true, throw InjectionException; //if component JndiNameEnvironment is null and validate is true, throw InjectionException; //if validate is false, the above 2 null conditions are basically ignored, //except that when fine logging is enabled, fine-log a message. if( inv != null ) { JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId()); if (componentEnv != null) { invokePreDestroy(instance.getClass(), instance, componentEnv); } else if (validate || _logger.isLoggable(Level.FINE)) { String msg1 = localStrings.getLocalString( "injection-manager.no-descriptor-registered-for-invocation", "No descriptor registered for current invocation: {0}", inv); if (validate) { throw new InjectionException(msg1); } _logger.log(Level.FINE, msg1); } } else if (validate || _logger.isLoggable(Level.FINE)) { String msg2 = localStrings.getLocalString( "injection-manager.null-invocation-context", "Null invocation context"); if (validate) { throw new InjectionException(msg2); } _logger.log(Level.FINE, msg2); } }
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; }
public void injectInstance(Object instance, boolean invokePostConstruct) throws InjectionException { ComponentInvocation inv = invocationMgr.getCurrentInvocation(); if( inv != null ) { JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId()); if( componentEnv != null ) { inject(instance.getClass(), instance, componentEnv, null, invokePostConstruct); } else { throw new InjectionException(localStrings.getLocalString( "injection-manager.no-descriptor-registered-for-invocation", "No descriptor registered for current invocation: {0}", inv)); } } else { throw new InjectionException(localStrings.getLocalString( "injection-manager.null-invocation-context", "Null invocation context")); } }
public void injectInstance(Object instance, boolean invokePostConstruct) throws InjectionException { ComponentInvocation inv = invocationMgr.getCurrentInvocation(); if( inv != null ) { JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId()); if( componentEnv != null ) { inject(instance.getClass(), instance, componentEnv, null, invokePostConstruct); } else { throw new InjectionException(localStrings.getLocalString( "injection-manager.no-descriptor-registered-for-invocation", "No descriptor registered for current invocation: {0}", inv)); } } else { throw new InjectionException(localStrings.getLocalString( "injection-manager.null-invocation-context", "Null invocation context")); } }
public void invokeInstancePreDestroy(Object instance) throws InjectionException { ComponentInvocation inv = invocationMgr.getCurrentInvocation(); if( inv != null ) { JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId()); if( componentEnv != null ) { invokePreDestroy(instance.getClass(), instance, componentEnv); } else { throw new InjectionException(localStrings.getLocalString( "injection-manager.no-descriptor-registered-for-invocation", "No descriptor registered for current invocation: {0}", inv)); } } else { throw new InjectionException(localStrings.getLocalString( "injection-manager.null-invocation-context", "Null invocation context")); } }
JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());
JndiNameEnvironment componentEnv = compEnvManager.getJndiNameEnvironment(inv.getComponentId());
inv.componentId = parentInv.getComponentId(); inv.setComponentInvocationType(parentInv.getInvocationType()); inv.instance = null; cpy.componentId = parentInv.getComponentId(); cpy.setComponentInvocationType(parentInv.getInvocationType()); cpy.instance = parentInv.getInstance();
inv.componentId = parentInv.getComponentId(); inv.setComponentInvocationType(parentInv.getInvocationType()); inv.instance = null; cpy.componentId = parentInv.getComponentId(); cpy.setComponentInvocationType(parentInv.getInvocationType()); cpy.instance = parentInv.getInstance();