Such utility methods already exists and since this is not specific to
services so it should not be placed into a service or deployer base class.

package org.jboss.naming;

public class Util
{
...
    /** 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;
    /** 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, Name name, Object value) throws
NamingException;

    /** 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.
    */
    public static void rebind(Context ctx, String name, Object value) throws
NamingException;
    /** 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.
    */
    public static void rebind(Context ctx, Name name, Object value) throws
NamingException;
}

> > I'm not sure if this is by spec though.  Are you not allowed to create a
> > heirarchy for the queue/topic names?  If I create transient topics, I
> > can do it if I pre-create the subcontexts.  So I know it 'works', I'm
> > just not sure it's legal.
> >
> > Also, is there some helper code somewhere in jboss to create a JNDI tree
> > already?  Or does everyone just roll there own with tokenizers or
> > something?
>
> I feel like I've seen 10 or twenty implementations of this, but its
> probably just 3 or 4;-)  They are often in Deployers.  Could we put one
> version in either DeployerMBeanSupport or ServiceMBeanSupport?
>
> David Jencks



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

Reply via email to