org.objectweb.dream.queue
Class AbstractPushIncomingHandlerOverflowImpl
java.lang.Object
org.objectweb.dream.AbstractComponent
org.objectweb.dream.queue.AbstractPushIncomingHandlerOverflowImpl
- All Implemented Interfaces:
- AttributeController, BindingController, LifeCycleController, Loggable, Push, PushQueueAttributeController
- Direct Known Subclasses:
- PushIncomingHandlerOverflowImpl
- public abstract class AbstractPushIncomingHandlerOverflowImpl
- extends AbstractComponent
- implements Push, PushQueueAttributeController
Abstract implementation of a Push incoming handler. It implements overflow
policies as defined in PushQueueAttributeController
. Moreover, it
implements the push
method: it checks for available space and
then applies appropriate policy.
Push incoming handler developers can inherit this class. They must implement
two methods:
canAdd(message)
returns a boolean indicating whether the
given message can be added into the buffer.
doAdd(message)
adds the given message into the buffer.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BLOCK_OVERFLOW_POLICY_ID
protected static final int BLOCK_OVERFLOW_POLICY_ID
- See Also:
- Constant Field Values
DROP_QUEUE_MESSAGE_OVERFLOW_POLICY_ID
protected static final int DROP_QUEUE_MESSAGE_OVERFLOW_POLICY_ID
- See Also:
- Constant Field Values
DROP_FIRST_OVERFLOW_POLICY_ID
protected static final int DROP_FIRST_OVERFLOW_POLICY_ID
- See Also:
- Constant Field Values
DROP_LAST_OVERFLOW_POLICY_ID
protected static final int DROP_LAST_OVERFLOW_POLICY_ID
- See Also:
- Constant Field Values
DROP_PROCESSED_MESSAGE_OVERFLOW_POLICY_ID
protected static final int DROP_PROCESSED_MESSAGE_OVERFLOW_POLICY_ID
- See Also:
- Constant Field Values
EXCEPTION_OVERFLOW_POLICY_ID
protected static final int EXCEPTION_OVERFLOW_POLICY_ID
- See Also:
- Constant Field Values
overflowPolicy
protected String overflowPolicy
overflowPolicyId
protected short overflowPolicyId
messageManagerItf
protected MessageManager messageManagerItf
bufferItf
protected Buffer bufferItf
bufferRemoveFirstLastItf
protected BufferRemoveFirstLast bufferRemoveFirstLastItf
bufferAddFirstLastItf
protected BufferAddFirstLast bufferAddFirstLastItf
AbstractPushIncomingHandlerOverflowImpl
public AbstractPushIncomingHandlerOverflowImpl()
push
public void push(Message message,
Map context)
throws PushException
- Specified by:
push
in interface Push
- Throws:
PushException
- See Also:
Push.push(org.objectweb.dream.message.Message,
java.util.Map)
canAdd
protected abstract boolean canAdd(Message message)
- Checks whether the given message can be added into the buffer.
- Parameters:
message
- the message to be tested.
- Returns:
true
if the message can be added.
doAdd
protected abstract void doAdd(Message message)
throws InterruptedException
- Adds a message to the buffer. This method should not check if there is
enough available space provided it has already been done.
- Parameters:
message
- the message to be added.
- Throws:
InterruptedException
- if it is interrupted while removing the
message.
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)
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)
listFc
public String[] listFc()
- Specified by:
listFc
in interface BindingController
- See Also:
BindingController.listFc()
Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.