org.objectweb.dream.queue
Class AbstractPushQueueImpl
java.lang.Object
org.objectweb.dream.AbstractComponent
org.objectweb.dream.queue.AbstractPushQueueImpl
- All Implemented Interfaces:
- AttributeController, BindingController, LifeCycleController, Loggable, Push, PushQueueAttributeController, QueueAttributeController
- Direct Known Subclasses:
- BasicPushPullKeyQueueImpl, BasicPushPullQueueImpl, BasicPushPushActiveQueueImpl, BasicPushPushPassiveQueueImpl
- public abstract class AbstractPushQueueImpl
- extends AbstractComponent
- implements Push, PushQueueAttributeController
Abstract implementation of a input push queue. It implements overflow
policies as defined in PushQueueAttributeController
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
messageManagerItf
protected MessageManager messageManagerItf
waitingList
protected LinkedList waitingList
maxCapacity
protected int maxCapacity
overflowPolicy
protected String overflowPolicy
AbstractPushQueueImpl
public AbstractPushQueueImpl()
push
public void push(Message message,
Map context)
throws PushException
- Specified by:
push
in interface Push
- Throws:
PushException
- See Also:
Push.push(Message, Map)
handleOverflow
protected boolean handleOverflow()
throws BufferOverflowException,
InterruptedPushException
- Handle current overflow policy, and returns
true
if message
can be put in the waiting list.
- Returns:
true
if message can be put in the waiting list.
- Throws:
BufferOverflowException
- thrown when overflow policy is
PushQueueAttributeController.EXCEPTION_OVERFLOW_POLICY
and queue is full
InterruptedPushException
- thrown when overflow policy is
PushQueueAttributeController.BLOCK_OVERFLOW_POLICY
and
the queue is full and the thread has been interrupted.
getOverflowPolicy
public String getOverflowPolicy()
- Description copied from interface:
PushQueueAttributeController
- Returns the overflow policy.
- Specified by:
getOverflowPolicy
in interface PushQueueAttributeController
- Returns:
- the overflow policy.
- See Also:
PushQueueAttributeController.getOverflowPolicy()
setOverflowPolicy
public void setOverflowPolicy(String policy)
- Description copied from interface:
PushQueueAttributeController
- Sets the overflow policy.
- Specified by:
setOverflowPolicy
in interface PushQueueAttributeController
- Parameters:
policy
- the overflow policy.- See Also:
PushQueueAttributeController.setOverflowPolicy(String)
getCurrentSize
public int getCurrentSize()
- Description copied from interface:
QueueAttributeController
- Returns the current size of the queue.
- Specified by:
getCurrentSize
in interface QueueAttributeController
- Returns:
- the current size of the queue.
- See Also:
QueueAttributeController.getCurrentSize()
getMaxCapacity
public int getMaxCapacity()
- Description copied from interface:
QueueAttributeController
- Returns the maximum capacity of the queue.
- Specified by:
getMaxCapacity
in interface QueueAttributeController
- Returns:
- the maximum capacity of the queue.
- See Also:
QueueAttributeController.getMaxCapacity()
setMaxCapacity
public void setMaxCapacity(int maxCapacity)
- Description copied from interface:
QueueAttributeController
- Sets the maximum capacity of the queue.
- Specified by:
setMaxCapacity
in interface QueueAttributeController
- Parameters:
maxCapacity
- the maximum capacity of the queue.- See Also:
QueueAttributeController.setMaxCapacity(int)
bindFc
public void bindFc(String clientItfName,
Object serverItf)
throws NoSuchInterfaceException,
IllegalBindingException,
IllegalLifeCycleException
- Specified by:
bindFc
in interface BindingController
- Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
- See Also:
BindingController.bindFc(String,
Object)
Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.