Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.messaging.core.plugin
Class SimpleMessageReference

    java.lang.Object
      org.jboss.messaging.core.message.RoutableSupport
          org.jboss.messaging.core.plugin.SimpleMessageReference

All Implemented Interfaces:
  java.io.Externalizable, MessageReference, Routable, java.io.Serializable

public class SimpleMessageReference
extends RoutableSupport
implements MessageReference

A Simple MessageReference implementation. Note that we do not need WeakReferences to message/holder objects since with the new lazy loading schema we guarantee that if a message ref is in memory - it's corresponding message is in memory too

Version:
  `1.3` SimpleMessageReference.java,v 1.3 2006/02/23 17:45:57 timfox Exp
Author:
  Serialized Form

Field Summary
`protected MessageStore` | `ms`

Fields inherited from class org.jboss.messaging.core.message.RoutableSupport
`BOOLEAN, BYTE, BYTES, DOUBLE, expiration, FLOAT, headers, INT, LIST, LONG, MAP, messageID, NULL, OBJECT, priority, redelivered, reliable, SHORT, STRING, timestamp`

Fields inherited from interface org.jboss.messaging.core.Routable
`COLLECTOR_ID, REMOTE_ROUTABLE, REPLICATOR_ID`

Constructor Summary
`` | `SimpleMessageReference()` Required by externalization.
`protected` | `SimpleMessageReference(long messageID, boolean reliable, long expiration, long timestamp, java.util.Map headers, boolean redelivered, byte priority, MessageStore ms)`
`` | `SimpleMessageReference(org.jboss.messaging.core.plugin.MessageHolder holder, MessageStore ms)` Creates a reference based on a given message.
`` | `SimpleMessageReference(SimpleMessageReference other)`

Method Summary
`MessageReference` | `copy()`
`boolean` | `equals(java.lang.Object o)`
`int` | `getDeliveryCount()`
`int` | `getInMemoryChannelCount()`
`Message` | `getMessage()` If it is a Message instance, then it returns itself, otherwise it will return the Message corresponding to this MessageReference.
`long` | `getOrdering()`
`java.io.Serializable` | `getStoreID()`
`int` | `hashCode()`
`void` | `incrementDeliveryCount()`
`boolean` | `isReference()`
`void` | `releaseMemoryReference()`
`void` | `setDeliveryCount(int deliveryCount)`
`void` | `setOrdering(long ordering)`
`java.lang.String` | `toString()`

Methods inherited from class org.jboss.messaging.core.message.RoutableSupport
`containsHeader, getExpiration, getHeader, getHeaderNames, getHeaders, getMessageID, getPriority, getTimestamp, internalReadObject, internalWriteObject, isExpired, isRedelivered, isReliable, putHeader, readExternal, readList, readMap, removeHeader, setPriority, setRedelivered, writeExternal, writeList, writeMap`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.jboss.messaging.core.Routable
`containsHeader, getExpiration, getHeader, getHeaderNames, getHeaders, getMessageID, getPriority, getTimestamp, isExpired, isRedelivered, isReliable, putHeader, removeHeader, setPriority, setRedelivered`

Field Detail

### ms

    protected transient MessageStore ms

Constructor Detail

### SimpleMessageReference

    public SimpleMessageReference()

  Required by externalization.

### SimpleMessageReference

    public SimpleMessageReference(org.jboss.messaging.core.plugin.MessageHolder holder,
                                  MessageStore ms)

  Creates a reference based on a given message.

### SimpleMessageReference

    public SimpleMessageReference(SimpleMessageReference other)

### SimpleMessageReference

    protected SimpleMessageReference(long messageID,
                                     boolean reliable,
                                     long expiration,
                                     long timestamp,
                                     java.util.Map headers,
                                     boolean redelivered,
                                     byte priority,
                                     MessageStore ms)

Method Detail

### isReference

    public boolean isReference()

  Specified by:
    `isReference` in interface `Routable`

### getStoreID

    public java.io.Serializable getStoreID()

  Specified by:
    `getStoreID` in interface `MessageReference`

### getMessage

    public Message getMessage()

  Description copied from interface: `Routable`
  If it is a Message instance, then it returns itself, otherwise it will return the Message corresponding to this MessageReference.

  Specified by:
    `getMessage` in interface `Routable`

### releaseMemoryReference

    public void releaseMemoryReference()

  Specified by:
    `releaseMemoryReference` in interface `MessageReference`

### getInMemoryChannelCount

    public int getInMemoryChannelCount()

  Specified by:
    `getInMemoryChannelCount` in interface `MessageReference`

### getDeliveryCount

    public int getDeliveryCount()

  Specified by:
    `getDeliveryCount` in interface `Routable`
  Overrides:
    `getDeliveryCount` in class `RoutableSupport`

### incrementDeliveryCount

    public void incrementDeliveryCount()

  Specified by:
    `incrementDeliveryCount` in interface `Routable`
  Overrides:
    `incrementDeliveryCount` in class `RoutableSupport`

### setDeliveryCount

    public void setDeliveryCount(int deliveryCount)

  Specified by:
    `setDeliveryCount` in interface `Routable`
  Overrides:
    `setDeliveryCount` in class `RoutableSupport`

### getOrdering

    public long getOrdering()

  Specified by:
    `getOrdering` in interface `MessageReference`

### setOrdering

    public void setOrdering(long ordering)

  Specified by:
    `setOrdering` in interface `MessageReference`

### copy

    public MessageReference copy()

  Specified by:
    `copy` in interface `MessageReference`

### equals

    public boolean equals(java.lang.Object o)

### hashCode

    public int hashCode()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `RoutableSupport`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 JBoss Inc. All Rights Reserved.