|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.spif.StoreChain | +--net.sf.spif.StoreDispatcher
A StoreChain which dispatches requests to the correct chain dependent upon object type. A StoreDispatcher can have multiple chains. It will forward to the chain it deems appropriate.
This type of chain will enable you to implements StoreChain
chains
that represents tree structures.
StoreDispatcher /\ LegacyPerson / \ All other types LegacyEmployee / \ / \ LegacyStore StorePersister | StoreDispatcher /\ / \ LegacyEmployee / \ LegacayPerson / \ / \ DB2Store ISAMStore
Note that the tree structure can be introduced at any level.
Currently, only one chain per type
is supported, which means that StoreDispatcher
will only dispatch to
one StoreChain
.
Field Summary |
Fields inherited from class net.sf.spif.StoreChain |
chained |
Constructor Summary | |
StoreDispatcher()
|
Method Summary | |
StoreChain |
getChained(Id id)
Get the chain for the appropriate id type |
protected StoreChain |
getStoreChainInstance(java.lang.Class clazz)
Retrieve the StoreChain instance for the given type (class). |
void |
setChained(java.lang.Class clazz,
StoreChain chain)
Sets a chained store for a particular type. |
java.lang.String |
toString()
String representation for debugging purposes. |
Methods inherited from class net.sf.spif.StoreChain |
clear, equals, get, getChained, getChained, hashCode, put, remove, setChained |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public StoreDispatcher()
Method Detail |
public StoreChain getChained(Id id)
getChained
in class StoreChain
id
- the id to return the chain of, or null to return the default chain.
Note that all implementations are required to return a sensible chain
given null.
Id.getType()
,
StoreDispatcher
public void setChained(java.lang.Class clazz, StoreChain chain)
setChained(java.lang.Class, net.sf.spif.StoreChain)
).
clazz
- the type this store should handlechain
- the store chain which handles this type,
or null to use the default chain for this typeprotected StoreChain getStoreChainInstance(java.lang.Class clazz)
StoreChain
instance for the given type (class).
clazz
- the type from which the StoreChain is related to.
StoreChain
valuepublic java.lang.String toString()
toString
in class java.lang.Object
String
value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |