org.apache.qpid.example.publisher
Class FileMessageFactory
java.lang.Object
org.apache.qpid.example.publisher.FileMessageFactory
public class FileMessageFactory
- extends Object
Constructor Summary |
FileMessageFactory(Session session,
String filename)
Contructs and instance using a filename from which content will be used to create message |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_session
protected final Session _session
_payload
protected final String _payload
_filename
protected final String _filename
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
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