org.jboss.txbridge.ba.execute
Class ServiceExecutor

java.lang.Object
  extended by org.jboss.txbridge.ba.execute.ServiceExecutor
Direct Known Subclasses:
LocalServiceExecutor, RemoteServiceExecutor

public abstract class ServiceExecutor
extends java.lang.Object

This is an abstract class that describes a basic ServiceExecutor. Service Executors are used for executing completion or compensation actions.

Version:
0.1
Author:
Maciej P. Machulak (mmachulak@redhat.com)

Field Summary
protected static DataManagerProvider cmp
           
(package private)  DataProvider dataProvider
           
(package private)  Executable execution
           
private static org.apache.log4j.Logger log
           
protected  TaskDescription taskDescription
           
 
Constructor Summary
ServiceExecutor(TaskDescription taskDesc)
          Main constructor.
ServiceExecutor(TaskDescription taskDesc, Executable execution, DataProvider dp)
          Constructor.
 
Method Summary
abstract  void invoke(MethodDescription md, ExecutionDataProvider edp)
          This method invokes the completion or compensation task which is specified in the service description.
 void setExecutionType(Executable execution)
          This method sets a new execution type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Logger log

cmp

protected static DataManagerProvider cmp

taskDescription

protected TaskDescription taskDescription

execution

Executable execution

dataProvider

DataProvider dataProvider
Constructor Detail

ServiceExecutor

ServiceExecutor(TaskDescription taskDesc)
Main constructor.

Parameters:
taskDesc - is the task's description.

ServiceExecutor

public ServiceExecutor(TaskDescription taskDesc,
                       Executable execution,
                       DataProvider dp)
Constructor.

Parameters:
taskDesc - is the task's description.
execution - is the execution interface that should be used.
dp - is the data provider for arguments.
Method Detail

setExecutionType

public void setExecutionType(Executable execution)
This method sets a new execution type.

Parameters:
execution - is the execution type which should be set.

invoke

public abstract void invoke(MethodDescription md,
                            ExecutionDataProvider edp)
                     throws ActionExecutionException
This method invokes the completion or compensation task which is specified in the service description. It uses managed data which are passed as a parameter.

Parameters:
md - represents the service description.
edp - represents the datamgmt data provider.
Throws:
ActionExecutionException - if it was not possible to execute datamgmt action.