The Meta-Environment API

toolbus.adapter.java
Class AbstractJavaTool

java.lang.Object
  extended by toolbus.adapter.AbstractTool
      extended by toolbus.adapter.java.AbstractJavaTool
All Implemented Interfaces:
IOperations

public abstract class AbstractJavaTool
extends AbstractTool

This class facilitates the functions a tool needs to be able to functions.

Author:
Arnold Lankamp

Field Summary
 
Fields inherited from class toolbus.adapter.AbstractTool
DIRECTTOOL, REMOTETOOL, termFactory, toolBridge
 
Fields inherited from interface toolbus.IOperations
ACKDO, ACKEVENT, CONNECT, DEBUGPERFORMANCESTATS, DISCONNECT, DO, END, EVAL, EVENT, PERFORMANCESTATS, REQUEST, RESPONSE, TERMINATE, UNDEFINED, VALUE
 
Constructor Summary
AbstractJavaTool()
          Default constructor.
 
Method Summary
 void connect(java.lang.String[] args)
          Connects to the ToolBus.
 void connectDirectly(ToolBus toolbus, java.lang.String toolName, int toolID)
          Connects to the ToolBus directly (instead of through TCP/IP).
 
Methods inherited from class toolbus.adapter.AbstractTool
disconnect, getFactory, getToolBridge, pack, receiveAckEvent, receiveTerminate, sendEvent, sendRequest, setToolBridge, terminate, unpack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJavaTool

public AbstractJavaTool()
Default constructor.

Method Detail

connect

public void connect(java.lang.String[] args)
             throws java.lang.Exception
Connects to the ToolBus. NOTE: For thread-safety reasons this method must NOT be called before the constructor of the AbstractJavaTool completes. This means that implementing classes should not put the connect call in their constructor.

Specified by:
connect in class AbstractTool
Parameters:
args - The arguments that contain the required information for running a tool (name + id and additionally the host + port of the ToolBus, depending on how this tool is connected to the ToolBus).
Throws:
java.lang.Exception - Thrown when something goes wrong during the parsing of the arguments or the establishing of the connection.

connectDirectly

public void connectDirectly(ToolBus toolbus,
                            java.lang.String toolName,
                            int toolID)
                     throws java.lang.Exception
Connects to the ToolBus directly (instead of through TCP/IP).

Parameters:
toolbus - The toolbus to connect to.
toolName - The name of the tool.
toolID - The ID of the tool.
Throws:
java.lang.Exception - When connecting to the toolbus directly failed.

The Meta-Environment API