equal
deleted
inserted
replaced
359 *<p> |
359 *<p> |
360 * When creating a subclass of InitialContext, use this method as |
360 * When creating a subclass of InitialContext, use this method as |
361 * follows. |
361 * follows. |
362 * Define a new method that uses this method to get an initial |
362 * Define a new method that uses this method to get an initial |
363 * context of the desired subclass. |
363 * context of the desired subclass. |
364 * <p><blockquote><pre> |
364 * <blockquote><pre> |
365 * protected XXXContext getURLOrDefaultInitXXXCtx(Name name) |
365 * protected XXXContext getURLOrDefaultInitXXXCtx(Name name) |
366 * throws NamingException { |
366 * throws NamingException { |
367 * Context answer = getURLOrDefaultInitCtx(name); |
367 * Context answer = getURLOrDefaultInitCtx(name); |
368 * if (!(answer instanceof XXXContext)) { |
368 * if (!(answer instanceof XXXContext)) { |
369 * if (answer == null) { |
369 * if (answer == null) { |
375 * return (XXXContext)answer; |
375 * return (XXXContext)answer; |
376 * } |
376 * } |
377 * </pre></blockquote> |
377 * </pre></blockquote> |
378 * When providing implementations for the new methods in the subclass, |
378 * When providing implementations for the new methods in the subclass, |
379 * use this newly defined method to get the initial context. |
379 * use this newly defined method to get the initial context. |
380 * <p><blockquote><pre> |
380 * <blockquote><pre> |
381 * public Object XXXMethod1(Name name, ...) { |
381 * public Object XXXMethod1(Name name, ...) { |
382 * throws NamingException { |
382 * throws NamingException { |
383 * return getURLOrDefaultInitXXXCtx(name).XXXMethod1(name, ...); |
383 * return getURLOrDefaultInitXXXCtx(name).XXXMethod1(name, ...); |
384 * } |
384 * } |
385 * </pre></blockquote> |
385 * </pre></blockquote> |