org.mentawai.filter
Class ConnectionFilter

java.lang.Object
  extended by org.mentawai.core.InputWrapper
      extended by org.mentawai.filter.ConnectionFilter
All Implemented Interfaces:
Map, AfterConsequenceFilter, Filter, Input

public class ConnectionFilter
extends InputWrapper
implements AfterConsequenceFilter

Author:
Sergio Oliveira

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static String KEY
           
 
Constructor Summary
ConnectionFilter(ConnectionHandler connHandler)
           
ConnectionFilter(ConnectionHandler connHandler, String connKey)
           
ConnectionFilter(String connKey, ConnectionHandler connHandler)
           
 
Method Summary
 void afterConsequence(Action action, Consequence c, boolean conseqExecuted, boolean actionExecuted, String result)
           
 void destroy()
          Gives a chance to the filter to deallocalte any resources before it is destroyed.
 String filter(InvocationChain chain)
          Executes the filter.
 Object getValue(String key)
          Gets a parameter value (any object) with the given name.
 void setKey(String key)
           
 
Methods inherited from class org.mentawai.core.InputWrapper
clear, containsKey, containsValue, entries, entrySet, get, getBoolean, getBoolean, getBooleanValue, getBooleanValue, getDate, getDate, getDate, getDouble, getDouble, getDoubleValue, getDoubleValue, getEnum, getEnums, getFloat, getFloat, getFloatValue, getFloatValue, getHeader, getHeaderKeys, getInt, getInt, getInts, getIntValue, getIntValue, getIntValues, getLong, getLong, getLongs, getLongValue, getLongValue, getObject, getObject, getProperty, getRoot, getString, getStrings, getStringValue, getStringValues, has, hasValue, inject, inject, isEmpty, keys, keySet, put, putAll, remove, removeInput, removeValue, setInput, setValue, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

KEY

public static final String KEY
See Also:
Constant Field Values
Constructor Detail

ConnectionFilter

public ConnectionFilter(String connKey,
                        ConnectionHandler connHandler)

ConnectionFilter

public ConnectionFilter(ConnectionHandler connHandler)

ConnectionFilter

public ConnectionFilter(ConnectionHandler connHandler,
                        String connKey)
Method Detail

setKey

public void setKey(String key)

filter

public String filter(InvocationChain chain)
              throws Exception
Description copied from interface: Filter
Executes the filter.

Specified by:
filter in interface Filter
Parameters:
chain - The InvocationChain for the action this filter is being applied to.
Returns:
The result of the filter or the action the filter is being applied to.
Throws:
Exception

afterConsequence

public void afterConsequence(Action action,
                             Consequence c,
                             boolean conseqExecuted,
                             boolean actionExecuted,
                             String result)
Specified by:
afterConsequence in interface AfterConsequenceFilter

getValue

public Object getValue(String key)
Description copied from interface: Input
Gets a parameter value (any object) with the given name.

Specified by:
getValue in interface Input
Overrides:
getValue in class InputWrapper
Parameters:
key - the name of the parameter
Returns:
the parameter value (any object) or null if it doesn't exist.

destroy

public void destroy()
Description copied from interface: Filter
Gives a chance to the filter to deallocalte any resources before it is destroyed. This is called when the web application is stopped, in other words, this has nothing to do with garbage collection.

Specified by:
destroy in interface Filter


Copyright © 2013. All Rights Reserved.