Package javax.naming

Examples of javax.naming.NotContextException


    return list(name.toString());
  }

  public NamingEnumeration listBindings(String name) throws NamingException {
    if (name.length() > 0)
      throw new NotContextException("Subcontexts not supported");
    final Iterator i = getCurrentBindings().iterator();
    return new NamingEnumeration() {
      public void close() {}
      public boolean hasMore() {
        return i.hasNext();
View Full Code Here


        } else {
            if (entry.type == NamingEntry.CONTEXT) {
                ((Context) entry.value).close();
                bindings.remove(name.get(0));
            } else {
                throw new NotContextException
                    (sm.getString("namingContext.contextExpected"));
            }
        }
       
    }
View Full Code Here

        if (name.size() > 1) {
            Object obj = bindings.get(name.get(0));
            if (obj instanceof Context) {
                return ((Context) obj).getNameParser(name.getSuffix(1));
            } else {
                throw new NotContextException
                    (sm.getString("namingContext.contextExpected"));
            }
        }

        return nameParser;
View Full Code Here

      Context context = (Context) binding;
      binding = context.lookup(name.getSuffix(1));
    }
    else
    {
      NotContextException e = new NotContextException(atom + " does not name a directory context that supports attributes");
      e.setRemainingName(name);
      e.setResolvedObj(binding);
      throw e;
    }
    return binding;
  }
View Full Code Here

      Context context = (Context) binding;
      context.unbind(name.getSuffix(1));
    }
    else
    {
      NotContextException e = new NotContextException(atom + " does not name a directory context that supports attributes");
      e.setRemainingName(name);
      e.setResolvedObj(binding);
      throw e;
    }
  }
View Full Code Here

    else
    {
        // Intermediate name: Consume name in this context and continue
      if( (binding instanceof Context) == false )
      {
        NotContextException e = new NotContextException(atom + " does not name a context");
        e.setRemainingName(name);
        e.setResolvedObj(binding);
        throw e;
      }

      if( attributes == null )
      {
        Context context = (Context) binding;
        if( isBind == true )
          context.bind(name.getSuffix(1), value);
        else
          context.rebind(name.getSuffix(1), value);
      }
      else if( (binding instanceof DirContext) == false )
      {
        NotContextException e = new NotContextException(atom + " does not name a directory context that supports attributes");
        e.setRemainingName(name);
        e.setResolvedObj(binding);
        throw e;
      }
      else
      {
        DirContext context = (DirContext) binding;
View Full Code Here

        {
            return ((Context) o).list("");
        }
        else
        {
            throw new NotContextException();
        }
    }
View Full Code Here

        {
            return ((Context) o).listBindings("");
        }
        else
        {
            throw new NotContextException();
        }
    }
View Full Code Here

      // The naming context is missing.
      // (we would have found it during the upward search)     
      throw new MissingContextException(
        ctxRecord.getId(), name);
    } else {
      throw new NotContextException();
    }
  }
View Full Code Here

        } else {
            if (entry.type == NamingEntry.CONTEXT) {
                ((Context) entry.value).close();
                bindings.remove(name.get(0));
            } else {
                throw new NotContextException
                    (sm.getString("namingContext.contextExpected"));
            }
        }
       
    }
View Full Code Here

TOP

Related Classes of javax.naming.NotContextException

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.