User: user57  
  Date: 01/07/20 20:26:43

  Modified:    src/main/org/jboss/naming Util.java
  Log:
   o reformat
  
  Revision  Changes    Path
  1.5       +69 -51    jboss/src/main/org/jboss/naming/Util.java
  
  Index: Util.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/naming/Util.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Util.java 2001/07/01 01:24:24     1.4
  +++ Util.java 2001/07/21 03:26:43     1.5
  @@ -1,5 +1,9 @@
  -
  -
  +/*
  + * JBoss, the OpenSource EJB server
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
   package org.jboss.naming;
   
   import javax.naming.Context;
  @@ -7,61 +11,75 @@
   import javax.naming.NameNotFoundException;
   import javax.naming.NamingException;
   
  -/** A static utility class for common JNDI operations.
  +/**
  + * A static utility class for common JNDI operations.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Scott Stark</a>.
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class Util
   {
  -
  -    /** 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 NamingException, on any JNDI failure
  +   /**
  +    * 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 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);
  -    }
  -    /** 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 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);
  +   }
  +   
  +   /**
  +    * 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 NamingException, on any JNDI failure
       */
  -    public 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;
  -    }
  -
  -    /** 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.
  +   public 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;
  +   }
  +
  +   /**
  +    * 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.
       */
  -    public static void bind(Context ctx, String name, Object value) throws 
NamingException
  -    {
  -        Name n = ctx.getNameParser("").parse(name);
  -        String atom = n.get(n.size()-1);
  -        Context parentCtx = createSubcontext(ctx, n.getPrefix(n.size()-1));
  -        parentCtx.bind(atom, value);
  -    }
  +   public static void bind(Context ctx, String name, Object value)
  +      throws NamingException
  +   {
  +      Name n = ctx.getNameParser("").parse(name);
  +      String atom = n.get(n.size()-1);
  +      Context parentCtx = createSubcontext(ctx, n.getPrefix(n.size()-1));
  +      parentCtx.bind(atom, value);
  +   }
   }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to