org.jboss.soa.esb.actions
Class AbstractSpringAction

java.lang.Object
  extended by org.jboss.soa.esb.actions.AbstractActionLifecycle
      extended by org.jboss.soa.esb.actions.AbstractSpringAction
All Implemented Interfaces:
ActionLifecycle

public abstract class AbstractSpringAction
extends AbstractActionLifecycle
implements ActionLifecycle

Abstract class for Actions that makes calls to Spring beans.

Usage :
 <action name="sayHello" class="xyx.com.SimpleSpringAction" process="process">
     <property name="springContextXml" value="spring-context1.xml, spring-context2.xml"/>
 </action>
 

Description of configuration properties:

Author:
James Williams., Daniel Bevenius

Field Summary
protected  ConfigTree configTree
          configuration object
 
Constructor Summary
AbstractSpringAction()
          Deprecated. Use AbstractSpringAction(ConfigTree) instead
AbstractSpringAction(ConfigTree configTree)
          Constructs and instance with storing the passed in ConfigTree instance.
 
Method Summary
 void destroy()
          Destroy the action instance.
 void exceptionHandler(Message message, java.lang.Throwable exception)
          Generic Exception handler for Spring Actions.
protected  BeanFactory getBeanFactory()
          Request a BeanFactory instance from the action.
 void initialise()
          Initialise the action instance.
protected  void initializeSpring()
          Initialize Spring IoC
 boolean isBeanFactoryNull()
          Check to see if Spring Bean factory is null.
protected  void logFooter()
          Deprecated.  
protected  void logHeader()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configTree

protected ConfigTree configTree
configuration object

Constructor Detail

AbstractSpringAction

public AbstractSpringAction(ConfigTree configTree)
Constructs and instance with storing the passed in ConfigTree instance.

Parameters:
configTree - the ConfigTree instance that will be stored

AbstractSpringAction

public AbstractSpringAction()
Deprecated. Use AbstractSpringAction(ConfigTree) instead

Please do not call this no-args constructor and use AbstractSpringAction(ConfigTree) instead. This is because the field configTree will be using in the initialise() method and will be null this config tree is not saved.

Method Detail

initialise

public void initialise()
                throws ActionLifecycleException
Description copied from class: AbstractActionLifecycle
Initialise the action instance.

This method is called after the action instance has been instantiated so that configuration options can be validated.

Specified by:
initialise in interface ActionLifecycle
Overrides:
initialise in class AbstractActionLifecycle
Throws:
ActionLifecycleException - for errors during initialisation.

isBeanFactoryNull

public boolean isBeanFactoryNull()
Check to see if Spring Bean factory is null. Mostly used for unit tests, but could provide use in other situations.

Returns:
true if the bean factory is null

exceptionHandler

public void exceptionHandler(Message message,
                             java.lang.Throwable exception)
Generic Exception handler for Spring Actions. Displays the root cause message and full stack trace.

Parameters:
message -
exception -

destroy

public void destroy()
             throws ActionLifecycleException
Description copied from class: AbstractActionLifecycle
Destroy the action instance.

This method is called prior to the release of the action instance. All resources associated with this action instance should be released as the instance will no longer be used.

Specified by:
destroy in interface ActionLifecycle
Overrides:
destroy in class AbstractActionLifecycle
Throws:
ActionLifecycleException

initializeSpring

protected void initializeSpring()
                         throws ActionLifecycleException
Initialize Spring IoC

Throws:
ActionLifecycleException

getBeanFactory

protected BeanFactory getBeanFactory()
                              throws ActionLifecycleException
Request a BeanFactory instance from the action. If no Spring IoC container exists, create one.

Returns:
Spring Bean Factory
Throws:
ActionLifecycleException

logHeader

protected void logHeader()
Deprecated. 

Conviencence method for printing a console log header


logFooter

protected void logFooter()
Deprecated. 

Conviencence method for printing a console log footer