|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.interface21.jndi.JndiTemplate
Helper class that simplifies JNDI operations. It provides methods to lookup and bind, and allows implementations of the ContextCallback interface to perform any operation they like with a JNDI naming context provided.
This is the central class in this package. It is analogous to the JdbcTemplate class. This class performs all error handling.
ContextCallback,
JdbcTemplate| Field Summary | |
protected org.apache.commons.logging.Log |
logger
|
| Constructor Summary | |
JndiTemplate()
Create a new JndiTemplate instance. |
|
JndiTemplate(java.util.Properties environment)
Create a new JndiTemplate instance, using the given environment. |
|
| Method Summary | |
void |
bind(java.lang.String name,
java.lang.Object object)
Bind the given object to the current JNDI context, using the given name. |
protected javax.naming.Context |
createInitialContext()
Create a new initial context. |
java.lang.Object |
execute(ContextCallback contextCallback)
Execute the given callback implementation. |
java.util.Properties |
getEnvironment()
|
java.lang.Object |
lookup(java.lang.String name)
Lookup the object with the given name in the current JNDI context. |
void |
setEnvironment(java.util.Properties environment)
Set the environment for the InitialContext. |
void |
unbind(java.lang.String name)
Remove the binding for the given name from the current JNDI context. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected final org.apache.commons.logging.Log logger
| Constructor Detail |
public JndiTemplate()
public JndiTemplate(java.util.Properties environment)
| Method Detail |
public void setEnvironment(java.util.Properties environment)
public java.util.Properties getEnvironment()
public java.lang.Object lookup(java.lang.String name)
throws javax.naming.NamingException
name - JNDI name of the objectjavax.naming.NamingException - if there is no object with the given
name bound to JNDI
public void bind(java.lang.String name,
java.lang.Object object)
throws javax.naming.NamingException
name - JNDI name of the objectobject - object to bindjavax.naming.NamingException - thrown by JNDI, mostly name already bound
public void unbind(java.lang.String name)
throws javax.naming.NamingException
name - the JNDI name of the objectjavax.naming.NamingException - thrown by JNDI, mostly name not found
public java.lang.Object execute(ContextCallback contextCallback)
throws javax.naming.NamingException
contextCallback - ContextCallback implementationjavax.naming.NamingException - thrown by the callback implementation.
protected javax.naming.Context createInitialContext()
throws javax.naming.NamingException
javax.naming.NamingException - in case of initialization errors
|
[Deprecated API] | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | CURRENT API | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||