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

All Known Subinterfaces:
BlockingRequestQueue, ComponentRequestQueue
All Known Implementing Classes:
BlockingRequestQueueImpl, ComponentRequestQueueImpl, RequestQueueImpl

public interface RequestQueue


Method Summary
 void add(Request request)
          Adds the given request to the end of the queue
 void addRequestQueueEventListener(RequestQueueEventListener listener)
           
 void addToFront(Request request)
          Adds the given request to the front of the queue before all other request already in the queue
 void clear()
           
 Request getOldest()
          Returns the oldest request from the queue or null if the queue is empty Do not remove it from the queue
 Request getOldest(RequestFilter requestFilter)
          Returns the oldest request that matches the criteria defined by the given filter Do not remove it from the request line
 Request getOldest(java.lang.String methodName)
          Returns the oldest request whose method name is s or null if no match Do not remove it from the queue
 Request getYoungest()
          Returns the youngest request from the queue or null if the queue is empty Do not remove it from the request line
 Request getYoungest(RequestFilter requestFilter)
          Returns the youngest request that matches the criteria defined by the given filter Do not remove it from the request line
 Request getYoungest(java.lang.String methodName)
          Returns the youngest request whose method name is s or null if no match Do not remove it from the request line
 boolean hasRequest(java.lang.String s)
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
          Returns an iterator over all the requests in the request queue.
 void processRequests(RequestProcessor processor, Body body)
          Processes all requests in the queue using the given RequestProcessor.
 Request removeOldest()
          Removes the oldest request from the queue and returns it Null is returned is the queue is empty
 Request removeOldest(RequestFilter requestFilter)
          Removes the oldest request that matches the criteria defined by the given filter Null is returned is no match
 Request removeOldest(java.lang.String methodName)
          Removes the oldest request whose method name is s and returns it.
 void removeRequestQueueEventListener(RequestQueueEventListener listener)
           
 Request removeYoungest()
          Removes the youngest request from the queue and returns it Null is returned is the queue is empty
 Request removeYoungest(RequestFilter requestFilter)
          Removes the youngest request that matches the criteria defined by the given filter Null is returned is no match
 Request removeYoungest(java.lang.String methodName)
          Removes the youngest request whose method name is s and returns it.
 int size()
           
 

Method Detail

iterator

public java.util.Iterator iterator()
Returns an iterator over all the requests in the request queue. It is up to the programmer to protect himself against any change in the request queue while using this iterator.


isEmpty

public boolean isEmpty()

size

public int size()

hasRequest

public boolean hasRequest(java.lang.String s)

clear

public void clear()

getOldest

public Request getOldest()
Returns the oldest request from the queue or null if the queue is empty Do not remove it from the queue

Returns:
the oldest request or null

getOldest

public Request getOldest(java.lang.String methodName)
Returns the oldest request whose method name is s or null if no match Do not remove it from the queue

Parameters:
methodName - the name of the method to look for
Returns:
the oldest matching request or null

getOldest

public Request getOldest(RequestFilter requestFilter)
Returns the oldest request that matches the criteria defined by the given filter Do not remove it from the request line

Parameters:
requestFilter - the filter accepting request on a given criteria
Returns:
the oldest matching request or null

removeOldest

public Request removeOldest()
Removes the oldest request from the queue and returns it Null is returned is the queue is empty

Returns:
the oldest request or null

removeOldest

public Request removeOldest(java.lang.String methodName)
Removes the oldest request whose method name is s and returns it. Null is returned is no match

Parameters:
methodName - the name of the method to look for
Returns:
the oldest matching request or null

removeOldest

public Request removeOldest(RequestFilter requestFilter)
Removes the oldest request that matches the criteria defined by the given filter Null is returned is no match

Parameters:
requestFilter - the filter accepting request on a given criteria
Returns:
the oldest matching request or null

getYoungest

public Request getYoungest()
Returns the youngest request from the queue or null if the queue is empty Do not remove it from the request line

Returns:
the youngest request or null

getYoungest

public Request getYoungest(java.lang.String methodName)
Returns the youngest request whose method name is s or null if no match Do not remove it from the request line

Parameters:
methodName - the name of the method to look for
Returns:
the youngest matching request or null

getYoungest

public Request getYoungest(RequestFilter requestFilter)
Returns the youngest request that matches the criteria defined by the given filter Do not remove it from the request line

Parameters:
requestFilter - the filter accepting request on a given criteria
Returns:
the youngest matching request or null

removeYoungest

public Request removeYoungest()
Removes the youngest request from the queue and returns it Null is returned is the queue is empty

Returns:
the youngest request or null

removeYoungest

public Request removeYoungest(java.lang.String methodName)
Removes the youngest request whose method name is s and returns it. Null is returned is no match

Parameters:
methodName - the name of the method to look for
Returns:
the youngest matching request or null

removeYoungest

public Request removeYoungest(RequestFilter requestFilter)
Removes the youngest request that matches the criteria defined by the given filter Null is returned is no match

Parameters:
requestFilter - the filter accepting request on a given criteria
Returns:
the youngest matching request or null

add

public void add(Request request)
Adds the given request to the end of the queue

Parameters:
request - the request to add

addToFront

public void addToFront(Request request)
Adds the given request to the front of the queue before all other request already in the queue

Parameters:
request - the request to add

processRequests

public void processRequests(RequestProcessor processor,
                            Body body)
Processes all requests in the queue using the given RequestProcessor. Requests are removed from the queue and served depending on the result returned by the processor

Parameters:
processor - the RequestProcessor to use
body - the body that processes the requests

addRequestQueueEventListener

public void addRequestQueueEventListener(RequestQueueEventListener listener)

removeRequestQueueEventListener

public void removeRequestQueueEventListener(RequestQueueEventListener listener)


Copyright © April 2004 INRIA All Rights Reserved.