|
|||||||||
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.AbstractBufferKeyedAddKeyedRemoveImpl
org.objectweb.dream.queue.keyed.BufferAscendingSequenceNumberKeyedAddKeyedRemoveImpl
public class BufferAscendingSequenceNumberKeyedAddKeyedRemoveImpl
This buffer stores incoming messages according to
SequenceNumberChunk
class. The name of this chunk can be specified
using the
BufferAttributeControllerAscendingSequenceNumber
AbstractBufferKeyedAddKeyedRemoveImpl.add(Message, Object)
method.doRemove(Object)
method removes the last message in sequence for
the specified key.
For each key, when there is a gap upon adding a message, missing sequence
numbers are made known using the MissingSequenceNumberKeyBased
interface. For instance, a component can use this interface to issue
retransmission requests.
Field Summary | |
---|---|
protected MessageManager |
messageManagerItf
|
protected MissingSequenceNumberKeyBased |
missingSequenceNumberKeyBasedItf
|
Fields inherited from class org.objectweb.dream.queue.keyed.AbstractBufferKeyedAddKeyedRemoveImpl |
---|
availableMessagesCount, CLIENT_INTERFACE_NAMES, lock, maxCapacity, storedMessagesCount |
Fields inherited from class org.objectweb.dream.AbstractComponent |
---|
bindingLogger, fcNeedAsyncStart, fcState, lifeCycleLogger, logger, weaveableC |
Fields inherited from interface org.objectweb.dream.queue.keyed.KeyedBufferAdd |
---|
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 | |
---|---|
BufferAscendingSequenceNumberKeyedAddKeyedRemoveImpl()
|
Method Summary | |
---|---|
void |
bindFc(String clientItfName,
Object serverItf)
|
protected void |
doAdd(Message message,
Object key)
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. |
Object[] |
getKeys()
Returns an array containing the keys that are used in the buffer. |
long |
getLastInSequence(Object key)
Returns the sequence number of the last delivered message for the given key. |
String |
getSortingChunkName()
Returns the name of the chunk to be used to sort messages. |
protected boolean |
hasAvailableMessage(Object key)
Checks whether there is a message available to get or remove. |
String[] |
listFc()
|
void |
setLastInSequence(Object key,
long lastInSequence)
Sets the sequence number of the last delivered message for the given key. |
void |
setSortingChunkName(String name)
Sets the name of the chunk to be used to sort messages. |
Methods inherited from class org.objectweb.dream.queue.keyed.AbstractBufferKeyedAddKeyedRemoveImpl |
---|
add, availableSpace, canAdd, get, getCurrentSize, getMaxCapacity, 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 |
Methods inherited from interface org.objectweb.dream.queue.BufferAttributeController |
---|
getCurrentSize, getMaxCapacity, setMaxCapacity |
Field Detail |
---|
protected MissingSequenceNumberKeyBased missingSequenceNumberKeyBasedItf
protected MessageManager messageManagerItf
Constructor Detail |
---|
public BufferAscendingSequenceNumberKeyedAddKeyedRemoveImpl()
Method Detail |
---|
protected void doAdd(Message message, Object key)
AbstractBufferKeyedAddKeyedRemoveImpl
AbstractBufferKeyedAddKeyedRemoveImpl.add(org.objectweb.dream.message.Message, java.lang.Object)
method. The lock
has been acquired when this
method is called.
doAdd
in class AbstractBufferKeyedAddKeyedRemoveImpl
message
- the message to be added.AbstractBufferKeyedAddKeyedRemoveImpl.doAdd(Message, Object)
protected Message doRemove(Object key)
AbstractBufferKeyedAddKeyedRemoveImpl
AbstractBufferKeyedAddKeyedRemoveImpl.remove(java.lang.Object)
method. The lock
has been acquired when this
method is called.
doRemove
in class AbstractBufferKeyedAddKeyedRemoveImpl
AbstractBufferKeyedAddKeyedRemoveImpl.doRemove(Object)
protected Message doRemoveAll()
AbstractBufferKeyedAddKeyedRemoveImpl
lock
has
been acquired when this method is called.
doRemoveAll
in class AbstractBufferKeyedAddKeyedRemoveImpl
AbstractBufferKeyedAddKeyedRemoveImpl.doRemoveAll()
protected Message doGet(Object key)
AbstractBufferKeyedAddKeyedRemoveImpl
AbstractBufferKeyedAddKeyedRemoveImpl.get(java.lang.Object)
method. The lock
has been acquired when this method is
called.
doGet
in class AbstractBufferKeyedAddKeyedRemoveImpl
AbstractBufferKeyedAddKeyedRemoveImpl.doGet(Object)
protected boolean hasAvailableMessage(Object key)
AbstractBufferKeyedAddKeyedRemoveImpl
hasAvailableMessage
in class AbstractBufferKeyedAddKeyedRemoveImpl
true
if there is an available message.AbstractBufferKeyedAddKeyedRemoveImpl.hasAvailableMessage(Object)
public String getSortingChunkName()
BufferAttributeControllerSorted
getSortingChunkName
in interface BufferAttributeControllerSorted
BufferAttributeControllerSorted.getSortingChunkName()
public void setSortingChunkName(String name)
BufferAttributeControllerSorted
setSortingChunkName
in interface BufferAttributeControllerSorted
name
- the name of the chunk to be used to sort messages.BufferAttributeControllerSorted.setSortingChunkName(java.lang.String)
public Object[] getKeys()
BufferAttributeControllerKeyed
getKeys
in interface BufferAttributeControllerKeyed
BufferAttributeControllerKeyed.getKeys()
public long getLastInSequence(Object key) throws InterruptedException
BufferAttributeControllerAscendingSequenceNumberKeyedAdd
getLastInSequence
in interface BufferAttributeControllerAscendingSequenceNumberKeyedAdd
key
- the key for which the last sequence number in sequence must be
returned.
InterruptedException
- if it is interrupted while waiting for the
mutex to be acquired.BufferAttributeControllerAscendingSequenceNumberKeyedAdd.getLastInSequence(Object)
public void setLastInSequence(Object key, long lastInSequence) throws InterruptedException
BufferAttributeControllerAscendingSequenceNumberKeyedAdd
setLastInSequence
in interface BufferAttributeControllerAscendingSequenceNumberKeyedAdd
key
- the key for which the last sequence number in sequence must be
set.lastInSequence
- the sequence number to be set.
InterruptedException
- if it is interrupted while waiting for the
mutex to be acquired.BufferAttributeControllerAscendingSequenceNumberKeyedAdd.setLastInSequence(Object,long)
public void bindFc(String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
bindFc
in interface BindingController
bindFc
in class AbstractBufferKeyedAddKeyedRemoveImpl
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
BindingController.bindFc(java.lang.String,
java.lang.Object)
public String[] listFc()
listFc
in interface BindingController
listFc
in class AbstractBufferKeyedAddKeyedRemoveImpl
BindingController.listFc()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |