/** * Set the specified resources in the naming context. */ public void removeResourceLink(String name) { try { envCtx.unbind(name); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg); } }
/** * Set the specified local EJBs in the naming context. */ public void removeLocalEjb(String name) { try { envCtx.unbind(name); } 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 removeResourceEnvRef(String name) { try { envCtx.unbind(name); } 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 removeEjb(String name) { try { envCtx.unbind(name); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg); } }
/** * Set the specified environment entries in the naming context. */ public void removeEnvironment(String name) { try { envCtx.unbind(name); } 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 removeResource(String name) { try { envCtx.unbind(name); } 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 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); } }
/** * Add additional parameters to the reference. */ private void addAdditionalParameters(NamingResources resources, Reference ref, String name) { if (resources == null) { resources = namingResources; } ResourceParams resourceParameters = resources.findResourceParams(name); if (debug >= 2) log(" Resource parameters for " + name + " = " + resourceParameters); if (resourceParameters == null) return; Hashtable<String, String> params = resourceParameters.getParameters(); Enumeration<String> enumeration = params.keys(); while (enumeration.hasMoreElements()) { String paramName = enumeration.nextElement(); String paramValue = params.get(paramName); StringRefAddr refAddr = new StringRefAddr(paramName, paramValue); ref.add(refAddr); } }
/** * 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); } }
log(msg); log(msg); } catch (IllegalArgumentException e) { String msg = MessageFormat.format(rb.getString(LogFacade.ENV_ENTRY_INVALID_VALUE), env.getName()); log(msg); try { if (debug >= 2) log(" Adding environment entry " + env.getName()); createSubcontexts(envCtx, env.getName()); envCtx.bind(env.getName(), value); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.ENV_ENTRY_INVALID_VALUE), env.getName()); 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); } }
} catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.CREATION_NAMING_CONTEXT_FAILED), e); log(msg); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg); } catch (NamingException e) { String msg = MessageFormat.format(rb.getString(LogFacade.BIND_OBJECT_FAILED), e); log(msg);