Boeing Simulation 3.1 API Specification

mission
Class SocketMissionControlTemplate

java.lang.Object
  |
  +--connect.socket.SocketComponentTemplate
        |
        +--mission.SocketMissionControlTemplate
All Implemented Interfaces:
Component, MissionControl
Direct Known Subclasses:
SocketMissionControl

public abstract class SocketMissionControlTemplate
extends SocketComponentTemplate
implements MissionControl

A socket based implementation of the MissionControl component that is meant to be used with the template pattern. This implementaion leave the decision making to the extending class.

Version:
$Revision: 1.12 $
Author:
Dave Jurgens

Field Summary
private static long serialVersionUID
           
private  boolean serverConnected
          If we are currently connected to a component of the specified type.
protected  util.ConsumerQueue serverQueue
          All objects read in from a requested connection are put into this queue structure.
protected  util.Queue toServer
          Queue structure to hold objects waiting to be written out.
protected  util.Queue toUAV
          Queue structure to hold objects waiting to be written out.
protected  util.Queue toUCAV
          Queue structure to hold objects waiting to be written out.
private  boolean uavConnected
          If we are currently connected to a component of the specified type.
protected  util.ConsumerQueue uavQueue
          All objects read in from a requested connection are put into this queue structure.
private  connect.SupplierChannel uavSupplierChannel
          All requests to remote components are written out this channel.
private  boolean ucavConnected
          If we are currently connected to a component of the specified type.
protected  util.ConsumerQueue ucavQueue
          All objects read in from a requested connection are put into this queue structure.
private  connect.SupplierChannel ucavSupplierChannel
          All requests to remote components are written out this channel.
 
Fields inherited from class connect.socket.SocketComponentTemplate
portNumber
 
Constructor Summary
SocketMissionControlTemplate(int port)
           
 
Method Summary
abstract  boolean abortMission(mission.Mission request)
          Stops the processing of the specified Mission, and returns whether the stop command issue was successful.
 boolean accept(Class requestingType)
          This component does not accept any requested connections.
protected  boolean allowMethod(util.MethodRequest request)
          Return true if we accept the request from the remote component.
abstract  Set getCurrentMissions()
          Return a List of all MissionHandle objects that can be used to access any Mission currently being executed.
protected  int getMaxPoints()
          Returns 1 so that a single RelayPoint may be created.
abstract  mission.MissionStatus getMissionStatus(mission.MissionHandle handle)
          Return the status of the mission associated with that handle.
 void processAcceptedConnection(Class hostType, connect.ChannelBundle acceptedConnection)
          Process the connection to the Server, UCAVManager or UAVManager components.
abstract  mission.MissionHandle processMission(mission.Mission request)
          Determine if this Mission is feasible, then coordinate resources until it is finished.
 void processRequestingConnection(connect.ComponentEmissary requestingType, connect.ChannelBundle incomingConnection)
          No components cannot connect, therefore this method is not used.
protected  void processServer(connect.ChannelBundle serverChannels)
          Start a Thread listening on each channel.
protected  void processUAVManager(connect.ChannelBundle uavChannels)
          Start a Thread listening on each channel.
protected  void processUCAVManager(connect.ChannelBundle ucavChannels)
          Start a Thread listening on each channel.
protected  void startListeningThread(util.ConsumerQueue inputQueue, util.Queue outputQueue)
          Dequeue MethodRequest objects on the specified ConsumerQueue and then enqueue the ReturnValue on the specified Queue.
protected  void writeOutComponentRequests()
          Writes out requests to the Server for the CreatesConnection for the UAVManager and UCAVManager components.
 
Methods inherited from class connect.socket.SocketComponentTemplate
connect, getComponentEmissary, getConnection, processRelayPoint, spawnRelayPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

serverConnected

private boolean serverConnected
If we are currently connected to a component of the specified type.


uavConnected

private boolean uavConnected
If we are currently connected to a component of the specified type.


ucavConnected

private boolean ucavConnected
If we are currently connected to a component of the specified type.


serverQueue

protected util.ConsumerQueue serverQueue
All objects read in from a requested connection are put into this queue structure. A ConsumerQueue is used due to the possibility of multiple threads requesting objects from multiple components. Having a standardized queue structure with wait behavior for specific objects requests enables the multiple threading/component ordering issues.


ucavQueue

protected util.ConsumerQueue ucavQueue
All objects read in from a requested connection are put into this queue structure. A ConsumerQueue is used due to the possibility of multiple threads requesting objects from multiple components. Having a standardized queue structure with wait behavior for specific objects requests enables the multiple threading/component ordering issues.


uavQueue

protected util.ConsumerQueue uavQueue
All objects read in from a requested connection are put into this queue structure. A ConsumerQueue is used due to the possibility of multiple threads requesting objects from multiple components. Having a standardized queue structure with wait behavior for specific objects requests enables the multiple threading/component ordering issues.


toServer

protected final util.Queue toServer
Queue structure to hold objects waiting to be written out.


toUCAV

protected final util.Queue toUCAV
Queue structure to hold objects waiting to be written out.


toUAV

protected final util.Queue toUAV
Queue structure to hold objects waiting to be written out.


ucavSupplierChannel

private connect.SupplierChannel ucavSupplierChannel
All requests to remote components are written out this channel.


uavSupplierChannel

private connect.SupplierChannel uavSupplierChannel
All requests to remote components are written out this channel.

Constructor Detail

SocketMissionControlTemplate

public SocketMissionControlTemplate(int port)
Method Detail

processRequestingConnection

public void processRequestingConnection(connect.ComponentEmissary requestingType,
                                        connect.ChannelBundle incomingConnection)
No components cannot connect, therefore this method is not used.

Specified by:
processRequestingConnection in class SocketComponentTemplate

processAcceptedConnection

public void processAcceptedConnection(Class hostType,
                                      connect.ChannelBundle acceptedConnection)
Process the connection to the Server, UCAVManager or UAVManager components. This will entail reading in MethodRequest objects and then invoking them if we allow them.

Specified by:
processAcceptedConnection in class SocketComponentTemplate

accept

public boolean accept(Class requestingType)
This component does not accept any requested connections.

Specified by:
accept in class SocketComponentTemplate

getMaxPoints

protected int getMaxPoints()
Returns 1 so that a single RelayPoint may be created.

Overrides:
getMaxPoints in class SocketComponentTemplate
See Also:
SocketComponentTemplate.spawnRelayPoint(int)

processServer

protected void processServer(connect.ChannelBundle serverChannels)
Start a Thread listening on each channel.


writeOutComponentRequests

protected void writeOutComponentRequests()
Writes out requests to the Server for the CreatesConnection for the UAVManager and UCAVManager components.


processUCAVManager

protected void processUCAVManager(connect.ChannelBundle ucavChannels)
Start a Thread listening on each channel.


processUAVManager

protected void processUAVManager(connect.ChannelBundle uavChannels)
Start a Thread listening on each channel.


startListeningThread

protected void startListeningThread(util.ConsumerQueue inputQueue,
                                    util.Queue outputQueue)
Dequeue MethodRequest objects on the specified ConsumerQueue and then enqueue the ReturnValue on the specified Queue.


allowMethod

protected boolean allowMethod(util.MethodRequest request)
Return true if we accept the request from the remote component.

Specified by:
allowMethod in class SocketComponentTemplate

abortMission

public abstract boolean abortMission(mission.Mission request)
Description copied from interface: MissionControl
Stops the processing of the specified Mission, and returns whether the stop command issue was successful.

Specified by:
abortMission in interface MissionControl

getCurrentMissions

public abstract Set getCurrentMissions()
Description copied from interface: MissionControl
Return a List of all MissionHandle objects that can be used to access any Mission currently being executed.

Specified by:
getCurrentMissions in interface MissionControl

getMissionStatus

public abstract mission.MissionStatus getMissionStatus(mission.MissionHandle handle)
Description copied from interface: MissionControl
Return the status of the mission associated with that handle.

Specified by:
getMissionStatus in interface MissionControl

processMission

public abstract mission.MissionHandle processMission(mission.Mission request)
Description copied from interface: MissionControl
Determine if this Mission is feasible, then coordinate resources until it is finished. Return the MissionHandle that will be associate with it.

Specified by:
processMission in interface MissionControl

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.