The Meta-Environment API

toolbus.communication
Interface IDataHandler

All Known Implementing Classes:
JavaToolBridge, ToolBridge, ToolInstance

public interface IDataHandler

DataHandlers proces the data and supply the data for ioHandlers.

Author:
Arnold Lankamp

Method Summary
 void exceptionOccured()
          Notifies the data handler that an exception has occured so it can take the necessary steps.
 void receive(byte operation, aterm.ATerm aTerm)
          Receives a term from the associated ioHandler.
 void send(byte operation, aterm.ATerm aTerm)
          Forwards a term to the associated ioHandler.
 void setIOHandler(IIOHandler ioHandler)
          Associates an ioHandler with the data handler.
 void shutDown()
          Shuts down this dataHandler.
 void terminate()
          Requests the termination of this dataHandler.
 

Method Detail

setIOHandler

void setIOHandler(IIOHandler ioHandler)
Associates an ioHandler with the data handler. Every data handler needs one to operate and it must NOT be changed during it's operation.

Parameters:
ioHandler - The I/O handler we need to associate with the data handler.

send

void send(byte operation,
          aterm.ATerm aTerm)
Forwards a term to the associated ioHandler.

Parameters:
operation - The operation associated with the term we need to send.
aTerm - The term that needs to be transmitted.

receive

void receive(byte operation,
             aterm.ATerm aTerm)
Receives a term from the associated ioHandler.

Parameters:
operation - The operation associate with the term we received.
aTerm - The term that was received.

terminate

void terminate()
Requests the termination of this dataHandler.


shutDown

void shutDown()
Shuts down this dataHandler. IMPORTANT: this method may only be called by the associated ioHandler. Manual invokation will lead to undefined behaviour.


exceptionOccured

void exceptionOccured()
Notifies the data handler that an exception has occured so it can take the necessary steps.


The Meta-Environment API