Package javax.naming

Examples of javax.naming.NameNotFoundException


            if (!(ctx instanceof Context))
                throw new NotContextException(ContainerJNDIManager.JNDI_RESOURCES.getString(
                        "WinstoneContext.NotContext", new String[] {
                                childName.get(0), ctx.getClass().getName() }));
            else if (ctx == null)
                throw new NameNotFoundException(ContainerJNDIManager.JNDI_RESOURCES.getString(
                        "WinstoneContext.NameNotFound", childName.get(0)));
            else
                try {
                    ((Context) ctx).destroySubcontext(childName.getSuffix(1));
                } finally {
View Full Code Here


    private String getRelativeName(final String name) throws NamingException {
        String newName = name;
        // We suppose that all names must be prefixed as this
        if (!name.startsWith(JAVA_PREFIX)) {
            logger.error("relative name! {0}" + name);
            throw new NameNotFoundException("Invalid name:" + name);
        }
        if (name.endsWith("/")) {
            newName = name.substring(JAVA_PREFIX.length() + 1);
        } else {
            newName = name.substring(JAVA_PREFIX.length());
View Full Code Here

     */
    private Name getRelativeName(final Name name) throws NamingException {
        if (name.get(0).equals(JAVA_PREFIX)) {
            return (name.getSuffix(1));
        }
        throw new NameNotFoundException("Invalid name:" + name);
    }
View Full Code Here

        }
        // leaf in the env tree
        Object ret = this.bindings.get(name);
        if (ret == null) {
            logger.debug(" {0} not found.", name);
            throw new NameNotFoundException(name);
        }
        if (ret instanceof LinkRef) {
            // Handle special case of the LinkRef since I think
            // it's not handled by std NamingManager.getObjectInstance().
            // The name hidden in linkref is in the initial context.
View Full Code Here

        if (n.size() == 1) {
            // leaf in the env tree
            if (this.bindings.get(name) == null) {
                logger.error("CompNamingContext nothing to unbind");
                throw new NameNotFoundException(name);
            }
            this.bindings.remove(name);
        } else {
            // sub context in the env tree
            String suffix = n.getSuffix(1).toString();
View Full Code Here

     * @see javax.naming.NameAlreadyBoundException
     */
    private Context lookupCtx(final String name) throws NamingException {
        Object obj = this.bindings.get(name);
        if (obj == null) {
            throw new NameNotFoundException();
        }
        if (obj instanceof ContextImpl) {
            return (Context) obj;
        }
        throw new NameAlreadyBoundException(name);
View Full Code Here

      int i = name.indexOf("/");
      String tok = i == -1 ? name : name.substring(0, i);
      Object value = map.get(tok);
      if (value == null)
      {
         throw new NameNotFoundException("Name not found: " + tok);
      }
      if (value instanceof InVMContext && i != -1)
      {
         return ((InVMContext)value).lookup(name.substring(i));
      }
View Full Code Here

      {
         String tok = name.substring(0, i);
         InVMContext c = (InVMContext)map.get(tok);
         if (c == null)
         {
            throw new NameNotFoundException("Context not found: " + tok);
         }
         c.unbind(name.substring(i));
      }
   }
View Full Code Here

   public Object lookup(String name) throws NamingException
   {
      Object value = bindings.get(name);
      if( value == null )
         throw new NameNotFoundException(name);
      return value;
   }
View Full Code Here

   public void rename(String oldName, String newName) throws NamingException
   {
      Object value = bindings.remove(oldName);
      if( value == null )
         throw new NameNotFoundException(oldName);
      bindings.put(newName, value);
   }
View Full Code Here

TOP

Related Classes of javax.naming.NameNotFoundException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.