|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.commons.jndi.beans.StandardDirContextFactory
public final class StandardDirContextFactory
A directory context factory that creates a new context every time one
is requested. Every time getContext is called, a new
DirContext is created, using the JNDI environment
specified in a previous call to setJNDIEnv.
Note that setJNDIEnv must be used to initialize this
factory before passing it to the
JNDIBeanStoreFactory.newBeanStore(DirContextFactory) method.
Use of this factory is likely to cause unnecessary communication overhead
in practice, so using FixedDirContextFactory is generally
a better choice.
FixedDirContextFactory| Constructor Summary | |
|---|---|
StandardDirContextFactory()
|
|
| Method Summary | |
|---|---|
void |
close()
Indicates that the JNDIBeanStore using this factory
has been closed down. |
DirContext |
getContext()
Creates a new DirContext. |
Properties |
getJNDIEnv()
Returns the JNDI environment that is being used to create new DirContext instances. |
void |
returnContext(DirContext ctx)
Closes the specified DirContext. |
void |
setJNDIEnv(Properties jndiEnv)
Sets the JNDI environment to use to create new DirContext
instances. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StandardDirContextFactory()
| Method Detail |
|---|
public Properties getJNDIEnv()
DirContext instances.
InitialDirContext.InitialDirContext(java.util.Hashtable)public void setJNDIEnv(Properties jndiEnv)
DirContext
instances.
jndiEnv - The environment that will be passed to the
InitialDirContext.InitialDirContext(java.util.Hashtable)
method.
public DirContext getContext()
throws NamingException
DirContext. The JNDI environment
previously set via the setJNDIEnv method is used
to create the new context.
getContext in interface DirContextFactoryNamingException - If a DirContext could not be
established for any reason.setJNDIEnv(java.util.Properties)
public void returnContext(DirContext ctx)
throws NamingException
DirContext. As this factory
always produces a brand new context, this method closes
any context that is no longer being used.
returnContext in interface DirContextFactoryctx - The context that is no longer in use.
NamingException - If there was a problem cleaning up the
context.Context.close()public void close()
DirContextFactoryJNDIBeanStore using this factory
has been closed down. An implementation should free up any
resources it is using.
close in interface DirContextFactoryJNDIBeanStore.close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||