|
|||||||||
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.AbstractBufferImpl
org.objectweb.dream.queue.BufferAscendingSequenceNumberImpl
public class BufferAscendingSequenceNumberImpl
Implementation of the Buffer
interface using a sorted list.
This buffer sorts messages according to a sequence number. For that purpose
all messages must contain a SequenceNumberChunk
chunk. The name under
which this chunk is registered is specified using the
BufferAttributeControllerSorted
.
This buffer guarantees that if message m1 (with sequence number sn ) is removed from the buffer, then next message to be removed will have sequence number sn+1 . As a consequence, the number of available message may be different from the number of stored messages.
Note: This buffer DOES NOT ALLOW incoming handlers that drop messages. Indicators on available space, available messages, and stored messages are expressed as number of messages.
BufferAdd
,
BufferRemove
,
AbstractBufferImpl
Nested Class Summary | |
---|---|
static class |
BufferAscendingSequenceNumberImpl.Element
This class represents elements of a linked list. |
Field Summary | |
---|---|
protected BufferAscendingSequenceNumberImpl.Element |
first
The first element stored in this buffer. |
protected BufferAscendingSequenceNumberImpl.Element |
last
The last element stored in this buffer. |
protected long |
lastInSequence
The last sequence number in sequence. |
protected String |
sortingChunkName
The name under which the chunk containing the sequence number is registered. |
Fields inherited from class org.objectweb.dream.queue.AbstractBufferImpl |
---|
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.BufferRemove |
---|
ITF_NAME |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
---|
STARTED, STOPPED |
Constructor Summary | |
---|---|
BufferAscendingSequenceNumberImpl()
|
Method Summary | |
---|---|
protected void |
doAdd(Message message)
Adds a message to the buffer. |
protected Message |
doGet()
Gets a message from the buffer. |
protected Message |
doRemove()
Removes a message from the buffer. |
Message |
doRemoveAll()
Removes all the messages stored into the buffer. |
long |
getLastInSequence()
Returns the sequence number of the last delivered message. |
String |
getSortingChunkName()
Returns the name of the chunk to be used to sort messages. |
String[] |
listFc()
|
void |
setLastInSequence(long lastInSequence)
Sets the sequence number of the last delivered message. |
void |
setSortingChunkName(String name)
Sets the name of the chunk to be used to sort messages. |
Methods inherited from class org.objectweb.dream.queue.AbstractBufferImpl |
---|
add, availableSpace, bindFc, 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 |
Methods inherited from interface org.objectweb.dream.queue.BufferAttributeController |
---|
getCurrentSize, getMaxCapacity, setMaxCapacity |
Field Detail |
---|
protected String sortingChunkName
protected long lastInSequence
protected BufferAscendingSequenceNumberImpl.Element first
protected BufferAscendingSequenceNumberImpl.Element last
Constructor Detail |
---|
public BufferAscendingSequenceNumberImpl()
Method Detail |
---|
protected void doAdd(Message message)
AbstractBufferImpl
AbstractBufferImpl.add(org.objectweb.dream.message.Message)
method. The lock
has been acquired when this
method is called.
doAdd
in class AbstractBufferImpl
message
- the message to be added.AbstractBufferImpl.doAdd(Message)
protected Message doRemove()
AbstractBufferImpl
AbstractBufferImpl.remove()
method. The lock
has been acquired when this
method is called.
doRemove
in class AbstractBufferImpl
AbstractBufferImpl.doRemove()
protected Message doGet()
AbstractBufferImpl
AbstractBufferImpl.get()
method. The lock
has been acquired when this method is
called.
doGet
in class AbstractBufferImpl
AbstractBufferImpl.doGet()
public Message doRemoveAll()
AbstractBufferImpl
lock
has
been acquired when this method is called.
doRemoveAll
in class AbstractBufferImpl
AbstractBufferImpl.doRemoveAll()
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(String)
public long getLastInSequence()
BufferAttributeControllerAscendingSequenceNumber
getLastInSequence
in interface BufferAttributeControllerAscendingSequenceNumber
BufferAttributeControllerAscendingSequenceNumber.getLastInSequence()
public void setLastInSequence(long lastInSequence)
BufferAttributeControllerAscendingSequenceNumber
setLastInSequence
in interface BufferAttributeControllerAscendingSequenceNumber
lastInSequence
- the sequence number to be set.BufferAttributeControllerAscendingSequenceNumber.setLastInSequence(long)
public String[] listFc()
listFc
in interface BindingController
listFc
in class AbstractBufferImpl
BindingController.listFc()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |