|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.dream.AbstractComponent
org.objectweb.dream.queue.keyed.AbstractBufferKeyedRemoveImpl
org.objectweb.dream.queue.keyed.BufferKeyChunkAddKeyedRemoveImpl
public class BufferKeyChunkAddKeyedRemoveImpl
This buffer stores every incoming message according to a key that is
contained in the message as a chunk
which name can be
specified as a Fractal component attribute using the interface of type
BufferAttributeControllerKeyChunkAdd
. The doRemove(Object)
method removes the message with the specified key.
Field Summary | |
---|---|
protected String |
keyChunkName
|
protected TreeMap<AbstractChunk,LinkedList<Message>> |
queue
Used to sort the messages according to the key that is a chunk in every message added to this buffer. |
Fields inherited from class org.objectweb.dream.queue.keyed.AbstractBufferKeyedRemoveImpl |
---|
availableMessagesCount, CLIENT_INTERFACE_NAMES, lock, maxCapacity, messageManagerItf, storedMessagesCount |
Fields inherited from class org.objectweb.dream.AbstractComponent |
---|
bindingLogger, fcNeedAsyncStart, fcState, lifeCycleLogger, logger, weaveableC |
Fields inherited from interface org.objectweb.dream.queue.BufferAdd |
---|
ITF_NAME |
Fields inherited from interface org.objectweb.dream.queue.keyed.KeyedBufferRemove |
---|
ITF_NAME |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
---|
STARTED, STOPPED |
Constructor Summary | |
---|---|
BufferKeyChunkAddKeyedRemoveImpl()
|
Method Summary | |
---|---|
protected boolean |
canAdd(Message message)
Checks whether the given message can be added into the buffer. |
protected void |
doAdd(Message message)
Adds a message to the buffer. |
protected Message |
doGet(Object key)
Gets a message from the buffer. |
protected Message |
doRemove(Object key)
Removes a message from the buffer. |
protected Message |
doRemoveAll()
Removes all the messages stored into the buffer. |
String |
getKeyChunkName()
Returns the name of the chunk that is used as a key. |
void |
setKeyChunkName(String keyChunkName)
Sets the name of the chunk that is used as a key. |
Methods inherited from class org.objectweb.dream.queue.keyed.AbstractBufferKeyedRemoveImpl |
---|
add, availableSpace, bindFc, 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 |
Methods inherited from interface org.objectweb.dream.queue.BufferAttributeController |
---|
getCurrentSize, getMaxCapacity, setMaxCapacity |
Field Detail |
---|
protected String keyChunkName
protected TreeMap<AbstractChunk,LinkedList<Message>> queue
Constructor Detail |
---|
public BufferKeyChunkAddKeyedRemoveImpl()
Method Detail |
---|
protected void doAdd(Message message)
AbstractBufferKeyedRemoveImpl
AbstractBufferKeyedRemoveImpl.add(org.objectweb.dream.message.Message)
method. The lock
has been acquired when this
method is called.
doAdd
in class AbstractBufferKeyedRemoveImpl
message
- the message to be added.protected Message doRemove(Object key)
AbstractBufferKeyedRemoveImpl
AbstractBufferKeyedRemoveImpl.remove(java.lang.Object)
method. The lock
has been acquired when this
method is called.
doRemove
in class AbstractBufferKeyedRemoveImpl
protected Message doGet(Object key)
AbstractBufferKeyedRemoveImpl
AbstractBufferKeyedRemoveImpl.get(java.lang.Object)
method. The lock
has been acquired when this method is
called.
doGet
in class AbstractBufferKeyedRemoveImpl
protected Message doRemoveAll()
AbstractBufferKeyedRemoveImpl
lock
has
been acquired when this method is called.
doRemoveAll
in class AbstractBufferKeyedRemoveImpl
protected boolean canAdd(Message message)
AbstractBufferKeyedRemoveImpl
lock
has been acquired when this method is called.
canAdd
in class AbstractBufferKeyedRemoveImpl
message
- the message to be tested.
true
if the message can be added.public void setKeyChunkName(String keyChunkName)
BufferAttributeControllerKeyChunkAdd
setKeyChunkName
in interface BufferAttributeControllerKeyChunkAdd
keyChunkName
- the name of the chunk.BufferAttributeControllerKeyChunkAdd.setKeyChunkName(String)
public String getKeyChunkName()
BufferAttributeControllerKeyChunkAdd
getKeyChunkName
in interface BufferAttributeControllerKeyChunkAdd
BufferAttributeControllerKeyChunkAdd.getKeyChunkName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |