edu.uci.isr.yancees.filter
Class AbstractFilter

java.lang.Object
  extended by edu.uci.isr.yancees.filter.AbstractFilter
All Implemented Interfaces:
FilterInterface
Direct Known Subclasses:
AbstractFilterManager.ResponseCollectorFilter, GenericFilter

public abstract class AbstractFilter
extends java.lang.Object
implements FilterInterface

Implements an abstract filter with the basic functionality to the methods of the FilterInterface


Constructor Summary
AbstractFilter()
          constructor
 
Method Summary
 void addSuccessor(FilterInterface filter)
          Adds a successor to the list of filters of this filter
protected abstract  EventInterface[] doFilterEvent(EventInterface evt)
          This method should be implemented by the subclasses of the AbstractFilter in order to process the messages being passed through this filter.
protected abstract  EventInterface[] doFilterEventList(EventInterface[] evtList)
          This method should be implemented by the subclasses of the AbstractFilter in order to process the messages being passed through this filter.
 java.lang.String getName()
           
 FilterInterface getSuccessor()
          list all the successors of this filters if any
 void handleMessage(EventInterface evt)
          Handles the incomming message and passes it forward to all the successors of this filter
 void handleMessage(EventInterface[] evtList)
          Handles the incomming message and passes it forward to all the successors of this filter
 void removeSuccessor()
          Remove a filter from the list of successors from this filter
 void setName(java.lang.String name)
          sets the name of this filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFilter

public AbstractFilter()
constructor

Method Detail

handleMessage

public void handleMessage(EventInterface evt)
Handles the incomming message and passes it forward to all the successors of this filter

Specified by:
handleMessage in interface FilterInterface
Parameters:
evt - is the event to process
See Also:
yancees.filter.FilterInterface#handleMessage(yancees.core.MessageInterface)

handleMessage

public void handleMessage(EventInterface[] evtList)
Handles the incomming message and passes it forward to all the successors of this filter

Specified by:
handleMessage in interface FilterInterface
Parameters:
evtList - is the list of events to process
See Also:
yancees.filter.FilterInterface#handleMessage(yancees.core.MessageInterface)

doFilterEvent

protected abstract EventInterface[] doFilterEvent(EventInterface evt)
This method should be implemented by the subclasses of the AbstractFilter in order to process the messages being passed through this filter. A filter uses this method to receive the message and process it. The filter must then select which events to let go to the next filter or subscriber. These events are returned in the method.

Parameters:
evt - is the event to be filtered
Returns:
is the list of events resulted from the filtering

doFilterEventList

protected abstract EventInterface[] doFilterEventList(EventInterface[] evtList)
This method should be implemented by the subclasses of the AbstractFilter in order to process the messages being passed through this filter. A filter uses this method to receive the message and process it. The filter must then select which events to let go to the next filter or subscriber. These events are returned in the method.

Parameters:
evtList - is a list of events to be filtered as a "burst"
Returns:
is the list of events resulted from the filtering

addSuccessor

public void addSuccessor(FilterInterface filter)
Adds a successor to the list of filters of this filter

Specified by:
addSuccessor in interface FilterInterface
Parameters:
filter - is the next filter to receive the message
See Also:
yancees.filter.FilterInterface#addSucessor(yancees.filter.FilterInterface)

removeSuccessor

public void removeSuccessor()
Remove a filter from the list of successors from this filter

Specified by:
removeSuccessor in interface FilterInterface
See Also:
yancees.filter.FilterInterface#removeSucessor(yancees.filter.FilterInterface)

getSuccessor

public FilterInterface getSuccessor()
list all the successors of this filters if any

Specified by:
getSuccessor in interface FilterInterface
Returns:
a list of filgers or an empty list if no successors are registered
See Also:
yancees.filter.FilterInterface#getSucessorsList()

getName

public java.lang.String getName()
Specified by:
getName in interface FilterInterface
Returns:
the name of this filter
See Also:
yancees.filter.FilterInterface#getName()

setName

public void setName(java.lang.String name)
Description copied from interface: FilterInterface
sets the name of this filter

Specified by:
setName in interface FilterInterface