org.apache.qpid.example.publisher
Class Publisher

java.lang.Object
  extended by org.apache.qpid.example.publisher.Publisher
Direct Known Subclasses:
MonitorPublisher, TopicPublisher

public class Publisher
extends Object


Field Summary
protected  Connection _connection
           
protected  InitialContextHelper _contextHelper
           
protected static String _defaultDestinationDir
           
protected  Destination _destination
           
protected  String _destinationDir
           
protected  String _name
           
protected  MessageProducer _producer
           
protected  Session _session
           
 
Constructor Summary
Publisher()
          Creates a Publisher instance using properties from example.properties See InitialContextHelper for details of how context etc created
 
Method Summary
 void cleanup()
          Cleanup resources before exit
 String getDestinationDir()
           
 String getName()
           
 Session getSession()
          Exposes session
 void sendMessage(int numMessages)
          Creates and sends the number of messages specified in the param
 boolean sendMessage(Message message)
          Publishes a non-persistent message using transacted session Note that persistent is the default mode for send - so need to specify for transient
 void setDestinationDir(String destinationDir)
           
 void setName(String _name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_contextHelper

protected InitialContextHelper _contextHelper

_connection

protected Connection _connection

_session

protected Session _session

_producer

protected MessageProducer _producer

_destinationDir

protected String _destinationDir

_name

protected String _name

_destination

protected Destination _destination

_defaultDestinationDir

protected static final String _defaultDestinationDir
See Also:
Constant Field Values
Constructor Detail

Publisher

public Publisher()
Creates a Publisher instance using properties from example.properties See InitialContextHelper for details of how context etc created

Method Detail

sendMessage

public void sendMessage(int numMessages)
Creates and sends the number of messages specified in the param


sendMessage

public boolean sendMessage(Message message)
Publishes a non-persistent message using transacted session Note that persistent is the default mode for send - so need to specify for transient


cleanup

public void cleanup()
Cleanup resources before exit


getSession

public Session getSession()
Exposes session

Returns:
Session

getDestinationDir

public String getDestinationDir()

setDestinationDir

public void setDestinationDir(String destinationDir)

getName

public String getName()

setName

public void setName(String _name)


Licensed to the Apache Software Foundation