@Override public NameParser getNameParser(String name) throws NamingException { return context.getNameParser(name); }
@Override public NameParser getNameParser(Name name) throws NamingException { return context.getNameParser(name.toString()); }
@Override public NameParser getNameParser(final String name) throws NamingException { return CNCtxFactory.INSTANCE.getInitialContext(environment).getNameParser(name); }
@Override public NameParser getNameParser(final Name name) throws NamingException { return CNCtxFactory.INSTANCE.getInitialContext(environment).getNameParser(name); }
/** * Unbinds a name from ctx, and removes parents if they are empty * * @param ctx the parent JNDI Context under which the name will be unbound * @param name The name to unbind * @throws NamingException for any error */ public static void unbind(Context ctx, String name) throws NamingException { unbind(ctx, ctx.getNameParser("").parse(name)); }
/** * Rebind val to name in ctx, and make sure that all intermediate contexts exist * * @param ctx the parent JNDI Context under which value will be bound * @param name the name relative to ctx where value will be bound * @param value the value to bind. * @throws NamingException for any error */ public static void rebind(final Context ctx, final String name, final Object value) throws NamingException { final Name n = ctx.getNameParser("").parse(name); rebind(ctx, n, value); }
private Name parseName(String jndiName, Context context) { try { return context.getNameParser( "" ).parse( jndiName ); } catch ( InvalidNameException e ) { throw new JndiNameException( "JNDI name [" + jndiName + "] was not valid", e ); } catch ( NamingException e ) { throw new JndiException( "Error parsing JNDI name [" + jndiName + "]", e ); } }
Name n = ctx.getNameParser( "" ).parse( name ); while ( n.size() > 1 ) { final String ctxName = n.get( 0 );
NameParser parser = ctx.getNameParser(""); String securityDomain = null; Name name = null;
public NameParser getNameParser(final CompositeName compositeName) throws NamingException { if (compositeName.isEmpty()) { return getNativeNameParser(); } final String first = compositeName.get(0); final Name nativeName = getNativeNameParser().parse(first); final Object obj = lookup(nativeName); if (obj instanceof Context) { final Context context = (Context) obj; try { return context.getNameParser(compositeName.getSuffix(1)); } finally { safeClose(context); } } else { throw log.notContextInCompositeName(first); } } }
@Override public Object operation() throws NamingException { return getDelegate().getNameParser(name); } }.perform();
@Override public Object operation() throws NamingException { return getDelegate().getNameParser(name); } }.perform();
/** Create a subcontext including any intermediate contexts. @param ctx the parent JNDI Context under which value will be bound @param name the name relative to ctx of the subcontext. @return The new or existing JNDI subcontext @throws javax.naming.NamingException on any JNDI failure */ public static Context createSubcontext(Context ctx, String name) throws NamingException { Name n = ctx.getNameParser("").parse(name); return createSubcontext(ctx, n); }
/** * Unbinds a name from ctx, and removes parents if they are empty * * @param ctx the parent JNDI Context under which the name will be unbound * @param name The name to unbind * @throws NamingException for any error */ public static void unbind(Context ctx, String name) throws NamingException { unbind(ctx, ctx.getNameParser("").parse(name)); }
/** Bind val to name in ctx, and make sure that all intermediate contexts exist @param ctx the parent JNDI Context under which value will be bound @param name the name relative to ctx where value will be bound @param value the value to bind. @throws NamingException for any error */ public static void bind(Context ctx, String name, Object value) throws NamingException { Name n = ctx.getNameParser("").parse(name); bind(ctx, n, value); }
/** Unbinds a name from ctx, and removes parents if they are empty @param ctx the parent JNDI Context under which the name will be unbound @param name The name to unbind @throws NamingException for any error */ public static void unbind(Context ctx, String name) throws NamingException { unbind(ctx, ctx.getNameParser("").parse(name)); }
/** * Create a subcontext including any intermediate contexts. * * @param ctx the parent JNDI Context under which value will be bound * @param name the name relative to ctx of the subcontext. * @return The new or existing JNDI subcontext * @throws javax.naming.NamingException on any JNDI failure */ public static Context createSubcontext(Context ctx, String name) throws NamingException { Name n = ctx.getNameParser("").parse(name); return createSubcontext(ctx, n); }
/** * Rebind val to name in ctx, and make sure that all intermediate contexts exist * * @param ctx the parent JNDI Context under which value will be bound * @param name the name relative to ctx where value will be bound * @param value the value to bind. * @throws NamingException for any error */ public static void rebind(Context ctx, String name, Object value) throws NamingException { Name n = ctx.getNameParser("").parse(name); rebind(ctx, n, value); }
/** Rebind val to name in ctx, and make sure that all intermediate contexts exist @param ctx the parent JNDI Context under which value will be bound @param name the name relative to ctx where value will be bound @param value the value to bind. @throws NamingException for any error */ public static void rebind(Context ctx, String name, Object value) throws NamingException { Name n = ctx.getNameParser("").parse(name); rebind(ctx, n, value); }
private static javax.naming.Context diveIntoJNDIContext(javax.naming.Context initialContext, JNDIContextDiver diver) throws NamingException { Name jerseyConfigCtxName = initialContext.getNameParser("").parse(JNDI_CDIEXTENSION_CTX); javax.naming.Context currentContext = initialContext; for (int i=0; i<jerseyConfigCtxName.size(); i++) { currentContext = diver.stepInto(currentContext, jerseyConfigCtxName.get(i)); } return currentContext; }