/** * Binds a name to an object. * * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null * @exception NameAlreadyBoundException if name is already bound * @exception InvalidAttributesException if object did not supply all * mandatory attributes * @exception NamingException if a naming exception is encountered */ public void bind(String name, Object obj) throws NamingException { dirContext.bind(composeName(name, path), obj); }
private ApplicationName deriveApplicationName() { ProxyDirContext resources = (ProxyDirContext) this.resources; String host = resources.getHostName(); String context = resources.getContextName(); return TcServerUtils.applicationName(host, context); }
/** * Enumerates the names bound in the named context, along with the class * names of objects bound to them. * * @param name the name of the context to list * @return an enumeration of the names and class names of the bindings in * this context. Each element of the enumeration is of type NameClassPair. * @exception NamingException if a naming exception is encountered */ public NamingEnumeration<NameClassPair> list(String name) throws NamingException { return dirContext.list(composeName(name, path)); }
/** * Set associated resources. */ public void setResources(DirContext resources) { this.resources = resources; DirContext res = resources; if (resources instanceof ProxyDirContext) { ProxyDirContext proxyRes = (ProxyDirContext)res; contextName = proxyRes.getContextName(); res = proxyRes.getDirContext(); } if (res instanceof WebDirContext) { ((WebDirContext)res).setJarFileResourcesProvider(this); } }
resources.list(cacheEntry.name); resources.lookupCache(cacheEntry.name + resourceName); if (!childCacheEntry.exists) { continue;
new ProxyDirContext(env, webappResources); if (webappResources instanceof FileDirContext) { filesystemBased = true; + (("".equals(getPath()))?"/":getPath())); Registry.getRegistry(null, null).registerComponent (proxyDirContext.getCache(), resourcesName, null);
resources.lookup(path); } catch (NamingException e) { exists = false; resources.createSubcontext(path); } catch (NamingException e) { result = false;
@Binding(bindingType = BindingType.MAY) public void setDirContext(DirContext dirContext) { if (dirContext == null) { dirContext_ = null; } else if (dirContext instanceof ProxyDirContext) { dirContext_ = (ProxyDirContext)dirContext; } else { try { dirContext_ = new ProxyDirContext(dirContext.getEnvironment(), dirContext); } catch (NamingException ex) { throw new RuntimeException("Can't set DirContext: " + dirContext, ex); } } }
/** * Binds a name to an object, overwriting any existing binding. * * @param name the name to bind; may not be empty * @param obj the object to bind; possibly null * @exception InvalidAttributesException if object did not supply all * mandatory attributes * @exception NamingException if a naming exception is encountered */ public void rebind(String name, Object obj) throws NamingException { dirContext.rebind(composeName(name, path), obj); }
public int compare(NameClassPair p1, NameClassPair p2) { CacheEntry ce1 = resources.lookupCache( dirName + p1.getName()); Date date1 = ce1.attributes.getCreationOrLastModifiedDate(); CacheEntry ce2 = resources.lookupCache( dirName + p2.getName()); Date date2 = ce2.attributes.getCreationOrLastModifiedDate(); if (date1.before(date2)) { return -1; } else if (date1.after(date2)) { return 1; } else { return 0; } } }
/** * Creates and binds a new context. * * @param name the name of the context to create; may not be empty * @return the newly created context * @exception NameAlreadyBoundException if name is already bound * @exception InvalidAttributesException if creation of the subcontext * requires specification of mandatory attributes * @exception NamingException if a naming exception is encountered */ public Context createSubcontext(String name) throws NamingException { return dirContext.createSubcontext(composeName(name, path)); }
/** * Set associated resources. */ public void setResources(DirContext resources) { this.resources = resources; if (resources instanceof ProxyDirContext) { contextName = ((ProxyDirContext) resources).getContextName(); } }
/** * Retrieves the named object. * * @param name the name of the object to look up * @return the object bound to name * @exception NamingException if a naming exception is encountered */ public Object lookup(String name) throws NamingException { return dirContext.lookup(composeName(name, path)); }
/** * Unbinds the named object. * * @param name the name to bind; may not be empty * @exception NameNotFoundException if an intermediate context does not * exist * @exception NamingException if a naming exception is encountered */ public void unbind(String name) throws NamingException { dirContext.unbind(composeName(name, path)); }
resources.list(cacheEntry.name); resources.lookupCache(cacheEntry.name + resourceName); if (!childCacheEntry.exists) { continue;
new ProxyDirContext(env, webappResources); if (webappResources instanceof FileDirContext) { filesystemBased = true; + (("".equals(getPath()))?"/":getPath())); Registry.getRegistry(null, null).registerComponent (proxyDirContext.getCache(), resourcesName, null);