/** * Set the specified EJBs in the naming context. */ public void addEjb(ContextEjb ejb) { // Create a reference to the EJB. Reference ref = new EjbRef (ejb.getType(), ejb.getHome(), ejb.getRemote(), ejb.getLink()); // Adding the additional parameters, if any Iterator<String> params = ejb.listProperties(); while (params.hasNext()) { String paramName = params.next(); String paramValue = (String) ejb.getProperty(paramName); StringRefAddr refAddr = new StringRefAddr(paramName, paramValue); ref.add(refAddr); } try { createSubcontexts(envCtx, ejb.getName()); envCtx.bind(ejb.getName(), ref); } catch (NamingException e) { logger.error(sm.getString("naming.bindFailed", e)); } }
/** * Set the specified EJBs in the naming context. */ public void addEjb(ContextEjb ejb) { // Create a reference to the EJB. Reference ref = new EjbRef (ejb.getType(), ejb.getHome(), ejb.getRemote(), ejb.getLink()); // Adding the additional parameters, if any Iterator params = ejb.listProperties(); while (params.hasNext()) { String paramName = (String) params.next(); String paramValue = (String) ejb.getProperty(paramName); StringRefAddr refAddr = new StringRefAddr(paramName, paramValue); ref.add(refAddr); } try { createSubcontexts(envCtx, ejb.getName()); envCtx.bind(ejb.getName(), ref); } catch (NamingException e) { logger.error(sm.getString("naming.bindFailed", e)); } }
/** * Set the specified EJBs in the naming context. */ public void addEjb(ContextEjb ejb) { // Create a reference to the EJB. Reference ref = new EjbRef (ejb.getType(), ejb.getHome(), ejb.getRemote(), ejb.getLink()); // Adding the additional parameters, if any addAdditionalParameters(ejb.getNamingResources(), ref, ejb.getName()); try { createSubcontexts(envCtx, ejb.getName()); envCtx.bind(ejb.getName(), ref); } catch (NamingException e) { log(sm.getString("naming.bindFailed", e)); } }
/** * Set the specified EJBs in the naming context. */ public void addEjb(ContextEjb ejb) { // Create a reference to the EJB. Reference ref = new EjbRef(ejb.getType(), ejb.getHome(), ejb.getRemote(), ejb.getLink()); // Adding the additional parameters, if any Iterator<String> params = ejb.listProperties(); while (params.hasNext()) { String paramName = params.next(); String paramValue = (String) ejb.getProperty(paramName); StringRefAddr refAddr = new StringRefAddr(paramName, paramValue); ref.add(refAddr); } try { createSubcontexts(envCtx, ejb.getName()); envCtx.bind(ejb.getName(), ref); } catch (NamingException e) { logger.error(sm.getString("naming.bindFailed", e)); } }
/** * Import the configuration from the DefaultContext into * current Context. * * @param context current web application context */ public void importDefaultContext(Context context) { if (context instanceof StandardContext) { ((StandardContext)context).setUseNaming(isUseNaming()); ((StandardContext)context).setSwallowOutput(getSwallowOutput()); if (!contexts.containsKey(context)) { ((StandardContext) context).addLifecycleListener(this); } } context.setCookies(getCookies()); context.setCrossContext(getCrossContext()); context.setReloadable(getReloadable()); String [] listeners = findApplicationListeners(); for( int i = 0; i < listeners.length; i++ ) { context.addApplicationListener(listeners[i]); } listeners = findInstanceListeners(); for( int i = 0; i < listeners.length; i++ ) { context.addInstanceListener(listeners[i]); } String [] wrapper = findWrapperListeners(); for( int i = 0; i < wrapper.length; i++ ) { context.addWrapperListener(wrapper[i]); } wrapper = findWrapperLifecycles(); for( int i = 0; i < wrapper.length; i++ ) { context.addWrapperLifecycle(wrapper[i]); } String [] parameters = findParameters(); for( int i = 0; i < parameters.length; i++ ) { context.addParameter(parameters[i],findParameter(parameters[i])); } ApplicationParameter [] appParam = findApplicationParameters(); for( int i = 0; i < appParam.length; i++ ) { context.addApplicationParameter(appParam[i]); } if (!(context instanceof StandardContext)) { ContextEjb [] contextEjb = findEjbs(); for( int i = 0; i < contextEjb.length; i++ ) { context.addEjb(contextEjb[i]); } ContextEnvironment [] contextEnv = findEnvironments(); for( int i = 0; i < contextEnv.length; i++ ) { context.addEnvironment(contextEnv[i]); } /* if (context instanceof StandardContext) { ResourceParams [] resourceParams = findResourceParams(); for( int i = 0; i < resourceParams.length; i++ ) { ((StandardContext)context).addResourceParams (resourceParams[i]); } } */ ContextResource [] resources = findResources(); for( int i = 0; i < resources.length; i++ ) { context.addResource(resources[i]); } String [] envRefs = findResourceEnvRefs(); for( int i = 0; i < envRefs.length; i++ ) { context.addResourceEnvRef (envRefs[i],findResourceEnvRef(envRefs[i])); } } }
public void addEjb(ContextEjb ejb) { }
public ContextEjb findEjb(String name) { return null; }
public ContextEjb[] findEjbs() { return null; }
/** * Add an EJB resource reference for this web application. * * @param ejb New EJB resource reference */ public void addEjb(ContextEjb ejb) { namingResources.addEjb(ejb); fireContainerEvent("addEjb", ejb.getName()); }
/** * Add an EJB resource reference for this web application. * * @param ejb New EJB resource reference */ public void addEjb(ContextEjb ejb);
/** * Return the EJB resource reference with the specified name, if any; * otherwise, return <code>null</code>. * * @param name Name of the desired EJB resource reference */ public ContextEjb findEjb(String name);
/** * Return the defined EJB resource references for this application. * If there are none, a zero-length array is returned. */ public ContextEjb[] findEjbs();
/** * Add an EJB resource reference for this web application. * * @param ejb New EJB resource reference */ public void addEjb(ContextEjb ejb) { namingResources.addEjb(ejb); }
/** * Return the defined EJB resource references for this application. * If there are none, a zero-length array is returned. */ public ContextEjb[] findEjbs() { return namingResources.findEjbs(); }