uwcse.location.client
Class PersonTracker

java.lang.Object
  |
  +--com.intel.research.rain.Service
        |
        +--uwcse.location.LocationService
              |
              +--uwcse.location.FusionClientService
                    |
                    +--uwcse.location.client.PersonTracker
All Implemented Interfaces:
MessageHandler

public class PersonTracker
extends FusionClientService

An example application to track and textually display the location of all Humans known to the system.

Version:
$Revision: 1.4 $
Author:
Jeffrey Hightower

Nested Class Summary
 
Nested classes inherited from class uwcse.location.LocationService
LocationService.RediscoverServices
 
Field Summary
 
Fields inherited from class uwcse.location.FusionClientService
FUSION_DISCOVERY_QUERY, m_fusionServiceIDSet
 
Fields inherited from class uwcse.location.LocationService
CONFIG_FILENAME, MESSAGE_ELEMENT, MESSAGE_EXTENSION, RPC_ELEMENT, RPC_EXCEPTION_ELEMENT, RPC_EXTENSION, RPC_RESULT_ELEMENT
 
Constructor Summary
PersonTracker(Set names)
          Create a person tracker.
 
Method Summary
static void main(String[] argv)
           
protected static void printUsageAndExit()
          Show the program argument usage and then exit.
protected  void processLocationMsg(ServiceID from, LocationMsg@SubscriberExpirationMsg expMsg)
          Resubscribe when we get the expiration message.
protected  void processLocationMsg(ServiceID from, LocationMsg@SubscriberLocationReportMsg report)
          Display the location reports.
protected  void withdraw()
          Supplement the inherited behavior to cancel the subscription when withdrawing from Rain.
 
Methods inherited from class uwcse.location.FusionClientService
callFusionServiceRpc, getFusionServiceIDSet
 
Methods inherited from class uwcse.location.LocationService
addObject, callLocationRpc, correctedTimeMillis, getObject, getSysclockError, handleTerminalCommand, multicastLocationMsg, multicastLocationMsgs, processLocationMsg, processLocationRpc, runTerminalCommandLoop, sendLocationMsg, sendLocationMsgs, setDescription
 
Methods inherited from class com.intel.research.rain.Service
getDaemon, getDispatcher, getServiceID, process, receive, setDaemon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersonTracker

public PersonTracker(Set names)
              throws RainException,
                     LocationException
Create a person tracker.

Throws:
RainException
LocationException
Method Detail

processLocationMsg

protected void processLocationMsg(ServiceID from,
                                  LocationMsg@SubscriberLocationReportMsg report)
Display the location reports.

Overrides:
processLocationMsg in class LocationService

processLocationMsg

protected void processLocationMsg(ServiceID from,
                                  LocationMsg@SubscriberExpirationMsg expMsg)
Resubscribe when we get the expiration message. A real service would want to handle subscription and resubscription failures in a more robust manner using the renewal mechanisms in case this expiration notification message were dropped in the network.

Overrides:
processLocationMsg in class LocationService

withdraw

protected void withdraw()
Supplement the inherited behavior to cancel the subscription when withdrawing from Rain.

Overrides:
withdraw in class FusionClientService

printUsageAndExit

protected static void printUsageAndExit()
Show the program argument usage and then exit.


main

public static void main(String[] argv)


This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE