ninja.activeproxy.path
Class Connector

java.lang.Object
  |
  +--ninja.activeproxy.path.Connector
Direct Known Subclasses:
PipeConnector, TCPConnector

public abstract class Connector
extends java.lang.Object
implements ConnectorIF

Connector is the base abstract class that other connectors should inherit from. There are only two methods that connectors must implement: createReader() and createWriter().


Field Summary
private  java.lang.Object info
           
private  Operator operator
           
private  java.lang.Object pathID
           
 
Constructor Summary
Connector()
          Constructs a connector with no operator or path ID specified.
Connector(Operator operator, java.lang.Object pathID)
          Constructs a connector with the specified operator and path ID.
 
Method Summary
abstract  void createReader()
          Creates a reader for an operator.
abstract  void createWriter(java.lang.Object info)
          Creates a writer for an operator.
 java.lang.Object getCommunicationInfo()
          Returns the information object.
 Operator getOperator()
          Returns the operator for which this connector creates a reader/writer.
 java.lang.Object getPathID()
          Returns the path ID of the path that will go through the operator.
 void setCommunicationInfo(java.lang.Object info)
          Sets the information object necessary for the previous operator in the path to setup its writer.
 void setOperator(Operator operator)
          Sets the operator for which this connector creates a reader/writer.
 void setOperatorReader(java.io.InputStream obj)
          Sets the reader of the operator.
 void setOperatorWriter(java.io.OutputStream obj)
          Sets the writer of the operator.
 void setPathID(java.lang.Object pathID)
          Sets the path ID of the path that will go through the operator.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

operator

private Operator operator

pathID

private java.lang.Object pathID

info

private java.lang.Object info
Constructor Detail

Connector

public Connector()
Constructs a connector with no operator or path ID specified.

Connector

public Connector(Operator operator,
                 java.lang.Object pathID)
Constructs a connector with the specified operator and path ID.
Parameters:
operator - operator for which the connector creates a reader/writer.
pathID - path ID for the path that will go through the operator.
Method Detail

setOperator

public void setOperator(Operator operator)
Description copied from interface: ConnectorIF
Sets the operator for which this connector creates a reader/writer.
Specified by:
setOperator in interface ConnectorIF
Tags copied from interface: ConnectorIF
Parameters:
operator - operator for which this connector creates a reader/writer.

getOperator

public Operator getOperator()
Description copied from interface: ConnectorIF
Returns the operator for which this connector creates a reader/writer.
Specified by:
getOperator in interface ConnectorIF
Tags copied from interface: ConnectorIF
Returns:
the operator for which this connector creates a reader/writer.

setPathID

public void setPathID(java.lang.Object pathID)
Description copied from interface: ConnectorIF
Sets the path ID of the path that will go through the operator.
Specified by:
setPathID in interface ConnectorIF
Tags copied from interface: ConnectorIF
Parameters:
pathID - path ID.

getPathID

public java.lang.Object getPathID()
Description copied from interface: ConnectorIF
Returns the path ID of the path that will go through the operator.
Specified by:
getPathID in interface ConnectorIF
Tags copied from interface: ConnectorIF
Returns:
path ID of the path that will go through the operator.

setOperatorReader

public void setOperatorReader(java.io.InputStream obj)
Description copied from interface: ConnectorIF
Sets the reader of the operator.
Specified by:
setOperatorReader in interface ConnectorIF
Tags copied from interface: ConnectorIF
Parameters:
obj - input stream of the operator.

setOperatorWriter

public void setOperatorWriter(java.io.OutputStream obj)
Description copied from interface: ConnectorIF
Sets the writer of the operator.
Specified by:
setOperatorWriter in interface ConnectorIF
Tags copied from interface: ConnectorIF
Parameters:
obj - output stream of the operator.

setCommunicationInfo

public void setCommunicationInfo(java.lang.Object info)
Description copied from interface: ConnectorIF
Sets the information object necessary for the previous operator in the path to setup its writer. This could be an Integer class containing the port number on which there is a thread listening for incoming connections, a PipedInputStream for operators running on the same machine, etc.
Specified by:
setCommunicationInfo in interface ConnectorIF
Tags copied from interface: ConnectorIF
Parameters:
info - information object.

getCommunicationInfo

public java.lang.Object getCommunicationInfo()
Description copied from interface: ConnectorIF
Returns the information object.
Specified by:
getCommunicationInfo in interface ConnectorIF
Tags copied from interface: ConnectorIF
Returns:
information object.

createReader

public abstract void createReader()
Description copied from interface: ConnectorIF
Creates a reader for an operator.
Specified by:
createReader in interface ConnectorIF

createWriter

public abstract void createWriter(java.lang.Object info)
Description copied from interface: ConnectorIF
Creates a writer for an operator.
Specified by:
createWriter in interface ConnectorIF
Tags copied from interface: ConnectorIF
Parameters:
info - information object from the next operator in the path.