org.npsnet.xrti.tests
Class HelloWorld

java.lang.Object
  extended byorg.npsnet.xrti.tests.HelloWorld
All Implemented Interfaces:
HelloWorldInteractionListener

public class HelloWorld
extends java.lang.Object
implements HelloWorldInteractionListener

A simple test of the XRTI.

Author:
Andrzej Kapolka

Field Summary
private static byte[] emptyTag
          An empty user-supplied tag.
private static java.lang.String HELLO_WORLD_OBJECT_MODEL
          The Hello World Object Model, stored as a resource.
private  HelloWorldProxyAmbassador helloWorldProxyAmbassador
          The Hello World proxy ambassador.
private  CountryProxy ownCountry
          The proxy for our own country.
private  ProxyAmbassador proxyAmbassador
          The root proxy ambassador.
private  RTIambassador rtiAmbassador
          The RTI ambassador.
 
Constructor Summary
HelloWorld(java.util.Properties configuration, java.lang.String name, double initialPopulation, int numberOfTicks)
          Constructor.
 
Method Summary
static void main(java.lang.String[] args)
          Program entry point.
 void receiveCommunication(java.lang.String message, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          A generic message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HELLO_WORLD_OBJECT_MODEL

private static final java.lang.String HELLO_WORLD_OBJECT_MODEL
The Hello World Object Model, stored as a resource.

See Also:
Constant Field Values

emptyTag

private static final byte[] emptyTag
An empty user-supplied tag.


rtiAmbassador

private RTIambassador rtiAmbassador
The RTI ambassador.


proxyAmbassador

private ProxyAmbassador proxyAmbassador
The root proxy ambassador.


helloWorldProxyAmbassador

private HelloWorldProxyAmbassador helloWorldProxyAmbassador
The Hello World proxy ambassador.


ownCountry

private CountryProxy ownCountry
The proxy for our own country.

Constructor Detail

HelloWorld

public HelloWorld(java.util.Properties configuration,
                  java.lang.String name,
                  double initialPopulation,
                  int numberOfTicks)
Constructor.

Parameters:
configuration - the list of configuration properties
name - the name of the country to simulate
initialPopulation - the country's initial population
numberOfTicks - the number of ticks to execute
Method Detail

main

public static void main(java.lang.String[] args)
Program entry point.

Parameters:
args - the command line arguments

receiveCommunication

public void receiveCommunication(java.lang.String message,
                                 byte[] userSuppliedTag,
                                 OrderType sentOrdering,
                                 TransportationType theTransport)
                          throws InteractionClassNotRecognized,
                                 InteractionParameterNotRecognized,
                                 InteractionClassNotSubscribed,
                                 FederateInternalError
A generic message.

Specified by:
receiveCommunication in interface HelloWorldInteractionListener
Parameters:
message - The contents of the message.
userSuppliedTag - a user-supplied tag associated with the interaction
sentOrdering - the type of ordering with which the interaction was sent
theTransport - the type of transport associated with the interaction
Throws:
InteractionClassNotRecognized - if the interaction class was not recognized
InteractionParameterNotRecognized - if a parameter of the interaction was not recognized
InteractionClassNotSubscribed - if the federate had not subscribed to the interaction class
FederateInternalError - if an error occurs in the federate