org.objectweb.dream.queue
Class SequenceNumberChunk

java.lang.Object
  extended by org.objectweb.dream.message.AbstractChunk<SequenceNumberChunk>
      extended by org.objectweb.dream.queue.SequenceNumberChunk
All Implemented Interfaces:
Externalizable, Serializable, Recyclable

public class SequenceNumberChunk
extends AbstractChunk<SequenceNumberChunk>

Chunk interface for messages that have to be sequentially ordered.

See Also:
Serialized Form

Field Summary
static String DEFAULT_NAME
          The default name for chunks of this type.
 
Constructor Summary
SequenceNumberChunk()
          Default constructor
SequenceNumberChunk(long sequenceNumber)
           
 
Method Summary
static String filterChunkName(String chunkName)
          If the given chunkName is equals to the default name returns DEFAULT_NAME, returns the given string otherwise.
 long getSequenceNumber()
          Returns the sequence number of this chunk.
 SequenceNumberChunk newChunk()
           
 void readExternal(ObjectInput in)
           
 void recycle()
           
 void setSequenceNumber(long sn)
          Sets the sequence number of this chunk.
 void transfertStateTo(SequenceNumberChunk newInstance)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.objectweb.dream.message.AbstractChunk
getReference, setReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME

public static final String DEFAULT_NAME
The default name for chunks of this type.

See Also:
Constant Field Values
Constructor Detail

SequenceNumberChunk

public SequenceNumberChunk()
Default constructor


SequenceNumberChunk

public SequenceNumberChunk(long sequenceNumber)
Parameters:
sequenceNumber - the sequence number of this chunk.
Method Detail

filterChunkName

public static String filterChunkName(String chunkName)
If the given chunkName is equals to the default name returns DEFAULT_NAME, returns the given string otherwise.

Parameters:
chunkName - the chunk name to filter.
Returns:
DEFAULT_NAMEor the given chunkName.

getSequenceNumber

public final long getSequenceNumber()
Returns the sequence number of this chunk.

Returns:
the sequence number of this chunk.

setSequenceNumber

public final void setSequenceNumber(long sn)
Sets the sequence number of this chunk.

Parameters:
sn - the sequence number to set.

transfertStateTo

public void transfertStateTo(SequenceNumberChunk newInstance)
Specified by:
transfertStateTo in class AbstractChunk<SequenceNumberChunk>
See Also:
AbstractChunk.transfertStateTo(AbstractChunk)

newChunk

public SequenceNumberChunk newChunk()
Specified by:
newChunk in class AbstractChunk<SequenceNumberChunk>
See Also:
AbstractChunk.newChunk()

recycle

public void recycle()
See Also:
Recyclable.recycle()

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Throws:
IOException
ClassNotFoundException
See Also:
Externalizable.readExternal(ObjectInput)

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Throws:
IOException
See Also:
Externalizable.writeExternal(ObjectOutput)


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.