org.apache.qpid.example.publisher
Class FileMessageFactory

java.lang.Object
  extended by org.apache.qpid.example.publisher.FileMessageFactory

public class FileMessageFactory
extends Object


Field Summary
protected  String _filename
           
protected  String _payload
           
protected  Session _session
           
 
Constructor Summary
FileMessageFactory(Session session, String filename)
          Contructs and instance using a filename from which content will be used to create message
 
Method Summary
 Message createEventMessage()
          Creates a text message and sets filename property on it The filename property is purely intended to provide visibility of file content passing trhough the broker using example classes
 Message createReportRequestMessage()
           
 Message createReportResponseMessage(String msg)
           
 Message createShutdownMessage()
           
static Message createSimpleEventMessage(Session session, String textMsg)
          Creates message from a string for use by the monitor
 Object getReport(Message m)
           
 boolean isReport(Message m)
           
 boolean isShutdown(Message m)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_session

protected final Session _session

_payload

protected final String _payload

_filename

protected final String _filename
Constructor Detail

FileMessageFactory

public FileMessageFactory(Session session,
                          String filename)
                   throws MessageFactoryException
Contructs and instance using a filename from which content will be used to create message

Parameters:
session -
filename -
Throws:
MessageFactoryException
Method Detail

createEventMessage

public Message createEventMessage()
                           throws JMSException
Creates a text message and sets filename property on it The filename property is purely intended to provide visibility of file content passing trhough the broker using example classes

Returns:
Message - a TextMessage with content from file
Throws:
JMSException

createSimpleEventMessage

public static Message createSimpleEventMessage(Session session,
                                               String textMsg)
                                        throws JMSException
Creates message from a string for use by the monitor

Parameters:
session -
textMsg - - message content
Returns:
Message - TextMessage with content from String
Throws:
JMSException

createShutdownMessage

public Message createShutdownMessage()
                              throws JMSException
Throws:
JMSException

createReportRequestMessage

public Message createReportRequestMessage()
                                   throws JMSException
Throws:
JMSException

createReportResponseMessage

public Message createReportResponseMessage(String msg)
                                    throws JMSException
Throws:
JMSException

isShutdown

public boolean isShutdown(Message m)

isReport

public boolean isReport(Message m)

getReport

public Object getReport(Message m)


Licensed to the Apache Software Foundation