net.floodlightcontroller.core.internal
Class OFStatisticsFuture

java.lang.Object
  extended by net.floodlightcontroller.core.internal.OFMessageFuture<java.util.List<OFStatistics>>
      extended by net.floodlightcontroller.core.internal.OFStatisticsFuture
All Implemented Interfaces:
java.util.concurrent.Future<java.util.List<OFStatistics>>

public class OFStatisticsFuture
extends OFMessageFuture<java.util.List<OFStatistics>>

A concrete implementation that handles asynchronously receiving OFStatistics

Author:
David Erickson (daviderickson@cs.stanford.edu)

Field Summary
protected  boolean finished
           
 
Fields inherited from class net.floodlightcontroller.core.internal.OFMessageFuture
canceled, DEFAULT_TIMEOUT, DEFAULT_TIMEOUT_UNIT, latch, responseType, result, sw, threadPool, timeoutTimer, transactionId
 
Constructor Summary
OFStatisticsFuture(IThreadPoolService tp, IOFSwitch sw, int transactionId)
           
OFStatisticsFuture(IThreadPoolService tp, IOFSwitch sw, int transactionId, long timeout, java.util.concurrent.TimeUnit unit)
           
 
Method Summary
protected  void handleReply(IOFSwitch sw, OFMessage msg)
          Used to handle the specific expected message this Future was reigstered for, the specified msg parameter is guaranteed to match the type and transaction id specified.
protected  boolean isFinished()
          Called directly after handleReply, subclasses implement this method to indicate when the future can deregister itself from receiving future messages, and when it is safe to return the results to any waiting threads.
protected  void unRegister()
           
 
Methods inherited from class net.floodlightcontroller.core.internal.OFMessageFuture
cancel, deliverFuture, get, get, getTransactionId, isCancelled, isDone, setTransactionId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

finished

protected volatile boolean finished
Constructor Detail

OFStatisticsFuture

public OFStatisticsFuture(IThreadPoolService tp,
                          IOFSwitch sw,
                          int transactionId)

OFStatisticsFuture

public OFStatisticsFuture(IThreadPoolService tp,
                          IOFSwitch sw,
                          int transactionId,
                          long timeout,
                          java.util.concurrent.TimeUnit unit)
Method Detail

handleReply

protected void handleReply(IOFSwitch sw,
                           OFMessage msg)
Description copied from class: OFMessageFuture
Used to handle the specific expected message this Future was reigstered for, the specified msg parameter is guaranteed to match the type and transaction id specified.

Specified by:
handleReply in class OFMessageFuture<java.util.List<OFStatistics>>

isFinished

protected boolean isFinished()
Description copied from class: OFMessageFuture
Called directly after handleReply, subclasses implement this method to indicate when the future can deregister itself from receiving future messages, and when it is safe to return the results to any waiting threads.

Specified by:
isFinished in class OFMessageFuture<java.util.List<OFStatistics>>
Returns:
when this Future has completed its work

unRegister

protected void unRegister()
Overrides:
unRegister in class OFMessageFuture<java.util.List<OFStatistics>>