|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jade.core.Filter
Base class for command filters, that allow to
set up an open-ended chain of platform services to process commands
coming from the upper JADE layers. Filters process commands when
their accept()
method and postProcess
methods are invoked; Filters in the filter chain are nested.
The accept()
method is called before the command is
processed by successive filters in the chain. It should be used
to take proper actions before the command consumption. On the other hand
the postProcess()
method is called after the command
has been processed by successive filters in the chain. It should be used
to take proper actions after the command consumption.
jade.core.CommandProcessor
Field Summary | |
static int |
FIRST
The constant indicating the first position in the filter chain |
static boolean |
INCOMING
A constant indicating a filter for incoming commands |
static int |
LAST
The constant indicating the last position in the filter chain |
static boolean |
OUTGOING
A constant indicating a filter for outgoing commands |
Constructor Summary | |
Filter()
|
Method Summary | |
protected boolean |
accept(VerticalCommand cmd)
Process a command before it is processed by successive filters in the filter-chain. |
int |
getPreferredPosition()
Retrieve the preferred position for this filter in the filter chain |
boolean |
isBlocking()
Inquires the blocking state of this filter. |
boolean |
isSkipping()
Inquires the skipping state of this filter. |
protected void |
postProcess(VerticalCommand cmd)
Post-process a command object after it has been processed by the successive filters in the filter chain. |
void |
setBlocking(boolean newState)
Sets the blocking state of this filter. |
void |
setPreferredPosition(int pos)
Sets the preferred position for this filter in the filter chain |
void |
setSkipping(boolean newState)
Sets the skipping state of this filter. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int FIRST
public static final int LAST
public static final boolean INCOMING
public static final boolean OUTGOING
Constructor Detail |
public Filter()
Method Detail |
protected boolean accept(VerticalCommand cmd)
cmd
- A VerticalCommand
describing what operation has
been requested from previous layers (that can be the actual
prime source of the command or previous filters in the chain).
false
from this method. A vetoed command
is not propagated in the filter chain.protected void postProcess(VerticalCommand cmd)
cmd
- A VerticalCommand
describing what operation has
been requested from previous layers (that can be the actual
prime source of the command or previous filters in the chain).public final int getPreferredPosition()
public final void setPreferredPosition(int pos)
public void setBlocking(boolean newState)
newState
- The boolean value to set the blocking state to.public boolean isBlocking()
public void setSkipping(boolean newState)
public boolean isSkipping()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |