SSF.OS
Class Resource

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--SSF.OS.Resource

public class Resource
extends com.renesys.raceway.SSF.Entity

This class provides the first-come, first serve queue for a shared resource. The processing delays accumulate, preserving the temporal ordering of request arrivals.

See Also:
ProtocolSession

Constructor Summary
Resource()
           
 
Method Summary
 long currentWait()
           
 boolean reserve(long ticks, boolean blocking)
          Reserve the resource for the given number of ticks.
 boolean reserve(long ticks, Continuation c, boolean blocking)
          Reserve the resource for the given number of ticks.
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, init, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resetSimulation, resumeAll, startAll, startAll, startClient, startClient, startServer, Vx, Yx
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resource

public Resource()
Method Detail

currentWait

public long currentWait()

reserve

public boolean reserve(long ticks,
                       boolean blocking)
Reserve the resource for the given number of ticks. No action is taken when the resource becomes free.


reserve

public boolean reserve(long ticks,
                       Continuation c,
                       boolean blocking)
Reserve the resource for the given number of ticks. The success() callback of the Continuation will be executed when the reserved period of service has completed. Returns true if the resource reservation has been scheduled, false if the resource reservation has been rejected.

A reservation is rejected when the blocking flag is false and the resource is busy.