Package javax.naming

Examples of javax.naming.NameAlreadyBoundException


      Trace.logger.log(BasicLevel.DEBUG, "ServerImpl.bind(" +
                       path + ',' +
                       obj + ',' + ')');
    // The root context is (in a way) already bound since
    // it is already a context.
    if (path.size() == 0) throw new NameAlreadyBoundException();

    path = (CompositeName) path.clone();
    String lastName = (String) path.remove(path.size() - 1);
    NamingContext nc = contextManager.getNamingContext(path);
View Full Code Here


      throw new NotOwnerException(
        nc.getOwnerId());
    }

    Record r = nc.getRecord(lastName);
    if (r != null) throw new NameAlreadyBoundException();
   
    nc.addRecord(new ObjectRecord(lastName, obj));
    contextManager.storeNamingContext(nc);
  }
View Full Code Here

        BasicLevel.DEBUG,
        "ServerImpl.createSubcontext(" +
        path + ',' + subcontextOwnerId + ')');

    // The root already exists.
    if (path.size() == 0) throw new NameAlreadyBoundException();

    CompositeName parentPath = (CompositeName)path.clone();   
    String lastName =
      (String)parentPath.remove(parentPath.size() - 1);
    NamingContext parentNc =
View Full Code Here

      throw new NotOwnerException(
        parentNc.getOwnerId());
    }

    if (parentNc.getRecord(lastName) != null)
      throw new NameAlreadyBoundException();
    NamingContext nc;
    if(!   looseCoupling)
   nc =
      contextManager.newNamingContext(
              subcontextOwnerId, ncid, path);
View Full Code Here

        if (n.size() == 1) {
            // leaf in the env tree
            if (this.bindings.get(name) != null) {
                logger.error("CompNamingContext: trying to overbind");
                throw new NameAlreadyBoundException("CompNamingContext: Use rebind to bind over a name");
            }
            this.bindings.put(name, obj);
        } else {
            // sub context in the env tree
            String suffix = n.getSuffix(1).toString();
View Full Code Here

            throw new NameNotFoundException();
        }
        if (obj instanceof ContextImpl) {
            return (Context) obj;
        }
        throw new NameAlreadyBoundException(name);
    }
View Full Code Here

   public Context createSubcontext(String name) throws NamingException
   {
      name = trimSlashes(name);
      if (map.get(name) != null)
      {
         throw new NameAlreadyBoundException(name);
      }
      InVMContext c = new InVMContext();
      map.put(name, c);
      return c;
   }
View Full Code Here

         c = (InVMContext)lookup(path);
      }
      name = name.substring(i + 1);
      if (!rebind && c.map.get(name) != null)
      {
         throw new NameAlreadyBoundException(name);
      }
      c.map.put(name, obj);
   }
View Full Code Here

    VFSItem oldFile = resolveFile(oldName);
    if (oldFile == null) throw new NamingException(smgr.getString("resources.notFound", oldName));

    VFSItem newFile = resolveFile(newName);
    if (newFile != null)
      throw new NameAlreadyBoundException();
   
    VFSStatus status = oldFile.rename(newName);
    if (status == VFSConstants.NO)
      throw new NameAlreadyBoundException();
  }
View Full Code Here

   */
  public void bind(String name, Object obj, Attributes attrs) throws NamingException {

    // Note: No custom attributes allowed
    VFSItem file = resolveFile(name);
    if (file != null) throw new NameAlreadyBoundException(smgr.getString("resources.alreadyBound", name));
   
    int lastSlash = name.lastIndexOf('/');
    if (lastSlash == -1) throw new NamingException();
    String parent = name.substring(0, lastSlash);
    VFSItem folder = resolveFile(parent);
View Full Code Here

TOP

Related Classes of javax.naming.NameAlreadyBoundException

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.