|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.commons.jndi.beans.FixedDirContextFactory
public final class FixedDirContextFactory
A directory context factory that always produces the same context
instance. This approach minimizes the cost of creating a new context,
as this is only done once. Use of this class assumes that a context
will remain valid for the entire life of the JNDIBeanStore
object that is using this factory.
There are two ways to configure this factory. Either provide a
pre-existing context directly via the
setContext(javax.naming.directory.DirContext) method,
or provide a JNDI environment to the
setJNDIEnv(java.util.Properties) method.
JNDIBeanStore| Constructor Summary | |
|---|---|
FixedDirContextFactory()
|
|
| Method Summary | |
|---|---|
void |
close()
Closes this factory's directory context. |
DirContext |
getContext()
Returns the directory context previously established by either the setJNDIEnv or setContext methods. |
void |
returnContext(DirContext ctx)
Called to indicate that a DirContext previously
provided by this factory is no longer needed. |
void |
setContext(DirContext ctx)
Sets the directory context to be returned by this factory. |
void |
setJNDIEnv(Properties props)
Sets the JNDI environment to use to create this factory's context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FixedDirContextFactory()
| Method Detail |
|---|
public void setJNDIEnv(Properties props)
throws NamingException
getContext. If this method is called, the
setContext method should not be called.
props - A JNDI environment.
NamingException - If the DirContext could not
be created.InitialDirContext.InitialDirContext(java.util.Hashtable),
getContext()public void setContext(DirContext ctx)
setJNDIEnv method shoudl
not be called.
public DirContext getContext()
setJNDIEnv or setContext methods.
getContext in interface DirContextFactoryDirContextFactory.returnContext(javax.naming.directory.DirContext)public void returnContext(DirContext ctx)
DirContextFactoryDirContext previously
provided by this factory is no longer needed.
returnContext in interface DirContextFactoryctx - The DirContext previously returned by
the getContext method.DirContextFactory.getContext()
public void close()
throws NamingException
close in interface DirContextFactoryNamingException - If an exception is thrown by the
DirContext.close metohd.Context.close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||