|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.da2.DAExchange
public class DAExchange
Used to exchange GenericDA's among friends.
The share(Class, GenericDA) method is called to offer up
a DA for others to use.
The getDA(Class, long) method is called to search for a DA
previously shared and/or to wait for it to be shared (the msTimeout
value is use to limit the amount of time that can be spent waiting).
This class can be used as a way to have several DA implementations attempt to be simultaneously simultaneously initialized—even if some DA implementations depend on other DA implementations (as long as there isn't a circular dependence!)
| Constructor Summary | |
|---|---|
DAExchange()
|
|
| Method Summary | ||
|---|---|---|
DASource |
createDASourceView()
Creates a lightweight view of the DAExchange
as a DASource. |
|
|
getDA(Class<T> daInterfaceType,
long msTimeout)
Returns a DA of the specified daInterfaceType potentially waiting for it to become available. |
|
void |
share(Class<? extends GenericDA> daInterfaceType,
GenericDA daImplementation)
Called to share the specified DA type and implementation. |
|
void |
shutdown()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DAExchange()
| Method Detail |
|---|
public void share(Class<? extends GenericDA> daInterfaceType,
GenericDA daImplementation)
throws DAException
daInterfaceType - the DA interface type to offer up for sharing.daImplementation - the implementation of the specified interface
type.
DAException
public <T extends GenericDA> T getDA(Class<T> daInterfaceType,
long msTimeout)
throws NotYetAvailableDAException,
DAException
daInterfaceType - the DA type to search for (or wait for).msTimeout - the maximum number of milliseconds to wait for the
DA to become available.
NotYetAvailableDAException - if the requested DA is still not
available after waiting for the specified timeout. Calling this
method again might be successful.
DAException - if something else goes wrong.public void shutdown()
public DASource createDASourceView()
throws ShutdownDAException
DAExchange
as a DASource. Calling shutdown() on this DASource
will also shutdown the DAExchange.
ShutdownDAException - if this has already been shutdown
|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||