Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* DREAM
* Copyright (C) 2003-2004 INRIA Rhone-Alpes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact : [email protected]
*
* Initial developer(s): Vivien Quema
* Contributor(s): Romain Lenglet
*/
package org.objectweb.dream.queue.keyed.buffer;
import java.util.HashMap;
import java.util.Map;
import org.objectweb.dream.message.Message;
import org.objectweb.dream.message.MessageManagerType;
import org.objectweb.dream.queue.SequenceNumberChunk;
import org.objectweb.dream.queue.keyed.MissingSequenceNumberKeyBased;
import org.objectweb.dream.util.Error;
import org.objectweb.fractal.api.Component;
import org.objectweb.fractal.fraclet.annotation.annotations.Attribute;
import org.objectweb.fractal.fraclet.annotation.annotations.Service;
import org.objectweb.dream.dreamannotation.DreamComponent;
import org.objectweb.dream.dreamannotation.DreamMonolog;
import org.objectweb.fractal.fraclet.annotation.annotations.Requires;
import org.objectweb.util.monolog.api.BasicLevel;
import org.objectweb.util.monolog.api.Logger;
/**
* This buffer stores incoming messages according to
*
*
a sequence number that is retrieved using a chunk that extends the
* {@link SequenceNumberChunk}class. The name of this chunk can be specified
* using the
* {@link org.objectweb.dream.queue.buffer.BufferAttributeControllerAscendingSequenceNumber}
*
*
a key that is explicitely passed as a parameter, when adding the message
* using the {@link #add(Message, Object)}method.
*
* The {@link #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 {@link MissingSequenceNumberKeyBased}
* interface. For instance, a component can use this interface to issue
* retransmission requests.
*/
@DreamComponent(controllerDesc = "dreamUnstoppablePrimitive")
public class BufferAscendingSequenceNumberKeyedAddKeyedRemove
extends
AbstractBufferKeyedAddKeyedRemove
{
// ---------------------------------------------------------------------------
// client interface.
// ---------------------------------------------------------------------------
@Requires(name = MissingSequenceNumberKeyBased.ITF_NAME)
protected MissingSequenceNumberKeyBased missingSequenceNumberKeyBasedItf;
@Requires(name = "message-manager")
protected MessageManagerType messageManagerItf;
// --------------------------------------------------------------------------
// Services interfaces
// --------------------------------------------------------------------------
/**
* Component reference
*/
@Service
Component weaveableC;
/**
* Logger of the component
*/
@DreamMonolog()
protected Logger logger;
// ---------------------------------------------------------------------------
// Attributes
// ---------------------------------------------------------------------------
@Attribute(argument = "sortingChunkName")
String sortingChunkName = SequenceNumberChunk.DEFAULT_NAME;
// ---------------------------------------------------------------------------
// Fields
// ---------------------------------------------------------------------------
/** Map that maintains messages keyed by keys. */
private Map