org.krakenapps.filter
Interface Filter

All Known Implementing Classes:
ActiveFilter, DefaultFilter

public interface Filter

Filter is a message processing unit. Filter can receive various message types from binded filters and send messages to binded filters.

Since:
1.0.0
Author:
xeraph

Method Summary
 MessageSpec[] getInputMessageSpecs()
          Returns the input message specifications that can be bound to this filter.
 MessageSpec getOutputMessageSpec()
          Returns the output message specification that can be bound to this filter.
 java.lang.Object getProperty(java.lang.String key)
          Returns the value of specified property.
 java.util.Set<java.lang.String> getPropertyKeys()
          Returns a Set of the keys of properties.
 void process(Message message)
          Process a message object pushed from other filters.
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets the property.
 void unsetProperty(java.lang.String key)
          Removes the specified property.
 void validateConfiguration()
          Validates current configuration of the filter.
 

Method Detail

getInputMessageSpecs

MessageSpec[] getInputMessageSpecs()
Returns the input message specifications that can be bound to this filter.

Returns:
the input message specifications array. null or empty array if no types are supported

getOutputMessageSpec

MessageSpec getOutputMessageSpec()
Returns the output message specification that can be bound to this filter.

Returns:
the output message specification. null if no type is supported

process

void process(Message message)
Process a message object pushed from other filters. ActiveFilter usually queues incoming message in this method, rather than processes it synchronously.


getPropertyKeys

java.util.Set<java.lang.String> getPropertyKeys()
Returns a Set of the keys of properties.


getProperty

java.lang.Object getProperty(java.lang.String key)
Returns the value of specified property.

Parameters:
key - the name of the property
Returns:
the value of specified property

setProperty

void setProperty(java.lang.String key,
                 java.lang.Object value)
Sets the property.

Parameters:
key - the name of the property
value - the value of the property

unsetProperty

void unsetProperty(java.lang.String key)
Removes the specified property.

Parameters:
key - the name of the property

validateConfiguration

void validateConfiguration()
                           throws ConfigurationException
Validates current configuration of the filter.

Throws:
ConfigurationException - if failed to validate


Copyright © 2008-2009 Kraken Project. All Rights Reserved.