Class ConsumerMessages
- java.lang.Object
-
- org.objectweb.joram.shared.client.AbstractJmsMessage
-
- org.objectweb.joram.shared.client.AbstractJmsReply
-
- org.objectweb.joram.shared.client.ConsumerMessages
-
- All Implemented Interfaces:
Encodable,Streamable,Externalizable,Serializable
public final class ConsumerMessages extends AbstractJmsReply
AConsumerMessagesis used by a JMS proxy for sending messages to a consumer.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private StringcomingFromName of the subscription or the queue the messages come from.private Vector<Message>messagesWrapped messages.private booleanpendingMessagesThis attribute specifies that the number of messages sent to the client has been limited by property MAX_NUMBER_OF_MSG_PER_REQUEST, and that there are still messages waiting on the broker.private booleanqueueModetrueif the messages come from a queue.private static longserialVersionUIDdefine serialVersionUID for interoperability-
Fields inherited from class org.objectweb.joram.shared.client.AbstractJmsReply
correlationId
-
Fields inherited from class org.objectweb.joram.shared.client.AbstractJmsMessage
ACTIVATE_CONSUMER_REQUEST, ADD_CLIENTID_REPLY, ADD_CLIENTID_REQUEST, classid, classnames, CNX_CLOSE_REPLY, CNX_CLOSE_REQUEST, CNX_CONNECT_REPLY, CNX_CONNECT_REQUEST, CNX_START_REQUEST, CNX_STOP_REQUEST, COMMIT_REQUEST, CONSUMER_ACK_REQUEST, CONSUMER_CLOSE_SUB_REQUEST, CONSUMER_DENY_REQUEST, CONSUMER_MESSAGES, CONSUMER_RECEIVE_REQUEST, CONSUMER_SET_LIST_REQUEST, CONSUMER_SUB_REQUEST, CONSUMER_UNSET_LIST_REQUEST, CONSUMER_UNSUB_REQUEST, GET_ADMIN_TOPIC_REPLY, GET_ADMIN_TOPIC_REQUEST, JMS_REQUEST_GROUP, MOM_EXCEPTION_REPLY, NULL_CLASS_ID, PING_REQUEST, PRODUCER_MESSAGES, QBROWSE_REPLY, QBROWSE_REQUEST, SERVER_REPLY, SESS_ACK_REQUEST, SESS_CREATE_DEST_REPLY, SESS_CREATE_DEST_REQUEST, SESS_DENY_REQUEST, TEMP_DEST_DELETE_REQUEST, XA_CNX_COMMIT, XA_CNX_PREPARE, XA_CNX_RECOVER_REPLY, XA_CNX_RECOVER_REQUEST, XA_CNX_ROLLBACK, XXX_SESS_CREATE_TTREQUEST
-
Fields inherited from interface fr.dyade.aaa.common.encoding.Encodable
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
-
-
Constructor Summary
Constructors Constructor Description ConsumerMessages()Constructs an emptyConsumerMessagesinstance.ConsumerMessages(int correlationId, String comingFrom, boolean queueMode)Constructs an emptyConsumerMessagesinstance.ConsumerMessages(int correlationId, Vector<Message> messages, String comingFrom, boolean queueMode)Constructs aConsumerMessagesinstance.ConsumerMessages(int correlationId, Message message, String comingFrom, boolean queueMode)Constructs aConsumerMessagesinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(Message msg)StringcomesFrom()Returns the name of the queue or the subscription the messages come from.protected intgetClassId()intgetMessageCount()Vector<Message>getMessages()Returns the messages to deliver.booleangetQueueMode()Returnstrueif the messages come from a queue.booleanhasPendingMessages()voidreadFrom(InputStream is)The object implements the readFrom method to restore its contents from the input stream.voidsetComesFrom(String comingFrom)voidsetMessages(Vector<Message> newMsgs)Replace old messages vector by new newMsgs vectorvoidsetPendingMessages(boolean pendingMessages)voidsetQueueMode(boolean queueMode)voidtoString(StringBuffer strbuf)voidwriteTo(OutputStream os)The object implements the writeTo method to write its contents to the output stream.-
Methods inherited from class org.objectweb.joram.shared.client.AbstractJmsReply
decode, encode, getCorrelationId, getEncodableClassId, getEncodedSize, setCorrelationId, toString
-
Methods inherited from class org.objectweb.joram.shared.client.AbstractJmsMessage
read, readExternal, write, writeExternal
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
comingFrom
private String comingFrom
Name of the subscription or the queue the messages come from.
-
queueMode
private boolean queueMode
trueif the messages come from a queue.
-
pendingMessages
private boolean pendingMessages
This attribute specifies that the number of messages sent to the client has been limited by property MAX_NUMBER_OF_MSG_PER_REQUEST, and that there are still messages waiting on the broker.
-
-
Constructor Detail
-
ConsumerMessages
public ConsumerMessages(int correlationId, Message message, String comingFrom, boolean queueMode)Constructs aConsumerMessagesinstance.- Parameters:
correlationId- Reply identifier.message- Message to wrap.comingFrom- Name of the queue or the subscription the message come from.queueMode-trueif the message come from a queue.
-
ConsumerMessages
public ConsumerMessages(int correlationId, Vector<Message> messages, String comingFrom, boolean queueMode)Constructs aConsumerMessagesinstance.- Parameters:
correlationId- Reply identifier.messages- Messages to wrap.comingFrom- Name of the queue or the subscription the messages comes from.queueMode-trueif the messages come from a queue.
-
ConsumerMessages
public ConsumerMessages(int correlationId, String comingFrom, boolean queueMode)Constructs an emptyConsumerMessagesinstance.- Parameters:
correlationId- Reply identifier.comingFrom- Name of the queue or the subscription the reply comes from.queueMode-trueif it replies to a queue consumer.
-
ConsumerMessages
public ConsumerMessages()
Constructs an emptyConsumerMessagesinstance.
-
-
Method Detail
-
getMessages
public Vector<Message> getMessages()
Returns the messages to deliver.- Returns:
- The messages to deliver.
-
addMessage
public void addMessage(Message msg)
-
getMessageCount
public int getMessageCount()
-
setMessages
public void setMessages(Vector<Message> newMsgs)
Replace old messages vector by new newMsgs vector- Parameters:
newMsgs- new messages vector.
-
comesFrom
public String comesFrom()
Returns the name of the queue or the subscription the messages come from.- Returns:
- The name of the queue or the subscription the messages come from.
-
setComesFrom
public void setComesFrom(String comingFrom)
-
getQueueMode
public boolean getQueueMode()
Returnstrueif the messages come from a queue.- Returns:
- True if the messages come from a queue.
-
setQueueMode
public void setQueueMode(boolean queueMode)
-
hasPendingMessages
public boolean hasPendingMessages()
- Returns:
- the isActive
-
setPendingMessages
public void setPendingMessages(boolean pendingMessages)
- Parameters:
isActive- the isActive to set
-
getClassId
protected int getClassId()
- Specified by:
getClassIdin classAbstractJmsMessage
-
toString
public void toString(StringBuffer strbuf)
- Overrides:
toStringin classAbstractJmsReply
-
writeTo
public void writeTo(OutputStream os) throws IOException
The object implements the writeTo method to write its contents to the output stream.- Specified by:
writeToin interfaceStreamable- Overrides:
writeToin classAbstractJmsReply- Parameters:
os- the stream to write the object to- Throws:
IOException- an error occurs during IO operation.
-
readFrom
public void readFrom(InputStream is) throws IOException
The object implements the readFrom method to restore its contents from the input stream.- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classAbstractJmsReply- Parameters:
is- the stream to read data from in order to restore the object- Throws:
IOException- an error occurs during IO operation.
-
-