org.objectweb.proactive.core.component.request
Class ComponentRequestQueueImpl

java.lang.Object
  |
  +--org.objectweb.proactive.core.event.AbstractEventProducer
        |
        +--org.objectweb.proactive.core.body.request.RequestQueueImpl
              |
              +--org.objectweb.proactive.core.body.request.BlockingRequestQueueImpl
                    |
                    +--org.objectweb.proactive.core.component.request.ComponentRequestQueueImpl
All Implemented Interfaces:
BlockingRequestQueue, ComponentRequestQueue, RequestQueue, java.io.Serializable

public class ComponentRequestQueueImpl
extends BlockingRequestQueueImpl
implements ComponentRequestQueue

Extension of the standard ProActive request queue. It enables the control of the life cycle of components. The algorithm is the following : loop if componentLifeCycle.isStarted() get next request // all requests are served else if componentLifeCycle.isStopped() get next component controller request // only component request are served ; if gotten request is a component life cycle request if startFc --> set started = true if stopFc --> set started = false

Author:
Matthieu Morel
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
AbstractEventProducer.ListenerList
 
Field Summary
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class org.objectweb.proactive.core.body.request.BlockingRequestQueueImpl
shouldWait
 
Fields inherited from class org.objectweb.proactive.core.body.request.RequestQueueImpl
ownerID, requestQueue, SEND_ADD_REMOVE_EVENT
 
Fields inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
eventListeners, shouldSerializeListeners
 
Constructor Summary
ComponentRequestQueueImpl(UniqueID ownerID)
          Constructor for ComponentRequestQueueImpl.
 
Method Summary
 Request blockingRemoveOldest()
          Blocks the calling thread until there is a request available Returns immediately if there is already one.
 boolean isStarted()
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.objectweb.proactive.core.body.request.BlockingRequestQueueImpl
add, addToFront, blockingRemove, blockingRemove, blockingRemove, blockingRemove, blockingRemoveOldest, blockingRemoveOldest, blockingRemoveOldest, blockingRemoveYoungest, blockingRemoveYoungest, blockingRemoveYoungest, blockingRemoveYoungest, destroy, isDestroyed, waitForRequest
 
Methods inherited from class org.objectweb.proactive.core.body.request.RequestQueueImpl
addRequestQueueEventListener, clear, getOldest, getOldest, getOldest, getYoungest, getYoungest, getYoungest, hasRequest, isEmpty, iterator, notifyOneListener, processRequests, removeOldest, removeOldest, removeOldest, removeRequestQueueEventListener, removeYoungest, removeYoungest, removeYoungest, size, toString
 
Methods inherited from class org.objectweb.proactive.core.event.AbstractEventProducer
addListener, hasListeners, notifyAllListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.proactive.core.body.request.BlockingRequestQueue
blockingRemoveOldest, blockingRemoveOldest, blockingRemoveOldest, blockingRemoveYoungest, blockingRemoveYoungest, blockingRemoveYoungest, blockingRemoveYoungest, destroy, isDestroyed, waitForRequest
 
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
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

ComponentRequestQueueImpl

public ComponentRequestQueueImpl(UniqueID ownerID)
Constructor for ComponentRequestQueueImpl.

Parameters:
ownerID -
Method Detail

start

public void start()
Specified by:
start in interface ComponentRequestQueue

stop

public void stop()
Specified by:
stop in interface ComponentRequestQueue

isStarted

public boolean isStarted()
Specified by:
isStarted in interface ComponentRequestQueue

blockingRemoveOldest

public Request blockingRemoveOldest()
Description copied from interface: BlockingRequestQueue
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.

Specified by:
blockingRemoveOldest in interface BlockingRequestQueue
Overrides:
blockingRemoveOldest in class BlockingRequestQueueImpl
Returns:
the oldest request found in the queue.


Copyright © April 2004 INRIA All Rights Reserved.