org.jboss.messaging.ra
Class JBMMessageProducer

java.lang.Object
  extended by org.jboss.messaging.ra.JBMMessageProducer
All Implemented Interfaces:
javax.jms.MessageProducer
Direct Known Subclasses:
JBMQueueSender, JBMTopicPublisher

public class JBMMessageProducer
extends java.lang.Object
implements javax.jms.MessageProducer

JBMMessageProducer.

Version:
$Revision: $
Author:
Adrian Brock, Jesper Pedersen

Field Summary
protected  javax.jms.MessageProducer producer
          The wrapped message producer
protected  JBMSession session
          The session for this consumer
 
Constructor Summary
JBMMessageProducer(javax.jms.MessageProducer producer, JBMSession session)
          Create a new wrapper
 
Method Summary
 void close()
          Close
 int getDeliveryMode()
          Get the delivery mode
 javax.jms.Destination getDestination()
          Get the destination
 boolean getDisableMessageID()
          Disable message id
 boolean getDisableMessageTimestamp()
          Disable message timestamp
 int getPriority()
          Get the priority
 long getTimeToLive()
          Get the time to live
 void send(javax.jms.Destination destination, javax.jms.Message message)
          Send message
 void send(javax.jms.Destination destination, javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Send message
 void send(javax.jms.Message message)
          Send message
 void send(javax.jms.Message message, int deliveryMode, int priority, long timeToLive)
          Send message
 void setDeliveryMode(int deliveryMode)
          Set the delivery mode
 void setDisableMessageID(boolean value)
          Set disable message id
 void setDisableMessageTimestamp(boolean value)
          Set disable message timestamp
 void setPriority(int defaultPriority)
          Set the priority
 void setTimeToLive(long timeToLive)
          Set the ttl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

producer

protected javax.jms.MessageProducer producer
The wrapped message producer


session

protected JBMSession session
The session for this consumer

Constructor Detail

JBMMessageProducer

public JBMMessageProducer(javax.jms.MessageProducer producer,
                          JBMSession session)
Create a new wrapper

Parameters:
producer - the producer
session - the session
Method Detail

close

public void close()
           throws javax.jms.JMSException
Close

Specified by:
close in interface javax.jms.MessageProducer
Throws:
javax.jms.JMSException - Thrown if an error occurs

send

public void send(javax.jms.Destination destination,
                 javax.jms.Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws javax.jms.JMSException
Send message

Specified by:
send in interface javax.jms.MessageProducer
Parameters:
destination - The destination
message - The message
deliveryMode - The delivery mode
priority - The priority
timeToLive - The time to live
Throws:
javax.jms.JMSException - Thrown if an error occurs

send

public void send(javax.jms.Destination destination,
                 javax.jms.Message message)
          throws javax.jms.JMSException
Send message

Specified by:
send in interface javax.jms.MessageProducer
Parameters:
destination - The destination
message - The message
Throws:
javax.jms.JMSException - Thrown if an error occurs

send

public void send(javax.jms.Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws javax.jms.JMSException
Send message

Specified by:
send in interface javax.jms.MessageProducer
Parameters:
message - The message
deliveryMode - The delivery mode
priority - The priority
timeToLive - The time to live
Throws:
javax.jms.JMSException - Thrown if an error occurs

send

public void send(javax.jms.Message message)
          throws javax.jms.JMSException
Send message

Specified by:
send in interface javax.jms.MessageProducer
Parameters:
message - The message
Throws:
javax.jms.JMSException - Thrown if an error occurs

getDeliveryMode

public int getDeliveryMode()
                    throws javax.jms.JMSException
Get the delivery mode

Specified by:
getDeliveryMode in interface javax.jms.MessageProducer
Returns:
The mode
Throws:
javax.jms.JMSException - Thrown if an error occurs

getDestination

public javax.jms.Destination getDestination()
                                     throws javax.jms.JMSException
Get the destination

Specified by:
getDestination in interface javax.jms.MessageProducer
Returns:
The destination
Throws:
javax.jms.JMSException - Thrown if an error occurs

getDisableMessageID

public boolean getDisableMessageID()
                            throws javax.jms.JMSException
Disable message id

Specified by:
getDisableMessageID in interface javax.jms.MessageProducer
Returns:
True if disable
Throws:
javax.jms.JMSException - Thrown if an error occurs

getDisableMessageTimestamp

public boolean getDisableMessageTimestamp()
                                   throws javax.jms.JMSException
Disable message timestamp

Specified by:
getDisableMessageTimestamp in interface javax.jms.MessageProducer
Returns:
True if disable
Throws:
javax.jms.JMSException - Thrown if an error occurs

getPriority

public int getPriority()
                throws javax.jms.JMSException
Get the priority

Specified by:
getPriority in interface javax.jms.MessageProducer
Returns:
The priority
Throws:
javax.jms.JMSException - Thrown if an error occurs

getTimeToLive

public long getTimeToLive()
                   throws javax.jms.JMSException
Get the time to live

Specified by:
getTimeToLive in interface javax.jms.MessageProducer
Returns:
The ttl
Throws:
javax.jms.JMSException - Thrown if an error occurs

setDeliveryMode

public void setDeliveryMode(int deliveryMode)
                     throws javax.jms.JMSException
Set the delivery mode

Specified by:
setDeliveryMode in interface javax.jms.MessageProducer
Parameters:
deliveryMode - The mode
Throws:
javax.jms.JMSException - Thrown if an error occurs

setDisableMessageID

public void setDisableMessageID(boolean value)
                         throws javax.jms.JMSException
Set disable message id

Specified by:
setDisableMessageID in interface javax.jms.MessageProducer
Parameters:
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setDisableMessageTimestamp

public void setDisableMessageTimestamp(boolean value)
                                throws javax.jms.JMSException
Set disable message timestamp

Specified by:
setDisableMessageTimestamp in interface javax.jms.MessageProducer
Parameters:
value - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setPriority

public void setPriority(int defaultPriority)
                 throws javax.jms.JMSException
Set the priority

Specified by:
setPriority in interface javax.jms.MessageProducer
Parameters:
defaultPriority - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs

setTimeToLive

public void setTimeToLive(long timeToLive)
                   throws javax.jms.JMSException
Set the ttl

Specified by:
setTimeToLive in interface javax.jms.MessageProducer
Parameters:
timeToLive - The value
Throws:
javax.jms.JMSException - Thrown if an error occurs


Copyright © 2006 JBoss Inc. All Rights Reserved.