/** * Set the specified resources in the naming context. */ public void addResourceEnvRef(String name, String type) { // Create a reference to the resource env. Reference ref = new ResourceEnvRef(type); // Adding the additional parameters, if any addAdditionalParameters(null, ref, name); try { if (debug >= 2) log(" Adding resource env ref " + name); createSubcontexts(envCtx, name); envCtx.bind(name, ref); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg); } }
/** * 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) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg); } }
/** * Set the specified resource link in the naming context. */ public void addResourceLink(ContextResourceLink resourceLink) { // Create a reference to the resource. Reference ref = new ResourceLinkRef (resourceLink.getType(), resourceLink.getGlobal()); // Adding the additional parameters, if any addAdditionalParameters(resourceLink.getNamingResources(), ref, resourceLink.getName()); try { if (debug >= 2) log(" Adding resource link " + resourceLink.getName()); createSubcontexts(envCtx, resourceLink.getName()); envCtx.bind(resourceLink.getName(), ref); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg); } }
/** * Set the specified resources in the naming context. */ public void addResource(ContextResource resource) { // Create a reference to the resource. Reference ref = new ResourceRef (resource.getType(), resource.getDescription(), resource.getScope(), resource.getAuth()); // Adding the additional parameters, if any addAdditionalParameters(resource.getNamingResources(), ref, resource.getName()); try { if (debug >= 2) { log(" Adding resource ref " + resource.getName()); log(" " + ref); } createSubcontexts(envCtx, resource.getName()); envCtx.bind(resource.getName(), ref); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg); } }
Reference ref = new TransactionRef(); compCtx.bind("UserTransaction", ref); addAdditionalParameters (namingResources, ref, "UserTransaction"); } catch (NamingException e) {