NetKernel APIs


com.ten60.netkernel.transport
Class Throttle

java.lang.Object
  extended bycom.ten60.netkernel.transport.Throttle

public class Throttle
extends Object

The throttle limits the number of concurrent requests that may pass from the transport manager into the scheduler. It forces requests to wait until there is capacity to accomodate them.


Constructor Summary
Throttle()
          Creates a new instance of Throttle with a default size of 5
 
Method Summary
 int getConcurrentCount()
           
 int getQueueSize()
           
 boolean isBusy()
          Returns true if there is any work to do
 void notifyOfReturn()
          Informs the throttle that a request has completed and thus if necessary can release another request to execute
 void setMaxCount(int aCount)
          Configure the number of concurrent requests we will permit
 void setMaxQueue(int aCount)
          Configure the maximum queue size for blocked requests
 void throttle()
          A blocking call to obtain permission to proceed with request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Throttle

public Throttle()
Creates a new instance of Throttle with a default size of 5

Method Detail

setMaxCount

public void setMaxCount(int aCount)
Configure the number of concurrent requests we will permit


setMaxQueue

public void setMaxQueue(int aCount)
Configure the maximum queue size for blocked requests


throttle

public void throttle()
              throws InterruptedException,
                     ThrottleOverloadException
A blocking call to obtain permission to proceed with request. when the method returns normally permission to proceed has been granted

Throws:
InterruptedException - thrown if system interrupted
ThrottleOverloadException - thrown if queue size becomes too large before permission has been given

notifyOfReturn

public void notifyOfReturn()
Informs the throttle that a request has completed and thus if necessary can release another request to execute


isBusy

public boolean isBusy()
Returns true if there is any work to do


getConcurrentCount

public int getConcurrentCount()

getQueueSize

public int getQueueSize()

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.