org.jboss.messaging.core.client.impl
Class ClientMessageImpl

java.lang.Object
  extended by org.jboss.messaging.core.message.impl.MessageImpl
      extended by org.jboss.messaging.core.client.impl.ClientMessageImpl
All Implemented Interfaces:
ClientMessage, ClientMessageInternal, Message

public class ClientMessageImpl
extends MessageImpl
implements ClientMessageInternal

A ClientMessageImpl

Author:
Tim Fox, Andy Taylor

Field Summary
static SimpleString REPLYTO_HEADER_NAME
           
 
Fields inherited from class org.jboss.messaging.core.message.impl.MessageImpl
durable, HDR_ACTUAL_EXPIRY_TIME, HDR_DUPLICATE_DETECTION_ID, HDR_FROM_CLUSTER, HDR_GROUP_ID, HDR_LAST_VALUE_NAME, HDR_ORIG_MESSAGE_ID, HDR_ORIGINAL_DESTINATION, HDR_ROUTE_TO_IDS, HDR_SCHEDULED_DELIVERY_TIME, messageID, type
 
Constructor Summary
ClientMessageImpl()
           
ClientMessageImpl(boolean durable, MessagingBuffer body)
           
ClientMessageImpl(byte type, boolean durable, long expiration, long timestamp, byte priority, MessagingBuffer body)
           
ClientMessageImpl(byte type, boolean durable, MessagingBuffer body)
           
ClientMessageImpl(int deliveryCount)
           
 
Method Summary
 void acknowledge()
           
 void discardLargeBody()
          Discard unused packets (used on large-message)
 int getDeliveryCount()
           
 int getFlowControlSize()
          Size used for FlowControl
 long getLargeBodySize()
           
 boolean isLargeMessage()
           
 void onReceipt(ClientConsumerInternal consumer)
           
 void saveToOutputStream(java.io.OutputStream out)
          Save the content of the message to the OutputStream.
 void setDeliveryCount(int deliveryCount)
           
 void setFlowControlSize(int flowControlSize)
          Size used for FlowControl
 void setLargeMessage(boolean largeMessage)
           
 void setOutputStream(java.io.OutputStream out)
          Sets the OutputStream that will receive the content of a message received in a non blocking way
 boolean waitOutputStreamCompletion(long timeMilliseconds)
          Wait the outputStream completion of the message.
 
Methods inherited from class org.jboss.messaging.core.message.impl.MessageImpl
containsProperty, containsProperty, decode, decodeBody, decodeProperties, encode, encodeBody, encodeBody, encodeProperties, getBody, getBodyInputStream, getBodySize, getDestination, getEncodeSize, getExpiration, getMessageID, getPriority, getProperties, getPropertiesEncodeSize, getProperty, getProperty, getPropertyNames, getTimestamp, getType, isDurable, isExpired, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, putTypedProperties, removeProperty, removeProperty, setBody, setBodyInputStream, setDestination, setDurable, setExpiration, setPriority, setTimestamp, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.messaging.core.message.Message
containsProperty, containsProperty, decode, decodeBody, decodeProperties, encode, encodeBody, encodeBody, encodeProperties, getBody, getBodyInputStream, getBodySize, getDestination, getEncodeSize, getExpiration, getMessageID, getPriority, getProperties, getPropertiesEncodeSize, getProperty, getProperty, getPropertyNames, getTimestamp, getType, isDurable, isExpired, putBooleanProperty, putBooleanProperty, putByteProperty, putByteProperty, putBytesProperty, putBytesProperty, putDoubleProperty, putDoubleProperty, putFloatProperty, putFloatProperty, putIntProperty, putIntProperty, putLongProperty, putLongProperty, putShortProperty, putShortProperty, putStringProperty, putStringProperty, putTypedProperties, removeProperty, removeProperty, setBody, setBodyInputStream, setDestination, setDurable, setExpiration, setPriority, setTimestamp, toMap
 

Field Detail

REPLYTO_HEADER_NAME

public static final SimpleString REPLYTO_HEADER_NAME
Constructor Detail

ClientMessageImpl

public ClientMessageImpl(int deliveryCount)

ClientMessageImpl

public ClientMessageImpl(byte type,
                         boolean durable,
                         long expiration,
                         long timestamp,
                         byte priority,
                         MessagingBuffer body)

ClientMessageImpl

public ClientMessageImpl(byte type,
                         boolean durable,
                         MessagingBuffer body)

ClientMessageImpl

public ClientMessageImpl(boolean durable,
                         MessagingBuffer body)

ClientMessageImpl

public ClientMessageImpl()
Method Detail

onReceipt

public void onReceipt(ClientConsumerInternal consumer)
Specified by:
onReceipt in interface ClientMessageInternal

setDeliveryCount

public void setDeliveryCount(int deliveryCount)
Specified by:
setDeliveryCount in interface ClientMessage

getDeliveryCount

public int getDeliveryCount()
Specified by:
getDeliveryCount in interface ClientMessage

acknowledge

public void acknowledge()
                 throws MessagingException
Specified by:
acknowledge in interface ClientMessage
Throws:
MessagingException

getLargeBodySize

public long getLargeBodySize()
Specified by:
getLargeBodySize in interface Message

getFlowControlSize

public int getFlowControlSize()
Description copied from interface: ClientMessageInternal
Size used for FlowControl

Specified by:
getFlowControlSize in interface ClientMessageInternal

setFlowControlSize

public void setFlowControlSize(int flowControlSize)
Description copied from interface: ClientMessageInternal
Size used for FlowControl

Specified by:
setFlowControlSize in interface ClientMessageInternal

isLargeMessage

public boolean isLargeMessage()
Specified by:
isLargeMessage in interface Message
Returns:
the largeMessage

setLargeMessage

public void setLargeMessage(boolean largeMessage)
Specified by:
setLargeMessage in interface ClientMessageInternal
Parameters:
largeMessage - the largeMessage to set

discardLargeBody

public void discardLargeBody()
Description copied from interface: ClientMessageInternal
Discard unused packets (used on large-message)

Specified by:
discardLargeBody in interface ClientMessageInternal

saveToOutputStream

public void saveToOutputStream(java.io.OutputStream out)
                        throws MessagingException
Description copied from interface: ClientMessage
Save the content of the message to the OutputStream. It will block until the entire content is transfered to the OutputStream.

Specified by:
saveToOutputStream in interface ClientMessage
Throws:
MessagingException

setOutputStream

public void setOutputStream(java.io.OutputStream out)
                     throws MessagingException
Description copied from interface: ClientMessage
Sets the OutputStream that will receive the content of a message received in a non blocking way

Specified by:
setOutputStream in interface ClientMessage
Throws:
MessagingException

waitOutputStreamCompletion

public boolean waitOutputStreamCompletion(long timeMilliseconds)
                                   throws MessagingException
Description copied from interface: ClientMessage
Wait the outputStream completion of the message.

Specified by:
waitOutputStreamCompletion in interface ClientMessage
Parameters:
timeMilliseconds - - 0 means wait forever
Returns:
true if it reached the end
Throws:
MessagingException


Copyright © 2006 JBoss Inc. All Rights Reserved.