Class ShutdownHandlerTag
- java.lang.Object
-
- org.apache.commons.jelly.TagSupport
-
- net.sf.jguiraffe.gui.builder.di.tags.ShutdownHandlerTag
-
- All Implemented Interfaces:
org.apache.commons.jelly.Tag
public class ShutdownHandlerTag extends org.apache.commons.jelly.TagSupportA tag handler class that defines a shutdown script for a
BeanProvider.This tag can appear in the body of a
BeanTag. In its body an arbitrary number of tags derived fromInvocationTagcan be placed defining a set of operations to be performed when shutting down the corresponding singleton bean. All theses operations are added to aChainedInvocationobject, which will then become the shutdown handler of the singletonBeanProvidercreated by the hosting bean tag.Using this tag is an alternative to the
shutdownMethodattribute supported byBeanTag. With the attribute only a single, parameter-less method can be specified to be invoked on shutdown of the bean. This tag in contrast supports much more complex shutdown scripts: all tags producingInvokableobjects can be used. However, care must be taken with the dependencies used by the shutdown script. Because the owningBeanStoremay already been partly destroyed when the shutdown script is invoked, access to other beans living in the same bean store is not permitted. It is possible to invoke arbitrary methods on the bean managed by theBeanProvider(this bean is also the default target of the invocation, so all method invocations or property access operations per default have this object as target), set or query properties on it, or making use of script-local variables.This tag does not define any attributes. In its body the
InvocationTagobjects can be placed that make up the shutdown script.- Version:
- $Id: ShutdownHandlerTag.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description ShutdownHandlerTag()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoTag(org.apache.commons.jelly.XMLOutput output)Executes this tag.protected voidprocess()Performs the actual processing of this tag.protected voidprocessBeforeBody()Performs some processing of this tag before the body is evaluated.-
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
-
-
-
-
Method Detail
-
doTag
public void doTag(org.apache.commons.jelly.XMLOutput output) throws org.apache.commons.jelly.JellyTagExceptionExecutes this tag. This implementation delegates to theprocessBeforeBody()andprocess()methods.- Parameters:
output- the output object- Throws:
org.apache.commons.jelly.JellyTagException- if the tag is used incorrectly
-
processBeforeBody
protected void processBeforeBody() throws org.apache.commons.jelly.JellyTagExceptionPerforms some processing of this tag before the body is evaluated.- Throws:
org.apache.commons.jelly.JellyTagException- if the tag is used incorrectly
-
process
protected void process() throws org.apache.commons.jelly.JellyTagExceptionPerforms the actual processing of this tag. This method is called bydoTag()after the body has been evaluated.- Throws:
org.apache.commons.jelly.JellyTagException- if an error occurs
-
-