its.backbone.frame
Class ItsFrameRedistributor

java.lang.Object
  extended byits.backbone.frame.ItsFrameReceiver
      extended byits.backbone.frame.ItsFrameRedistributor
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
Redistributor

public class ItsFrameRedistributor
extends ItsFrameReceiver

Base class for components that are both receivers and transmitters of ITS frames. One use of such a component is to scale the data stream across machines to meet increased demand. Another possibility is that the Redistributor component changes the data stream in some way, providing the result of its calculations to listeners downstream.


Field Summary
 
Fields inherited from class its.backbone.frame.ItsFrameReceiver
ignoreStreamTimeout
 
Constructor Summary
ItsFrameRedistributor(java.lang.String sourceServer, int sourcePort, int requestPort)
          Creates an ItsFrameRedistributor.
ItsFrameRedistributor(java.lang.String sourceServer, int sourcePort, int requestPort, boolean autoStart)
          Creates an ItsFrameRedistributor.
 
Method Summary
 void finalize()
           
 void frameReceived(ItsFrame frame)
          Subclasses can override this method to receive the incoming ITS Frames.
protected  ItsFrame transform(ItsFrame frame)
          This method can be overridden by subclasses to transform or filter frames in the data stream.
protected  void transmitFrame(ItsFrame f)
           
 
Methods inherited from class its.backbone.frame.ItsFrameReceiver
getFrameQueue, getInputBuffer, run, start, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItsFrameRedistributor

public ItsFrameRedistributor(java.lang.String sourceServer,
                             int sourcePort,
                             int requestPort,
                             boolean autoStart)
                      throws java.io.IOException
Creates an ItsFrameRedistributor.

Parameters:
sourceServer - the name of the upstream server
sourcePort - the port on the upstream server
requestPort - the port where the object will listen for connection requests from downstream components
autoStart - whether the receiver auto-connects to its upstream server
Throws:
java.io.IOException - indicates a problem creating a serverSocket on requestPort
java.net.UnknownHostException - indicates a problem connecting to the server

ItsFrameRedistributor

public ItsFrameRedistributor(java.lang.String sourceServer,
                             int sourcePort,
                             int requestPort)
                      throws java.io.IOException
Creates an ItsFrameRedistributor. Autostarts the receiver

Parameters:
sourceServer - the name of the upstream server
sourcePort - the port on the upstream server
requestPort - the port where the object will listen for connection requests from downstream components
Throws:
java.io.IOException - indicates a problem creating a serverSocket on requestPort
java.net.UnknownHostException - indicates a problem connecting to the server
Method Detail

frameReceived

public void frameReceived(ItsFrame frame)
Description copied from class: ItsFrameReceiver
Subclasses can override this method to receive the incoming ITS Frames. The subclass must be careful to return from this method in a reasonable amount of time relative to the incoming data rate.

Overrides:
frameReceived in class ItsFrameReceiver

transform

protected ItsFrame transform(ItsFrame frame)
                      throws DenyFrameException
This method can be overridden by subclasses to transform or filter frames in the data stream. The default implementation here simply returns the same frame that was passed in.

Parameters:
frame - A frame received from the data stream
Returns:
the transformed frame
Throws:
DenyFrameException - prevents this frame from being redistributed

transmitFrame

protected void transmitFrame(ItsFrame f)

finalize

public void finalize()