TeslaExecutable Class Reference

Inheritance diagram for TeslaExecutable:
Collaboration diagram for TeslaExecutable:

List of all members.


Detailed Description

Abstract base for all tesla executables (TeslaComponents, CorpusSelectors). Still work in progress.

Author:
jhermes

Public Methods

 TeslaExecutable ()
void setExperimentId (int experimentId)
void initMessaging (Level logLevel)
final void setId (int id) throws IllegalStateException
final int getId ()
void releaseThreads ()
final void onMessage (Message msg)
void tryToCancel ()
CustomThreads getCustomThreadExecutor () throws IllegalThreadModeException
void setCustomThreadExecutor (CustomThreads executor)
Logger newLogger (Class forClass)

Protected Methods

boolean cancelled ()
void cancel ()

Protected Attributes

Logger logger = Logger.getLogger(this.getClass())
Properties properties = new Properties()
int experimentId

Package Functions

public< T > List< T > asList (InputIterator< T > iterator)
public< T > Set< T > asSet (InputIterator< T > iterator)

Constructors


Method Details

public<T> List<T> asList ( InputIterator< T >  iterator) [package]
public<T> Set<T> asSet ( InputIterator< T >  iterator) [package]
void cancel ( ) [protected]
boolean cancelled ( ) [protected]
CustomThreads getCustomThreadExecutor ( ) throws IllegalThreadModeException

Returns the CustomThreads of this component, such that Callable or Runnable objects can be executed in parallel. Will throw an IllegalThreadModeException if the ThreadMode of the component has not been defined as ThreadMode#CUSTOM.

Returns:
final int getId ( )
void initMessaging ( Level  logLevel)

Tesla-internal method that must never be called by any client code. A JMS-Listener is set up that enables Tesla to send messages to this component. Currently, Messages are only used for sending a cancel command.

Exceptions:
NamingException
JMSException
Logger newLogger ( Class  forClass)
final void onMessage ( Message  msg)
void releaseThreads ( )
void setCustomThreadExecutor ( CustomThreads  executor)
void setExperimentId ( int  experimentId)
Parameters:
experimentId
final void setId ( int  id) throws IllegalStateException

This method is called internally by Tesla during the creation of an object of this class. Calling it a second time will result in an IllegalStateException.

Parameters:
stateAccessor
Exceptions:
IllegalStateExceptionwhen a uuid has already been set.
void tryToCancel ( )

Field Details

int experimentId [protected]
Logger logger = Logger.getLogger(this.getClass()) [protected]

A logger that shoud be used in subclasses.

Properties properties = new Properties() [protected]