|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object eu.semaine.jms.message.SEMAINEMessage
public class SEMAINEMessage
A representation of a message as used in SEMAINE code. It is a higher-level access method for JMS messages, providing interpretations of information accessible in the message headers. This base class provides access to the Message body only as plain text (for text messages). Subclasses should:
Field Summary | |
---|---|
static java.lang.String |
DATATYPE
The name of the property used for the type of data being sent. |
static java.lang.String |
EVENT
The name of the property used for the type of event being sent (for event-based messages). |
protected javax.jms.Message |
message
|
static java.lang.String |
PERIOD
The name of the property used for the period length, in milliseconds (for periodic messages). |
static java.lang.String |
SOURCE
The name of the property used for the component that sent the data. |
static java.lang.String |
USERTIME
The name of the property used for time in "user" time that the message refers to. |
Constructor Summary | |
---|---|
SEMAINEMessage(javax.jms.Message message)
Create a SEMAINE specific abstraction from the given message. |
Method Summary | |
---|---|
java.lang.String |
getDatatype()
Get the name of the data type received. |
IOBase.Event |
getEventType()
For event-based messages, determine the event type. |
javax.jms.Message |
getMessage()
Provide access to the low-level message encapsulated in this object. |
int |
getPeriod()
For periodic messages, determine the period length. |
java.lang.String |
getSource()
Get the name of the source component that sent the data. |
java.lang.String |
getText()
For text messages, provide access to the text sent. |
java.lang.String |
getTopicName()
Get the name of the topic to which this message had been sent. |
long |
getUsertime()
Get the user time that the message refers to, in milliseconds since 1970. |
boolean |
isBytesMessage()
Determine whether the message is a bytes message. |
boolean |
isEventBased()
Determine whether the message is event-based. |
boolean |
isPeriodic()
Determine whether the message is periodic. |
boolean |
isTextMessage()
Determine whether the message is a text message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USERTIME
public static final java.lang.String DATATYPE
public static final java.lang.String SOURCE
public static final java.lang.String EVENT
public static final java.lang.String PERIOD
protected javax.jms.Message message
Constructor Detail |
---|
public SEMAINEMessage(javax.jms.Message message) throws MessageFormatException
message
- a message containing SEMAINE-specific properties.
java.lang.NullPointerException
- if message is null.
MessageFormatException
- if the message does not have the proper formatMethod Detail |
---|
public long getUsertime() throws javax.jms.JMSException
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.
MessageFormatException
- if the message property exists but has the wrong type.public java.lang.String getDatatype() throws javax.jms.JMSException
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.public java.lang.String getSource() throws javax.jms.JMSException
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.public boolean isPeriodic() throws javax.jms.JMSException
period
property.
true
if message is periodic,
false
if message is event-based.
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.public boolean isEventBased() throws javax.jms.JMSException
event
property.
true
if message is event-based,
false
if message is periodic.
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.public IOBase.Event getEventType() throws javax.jms.JMSException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, MessageFormatException
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.
MessageFormatException
- if the message contains an event
property, but the value is not known.
java.lang.IllegalStateException
- if the message is not event-based.
java.lang.IllegalArgumentException
public int getPeriod() throws javax.jms.JMSException, java.lang.IllegalStateException
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.
java.lang.IllegalStateException
- if the message is not periodic.public boolean isTextMessage()
public boolean isBytesMessage()
public java.lang.String getText() throws javax.jms.JMSException
javax.jms.JMSException
- if the JMS provider fails to get the property value due to some internal error.
java.lang.IllegalStateException
- if the message is not a text message.public java.lang.String getTopicName() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message getMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |