uwcse.location
Class FusionService.SubscriptionThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--uwcse.location.FusionService.SubscriptionThread
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
FusionService.NameSubscriptionThread, FusionService.TypeSubscriptionThread
Enclosing class:
FusionService

protected abstract class FusionService.SubscriptionThread
extends Thread

A thread class to manage and dispatch subscription issues.


Field Summary
protected  Subscription m_subscription
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FusionService.SubscriptionThread(Subscription sub)
           
 
Method Summary
 Subscription cancel(Subscription sub)
          Cancel the subscription immediately.
 Subscription expire(Subscription sub)
          Expire the subscription.
protected abstract  Collection getSubscribedObjectNames()
          This method is called with each subscription checkup to get the current collection of object names the subscription is for.
 Subscription renew(Subscription sub)
          Reset the expiration date of the subscription from the time this method is called.
 void run()
          Run the thread.
 void shutdown()
          Signal the thread to stop executing when it reaches a graceful termination point.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_subscription

protected Subscription m_subscription
Constructor Detail

FusionService.SubscriptionThread

public FusionService.SubscriptionThread(Subscription sub)
Method Detail

shutdown

public void shutdown()
Signal the thread to stop executing when it reaches a graceful termination point.


renew

public Subscription renew(Subscription sub)
Reset the expiration date of the subscription from the time this method is called. As verification, this method does nothing and returns null unless the given subscription is the one handled by this thread.

Returns:
the renewed subscription with the extended expiration date or null if the given subscription is not the one handled by this thread

expire

public Subscription expire(Subscription sub)
Expire the subscription. A subscription for multiple objects will finish issues for the set if they are in progress. Expiration notification messages will be set to subscribers just as if the subscription expired naturally. As verification, this method does nothing and returns null unless the given subscription is the one handled by this thread.

Returns:
the now expired subscription with the new expiration date or null if the given subscription is not the one handled by this thread
See Also:
cancel(Subscription)

cancel

public Subscription cancel(Subscription sub)
Cancel the subscription immediately. No expiration notification messages will be set to subscribers. As verification, this method does nothing and returns false unless the given subscription is the one handled by this thread.

Returns:
the cancelled subscription with the canceled date as the expiration date or null if the given subscription is not the one handled by this thread
See Also:
expire(Subscription)

getSubscribedObjectNames

protected abstract Collection getSubscribedObjectNames()
This method is called with each subscription checkup to get the current collection of object names the subscription is for.


run

public void run()
Run the thread.

Specified by:
run in interface Runnable
Overrides:
run in class Thread


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