eu.semaine.jms.sender
Class BytesSender
java.lang.Object
eu.semaine.jms.IOBase
eu.semaine.jms.sender.Sender
eu.semaine.jms.sender.BytesSender
public class BytesSender
- extends Sender
- Author:
- marc
Constructor Summary |
BytesSender(java.lang.String topicName,
java.lang.String datatype,
java.lang.String source)
|
BytesSender(java.lang.String jmsUrl,
java.lang.String jmsUser,
java.lang.String jmsPassword,
java.lang.String topicName,
java.lang.String datatype,
java.lang.String source)
|
Method Summary |
void |
sendBytesMessage(byte[] bytes,
long usertime)
Send a bytes message via this sender. |
void |
sendBytesMessage(byte[] bytes,
long usertime,
java.lang.String contentID,
long contentCreationTime)
Send a bytes message via this sender. |
Methods inherited from class eu.semaine.jms.sender.Sender |
fillMessageProperties, fillMessageProperties, getDatatype, getPeriod, getSource, getTimeToLive, initialise, isEventBased, isPeriodic, main, sendTextMessage, sendTextMessage, sendTextMessage, sendTextMessage, setEventBased, setPeriodic, setTimeToLive |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BytesSender
public BytesSender(java.lang.String topicName,
java.lang.String datatype,
java.lang.String source)
throws javax.jms.JMSException
- Parameters:
topicName
- datatype
- source
-
- Throws:
javax.jms.JMSException
BytesSender
public BytesSender(java.lang.String jmsUrl,
java.lang.String jmsUser,
java.lang.String jmsPassword,
java.lang.String topicName,
java.lang.String datatype,
java.lang.String source)
throws javax.jms.JMSException
- Parameters:
jmsUrl
- jmsUser
- jmsPassword
- topicName
- datatype
- source
-
- Throws:
javax.jms.JMSException
sendBytesMessage
public void sendBytesMessage(byte[] bytes,
long usertime)
throws javax.jms.JMSException
- Send a bytes message via this sender.
This will send a message to the registered topic
with the following message properties:
datatype
is a String property containing the value produced by Sender.getDatatype()
;
source
is a String property containing the value produced by Sender.getSource()
;
usertime
is a long property containing the value of parameter usertime
;
- if the message is periodic (
Sender.isPeriodic()
returns true
),
period
is an int property containing the value returned by Sender.getPeriod()
;
- else, the message is event-based.
event
is a String property; as
this method does not specify an event type, the default value single
is assumed.
Furthermore, if Sender.getTimeToLive()
returns a non-zero value, the message will
contain a header field JMSExpiration
containing the time when the message
will expire.
- Parameters:
bytes
- the message data, as a byte array.usertime
- the "user" time at which this message is being sent,
in milliseconds since system startup.
- Throws:
java.lang.IllegalStateException
- if the connection is not started or the sender is in event-based mode.
javax.jms.JMSException
sendBytesMessage
public void sendBytesMessage(byte[] bytes,
long usertime,
java.lang.String contentID,
long contentCreationTime)
throws javax.jms.JMSException
- Send a bytes message via this sender.
This will send a message to the registered topic
with the following message properties:
datatype
is a String property containing the value produced by Sender.getDatatype()
;
source
is a String property containing the value produced by Sender.getSource()
;
usertime
is a long property containing the value of parameter usertime
;
- if the message is periodic (
Sender.isPeriodic()
returns true
),
period
is an int property containing the value returned by Sender.getPeriod()
;
- else, the message is event-based.
event
is a String property; as
this method does not specify an event type, the default value single
is assumed.
Furthermore, if Sender.getTimeToLive()
returns a non-zero value, the message will
contain a header field JMSExpiration
containing the time when the message
will expire.
- Parameters:
bytes
- the message data, as a byte array.usertime
- the "user" time that this message refers to,
in milliseconds since system startup.contentID
- a unique identifier for the message's content.
If this is not null, it will cause the addition of the String property content-id
in the message.contentCreationTime
- the time when the content in this message was created.
If this is not negative, it will cause the addition of the Long property content-creation-time
in the message.
- Throws:
java.lang.IllegalStateException
- if the connection is not started or the sender is in event-based mode.
javax.jms.JMSException