eu.semaine.jms.receiver
Class FeatureReceiver

java.lang.Object
  extended by eu.semaine.jms.IOBase
      extended by eu.semaine.jms.receiver.Receiver
          extended by eu.semaine.jms.receiver.FeatureReceiver
All Implemented Interfaces:
javax.jms.MessageListener

public class FeatureReceiver
extends Receiver

An abstraction of the Receiver for feature vectors.

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.receiver.Receiver
consumer, listener, log, message
 
Fields inherited from class eu.semaine.jms.IOBase
connection, isConnectionStarted, jmsPassword, jmsUrl, jmsUser, session, topic, topicName
 
Constructor Summary
FeatureReceiver(java.lang.String topicName)
          Create a receiver that will listen for all messages in the given Topic on the default JMS server.
FeatureReceiver(java.lang.String topicName, java.lang.String messageSelector)
          Create a receiver that will listen only to the messages in the given Topic that will pass the given messageSelector, on the default JMS server.
FeatureReceiver(java.lang.String jmsUrl, java.lang.String jmsUser, java.lang.String jmsPassword, java.lang.String topicName)
          Create a receiver that will listen for all messages in the given Topic on the given JMS server.
FeatureReceiver(java.lang.String jmsUrl, java.lang.String jmsUser, java.lang.String jmsPassword, java.lang.String topicName, java.lang.String messageSelector)
          Create a receiver that will listen only to the messages in the given Topic that will pass the given messageSelector, on the given JMS server.
 
Method Summary
protected  SEMAINEMessage createSEMAINEMessage(javax.jms.Message message)
          Create a SEMAINE message from the given JMS message.
 
Methods inherited from class eu.semaine.jms.receiver.Receiver
getMessage, getMessageListener, getMessageSelector, main, notPickedUp, onMessage, receive, receive, receiveNoWait, setMessageListener
 
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

FeatureReceiver

public FeatureReceiver(java.lang.String topicName)
                throws javax.jms.JMSException
Create a receiver that will listen for all messages in the given Topic on the default JMS server. The default JMS server is determined as follows:

Parameters:
topic - the name of the JMS Topic to listen to.
Throws:
javax.jms.JMSException

FeatureReceiver

public FeatureReceiver(java.lang.String topicName,
                       java.lang.String messageSelector)
                throws javax.jms.JMSException
Create a receiver that will listen only to the messages in the given Topic that will pass the given messageSelector, on the default JMS server. The default JMS server is determined as follows:

Parameters:
topicName - the name of the JMS Topic to listen to.
messageSelector - a message selector expression, see e.g. http://java.sun.com/javaee/5/docs/api/javax/jms/Message.html for the detailed description.
Throws:
javax.jms.JMSException

FeatureReceiver

public FeatureReceiver(java.lang.String jmsUrl,
                       java.lang.String jmsUser,
                       java.lang.String jmsPassword,
                       java.lang.String topicName)
                throws javax.jms.JMSException
Create a receiver that will listen for all messages in the given Topic on the given JMS server.

Parameters:
jmsUrl - the url where to contact the JMS server
jmsUser - the username to use (can be null)
jmsPassword - the password to use (can be null)
topic - the name of the JMS Topic to listen to.
Throws:
javax.jms.JMSException

FeatureReceiver

public FeatureReceiver(java.lang.String jmsUrl,
                       java.lang.String jmsUser,
                       java.lang.String jmsPassword,
                       java.lang.String topicName,
                       java.lang.String messageSelector)
                throws javax.jms.JMSException
Create a receiver that will listen only to the messages in the given Topic that will pass the given messageSelector, on the given JMS server.

Parameters:
jmsUrl - the url where to contact the JMS server
jmsUser - the username to use (can be null)
jmsPassword - the password to use (can be null)
topicName - the name of the JMS Topic to listen to.
messageSelector - a message selector expression, see e.g. http://java.sun.com/javaee/5/docs/api/javax/jms/Message.html for the detailed description.
Throws:
javax.jms.JMSException
Method Detail

createSEMAINEMessage

protected SEMAINEMessage createSEMAINEMessage(javax.jms.Message message)
                                       throws MessageFormatException
Description copied from class: Receiver
Create a SEMAINE message from the given JMS message. Subclasses may want to override this in order to provide subclasses of SEMAINEMessage for their data.

Overrides:
createSEMAINEMessage in class Receiver
Parameters:
message - the JMS method to convert into a SEMAINE message.
Throws:
MessageFormatException - if the message format is problematic