|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BlockingThrottle
The base interface for all throttle objects that will block the requesting threads. It declares the basic methods required for a blocking throttle object. All the implementations should be thread-safe and can be invoked by multiple threads at the same time.
Method Summary | |
---|---|
boolean |
enterThrottle(long maxWaitTime)
Method to be called when entering the code block that needs the throttling control. |
void |
exitThrottle()
Method to be called when exiting the code block that was throttle controlled |
Method Detail |
---|
boolean enterThrottle(long maxWaitTime)
This method is designed intentionally to force the caller to specify the maxWaitTime. It does not allow a thread to be block forever until the resource is available. It is because we need to ensure the calling thread will eventually return and continue processing.
If an implementation really needs to support "forever blocking" (which is NOT recommended), the developer should provide another way to wake up all the blocking threads when the application is being shut down.
maxWaitTime
- The maximum time to wait for entering the throttle. It must be a long
integer larger than 0. If it is smaller than that, this throttle will
fail the request.
void exitThrottle()
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.