org.mentawai.filter
Class PushConnectionFilter

java.lang.Object
  extended by org.mentawai.filter.PushConnectionFilter
All Implemented Interfaces:
Filter

public class PushConnectionFilter
extends Object
implements Filter

A filter to serve a ready-to-use database connection to its actions.

Author:
Sergio Oliveira

Field Summary
static String KEY
          The default key name to use when placing the connection in the action input.
 
Constructor Summary
PushConnectionFilter(ConnectionHandler connHandler)
          Creates a ConnectionFilter with the given ConnectionHandler.
PushConnectionFilter(ConnectionHandler connHandler, String conn_key)
          Creates a ConnectionFilter with the given ConnectionHandler and connection key.
 
Method Summary
 void destroy()
          Gives a chance to the filter to deallocalte any resources before it is destroyed.
 String filter(InvocationChain chain)
          Executes the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
The default key name to use when placing the connection in the action input.

See Also:
Constant Field Values
Constructor Detail

PushConnectionFilter

public PushConnectionFilter(ConnectionHandler connHandler)
Creates a ConnectionFilter with the given ConnectionHandler.

Parameters:
connHandler - The connection handler to use for this filter.

PushConnectionFilter

public PushConnectionFilter(ConnectionHandler connHandler,
                            String conn_key)
Creates a ConnectionFilter with the given ConnectionHandler and connection key. This key will be used to place the connection in the action input.

Parameters:
connHandler - The connection handler to use for this filter.
conn_key - The name of the key to use when placing the connection in the action input.
Method Detail

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

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.