|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--server.Server
The server component links all the pieces together. It generates some components at run time via the ServerComponentGenerator while other components connect to it asynchronously. The server maintains the world state and provides way for components to connect to other components.
| Field Summary | |
private ServerSocket |
componentSS
ServerSocket for receiving all connecting components. |
private world.WorldState |
currentState
Current state of the world, as provided by the PerspectiveUnifier. |
private static boolean |
DEBUG
standard debugging flag |
static int |
DEFAULT_PORT
If no port is specified, the server will be initialized on this port. |
private util.WorkerThread |
imageProcessor
This thread processes WorldImages by dequeueing an image from the worldImageQueue and then calling
process on the PerspectiveUnifier passing in
the dequeued WorldImage as the parameter. |
private connect.SupplierChannel |
missionControlChannel
Supplier objects for the key server components |
private boolean |
missionControlConnected
Boolean flags regarding the connection status of server critical components. |
private util.ConsumerQueue |
missionControlQueue
The multithreaded Queue object for reading in off the key servercomponents. |
private boolean |
perspectiveUnifierConnected
|
private int |
port
port represents the actual port that the Server is listening in on. |
private connect.SupplierChannel |
puChannel
Supplier objects for the key server components |
private util.ConsumerQueue |
puQueue
The multithreaded Queue object for reading in off the key servercomponents. |
private static long |
serialVersionUID
|
private static boolean |
SHOW_CONNECTION_ATTEMPTS
|
private static boolean |
SHOW_STATE
This flag will show the servers functional state when any component attempts to wait for initialization. |
private connect.SupplierChannel |
uavManagerChannel
Supplier objects for the key server components |
private boolean |
uavManagerConnected
|
private util.ConsumerQueue |
uavManagerQueue
The multithreaded Queue object for reading in off the key servercomponents. |
private util.PriorityProvider |
uavPriorities
This object allows us to adjust the priority (i.e. |
private List |
uavs
List containing all active uavs. |
private connect.SupplierChannel |
ucavManagerChannel
Supplier objects for the key server components |
private boolean |
ucavManagerConnected
|
private util.ConsumerQueue |
ucavManagerQueue
The multithreaded Queue object for reading in off the key servercomponents. |
private util.FairWeightedQueue |
worldImageQueue
This queue hold all waiting-to-be-processed images from the ucavs. |
private PropertyChangeSupport |
worldUpdates
Interested parties may register with this PropertyChangeSupport to be notified when the current WorldState has been changed. |
| Constructor Summary | |
Server()
|
|
Server(int port)
|
|
| Method Summary | |
protected boolean |
accept(connect.ComponentEmissary requesting)
Returns whether the Server will an incoming request for connection of the component type specified in the ComponentEmissary. |
protected boolean |
allowMethod(util.MethodRequest request)
Returns whether the Server component will all the MethodRequest to be invoked. |
private void |
debug(String s)
private method for sending out debug messages |
private util.PriorityEnqueueable |
generatePriorityEnqueueable(Object evalObject,
Object enqueueable)
Generates a PriorityEnqueueable with the specified
arguements. |
connect.CreatesConnection |
getConnection()
Returns the CreatesConnection that will connect an
outside Component to the Server. |
connect.CreatesConnection |
getUAVManagerConnection()
Returns the CreatesConnection that will connect with the UCAVManager component. |
connect.CreatesConnection |
getUCAVManagerConnection()
Returns the CreatesConnection that will connect with the UAVManager component. |
protected void |
initializeServerComponents()
Calls on the ServerComponentFactory to
generate the components that the server will need, as specified
by the class types passed in. |
protected boolean |
isFullyFunctional()
Returns whether the server has all of its key component currently connected. |
protected void |
listenForComponents()
Continually listens on the incoming channel for new Component connetions. |
static void |
main(String[] args)
|
protected void |
notifyOfInitialization()
This method notifies the blocking initialization method when all the criticial components have connected, thus assuring full functionality the server. |
protected void |
processCommandControl(connect.ComponentEmissary cc,
connect.ChannelBundle channels)
Listens for I/O between the server and the CommandControl component |
protected void |
processMissionControl(connect.ComponentEmissary mc,
connect.ChannelBundle channels)
Listens for I/O between the server and the MissionControl component. |
protected void |
processNewComponent(connect.ComponentEmissary accepted,
connect.ChannelBundle channels)
When a component is accepted, the server should determine what to do with the connection. |
protected void |
processObjectLocater(connect.ComponentEmissary ol,
connect.ChannelBundle channels)
Since the ObjectLocater has connected, we need a reference to the UAV that it is listening for. |
protected void |
processPerspectiveUnifier(connect.ComponentEmissary pu,
connect.ChannelBundle channels)
Begins listening for I/O between the server and the PerspectiveUnifier component. |
protected void |
processUAVManager(connect.ComponentEmissary uav,
connect.ChannelBundle channels)
The UAVManager provides mediated access to the uavs. |
protected void |
processUCAVManager(connect.ComponentEmissary uav,
connect.ChannelBundle channels)
The UCAVManager provides mediated access to the UCAVs. |
protected void |
processVisualizer(connect.ComponentEmissary viz,
connect.ChannelBundle channels)
Adds a PropertyChangeListener for updates in
the current WorldState and then writes out the
new value upon update. |
mission.MissionHandle |
requestMission(mission.Mission request)
Request that the MissionControl process this
mission. |
void |
run()
The server begins by trying to accept new Components via its ServerSocket. |
protected void |
updateWorldState(world.WorldImage newImage)
Updates the current WorldState by communication
with the PerspectiveUnifier. |
protected void |
waitForInitialization()
This method should be called by any thread that should not proceed until the Server is in a fully consistent state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final long serialVersionUID
public static final int DEFAULT_PORT
private final int port
private static final boolean DEBUG
private static final boolean SHOW_STATE
private static final boolean SHOW_CONNECTION_ATTEMPTS
private final ServerSocket componentSS
private final util.FairWeightedQueue worldImageQueue
private final util.PriorityProvider uavPriorities
private final PropertyChangeSupport worldUpdates
private final List uavs
private final util.WorkerThread imageProcessor
worldImageQueue and then calling
process on the PerspectiveUnifier passing in
the dequeued WorldImage as the parameter.
private world.WorldState currentState
PerspectiveUnifier.
private connect.SupplierChannel puChannel
private connect.SupplierChannel missionControlChannel
private connect.SupplierChannel uavManagerChannel
private connect.SupplierChannel ucavManagerChannel
private util.ConsumerQueue puQueue
Queue object for reading in off the key servercomponents.
private util.ConsumerQueue missionControlQueue
Queue object for reading in off the key servercomponents.
private util.ConsumerQueue uavManagerQueue
Queue object for reading in off the key servercomponents.
private util.ConsumerQueue ucavManagerQueue
Queue object for reading in off the key servercomponents.
private boolean missionControlConnected
private boolean perspectiveUnifierConnected
private boolean uavManagerConnected
private boolean ucavManagerConnected
| Constructor Detail |
public Server()
public Server(int port)
| Method Detail |
public void run()
run in interface Runnablepublic mission.MissionHandle requestMission(mission.Mission request)
MissionControl process this
mission. Return the MissionHandle associated with
it.
request - the Mission object that will be relayed
to the MissionControl
protected void initializeServerComponents()
ServerComponentFactory to
generate the components that the server will need, as specified
by the class types passed in. These components will connect
using the CreatesConnection passed in. This method will then
block until all the components have registered themselves.
getConnection()protected void listenForComponents()
Component connetions. Upon hearing a new connection, the
Server will attempt to read in a ComponentEmissary which will denote the requesting
Component. If the Server will accept the
connection to a Component of that type, then a ReturnValue with a true Boolean will be sent
back, and the channels will be dispatched based on the type
specified by the ComponentEmissary. If the request is
rejected, a false Boolean will be sent back
and the channel will be closed.
public connect.CreatesConnection getConnection()
CreatesConnection that will connect an
outside Component to the Server. The value
returned is created dynamically by system property lookups.
public connect.CreatesConnection getUCAVManagerConnection()
UAVManager component.
public connect.CreatesConnection getUAVManagerConnection()
UCAVManager component.
protected boolean accept(connect.ComponentEmissary requesting)
protected void processNewComponent(connect.ComponentEmissary accepted,
connect.ChannelBundle channels)
protected void processCommandControl(connect.ComponentEmissary cc,
connect.ChannelBundle channels)
CommandControl component
protected void processMissionControl(connect.ComponentEmissary mc,
connect.ChannelBundle channels)
MissionControl component.
protected void processPerspectiveUnifier(connect.ComponentEmissary pu,
connect.ChannelBundle channels)
PerspectiveUnifier component.
protected void processUAVManager(connect.ComponentEmissary uav,
connect.ChannelBundle channels)
protected void processUCAVManager(connect.ComponentEmissary uav,
connect.ChannelBundle channels)
UCAVManager provides mediated access to the UCAVs. It may be
queried for the CreatesConnection of all, some, or a specific uav.
In addition, will query the server for a CreatesConnection to a
ObjectLocater.
protected void processObjectLocater(connect.ComponentEmissary ol,
connect.ChannelBundle channels)
private util.PriorityEnqueueable generatePriorityEnqueueable(Object evalObject,
Object enqueueable)
PriorityEnqueueable with the specified
arguements.
protected void processVisualizer(connect.ComponentEmissary viz,
connect.ChannelBundle channels)
PropertyChangeListener for updates in
the current WorldState and then writes out the
new value upon update.
protected boolean allowMethod(util.MethodRequest request)
MethodRequest to be invoked.
protected void updateWorldState(world.WorldImage newImage)
WorldState by communication
with the PerspectiveUnifier. The process is
done by taking in new images and sending them out to the
PerspectiveUnifier, which sends back a DeltaState that is used to update our currentState
object. This method does not need to exhibit blocking behavior
because the PerspectiveUnifier is guaranteed to be
initialzed before this method has been called. This invariant
is maintained because no Component is allowed to
connect fully before the PerspectiveUnifier has been
set, which means that no UAV could cause a
WorldImage to enqueue on the worldImageQueue, which causes this method to be
called.
protected void notifyOfInitialization()
protected void waitForInitialization()
protected boolean isFullyFunctional()
private void debug(String s)
public static void main(String[] args)
|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||