org.apache.qpid.client
Class BasicMessageProducer

java.lang.Object
  extended by org.apache.qpid.client.Closeable
      extended by org.apache.qpid.client.BasicMessageProducer
All Implemented Interfaces:
MessageProducer
Direct Known Subclasses:
BasicMessageProducer_0_10, BasicMessageProducer_0_8

public abstract class BasicMessageProducer
extends Closeable
implements MessageProducer


Nested Class Summary
(package private) static class BasicMessageProducer.PublishMode
           
 
Field Summary
protected  int _channelId
           
protected  AMQDestination _destination
          The Destination used for this consumer, if specified upon creation.
protected  boolean _disableTimestamps
          If true, messages will not get a timestamp.
protected  org.slf4j.Logger _logger
           
protected  AMQProtocolHandler _protocolHandler
           
protected  AMQSession _session
          The session used to create this producer
protected  String _userID
           
protected  BasicMessageProducer.PublishMode publishMode
           
 
Fields inherited from class org.apache.qpid.client.Closeable
_closed, _closing
 
Constructor Summary
protected BasicMessageProducer(AMQConnection connection, AMQDestination destination, boolean transacted, int channelId, AMQSession session, AMQProtocolHandler protocolHandler, long producerId, boolean immediate, boolean mandatory, boolean waitUntilSent)
           
 
Method Summary
 void close()
          Closes this object.
(package private) abstract  void declareDestination(AMQDestination destination)
           
 int getDeliveryMode()
           
 Destination getDestination()
           
 boolean getDisableMessageID()
           
 boolean getDisableMessageTimestamp()
           
 int getPriority()
           
 AMQSession getSession()
           
 long getTimeToLive()
           
 boolean isBound(AMQDestination destination)
           
(package private)  void resubscribe()
           
 void send(Destination destination, Message message)
           
 void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive)
           
 void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, boolean mandatory)
           
 void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, boolean mandatory, boolean immediate)
           
 void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive, boolean mandatory, boolean immediate, boolean waitUntilSent)
           
 void send(Message message)
           
 void send(Message message, int deliveryMode)
           
 void send(Message message, int deliveryMode, boolean immediate)
           
 void send(Message message, int deliveryMode, int priority, long timeToLive)
           
protected  void sendImpl(AMQDestination destination, Message message, int deliveryMode, int priority, long timeToLive, boolean mandatory, boolean immediate)
           
protected  void sendImpl(AMQDestination destination, Message origMessage, int deliveryMode, int priority, long timeToLive, boolean mandatory, boolean immediate, boolean wait)
          The caller of this method must hold the failover mutex.
(package private) abstract  void sendMessage(AMQDestination destination, Message origMessage, AbstractJMSMessage message, UUID messageId, int deliveryMode, int priority, long timeToLive, boolean mandatory, boolean immediate, boolean wait)
           
 void setDeliveryMode(int i)
           
 void setDisableMessageID(boolean b)
           
 void setDisableMessageTimestamp(boolean b)
           
 void setEncoding(String encoding)
          Set the default encoding for messages produced by this producer.
 void setMimeType(String mimeType)
          Set the default MIME type for messages produced by this producer.
 void setPriority(int i)
           
(package private)  void setPublishMode()
           
 void setTimeToLive(long l)
           
 
Methods inherited from class org.apache.qpid.client.Closeable
checkNotClosed, isClosed, isClosing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected final org.slf4j.Logger _logger

_disableTimestamps

protected boolean _disableTimestamps
If true, messages will not get a timestamp.


_destination

protected AMQDestination _destination
The Destination used for this consumer, if specified upon creation.


_protocolHandler

protected AMQProtocolHandler _protocolHandler

_channelId

protected int _channelId

_session

protected AMQSession _session
The session used to create this producer


_userID

protected String _userID

publishMode

protected BasicMessageProducer.PublishMode publishMode
Constructor Detail

BasicMessageProducer

protected BasicMessageProducer(AMQConnection connection,
                               AMQDestination destination,
                               boolean transacted,
                               int channelId,
                               AMQSession session,
                               AMQProtocolHandler protocolHandler,
                               long producerId,
                               boolean immediate,
                               boolean mandatory,
                               boolean waitUntilSent)
Method Detail

setPublishMode

void setPublishMode()

resubscribe

void resubscribe()
           throws org.apache.qpid.AMQException
Throws:
org.apache.qpid.AMQException

declareDestination

abstract void declareDestination(AMQDestination destination)

setDisableMessageID

public void setDisableMessageID(boolean b)
                         throws JMSException
Specified by:
setDisableMessageID in interface MessageProducer
Throws:
JMSException

getDisableMessageID

public boolean getDisableMessageID()
                            throws JMSException
Specified by:
getDisableMessageID in interface MessageProducer
Throws:
JMSException

setDisableMessageTimestamp

public void setDisableMessageTimestamp(boolean b)
                                throws JMSException
Specified by:
setDisableMessageTimestamp in interface MessageProducer
Throws:
JMSException

getDisableMessageTimestamp

public boolean getDisableMessageTimestamp()
                                   throws JMSException
Specified by:
getDisableMessageTimestamp in interface MessageProducer
Throws:
JMSException

setDeliveryMode

public void setDeliveryMode(int i)
                     throws JMSException
Specified by:
setDeliveryMode in interface MessageProducer
Throws:
JMSException

getDeliveryMode

public int getDeliveryMode()
                    throws JMSException
Specified by:
getDeliveryMode in interface MessageProducer
Throws:
JMSException

setPriority

public void setPriority(int i)
                 throws JMSException
Specified by:
setPriority in interface MessageProducer
Throws:
JMSException

getPriority

public int getPriority()
                throws JMSException
Specified by:
getPriority in interface MessageProducer
Throws:
JMSException

setTimeToLive

public void setTimeToLive(long l)
                   throws JMSException
Specified by:
setTimeToLive in interface MessageProducer
Throws:
JMSException

getTimeToLive

public long getTimeToLive()
                   throws JMSException
Specified by:
getTimeToLive in interface MessageProducer
Throws:
JMSException

getDestination

public Destination getDestination()
                           throws JMSException
Specified by:
getDestination in interface MessageProducer
Throws:
JMSException

close

public void close()
Description copied from class: Closeable
Closes this object.

Specified by:
close in interface MessageProducer
Specified by:
close in class Closeable

send

public void send(Message message)
          throws JMSException
Specified by:
send in interface MessageProducer
Throws:
JMSException

send

public void send(Message message,
                 int deliveryMode)
          throws JMSException
Throws:
JMSException

send

public void send(Message message,
                 int deliveryMode,
                 boolean immediate)
          throws JMSException
Throws:
JMSException

send

public void send(Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
Specified by:
send in interface MessageProducer
Throws:
JMSException

send

public void send(Destination destination,
                 Message message)
          throws JMSException
Specified by:
send in interface MessageProducer
Throws:
JMSException

send

public void send(Destination destination,
                 Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive)
          throws JMSException
Specified by:
send in interface MessageProducer
Throws:
JMSException

send

public void send(Destination destination,
                 Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive,
                 boolean mandatory)
          throws JMSException
Throws:
JMSException

send

public void send(Destination destination,
                 Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive,
                 boolean mandatory,
                 boolean immediate)
          throws JMSException
Throws:
JMSException

send

public void send(Destination destination,
                 Message message,
                 int deliveryMode,
                 int priority,
                 long timeToLive,
                 boolean mandatory,
                 boolean immediate,
                 boolean waitUntilSent)
          throws JMSException
Throws:
JMSException

sendImpl

protected void sendImpl(AMQDestination destination,
                        Message message,
                        int deliveryMode,
                        int priority,
                        long timeToLive,
                        boolean mandatory,
                        boolean immediate)
                 throws JMSException
Throws:
JMSException

sendImpl

protected void sendImpl(AMQDestination destination,
                        Message origMessage,
                        int deliveryMode,
                        int priority,
                        long timeToLive,
                        boolean mandatory,
                        boolean immediate,
                        boolean wait)
                 throws JMSException
The caller of this method must hold the failover mutex.

Parameters:
destination -
origMessage -
deliveryMode -
priority -
timeToLive -
mandatory -
immediate -
Throws:
JMSException

sendMessage

abstract void sendMessage(AMQDestination destination,
                          Message origMessage,
                          AbstractJMSMessage message,
                          UUID messageId,
                          int deliveryMode,
                          int priority,
                          long timeToLive,
                          boolean mandatory,
                          boolean immediate,
                          boolean wait)
                   throws JMSException
Throws:
JMSException

setMimeType

public void setMimeType(String mimeType)
                 throws JMSException
Description copied from interface: MessageProducer
Set the default MIME type for messages produced by this producer. This reduces the overhead of each message.

Throws:
JMSException

setEncoding

public void setEncoding(String encoding)
                 throws JMSException,
                        UnsupportedEncodingException
Description copied from interface: MessageProducer
Set the default encoding for messages produced by this producer. This reduces the overhead of each message.

Parameters:
encoding - the encoding as understood by XXXX how do I specify this?? RG
Throws:
UnsupportedEncodingException - if the encoding is not understood
JMSException

getSession

public AMQSession getSession()

isBound

public boolean isBound(AMQDestination destination)
                throws JMSException
Throws:
JMSException


Licensed to the Apache Software Foundation