org.objectweb.dream.queue.keyed
Class BufferKeyedAddKeyedRemoveImpl
java.lang.Object
org.objectweb.dream.AbstractComponent
org.objectweb.dream.queue.keyed.AbstractBufferKeyedAddKeyedRemoveImpl
org.objectweb.dream.queue.keyed.BufferKeyedAddKeyedRemoveImpl
- All Implemented Interfaces:
- ContextualBindingController, NeedAsyncStartController, PrepareStopLifeCycleController, Loggable, BufferAttributeController, KeyedBufferAdd, KeyedBufferRemove, AttributeController, BindingController, LifeCycleController
public class BufferKeyedAddKeyedRemoveImpl
- extends AbstractBufferKeyedAddKeyedRemoveImpl
Buffer that uses keys to sort messages. The key corresponding to a message is
explicitely passed as a parameter, when adding the message using the
AbstractBufferKeyedAddKeyedRemoveImpl.add(Message, Object)
method. The doRemove(Object)
method
removes the message with the specified key. If no key is specified in the
doRemove()
method, this latter returns the message with the
highest key.
Note: Keys must implement the Comparable
interface.
Methods inherited from class org.objectweb.dream.queue.keyed.AbstractBufferKeyedAddKeyedRemoveImpl |
add, availableSpace, bindFc, canAdd, get, getCurrentSize, getMaxCapacity, hasAvailableMessage, incrementAvailableMessagesCount, incrementStoredMessagesCount, listFc, remove, removeAll, setMaxCapacity, tryAdd, tryGet, tryRemove |
Methods inherited from class org.objectweb.dream.AbstractComponent |
beforeFirstStart, bindFc, getFcNeedAsyncStart, getFcState, initComponent, lookupFc, prepareStopFc, setLogger, startFc, stopFc, unbindFc |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BufferKeyedAddKeyedRemoveImpl
public BufferKeyedAddKeyedRemoveImpl()
doAdd
protected void doAdd(Message message,
Object key)
- Description copied from class:
AbstractBufferKeyedAddKeyedRemoveImpl
- Adds a message to the buffer. This method should not check if there is
enough available space provided it has already been done in the
AbstractBufferKeyedAddKeyedRemoveImpl.add(org.objectweb.dream.message.Message, java.lang.Object)
method. The lock
has been acquired when this
method is called.
- Specified by:
doAdd
in class AbstractBufferKeyedAddKeyedRemoveImpl
- Parameters:
message
- the message to be added.
doGet
protected Message doGet(Object key)
- Description copied from class:
AbstractBufferKeyedAddKeyedRemoveImpl
- Gets a message from the buffer. This method should not check if there is a
message available provided it has already been done in the
AbstractBufferKeyedAddKeyedRemoveImpl.get(java.lang.Object)
method. The lock
has been acquired when this method is
called.
- Specified by:
doGet
in class AbstractBufferKeyedAddKeyedRemoveImpl
- Returns:
- a message.
doRemove
protected Message doRemove(Object key)
- Description copied from class:
AbstractBufferKeyedAddKeyedRemoveImpl
- Removes a message from the buffer. This method should not check if there is
a message available provided it has already been done in the
AbstractBufferKeyedAddKeyedRemoveImpl.remove(java.lang.Object)
method. The lock
has been acquired when this
method is called.
- Specified by:
doRemove
in class AbstractBufferKeyedAddKeyedRemoveImpl
- Returns:
- a message.
doRemoveAll
protected Message doRemoveAll()
- Description copied from class:
AbstractBufferKeyedAddKeyedRemoveImpl
- Removes all the messages stored into the buffer. The
lock
has
been acquired when this method is called.
- Specified by:
doRemoveAll
in class AbstractBufferKeyedAddKeyedRemoveImpl
- Returns:
- an aggregated message.
Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.