added helper method to create non-persistent output streams together with added more javadoc

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@384173 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-03-08 10:14:44 +00:00
parent 7e6e788362
commit 8776a4154e
1 changed files with 14 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import java.util.Map;
import javax.jms.Connection;
import javax.jms.ConnectionConsumer;
import javax.jms.ConnectionMetaData;
import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.ExceptionListener;
import javax.jms.IllegalStateException;
@ -1468,10 +1469,23 @@ public class ActiveMQConnection extends DefaultTransportListener implements Conn
}
/**
* Creates a persistent output stream; individual messages will be written to disk/database by the broker
*/
public OutputStream createOutputStream(Destination dest) throws JMSException {
return createOutputStream(dest, null, ActiveMQMessage.DEFAULT_DELIVERY_MODE, ActiveMQMessage.DEFAULT_PRIORITY, ActiveMQMessage.DEFAULT_TIME_TO_LIVE);
}
/**
* Creates a non persistent output stream; messages will not be written to disk
*/
public OutputStream createNonPersistentOutputStream(Destination dest) throws JMSException {
return createOutputStream(dest, null, DeliveryMode.NON_PERSISTENT, ActiveMQMessage.DEFAULT_PRIORITY, ActiveMQMessage.DEFAULT_TIME_TO_LIVE);
}
/**
* Creates an output stream allowing full control over the delivery mode, the priority and time to live of the messaages and the properties added to messages on the stream.
*/
public OutputStream createOutputStream(Destination dest, Map streamProperties, int deliveryMode, int priority, long timeToLive) throws JMSException {
checkClosedOrFailed();
ensureConnectionInfoSent();