eu.semaine.jms.sender
Class BytesSender

java.lang.Object
  extended by eu.semaine.jms.IOBase
      extended by eu.semaine.jms.sender.Sender
          extended by eu.semaine.jms.sender.BytesSender

public class BytesSender
extends Sender

Author:
marc

Nested Class Summary
 
Nested classes/interfaces inherited from class eu.semaine.jms.IOBase
IOBase.Event
 
Field Summary
 
Fields inherited from class eu.semaine.jms.sender.Sender
datatype, period, producer, source
 
Fields inherited from class eu.semaine.jms.IOBase
connection, isConnectionStarted, jmsPassword, jmsUrl, jmsUser, session, topic, topicName
 
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 eu.semaine.jms.IOBase
getConnection, getJMSUrl, getSession, getTopic, getTopicName, startConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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: 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: 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