com.redstarhackers.func
Class AbstractFunc

java.lang.Object
  extended bycom.redstarhackers.func.AbstractFunc
All Implemented Interfaces:
BusinessFunction, Function, UndoableFunction

public abstract class AbstractFunc
extends java.lang.Object
implements BusinessFunction

TODO Class summary sentence. Class documentation.

Version:
$Revision: 1.5 $
Author:
$Author: kostya $

Constructor Summary
AbstractFunc(ApplicationTransaction apptxObj)
           
 
Method Summary
protected abstract  void doWork()
           
 void execute()
          Executes a unit of work, throwing any application or system exceptions that occur during execution.
 ApplicationTransaction getApplicationTransaction()
           
 java.lang.Object getResult()
          Returns the result of the unit of work, if any.
 boolean isUndone()
          Returns true if the function was undone, false otherwise.
protected  void setResult(java.lang.Object obj)
          Allows subclasses to set the result of their work (usually called in doWork()).
 void undo()
          Undo the business function (marks the function as undone and defers to transactional containers or specific subclasses to take care of the rest).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.redstarhackers.func.BusinessFunction
checkBusinessRules, checkSecurity, validate
 

Constructor Detail

AbstractFunc

public AbstractFunc(ApplicationTransaction apptxObj)
Method Detail

undo

public void undo()
Undo the business function (marks the function as undone and defers to transactional containers or specific subclasses to take care of the rest).

Specified by:
undo in interface UndoableFunction

isUndone

public boolean isUndone()
Returns true if the function was undone, false otherwise.

Specified by:
isUndone in interface UndoableFunction
Returns:
true if the function was undone, false otherwise.

execute

public void execute()
             throws ApplicationException,
                    SystemException
Description copied from interface: Function
Executes a unit of work, throwing any application or system exceptions that occur during execution.

Specified by:
execute in interface Function
Throws:
SystemException - if any system exception occurs.
ApplicationException - if any application exception occurs.

getApplicationTransaction

public ApplicationTransaction getApplicationTransaction()

getResult

public java.lang.Object getResult()
Description copied from interface: Function
Returns the result of the unit of work, if any.

Specified by:
getResult in interface Function
Returns:
the result of the unit of work, null if there were no results.

doWork

protected abstract void doWork()
                        throws ApplicationException,
                               SystemException
Throws:
ApplicationException
SystemException

setResult

protected void setResult(java.lang.Object obj)
Allows subclasses to set the result of their work (usually called in doWork()).

Parameters:
obj - the new result for the function.