org.apache.naming.resources

Class DirContextURLStreamHandler

public class DirContextURLStreamHandler extends URLStreamHandler

Stream handler to a JNDI directory context.

Version: $Revision: 467222 $

Author: Remy Maucherat

Field Summary
protected DirContextcontext
Directory context.
Constructor Summary
DirContextURLStreamHandler()
DirContextURLStreamHandler(DirContext context)
Method Summary
static voidbind(DirContext dirContext)
Binds a directory context to a class loader.
static voidbind(ClassLoader cl, DirContext dirContext)
Binds a directory context to a class loader.
static voidbindThread(DirContext dirContext)
Binds a directory context to a thread.
static DirContextget()
Get the bound context.
static DirContextget(ClassLoader cl)
Get the bound context.
static DirContextget(Thread thread)
Get the bound context.
static booleanisBound()
Returns true if the thread or the context class loader of the current thread is bound.
protected URLConnectionopenConnection(URL u)
Opens a connection to the object referenced by the URL argument.
static voidsetProtocolHandler()
Set the java.protocol.handler.pkgs system property.
protected StringtoExternalForm(URL u)
Override as part of the fix for 36534, to ensure toString is correct.
static voidunbind()
Unbinds a directory context to a class loader.
static voidunbind(ClassLoader cl)
Unbinds a directory context to a class loader.
static voidunbindThread()
Unbinds a directory context to a thread.

Field Detail

context

protected DirContext context
Directory context.

Constructor Detail

DirContextURLStreamHandler

public DirContextURLStreamHandler()

DirContextURLStreamHandler

public DirContextURLStreamHandler(DirContext context)

Method Detail

bind

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

bind

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

bindThread

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

get

public static DirContext get()
Get the bound context.

get

public static DirContext get(ClassLoader cl)
Get the bound context.

get

public static DirContext get(Thread thread)
Get the bound context.

isBound

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

openConnection

protected URLConnection openConnection(URL u)
Opens a connection to the object referenced by the URL argument.

setProtocolHandler

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

toExternalForm

protected String toExternalForm(URL u)
Override as part of the fix for 36534, to ensure toString is correct.

unbind

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

unbind

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

unbindThread

public static void unbindThread()
Unbinds a directory context to a thread.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.