|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.perfectjpattern.core.behavioral.chainofresponsibility.OnlyOneHandleStrategy
public final class OnlyOneHandleStrategy
Concrete implementation of IChainStrategy
that allows
only one IHandler
to handle the given request then stops the
processing of the chain.
OnlyOneHandleStrategy
is stateless, reentrant and a Singleton
therefore it may not be directly instantiated, neither it may be extended.
Method Summary | |
---|---|
static IChainStrategy |
getInstance()
Returns Singleton instance of OnlyOneHandlesStrategy . |
void |
process(IHandler<Object> aHandler,
Object aRequest)
Defines the decision-logic regarding handling and forwarding of the requests. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static IChainStrategy getInstance()
OnlyOneHandlesStrategy
.
OnlyOneHandlesStrategy
.public void process(IHandler<Object> aHandler, Object aRequest)
process
in interface IChainStrategy
aHandler
- Chain of Responsibility IHandler instance.aRequest
- Request to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |