naming/src/main/java/org/jboss/as/naming/util/NamingUtils.java
public static void rebind(final Context ctx, final String name, final Object value) throws NamingException {
       final Name n = ctx.getNameParser("").parse(name);
       rebind(ctx, n, value);
    }
public static void rebind(final Context ctx, final String name, final Object value) throws NamingException {
       final Name n = ctx.getNameParser("").parse(name);
       rebind(ctx, n, value);
    }
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.
@throws NamingException for any error