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.message
Class MessageSupport

    java.lang.Object
      org.jboss.messaging.core.message.RoutableSupport
          org.jboss.messaging.core.message.MessageSupport

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

Direct Known Subclasses:
  CoreMessage, JBossMessage

public abstract class MessageSupport
extends RoutableSupport
implements Message

A message base.

Version:
  `$Revision: 1.27 $` $Id: MessageSupport.java,v 1.27 2006/06/19 15:16:07 timfox Exp $
Author:
  Ovidiu Feodorov, Tim Fox
See Also:
  Serialized Form

Field Summary

Fields inherited from class org.jboss.messaging.core.message.RoutableSupport
`BOOLEAN, BYTE, BYTES, deliveryCount, 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
`` | `MessageSupport()` Required by externalization.
`` | `MessageSupport(long messageID)`
`` | `MessageSupport(long messageID, boolean reliable)`
`` | `MessageSupport(long messageID, boolean reliable, long timeToLive)`
`` | `MessageSupport(long messageID, boolean reliable, long expiration, long timestamp, byte priority, int deliveryCount, java.util.Map headers, byte[] payloadAsByteArray, int persistentChannelCount)`
`` | `MessageSupport(long messageID, boolean reliable, long timeToLive, java.io.Serializable payload)`
`` | `MessageSupport(long messageID, boolean reliable, java.io.Serializable payload)`
`` | `MessageSupport(long messageID, java.io.Serializable payload)`
`protected` | `MessageSupport(MessageSupport that)`

Method Summary
`protected void` | `clearPayloadAsByteArray()`
`protected void` | `copyPayloadAsByteArrayToPayload()` It makes sense to use this method only from within JBossBytesMessage (optimization).
`void` | `decPersistentChannelCount()`
`boolean` | `equals(java.lang.Object o)`
`java.util.Map` | `getHeaders()`
`Message` | `getMessage()` If it is a Message instance, then it returns itself, otherwise it will return the Message corresponding to this MessageReference.
`java.io.Serializable` | `getPayload()` Warning! Calling getPayload will cause the payload to be deserialized so should not be called on the server.
`byte[]` | `getPayloadAsByteArray()`
`int` | `getPersistentChannelCount()`
`int` | `hashCode()`
`void` | `incPersistentChannelCount()`
`boolean` | `isReference()`
`void` | `readExternal(java.io.ObjectInput in)`
`protected java.io.Serializable` | `readPayloadExternal(java.io.ObjectInput in, int length)` Override this if you want more sophisticated payload externalization.
`void` | `setPayload(java.io.Serializable payload)`
`java.lang.String` | `toString()`
`void` | `writeExternal(java.io.ObjectOutput out)`
`protected void` | `writePayloadExternal(java.io.ObjectOutput out, java.io.Serializable thePayload)` Override this if you want more sophisticated payload externalization.

Methods inherited from class org.jboss.messaging.core.message.RoutableSupport
`containsHeader, getDeliveryCount, getExpiration, getHeader, getHeaderNames, getMessageID, getPriority, getTimestamp, incrementDeliveryCount, internalReadObject, internalWriteObject, isExpired, isRedelivered, isReliable, putHeader, readList, readMap, removeHeader, setDeliveryCount, setPriority, setRedelivered, 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, getDeliveryCount, getExpiration, getHeader, getHeaderNames, getMessageID, getPriority, getTimestamp, incrementDeliveryCount, isExpired, isRedelivered, isReliable, putHeader, removeHeader, setDeliveryCount, setPriority, setRedelivered`

Constructor Detail

### MessageSupport

    public MessageSupport()

  Required by externalization.

### MessageSupport

    public MessageSupport(long messageID)

Parameters:
  `messageID` -

### MessageSupport

    public MessageSupport(long messageID,
                          java.io.Serializable payload)

### MessageSupport

    public MessageSupport(long messageID,
                          boolean reliable,
                          java.io.Serializable payload)

### MessageSupport

    public MessageSupport(long messageID,
                          boolean reliable)

### MessageSupport

    public MessageSupport(long messageID,
                          boolean reliable,
                          long timeToLive)

### MessageSupport

    public MessageSupport(long messageID,
                          boolean reliable,
                          long timeToLive,
                          java.io.Serializable payload)

### MessageSupport

    public MessageSupport(long messageID,
                          boolean reliable,
                          long expiration,
                          long timestamp,
                          byte priority,
                          int deliveryCount,
                          java.util.Map headers,
                          byte[] payloadAsByteArray,
                          int persistentChannelCount)

### MessageSupport

    protected MessageSupport(MessageSupport that)

Method Detail

### 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`

### isReference

    public boolean isReference()

  Specified by:
    `isReference` in interface `Routable`

### getPayloadAsByteArray

    public byte[] getPayloadAsByteArray()

  Specified by:
    `getPayloadAsByteArray` in interface `Message`

### getPayload

    public java.io.Serializable getPayload()

  Warning! Calling getPayload will cause the payload to be deserialized so should not be called on the server.

  Specified by:
    `getPayload` in interface `Message`

### setPayload

    public void setPayload(java.io.Serializable payload)

### clearPayloadAsByteArray

    protected void clearPayloadAsByteArray()

### decPersistentChannelCount

    public void decPersistentChannelCount()

  Specified by:
    `decPersistentChannelCount` in interface `Message`

### incPersistentChannelCount

    public void incPersistentChannelCount()

  Specified by:
    `incPersistentChannelCount` in interface `Message`

### getPersistentChannelCount

    public int getPersistentChannelCount()

  Specified by:
    `getPersistentChannelCount` in interface `Message`

### equals

    public boolean equals(java.lang.Object o)

### getHeaders

    public java.util.Map getHeaders()

  Specified by:
    `getHeaders` in interface `Routable`
  Overrides:
    `getHeaders` in class `RoutableSupport`
  Returns:
    a reference of the internal header map.

### hashCode

    public int hashCode()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `RoutableSupport`

### writeExternal

    public void writeExternal(java.io.ObjectOutput out)
                       throws java.io.IOException

  Specified by:
    `writeExternal` in interface `java.io.Externalizable`
  Overrides:
    `writeExternal` in class `RoutableSupport`
  Throws:
    `java.io.IOException`

### readExternal

    public void readExternal(java.io.ObjectInput in)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException

  Specified by:
    `readExternal` in interface `java.io.Externalizable`
  Overrides:
    `readExternal` in class `RoutableSupport`
  Throws:
    `java.io.IOException`
    `java.lang.ClassNotFoundException`

### writePayloadExternal

    protected void writePayloadExternal(java.io.ObjectOutput out,
                                        java.io.Serializable thePayload)
                                 throws java.io.IOException

  Override this if you want more sophisticated payload externalization.

  Throws:
    `java.io.IOException`

### readPayloadExternal

    protected java.io.Serializable readPayloadExternal(java.io.ObjectInput in,
                                                       int length)
                                                throws java.io.IOException,
                                                       java.lang.ClassNotFoundException

  Override this if you want more sophisticated payload externalization.

  Throws:
    `java.io.IOException`
    `java.lang.ClassNotFoundException`

### copyPayloadAsByteArrayToPayload

    protected final void copyPayloadAsByteArrayToPayload()

  It makes sense to use this method only from within JBossBytesMessage (optimization). Using it from anywhere else will lead to corrupted data.

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.