kaos.core.service.boot.usecase
Class CommSpeedTestReceiver

java.lang.Object
  extended by kaos.core.service.boot.KAoSAgent
      extended by kaos.core.service.boot.usecase.CommSpeedTestReceiver
All Implemented Interfaces:
KAoSAgentHelper

public class CommSpeedTestReceiver
extends KAoSAgent

This class works as the receiver part of a test programme developed to find out network transmission speed for a given transport. This class receives a number of consecutive messages with a certain size from its counterpart, i.e. the sender, and when that is done, prints the amount of time taken (in miliseconds) to receive those messages. The number of messages can be set by a command line parameter -count. The type of transport is set by a command line parameter -transport. Please also note that the receiver part of this test has to be started first and then the sender part.


Field Summary
protected static java.io.PrintStream LOGGER
           
 
Fields inherited from class kaos.core.service.boot.KAoSAgent
_agentDescription, _agentDirectoryService, _agentNamingService, _agentNickname, _lctr, _logger, _messageTransportService, _name, _serviceRoot
 
Constructor Summary
CommSpeedTestReceiver()
           
 
Method Summary
static void main(java.lang.String[] args)
           
 void receiveMessage(TransportMessage tmsg)
          Overrides the receiveMessage method defined in the superclass.
 
Methods inherited from class kaos.core.service.boot.KAoSAgent
acquireAgentDirectoryService, acquireAgentName, acquireAgentNamingService, acquireMessageTransportService, assertFalse, assertTrue, bindToMessageTransportService, checkPermission, createTransportMessage, equals, establishAgentDescription, findAgentDescriptionForID, findAgentDescriptionForNickname, getAgentID, getKAoSAgentDescription, hashCode, initialize, logMessage, logMessage, printTransportMessage, sendMessage, verifyRegistration
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final java.io.PrintStream LOGGER
Constructor Detail

CommSpeedTestReceiver

public CommSpeedTestReceiver()
Method Detail

receiveMessage

public void receiveMessage(TransportMessage tmsg)
Overrides the receiveMessage method defined in the superclass. The method is called everytime this agent receives a message from SpeedTestSender. The method stores the time at which the first message was received, counts till the pre-specified # messages are received, and then prints the difference between the time the last and the first messages were received.

Overrides:
receiveMessage in class KAoSAgent
See Also:
MessageListener, TransportMessage, "JAS Specification, Section(s) 3.4.2, 4.7.2"

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception