|
||||||||||
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
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
QueueSortedAttributeController
.
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 overflow policies that drop messages. Indicators on available space, available messages, and stored messages are expressed as number of messages.
Buffer
,
@
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 ObjectPool |
objectPoolItf
The client interface used to access the pool of BufferAscendingSequenceNumberImpl.Element instances. |
protected String |
sortingChunkName
The name under which the chunk containing the sequence number is registered. |
Fields inherited from class org.objectweb.dream.queue.AbstractBufferImpl |
availableMessagesIndicator, lock, maxCapacity, messageManagerItf, storedMessagesIndicator |
Fields inherited from class org.objectweb.dream.AbstractComponent |
bindingLogger, componentDesc, fcState, firstStart, lifeCycleLogger, logger, weaveableC |
Fields inherited from interface org.objectweb.dream.queue.Buffer |
ITF_NAME |
Fields inherited from interface org.objectweb.dream.queue.BufferAddFirstLast |
ITF_NAME |
Fields inherited from interface org.objectweb.dream.queue.BufferRemoveFirstLast |
ITF_NAME |
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController |
STARTED, STOPPED |
Constructor Summary | |
BufferAscendingSequenceNumberImpl()
|
Method Summary | |
void |
bindFc(String clientItfName,
Object serverItf)
|
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()
Gets a message from the buffer. |
protected Message |
doRemove()
Removes a message from the buffer. |
String |
getSortingChunkName()
Returns the name of the chunk to be used to sort messages. |
protected boolean |
hasAvailableMessage()
Checks whether there is an available message. |
String[] |
listFc()
|
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, addFirst, addLast, availableMessagesIndicator, availableSpaceIndicator, doAddFirst, doAddLast, doGetFirst, doGetLast, doRemoveFirst, doRemoveLast, get, getCurrentSize, getFirst, getLast, getMaxCapacity, incrementAvailableMessagesIndicator, incrementStoredMessagesIndicator, remove, removeFirst, removeLast, setMaxCapacity, storedMessagesIndicator |
Methods inherited from class org.objectweb.dream.AbstractComponent |
beforeFirstStart, getFcState, initComponent, lookupFc, 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.QueueAttributeController |
getCurrentSize, getMaxCapacity, setMaxCapacity |
Field Detail |
protected String sortingChunkName
protected BufferAscendingSequenceNumberImpl.Element first
protected BufferAscendingSequenceNumberImpl.Element last
protected ObjectPool objectPoolItf
BufferAscendingSequenceNumberImpl.Element
instances.
protected long lastInSequence
Constructor Detail |
public BufferAscendingSequenceNumberImpl()
Method Detail |
protected boolean hasAvailableMessage()
AbstractBufferImpl
hasAvailableMessage
in class AbstractBufferImpl
true
if there is an available message.AbstractBufferImpl.hasAvailableMessage()
protected boolean canAdd(Message message)
AbstractBufferImpl
canAdd
in class AbstractBufferImpl
message
- the message to be tested.
true
if the message can be added.AbstractBufferImpl.canAdd(org.objectweb.dream.message.Message)
protected void doAdd(Message message)
AbstractBufferImpl
AbstractBufferImpl.add(org.objectweb.dream.message.Message)
method.
doAdd
in class AbstractBufferImpl
message
- the message to be added.AbstractBufferImpl.doAdd(org.objectweb.dream.message.Message)
protected Message doRemove()
AbstractBufferImpl
AbstractBufferImpl.remove()
method.
doRemove
in class AbstractBufferImpl
AbstractBufferImpl.doRemove()
protected Message doGet()
AbstractBufferImpl
AbstractBufferImpl.remove()
method.
doGet
in class AbstractBufferImpl
AbstractBufferImpl.doGet()
public String getSortingChunkName()
QueueSortedAttributeController
getSortingChunkName
in interface QueueSortedAttributeController
QueueSortedAttributeController.getSortingChunkName()
public void setSortingChunkName(String name)
QueueSortedAttributeController
setSortingChunkName
in interface QueueSortedAttributeController
name
- the name of the chunk to be used to sort messages.QueueSortedAttributeController.setSortingChunkName(String)
public void bindFc(String clientItfName, Object serverItf) throws NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException
bindFc
in interface BindingController
bindFc
in class AbstractBufferImpl
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
BindingController.bindFc(String,
Object)
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 |