org.milyn.util
Class JNDIUtil

java.lang.Object
  extended by org.milyn.util.JNDIUtil

public class JNDIUtil
extends Object

JNDI utilities.

Author:
tom.fennelly@jboss.com

Method Summary
static Properties getDefaultProperties()
           
static Context getNamingContext(Properties jndiProperties)
          Get the JNDI Context.
static Object lookup(String objectName, Properties jndiProperties)
          Lookup an object through the JNDI context.
static Object lookup(String objectName, Properties jndiProperties, ClassLoader[] classLoaders)
          Lookup an object through the JNDI context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNamingContext

public static Context getNamingContext(Properties jndiProperties)
                                throws NamingException
Get the JNDI Context.

Don't forget to close it when done!

Parameters:
jndiProperties - JNDI properties.
Returns:
The context.
Throws:
NamingException - Error getting context.

lookup

public static Object lookup(String objectName,
                            Properties jndiProperties)
                     throws NamingException
Lookup an object through the JNDI context.

Parameters:
objectName - The name of the object to be looked up.
jndiProperties - JNDI properties.
Returns:
The object.
Throws:
NamingException - Error getting object.

lookup

public static Object lookup(String objectName,
                            Properties jndiProperties,
                            ClassLoader[] classLoaders)
                     throws NamingException
Lookup an object through the JNDI context.

Parameters:
objectName - The name of the object to be looked up.
jndiProperties - JNDI properties.
classLoaders - The {@link ClassLoader ClassLoaders) to be used during the lookup.
Returns:
The object.
Throws:
NamingException - Error getting object.

getDefaultProperties

public static Properties getDefaultProperties()


Copyright © 2018. All rights reserved.