Boeing Simulation 3.1 API Specification

locater
Class SocketObjectLocaterTemplate

java.lang.Object
  |
  +--connect.socket.SocketComponentTemplate
        |
        +--locater.SocketObjectLocaterTemplate
All Implemented Interfaces:
Component, ObjectLocater
Direct Known Subclasses:
SocketObjectLocater

public abstract class SocketObjectLocaterTemplate
extends SocketComponentTemplate
implements ObjectLocater

Default Socket-based template. Should be extended in Socket-based implementations.

Version:
$Revision: 1.16 $
Author:
Dave Jurgens
, Jim Adamich

Field Summary
private  boolean connected
           
private static long serialVersionUID
           
private  Object syncPoint
           
private  util.Queue toServerQueue
           
 
Fields inherited from class connect.socket.SocketComponentTemplate
portNumber
 
Constructor Summary
SocketObjectLocaterTemplate(int port)
           
 
Method Summary
 boolean accept(Class requestingType)
          Accept only the 1st UAV, then always return false
abstract  boolean allowMethod(util.MethodRequest request)
          Extending classes should define which methods to allow remote components to execute.
 void processAcceptedConnection(Class hostType, connect.ChannelBundle acceptedConnection)
          Upon creation, we should have been connected to a Server.
abstract  world.WorldImage processImage(uav.UAVImage image)
          This method should time stamp the create a new WorldImage, time stamp it (before processing), and then analyze the UCAV image by identifying known objects on it.
 void processRequestingConnection(connect.ComponentEmissary requestingType, connect.ChannelBundle incomingConnection)
          When this method is called, there should be only 1 type of class that we accept (the UAV Class).
protected  void startListeningThread(connect.ChannelBundle channels)
           
 
Methods inherited from class connect.socket.SocketComponentTemplate
connect, getComponentEmissary, getConnection, getMaxPoints, processRelayPoint, spawnRelayPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface connect.Component
connect, getConnection
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

toServerQueue

private final util.Queue toServerQueue

connected

private boolean connected

syncPoint

private Object syncPoint
Constructor Detail

SocketObjectLocaterTemplate

public SocketObjectLocaterTemplate(int port)
Method Detail

processRequestingConnection

public void processRequestingConnection(connect.ComponentEmissary requestingType,
                                        connect.ChannelBundle incomingConnection)
When this method is called, there should be only 1 type of class that we accept (the UAV Class). We only want to accept 1 UAV for our lifetime since accepting a UAV afterwards would mean that we are giving the server information about a different UAV than it believes it is receiving. Therefore, we accept the connection from the 1st UAV and reject all others not from a UAV before and every request after.

Specified by:
processRequestingConnection in class SocketComponentTemplate

processAcceptedConnection

public void processAcceptedConnection(Class hostType,
                                      connect.ChannelBundle acceptedConnection)
Upon creation, we should have been connected to a Server. Therefore, we should push our processed images to the Server via the SupplierChannel. All processed images are buffered on the toServerQueue. This process is done in a multithreaded way because we have two components connected to this component. Therefore, we buffer the write outs because our UAV may push images on us faster than we are able to write them out. While this is unlikely, this component should take precautions since its acting as a proxy between two components.

Specified by:
processAcceptedConnection in class SocketComponentTemplate

accept

public boolean accept(Class requestingType)
Accept only the 1st UAV, then always return false

Specified by:
accept in class SocketComponentTemplate

startListeningThread

protected void startListeningThread(connect.ChannelBundle channels)

allowMethod

public abstract boolean allowMethod(util.MethodRequest request)
Extending classes should define which methods to allow remote components to execute. This is for security, leaving this invoke automatically could allow for unspecified behavior

Specified by:
allowMethod in class SocketComponentTemplate

processImage

public abstract world.WorldImage processImage(uav.UAVImage image)
This method should time stamp the create a new WorldImage, time stamp it (before processing), and then analyze the UCAV image by identifying known objects on it.

Specified by:
processImage in interface ObjectLocater

Boeing Simulation 3.1 API Specification

To submit a bug or feature email the author of that class. Funding for this research was provided by Boeing and DARPA.