Package org.smooks.cartridges.routing
Class JNDIUtil
- java.lang.Object
-
- org.smooks.cartridges.routing.JNDIUtil
-
public final class JNDIUtil extends Object
JNDI utilities.- Author:
- tom.fennelly@jboss.com
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertiesgetDefaultProperties()static ContextgetNamingContext(Properties jndiProperties)Get the JNDI Context.static Objectlookup(String objectName, Properties jndiProperties)Lookup an object through the JNDI context.static Objectlookup(String objectName, Properties jndiProperties, ClassLoader[] classLoaders)Lookup an object through the JNDI context.
-
-
-
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- TheClassLoaders) to be used during the lookup.- Returns:
- The object.
- Throws:
NamingException- Error getting object.
-
getDefaultProperties
public static Properties getDefaultProperties()
-
-