|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DirContextFactory
A factory interface for creating DirContext instances.
An object implementing this interface can be passed to the
JNDIBeanStoreFactory.newBeanStore(DirContextFactory) method,
which creates a new JNDIBeanStore instance. The
JNDIBeanStore will then use the provided
DirContextFactory whenever it needs a DirContext.
Factories are usually configured in JavaBeans style. Therefore, implementations
of this interface should provide a public no-arg constructor, along
with property setter methods to allow the instance to be configured.
These property setters must be used to configure factories
before passing them to the
JNDIBeanStoreFactory.newBeanStore method.
Within a single instance of JNDIBeanStore,
calls to the getContext and returnContext methods
will always be paired. Therefore, getContext is called first,
and is always followed by a later call to returnContext.
The close method is called by the
JNDIBeanStore.close() method, and
can be used by a factory to perform cleanup.
Note that this interface is not designed with concurrent access in mind.
Therefore, a factory instance should only ever be used with a single
JNDIBeanStore instance. Implementations of this interface
should expect to only be called by one thread at a time.
JNDIBeanStoreFactory,
JNDIBeanStore,
DirContext| Method Summary | |
|---|---|
void |
close()
Indicates that the JNDIBeanStore using this factory
has been closed down. |
DirContext |
getContext()
Returns a DirContext instance that is ready for use. |
void |
returnContext(DirContext ctx)
Called to indicate that a DirContext previously
provided by this factory is no longer needed. |
| Method Detail |
|---|
DirContext getContext()
throws NamingException
DirContext instance that is ready for use.
The object returned by this method will always be passed back
as a parameter to the returnContext method.
NamingException - If a DirContext could not be
established for any reason.returnContext(javax.naming.directory.DirContext)
void returnContext(DirContext ctx)
throws NamingException
DirContext previously
provided by this factory is no longer needed.
ctx - The DirContext previously returned by
the getContext method.
NamingException - If there was a problem cleaning up the
context.getContext()
void close()
throws NamingException
JNDIBeanStore using this factory
has been closed down. An implementation should free up any
resources it is using.
NamingException - If there was a problem when freeing resources.JNDIBeanStore.close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||