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

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
All Implemented Interfaces:
Serializable, Cloneable, EventListener, Poolable, Recyclable, ContextBindingListener
Direct Known Subclasses:
ContextTool, MathTool, PathTool, TypeTool, VoidTool

public abstract class GlobalTool
extends PoolableSupport
implements ContextBindingListener, Cloneable, Serializable

An abstract global context tool implementing the ContextBindingListener interface and pooling itself when it is unbound from the context.

Version:
$Id: GlobalTool.java,v 1.9 2009/09/28 15:08:29 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Constructor Summary
GlobalTool()
          Constructs a new tool.
 
Method Summary
 Object clone()
           
 void dispose()
          Disposes the object by setting its disposed flag.
protected  TemplateContext getContext()
          Gets the target context.
protected  ContextToolFilter getContextToolFilter()
          Gets the context tool filter if available.
protected  MBeanServer getMBeanServer()
          Gets the current MBean server if available.
protected  boolean isBound()
          Gets the bound state.
 void nop()
          A no-operation method to discard return values from any tool extension.
 String toString()
          Converts the tool into a string.
 void valueBound(ContextBindingEvent event)
          Notifies the object that it is being bound to a context.
 void valueUnbound(ContextBindingEvent event)
          Notifies the object that it is being unbound from a context.
 
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

GlobalTool

public GlobalTool()
Constructs a new tool.

Method Detail

clone

public Object clone()
Overrides:
clone in class Object

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 RecyclableSupport

nop

public void nop()
A no-operation method to discard return values from any tool extension.


toString

public String toString()
Converts the tool into a string. For most tools, an empty string is a convenient result. Subclasses can implement more specific conversions.

Overrides:
toString in class Object
Returns:
an empty string.

valueBound

public void valueBound(ContextBindingEvent event)
Description copied from interface: ContextBindingListener
Notifies the object that it is being bound to a context.

Specified by:
valueBound in interface ContextBindingListener
Parameters:
event - the binding event.

valueUnbound

public void valueUnbound(ContextBindingEvent event)
Description copied from interface: ContextBindingListener
Notifies the object that it is being unbound from a context.

Specified by:
valueUnbound in interface ContextBindingListener
Parameters:
event - the binding event.

getContext

protected TemplateContext getContext()
Gets the target context.

Returns:
the context.

isBound

protected boolean isBound()
Gets the bound state.

Returns:
true if bound, otherwise false.

getMBeanServer

protected MBeanServer getMBeanServer()
Gets the current MBean server if available.

Returns:
the MBean server or null.

getContextToolFilter

protected ContextToolFilter getContextToolFilter()
Gets the context tool filter if available.

Returns:
the context filter or null.


Copyright © 2004 The Norther Organization. All rights reserved.