399 if (answer != null)
400 return answer;
401 }
402 }
403 }
404 return null;
405 }
406
407
408 /**
409 * Retrieves a context identified by <code>obj</code>, using the specified
410 * environment.
411 * Used by ContinuationContext.
412 *
413 * @param obj The object identifying the context.
414 * @param name The name of the context being returned, relative to
415 * <code>nameCtx</code>, or null if no name is being
416 * specified.
417 * See the <code>getObjectInstance</code> method for
418 * details.
419 * @param ctx The context relative to which <code>name</code> is
420 * specified, or null for the default initial context.
421 * See the <code>getObjectInstance</code> method for
422 * details.
423 * @param environment Environment specifying characteristics of the
424 * resulting context.
425 * @return A context identified by <code>obj</code>.
426 *
427 * @see #getObjectInstance
428 */
429 static Context getContext(Object obj, Name name, Context nameCtx,
430 Hashtable<?,?> environment) throws NamingException {
431 Object answer;
432
433 if (obj instanceof Context) {
434 // %%% Ignore environment for now. OK since method not public.
435 return (Context)obj;
436 }
437
438 try {
439 answer = getObjectInstance(obj, name, nameCtx, environment);
|
399 if (answer != null)
400 return answer;
401 }
402 }
403 }
404 return null;
405 }
406
407
408 /**
409 * Retrieves a context identified by <code>obj</code>, using the specified
410 * environment.
411 * Used by ContinuationContext.
412 *
413 * @param obj The object identifying the context.
414 * @param name The name of the context being returned, relative to
415 * <code>nameCtx</code>, or null if no name is being
416 * specified.
417 * See the <code>getObjectInstance</code> method for
418 * details.
419 * @param nameCtx The context relative to which <code>name</code> is
420 * specified, or null for the default initial context.
421 * See the <code>getObjectInstance</code> method for
422 * details.
423 * @param environment Environment specifying characteristics of the
424 * resulting context.
425 * @return A context identified by <code>obj</code>.
426 *
427 * @see #getObjectInstance
428 */
429 static Context getContext(Object obj, Name name, Context nameCtx,
430 Hashtable<?,?> environment) throws NamingException {
431 Object answer;
432
433 if (obj instanceof Context) {
434 // %%% Ignore environment for now. OK since method not public.
435 return (Context)obj;
436 }
437
438 try {
439 answer = getObjectInstance(obj, name, nameCtx, environment);
|