|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xcmis.search.content.interceptors.AbstractVisitor
org.xcmis.search.content.interceptors.CommandInterceptor
public class CommandInterceptor
This is the base class for all interceptors to extend, and implements the
Visitor interface allowing it to intercept invocations on
VisitableCommands.
handleDefault(InvocationContext , VisitableCommand) which is the
default behaviour of any visit method, as defined in
AbstractVisitor.handleDefault(InvocationContext , VisitableCommand).
The preferred approach is to override the specific visitXXX() methods that
are of interest rather than to override
handleDefault(InvocationContext , VisitableCommand) and then write a
series of if statements or a switch block, if command-specific behaviour is
needed.
| Constructor Summary | |
|---|---|
CommandInterceptor()
|
|
| Method Summary | |
|---|---|
CommandInterceptor |
getNext()
Retrieves the next interceptor in the chain. |
protected Object |
handleDefault(InvocationContext ctx,
VisitableCommand command)
The default behaviour of the visitXXX methods, which is to ignore the call and pass the call up to the next interceptor in the chain. |
boolean |
hasNext()
|
Object |
invokeNextInterceptor(InvocationContext ctx,
VisitableCommand command)
Invokes the next interceptor in the chain. |
void |
setNext(CommandInterceptor next)
Sets the next interceptor in the chain to the interceptor passed in. |
void |
start()
|
void |
stop()
|
| Methods inherited from class org.xcmis.search.content.interceptors.AbstractVisitor |
|---|
visitChildEntriesCommand, visitExecuteSelectorCommand, visitGetContentEntryCommand, visitGetUnfiledEntriesCommand, visitModifyIndexCommand, visitProcessQueryCommand |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandInterceptor()
| Method Detail |
|---|
public CommandInterceptor getNext()
public boolean hasNext()
public void setNext(CommandInterceptor next)
next - next interceptor in the chain.
public Object invokeNextInterceptor(InvocationContext ctx,
VisitableCommand command)
throws Throwable
ctx - invocation contextcommand - command to pass up the chain.
Throwable - in the event of problems
protected Object handleDefault(InvocationContext ctx,
VisitableCommand command)
throws Throwable
handleDefault in class AbstractVisitorctx - invocation contextcommand - command to invoke
Throwable - in the event of problemspublic void start()
start in interface StartableStartable.start()public void stop()
stop in interface StartableStartable.stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||