Top Description Fields Constructors Methods
org.eclipse.jetty.util.jndi

public Class NamingUtil

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, javax.naming.Binding, .Context, .Name, .NameNotFoundException, .NameParser, .NamingEnumeration, .NamingException, org.slf4j.Logger, .LoggerFactory

Naming Utility Methods

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Context

Returns:

the bound context
bind
(Context
the context into which to bind
ctx
,
String
the name relative to context to bind
nameStr
,
Object
the object to be bound
obj
)

Bind an object to a context ensuring all sub-contexts are created if necessary

public static Map<String, Object>

Returns:

map: key is fully qualified name, value is the bound object
flattenBindings
(Context
the context containing the name for which to list the bindings
ctx
,
String
the name in the context to list
name
)

Do a deep listing of the bindings for a context.

public static void
public static void
unbind(Context context, String name, boolean deep)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Logger LOG

Constructor Detail

NamingUtilback to summary
public NamingUtil()

Method Detail

bindback to summary
public static Context bind(Context ctx, String nameStr, Object obj) throws NamingException

Bind an object to a context ensuring all sub-contexts are created if necessary

Parameters
ctx:Context

the context into which to bind

nameStr:String

the name relative to context to bind

obj:Object

the object to be bound

Returns:Context

the bound context

Exceptions
NamingException:
if an error occurs
flattenBindingsback to summary
public static Map<String, Object> flattenBindings(Context ctx, String name) throws NamingException

Do a deep listing of the bindings for a context.

Parameters
ctx:Context

the context containing the name for which to list the bindings

name:String

the name in the context to list

Returns:Map<String, Object>

map: key is fully qualified name, value is the bound object

Exceptions
NamingException:
if unable to flatten bindings
unbindback to summary
public static void unbind(Context ctx) throws NamingException
unbindback to summary
public static void unbind(Context context, String name, boolean deep) throws NamingException