private static Context createSubcontext(Context ctx, Name name) throws NamingException
    {
        Context subctx = ctx;
        for (int pos = 0; pos < name.size(); pos++)
        {
            String ctxName = name.get(pos);
            try
            {
                subctx = (Context) ctx.lookup(ctxName);
            }
            catch (NameNotFoundException e)
            {
                subctx = ctx.createSubcontext(ctxName);
            }
            // The current subctx will be the ctx for the next name component
            ctx = subctx;
        }
        return subctx;
    }
private static Context createSubcontext(Context ctx, Name name) throws NamingException
    {
        Context subctx = ctx;
        for (int pos = 0; pos < name.size(); pos++)
        {
            String ctxName = name.get(pos);
            try
            {
                subctx = (Context) ctx.lookup(ctxName);
            }
            catch (NameNotFoundException e)
            {
                subctx = ctx.createSubcontext(ctxName);
            }
            
            ctx = subctx;
        }
        return subctx;
    }
private static Context createSubcontext ( Context ctx , Name name ) throws NamingException { Context subctx = ctx ; for ( int pos = 0 ; pos < name . size ( ) ; pos ++ ) { String ctxName = name . get ( pos ) ; try { subctx = ( Context ) ctx . lookup ( ctxName ) ; } catch ( NameNotFoundException e ) { subctx = ctx . createSubcontext ( ctxName ) ; } // The current subctx will be the ctx for the next name component
 ctx = subctx ; } return subctx ; }
--- End ObjectFactory interface methods
--- End ObjectFactory interface methods