org.objectweb.dream.queue
Class BufferSortingImpl
java.lang.Object
org.objectweb.dream.AbstractComponent
org.objectweb.dream.queue.AbstractBufferImpl
org.objectweb.dream.queue.BufferSortingImpl
- All Implemented Interfaces:
- ContextualBindingController, NeedAsyncStartController, PrepareStopLifeCycleController, Loggable, BufferAdd, BufferAttributeController, BufferRemove, AttributeController, BindingController, LifeCycleController
public class BufferSortingImpl
- extends AbstractBufferImpl
A buffer in which stored messages are available to get
or
remove
in the order of the "key" that is calculated for
each message by the MessageComparableKeyManager
component bound to
this component when adding
each message. Messages that
have the "highest" key are retrieved first.
Methods inherited from class org.objectweb.dream.queue.AbstractBufferImpl |
add, availableSpace, canAdd, get, getCurrentSize, getMaxCapacity, hasAvailableMessage, incrementAvailableMessagesCount, incrementStoredMessagesCount, 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 |
CLIENT_INTERFACE_NAMES
protected static final String[] CLIENT_INTERFACE_NAMES
- The names of client interfaces.
messageComparableKeyManager
protected MessageComparableKeyManager messageComparableKeyManager
- Used to calculate a key for each added message.
messages
protected SortedMap<Comparable,Message> messages
- The messages stored in this buffer, indexed by their key.
BufferSortingImpl
public BufferSortingImpl()
doAdd
protected void doAdd(Message message)
- Description copied from class:
AbstractBufferImpl
- 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
AbstractBufferImpl.add(org.objectweb.dream.message.Message)
method. The lock
has been acquired when this
method is called.
- Specified by:
doAdd
in class AbstractBufferImpl
- Parameters:
message
- the message to be added.
doGet
protected Message doGet()
- Description copied from class:
AbstractBufferImpl
- 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
AbstractBufferImpl.get()
method. The lock
has been acquired when this method is
called.
- Specified by:
doGet
in class AbstractBufferImpl
- Returns:
- a message.
doRemove
protected Message doRemove()
- Description copied from class:
AbstractBufferImpl
- 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
AbstractBufferImpl.remove()
method. The lock
has been acquired when this
method is called.
- Specified by:
doRemove
in class AbstractBufferImpl
- Returns:
- a message.
doRemoveAll
protected Message doRemoveAll()
- Description copied from class:
AbstractBufferImpl
- Removes all the messages stored into the buffer. The
lock
has
been acquired when this method is called.
- Specified by:
doRemoveAll
in class AbstractBufferImpl
- Returns:
- an aggregated message.
listFc
public String[] listFc()
- Specified by:
listFc
in interface BindingController
- Overrides:
listFc
in class AbstractBufferImpl
- See Also:
BindingController.listFc()
bindFc
public void bindFc(String clientItfName,
Object serverItf)
throws NoSuchInterfaceException,
IllegalBindingException,
IllegalLifeCycleException
- Specified by:
bindFc
in interface BindingController
- Overrides:
bindFc
in class AbstractBufferImpl
- Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
- See Also:
BindingController.bindFc(String,
Object)
Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.