org.objectweb.proactive.core.body.request
Interface BlockingRequestQueue

All Superinterfaces:
RequestQueue
All Known Subinterfaces:
ComponentRequestQueue
All Known Implementing Classes:
BlockingRequestQueueImpl, ComponentRequestQueueImpl

public interface BlockingRequestQueue
extends RequestQueue


Method Summary
 Request blockingRemoveOldest()
          Blocks the calling thread until there is a request available Returns immediately if there is already one.
 Request blockingRemoveOldest(long timeout)
          Blocks the calling thread until there is a request available but try to limit the time the thread is blocked to timeout.
 Request blockingRemoveOldest(RequestFilter requestFilter)
          Blocks the calling thread until there is a request that can be accepted be the given RequestFilter.
 Request blockingRemoveOldest(java.lang.String methodName)
          Blocks the calling thread until there is a request of name methodName Returns immediately if there is already one.
 Request blockingRemoveYoungest()
          Blocks the calling thread until there is a request available Returns immediately if there is already one.
 Request blockingRemoveYoungest(long timeout)
          Blocks the calling thread until there is a request available but try to limit the time the thread is blocked to timeout.
 Request blockingRemoveYoungest(RequestFilter requestFilter)
          Blocks the calling thread until there is a request that can be accepted be the given RequestFilter.
 Request blockingRemoveYoungest(java.lang.String methodName)
          Blocks the calling thread until there is a request of name methodName Returns immediately if there is already one.
 void destroy()
          Destroys this BlockingQueue by removing all its content, unblocking all thread waiting for a request and making sure that no thread will block again.
 boolean isDestroyed()
          Returns if this BlockingQueue is destroyed
 void waitForRequest()
          Blocks the calling thread until there is a request available.
 
Methods inherited from interface org.objectweb.proactive.core.body.request.RequestQueue
add, addRequestQueueEventListener, addToFront, clear, getOldest, getOldest, getOldest, getYoungest, getYoungest, getYoungest, hasRequest, isEmpty, iterator, processRequests, removeOldest, removeOldest, removeOldest, removeRequestQueueEventListener, removeYoungest, removeYoungest, removeYoungest, size
 

Method Detail

destroy

public void destroy()
Destroys this BlockingQueue by removing all its content, unblocking all thread waiting for a request and making sure that no thread will block again. After this call, any call to a blocking method won't block and return null.


isDestroyed

public boolean isDestroyed()
Returns if this BlockingQueue is destroyed


blockingRemoveOldest

public Request blockingRemoveOldest(RequestFilter requestFilter)
Blocks the calling thread until there is a request that can be accepted be the given RequestFilter. Returns immediately if there is already one. The request returned is non null unless the thread has been asked not to wait anymore.

Parameters:
requestFilter - the request filter that select the request to be returned
Returns:
the oldest request found in the queue that is accepted by the filter.

blockingRemoveOldest

public Request blockingRemoveOldest(java.lang.String methodName)
Blocks the calling thread until there is a request of name methodName Returns immediately if there is already one. The request returned is non null unless the thread has been asked not to wait anymore.

Parameters:
methodName - the name of the method to wait for
Returns:
the oldest request of name methodName found in the queue.

blockingRemoveOldest

public Request blockingRemoveOldest()
Blocks the calling thread until there is a request available Returns immediately if there is already one. The request returned is non null unless the thread has been asked not to wait anymore.

Returns:
the oldest request found in the queue.

blockingRemoveOldest

public Request blockingRemoveOldest(long timeout)
Blocks the calling thread until there is a request available but try to limit the time the thread is blocked to timeout. Returns immediately if there is already one. The request returned is non null if a request has been found during the given time.

Returns:
the oldest request found in the queue or null.

blockingRemoveYoungest

public Request blockingRemoveYoungest(RequestFilter requestFilter)
Blocks the calling thread until there is a request that can be accepted be the given RequestFilter. Returns immediately if there is already one. The request returned is non null unless the thread has been asked not to wait anymore.

Parameters:
requestFilter - the request filter that select the request to be returned
Returns:
the youngest request found in the queue that is accepted by the filter.

blockingRemoveYoungest

public Request blockingRemoveYoungest(java.lang.String methodName)
Blocks the calling thread until there is a request of name methodName Returns immediately if there is already one. The request returned is non null unless the thread has been asked not to wait anymore.

Parameters:
methodName - the name of the method to wait for
Returns:
the youngest request of name methodName found in the queue.

blockingRemoveYoungest

public Request blockingRemoveYoungest()
Blocks the calling thread until there is a request available Returns immediately if there is already one. The request returned is non null unless the thread has been asked not to wait anymore.

Returns:
the youngest request found in the queue.

blockingRemoveYoungest

public Request blockingRemoveYoungest(long timeout)
Blocks the calling thread until there is a request available but try to limit the time the thread is blocked to timeout. Returns immediately if there is already one. The request returned is non null if a request has been found during the given time.

Returns:
the youngest request found in the queue or null.

waitForRequest

public void waitForRequest()
Blocks the calling thread until there is a request available. The request is not removed from the queue. Returns immediately if there is already one.



Copyright © April 2004 INRIA All Rights Reserved.