Package javax.naming

Examples of javax.naming.NamingException


    if (request instanceof ChangeOwnerRequest) {
      changeOwner((ChangeOwnerRequest)request);
      return new JndiReply();
    }
   
    return new JndiError(new NamingException("Unknown admin operation"));
  }
View Full Code Here


    AgentId newOwnerId;
    try {
      newOwnerId =
        AgentId.fromString(request.getOwnerId());
    } catch (Exception exc) {
      NamingException ne =
        new NamingException(exc.toString());
      ne.setRootCause(exc);
      throw ne;
    }
    if (getId().equals(newOwnerId))
      throw new NamingException("Server already owner");
    impl.changeOwner(request.getName(), newOwnerId);
  }
View Full Code Here

  protected JndiReply invokeOwner(AgentId owner,
                                  RequestContext reqCtx) {
    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG, "RequestManager.invokeOwner(" +
                       owner + ',' + reqCtx + ')');
    return new JndiError(new NamingException("Not owner"));
  }
View Full Code Here

      Trace.logger.log(BasicLevel.DEBUG, "ServerImpl.rebind(" +
                       path + ',' +
                       obj + ',' + ')');

    // The root context cannot become a name-value pair.
    if (path.size() == 0) throw new NamingException("Cannot rebind the root context");

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

      if (r instanceof ContextRecord) {
        // DF: seems not consistent to delete recursively the whole context
        // (empty or not) as the reverse operation is not possible (create a
        // context with a name already bound), so prefer to raise an error.
        // DF (TODO): Have to check the specification.
        throw new NamingException("Cannot rebind a context");
      }
     
      ObjectRecord or = (ObjectRecord)r;
      or.setObject(obj);
    } else {
View Full Code Here

    if (Trace.logger.isLoggable(BasicLevel.DEBUG))
      Trace.logger.log(BasicLevel.DEBUG, "ServerImpl.unbind(" +
                       path + ')');

    // The root context cannot be deleted.
    if (path.size() == 0) throw new NamingException("Cannot unbind the root context");

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

        nc.getOwnerId());
    }
    Record r = nc.getRecord(lastName);
    if (r != null) {
      if (r instanceof ContextRecord)
        throw new NamingException("Cannot unbind a context");

      nc.removeRecord(lastName);
      contextManager.storeNamingContext(nc);       
      return true;
    }
View Full Code Here

      Trace.logger.log(BasicLevel.DEBUG,
                       "ServerImpl.destroySubcontext(" +
                       path + ')');

    if (path.size() == 0)
      throw new NamingException("Cannot delete root context.");

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

    contextCounter++;
    try {
      transaction.save(new Long(contextCounter), CTX_COUNTER);
      return ncid;
    } catch (IOException ioexc) {
      NamingException nexc = new NamingException();
      nexc.setRootCause(ioexc);
      throw nexc;
    }
  }
View Full Code Here

      Trace.logger.log(BasicLevel.DEBUG,
                       "StorageManager.storeNamingContext(" + nc + ')');
    try {
      transaction.save(nc, ROOT, nc.getId().toString());
    } catch (IOException exc) {
      NamingException ne = new NamingException(exc.getMessage());
      ne.setRootCause(exc);
      throw ne;
    }
  }
View Full Code Here

TOP

Related Classes of javax.naming.NamingException

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.