Class NamingUtil


  • public class NamingUtil
    extends java.lang.Object
    Naming Utility Methods
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Logger __log
      Deprecated.
      no replacement, use a logger-per-class idiom instead.
    • Constructor Summary

      Constructors 
      Constructor Description
      NamingUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.naming.Context bind​(javax.naming.Context ctx, java.lang.String nameStr, java.lang.Object obj)
      Bind an object to a context ensuring all sub-contexts are created if necessary
      static java.util.Map flattenBindings​(javax.naming.Context ctx, java.lang.String name)
      Do a deep listing of the bindings for a context.
      static void unbind​(javax.naming.Context ctx)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • __log

        @Deprecated
        public static final Logger __log
        Deprecated.
        no replacement, use a logger-per-class idiom instead.
    • Constructor Detail

      • NamingUtil

        public NamingUtil()
    • Method Detail

      • bind

        public static javax.naming.Context bind​(javax.naming.Context ctx,
                                                java.lang.String nameStr,
                                                java.lang.Object obj)
                                         throws javax.naming.NamingException
        Bind an object to a context ensuring all sub-contexts are created if necessary
        Parameters:
        ctx - the context into which to bind
        nameStr - the name relative to context to bind
        obj - the object to be bound
        Returns:
        the bound context
        Throws:
        javax.naming.NamingException - if an error occurs
      • unbind

        public static void unbind​(javax.naming.Context ctx)
                           throws javax.naming.NamingException
        Throws:
        javax.naming.NamingException
      • flattenBindings

        public static java.util.Map flattenBindings​(javax.naming.Context ctx,
                                                    java.lang.String name)
                                             throws javax.naming.NamingException
        Do a deep listing of the bindings for a context.
        Parameters:
        ctx - the context containing the name for which to list the bindings
        name - the name in the context to list
        Returns:
        map: key is fully qualified name, value is the bound object
        Throws:
        javax.naming.NamingException - if unable to flatten bindings