org.mentawai.filter
Class IoCFilter

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

public class IoCFilter
extends InputWrapper
implements Filter

Autowiring filter for IoC. This is basically a pull approach for IoC, in other words, if you don't ask for the component, it will not be instantiated. On the other hand, the PushIoCFilter (old IoCFilter) has a push approach, in other words, it will instantiate (according to scope) and place the object in the action input, even if you don't need it.

Author:
Davi Luan Carneiro

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
static int APPLICATION
           
static int REQUEST
           
static int SESSION
           
 
Fields inherited from interface org.mentawai.core.Input
DEFAULT_CHARSET
 
Constructor Summary
IoCFilter()
           
IoCFilter(Component comp, java.lang.String key)
           
IoCFilter(Component comp, java.lang.String key, int scope)
           
 
Method Summary
 void destroy()
          Gives a chance to the filter to deallocalte any resources before it is destroyed.
 java.lang.String filter(InvocationChain chain)
          Executes the filter.
 java.lang.Object getValue(java.lang.String key)
          Gets a parameter value (any object) with the given name.
 java.lang.String toString()
           
 
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, getFloat, getFloat, getFloatValue, getFloatValue, getHeader, getHeaderKeys, getInt, getInt, getInts, getIntValue, getIntValue, getIntValues, getLong, getLong, getLongValue, getLongValue, getObject, getObject, getObject, getObject, getProperty, getString, getStrings, getStringValue, getStringValues, hasValue, isEmpty, keys, keySet, put, putAll, remove, removeValue, setInput, setValue, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

REQUEST

public static final int REQUEST
See Also:
Constant Field Values

SESSION

public static final int SESSION
See Also:
Constant Field Values

APPLICATION

public static final int APPLICATION
See Also:
Constant Field Values
Constructor Detail

IoCFilter

public IoCFilter()

IoCFilter

public IoCFilter(Component comp,
                 java.lang.String key)

IoCFilter

public IoCFilter(Component comp,
                 java.lang.String key,
                 int scope)
Method Detail

filter

public java.lang.String filter(InvocationChain chain)
                        throws java.lang.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:
java.lang.Exception

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getValue

public java.lang.Object getValue(java.lang.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.


Copyright © 2005 Mentawai Team. All Rights Reserved.