Class DirContextURLStreamHandler

  • Direct Known Subclasses:
    Handler

    public class DirContextURLStreamHandler
    extends URLStreamHandler
    Stream handler to a JNDI directory context.
    Version:
    $Revision: 1.3 $
    Author:
    Remy Maucherat
    • Field Detail

      • context

        protected DirContext context
        Directory context.
    • Constructor Detail

      • DirContextURLStreamHandler

        public DirContextURLStreamHandler()
      • DirContextURLStreamHandler

        public DirContextURLStreamHandler​(DirContext context)
    • Method Detail

      • setProtocolHandler

        public static void setProtocolHandler()
        Set the java.protocol.handler.pkgs system property.
      • isBound

        public static boolean isBound()
        Returns true if the thread or the context class loader of the current thread is bound.
      • bind

        public static void bind​(DirContext dirContext)
        Binds a directory context to a class loader.
      • unbind

        public static void unbind()
        Unbinds a directory context to a class loader.
      • bindThread

        public static void bindThread​(DirContext dirContext)
        Binds a directory context to a thread.
      • unbindThread

        public static void unbindThread()
        Unbinds a directory context to a thread.
      • get

        public static DirContext get()
        Get the bound context.
      • bind

        public static void bind​(ClassLoader cl,
                                DirContext dirContext)
        Binds a directory context to a class loader.
      • unbind

        public static void unbind​(ClassLoader cl)
        Unbinds a directory context to a class loader.
      • toExternalForm

        protected String toExternalForm​(URL u)
        Converts a URL of a specific protocol to a String. The impl of this method is almost identical to that of the java.net.URLStreamHandler superclass, except that it omits the URL's authority field from the URL's String representation.
        Overrides:
        toExternalForm in class URLStreamHandler
        Parameters:
        u - the URL.
        Returns:
        a string representation of the URL argument.