org.norther.tammi.spray.engine.tool
Class ContextTool

java.lang.Object
  extended by org.norther.tammi.core.pool.RecyclableSupport
      extended by org.norther.tammi.core.pool.PoolableSupport
          extended by org.norther.tammi.spray.engine.tool.GlobalTool
              extended by org.norther.tammi.spray.engine.tool.ContextTool
All Implemented Interfaces:
Serializable, Cloneable, EventListener, Poolable, Recyclable, ContextBindingListener
Direct Known Subclasses:
ChainTool, ChartTool, ContentTool, FlowTool, JavaTool, MediaTool, UserTool

public abstract class ContextTool
extends GlobalTool

An abstract request context tool extending the global tool.

Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
ContextTool()
          Contructs a new tool.
 
Method Summary
 void dispose()
          Disposes the object by setting its disposed flag.
protected  Filter getFilter(Class clazz)
          Gets the first specific filter from the filter chain.
protected  HttpFilterChain getFilterChain()
          Gets the current filter chain if available.
protected  String getFilterKey(Class clazz)
          Gets the key of the first specific key filter from the filter chain.
protected  Principal getPrincipal()
          Gets the current principal if available.
protected  ServletRequest getRequest()
          Gets the current request if available.
protected  ServletResponse getResponse()
          Gets the current response if available.
protected  boolean isFilterChanged()
          Checks whether the current filter has changed since the previous check.
 
Methods inherited from class org.norther.tammi.spray.engine.tool.GlobalTool
clone, getContext, getContextToolFilter, getMBeanServer, getName, isBound, nop, toString, valueBound, valueUnbound
 
Methods inherited from class org.norther.tammi.core.pool.PoolableSupport
disposed, recycled
 
Methods inherited from class org.norther.tammi.core.pool.RecyclableSupport
isDisposed, recycle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.core.pool.Recyclable
isDisposed, recycle
 

Constructor Detail

ContextTool

public ContextTool()
Contructs a new tool.

Method Detail

dispose

public void dispose()
Description copied from class: RecyclableSupport
Disposes the object by setting its disposed flag.

Specified by:
dispose in interface Recyclable
Overrides:
dispose in class GlobalTool

getRequest

protected ServletRequest getRequest()
Gets the current request if available.

Returns:
the request or null.

getResponse

protected ServletResponse getResponse()
Gets the current response if available.

Returns:
the response or null.

getFilterChain

protected HttpFilterChain getFilterChain()
Gets the current filter chain if available.

Returns:
the filter chain or null.

getPrincipal

protected Principal getPrincipal()
Gets the current principal if available.

Returns:
the filter chain or null.

getFilter

protected Filter getFilter(Class clazz)
Gets the first specific filter from the filter chain.

Parameters:
clazz - the class or interface of the filter.
Returns:
the found filter or null.

getFilterKey

protected String getFilterKey(Class clazz)
Gets the key of the first specific key filter from the filter chain.

Parameters:
clazz - the class or interface of the key filter.
Returns:
the found key.

isFilterChanged

protected boolean isFilterChanged()
Checks whether the current filter has changed since the previous check.

Returns:
true if changed, false otherwise.


Copyright © 2004 The Norther Organization. All rights reserved.