org.npsnet.xrti.tests
Class HelloWorldEx

java.lang.Object
  extended byorg.npsnet.xrti.tests.HelloWorldEx
All Implemented Interfaces:
HelloWorldExInteractionListener

public class HelloWorldEx
extends java.lang.Object
implements HelloWorldExInteractionListener

A simple test of the XRTI's extension mechanism.

Author:
Andrzej Kapolka

Constructor Summary
HelloWorldEx(java.util.Properties configuration, java.lang.String name, double initialPopulation, double initialGDP, 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.
 void receivePrioritizedCommunication(java.lang.String message, double priority, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          A prioritized message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelloWorldEx

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

Parameters:
configuration - the list of configuration properties
name - the name of the country to simulate
initialPopulation - the country's initial population
initialGDP - the country's initial GDP
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 HelloWorldExInteractionListener
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

receivePrioritizedCommunication

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

Specified by:
receivePrioritizedCommunication in interface HelloWorldExInteractionListener
Parameters:
message - The contents of the message.
priority - The priority level 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