TIBCO ActiveMatrix Mediation Implementation Type v3.3.1

com.tibco.mediation.task.rt
Class Task<I,U,N extends I,A extends I,S,T,X>

java.lang.Object
  extended by com.tibco.mediation.task.rt.Task<I,U,N,A,S,T,X>

public abstract class Task<I,U,N extends I,A extends I,S,T,X>
extends java.lang.Object

Class Task is the root of the custom task runtime class hierarchy. Every custom task runtime class has Task as a superclass.


Constructor Summary
Task()
           
 
Method Summary
abstract  void destroy()
          The destroy method is called once by the Process Engine before the instance is destroyed.
abstract  N execute(N input, Exchange<N> exchange)
          The Process engine invokes this method to execute a task.
 TaskContext<I,U,N,A,S,T,X> getContext()
          The getContext() method returns the context of the task
 org.slf4j.Logger getLogger()
          The getLogger() method returns the Logger for the task
abstract  void init()
          The init method is called once by the Process Engine after the instance is created.
 void setContext(TaskContext<I,U,N,A,S,T,X> context)
          The setContext method is called once by the Process Engine after the instance is created.
 void setLogger(org.slf4j.Logger logger)
          The setLogger method is called once by the Process Engine after the instance is created.
 java.lang.String toString()
          Returns a string representation of the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Task

public Task()
Method Detail

setContext

public final void setContext(TaskContext<I,U,N,A,S,T,X> context)

The setContext method is called once by the Process Engine after the instance is created. Subclasses of Task can not over-ride the method or reset the context of a task. Calling this method after the first time does not have any effect i.e. it does not reset the task context


getContext

public final TaskContext<I,U,N,A,S,T,X> getContext()
The getContext() method returns the context of the task

Returns:
context of the task
See Also:
TaskContext

setLogger

public final void setLogger(org.slf4j.Logger logger)

The setLogger method is called once by the Process Engine after the instance is created. Subclasses of Task can not over-ride the method or reset the Logger for a task. Calling this method after the first time does not have any effect i.e. it does not reset the Logger


getLogger

public final org.slf4j.Logger getLogger()
The getLogger() method returns the Logger for the task

Returns:
Logger for the task
See Also:
Logger

init

public abstract void init()
                   throws TaskLifeCycleFault

The init method is called once by the Process Engine after the instance is created. This method may be implemented to acquire any resources required for the task runtime.

Throws:
TaskLifeCycleFault - Thrown by the method to indicate a failure caused by the implementation of the initialization steps

destroy

public abstract void destroy()
                      throws TaskLifeCycleFault

The destroy method is called once by the Process Engine before the instance is destroyed. This method may be implemented to release any resources acquired by the init method.

Throws:
TaskLifeCycleFault - - Thrown by the method to indicate a failure caused by the implementation of the resource release steps

execute

public abstract N execute(N input,
                          Exchange<N> exchange)
                             throws TaskFault
The Process engine invokes this method to execute a task. Implementation of this method defines the behavior of the task. Ensure that gXML API is used to process the input node. Also ensure that the output node is built using gXML API in-order to make it XML tree model agnostic. Avoid using org.w3c.dom specific API. Refer to the javadoc and samples for usage of gXML API.

Parameters:
input - The input to the task may be a XML document or null if the task does not require an input
exchange - The exchange carries the information flowing through the process flow
Returns:
An XML Document which adheres to the output schema of the custom task. May return null if the task does not require any output
Throws:
TaskFault - Thrown by the method to indicate a failure in executing the implementation

toString

public java.lang.String toString()
Returns a string representation of the task. It is recommended that all subclasses override this method.
 Object.toString() + [name={name}]
 

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the task.

TIBCO ActiveMatrix Mediation Implementation Type v3.3.1

Copyright © 2010 TIBCO Software Inc. All Rights Reserved.