public void unbind(String name) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.unbind(" + name + ')'); JndiReply reply = connection.invoke( new UnbindRequest(merge(contextPath, name))); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } }
public void destroySubcontext(String name) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.destroySubcontext(" + name + ')'); JndiReply reply = connection.invoke( new DestroySubcontextRequest(merge(contextPath, name))); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } }
ne.fillInStackTrace(); throw ne; ne.fillInStackTrace(); throw ne;
public NamingEnumeration list(String name) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.list(" + name + ')'); JndiReply reply = connection.invoke( new ListRequest(merge(contextPath, name))); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } return ((ListReply)reply).getEnumeration(); }
public void rebind(String name, Object obj) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.rebind(" + name + ',' + obj + ')'); if (obj instanceof Referenceable) { obj = ((Referenceable)obj).getReference(); } JndiReply reply = connection.invoke( new BindRequest(merge(contextPath, name), obj, true)); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } }
public void bind(String name, Object obj) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.bind(" + name + ',' + obj + ')'); if (obj instanceof Referenceable) { obj = ((Referenceable)obj).getReference(); } JndiReply reply = connection.invoke( new BindRequest(merge(contextPath, name), obj)); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } }
public Context createSubcontext(String name) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.createSubcontext(" + name + ')'); CompositeName path = merge(contextPath, name); JndiReply reply = connection.invoke( new CreateSubcontextRequest(path)); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } return new NamingContextImpl(connection.cloneConnection(), path); }
public Object lookup(String name) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.lookup(" + name + ')'); CompositeName path = merge(contextPath, name); JndiReply reply = connection.invoke(new LookupRequest(path)); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } else if (reply instanceof LookupReply) { Object obj = ((LookupReply)reply).getObject(); return obj; } else { return new NamingContextImpl( connection.cloneConnection(), path); } }
public NamingEnumeration listBindings(String name) throws NamingException { if (Trace.logger.isLoggable(BasicLevel.DEBUG)) Trace.logger.log(BasicLevel.DEBUG, "NamingContextImpl.listBindings(" + name + ')'); CompositeName queryPath = merge(contextPath, name); JndiReply reply = connection.invoke(new ListBindingsRequest(queryPath)); if (reply instanceof JndiError) { NamingException exc = ((JndiError)reply).getException(); exc.fillInStackTrace(); throw exc; } ListBindingsReply lbr = (ListBindingsReply)reply; // 1- resolve contexts Binding[] bindings = lbr.getContexts(); for (int i = 0; i < bindings.length; i++) { CompositeName subCtxPath = (CompositeName)queryPath.clone(); subCtxPath.add(bindings[i].getName()); bindings[i].setObject(new NamingContextImpl( connection.cloneConnection(), subCtxPath)); } // 2- resolve references lbr.resolveReferences(); return lbr.getEnumeration(); }