edu.nps.moves.net
Class BehaviorConsumerThreaded

java.lang.Object
  extended by edu.nps.moves.net.BehaviorConsumerThreaded
All Implemented Interfaces:
BehaviorConsumerIF, java.lang.Runnable

public class BehaviorConsumerThreaded
extends java.lang.Object
implements BehaviorConsumerIF, java.lang.Runnable

Example threaded implementation of the BehaviorConsumerIF interface.

A threaded BehaviorConsumer should be used if it takes a long time to process each DIS packet, or if you want to process the packets in your own thread, rather than the thread used in the BehaviorProducer.

Author:
DMcG
See Also:
BehaviorProducerIF, BehaviorConsumerIF

Constructor Summary
BehaviorConsumerThreaded()
           
 
Method Summary
 void receivePdu(Pdu pdu)
          Receives a PDU from the BehaviorProducer.
 void run()
          Implementation of the Runnable interface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BehaviorConsumerThreaded

public BehaviorConsumerThreaded()
Method Detail

receivePdu

public void receivePdu(Pdu pdu)
Receives a PDU from the BehaviorProducer.

Specified by:
receivePdu in interface BehaviorConsumerIF
Parameters:
pdu - the ProtocolDataUnit generated by the BehaviorProducer

run

public void run()
Implementation of the Runnable interface

Specified by:
run in interface java.lang.Runnable