|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mq.SpyMessageProducer
This class implements javax.jms.MessageProducer
Field Summary | |
protected boolean |
closed
Whether we are closed |
protected int |
defaultDeliveryMode
The defaultDeliveryMode |
protected int |
defaultPriority
The defaultPriority |
protected long |
defaultTTL
The defaultTTL |
protected Destination (src) |
destination
The destination |
protected SpySession (src) |
session
The session |
Method Summary | |
protected void |
checkClosed()
|
void |
close()
Closes the message producer. |
protected SpyMessage (src) |
encapsulateMessage(Message (src) message)
|
int |
getDeliveryMode()
Gets the producer's default delivery mode. |
Destination (src) |
getDestination()
Gets the destination associated with this MessageProducer . |
boolean |
getDisableMessageID()
Gets an indication of whether message IDs are disabled. |
boolean |
getDisableMessageTimestamp()
Gets an indication of whether message timestamps are disabled. |
int |
getPriority()
Gets the producer's default priority. |
long |
getTimeToLive()
Gets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system. |
void |
send(Destination (src) destination,
Message (src) message)
Sends a message to a destination for an unidentified message producer. |
void |
send(Destination (src) destination,
Message (src) message,
int deliveryMode,
int priority,
long ttl)
Sends a message to a destination for an unidentified message producer, specifying delivery mode, priority and time to live. |
void |
send(Message (src) message)
Sends a message using the MessageProducer 's
default delivery mode, priority, and time to live. |
void |
send(Message (src) message,
int deliveryMode,
int priority,
long ttl)
Sends a message to the destination, specifying delivery mode, priority, and time to live. |
void |
setDeliveryMode(int deli)
Sets the producer's default delivery mode. |
void |
setDisableMessageID(boolean value)
Sets whether message IDs are disabled. |
void |
setDisableMessageTimestamp(boolean value)
Sets whether message timestamps are disabled. |
void |
setPriority(int pri)
Sets the producer's default priority. |
void |
setTimeToLive(int timeToLive)
|
void |
setTimeToLive(long timeToLive)
Sets the default length of time in milliseconds from its dispatch time that a produced message should be retained by the message system. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected SpySession (src) session
protected Destination (src) destination
protected int defaultDeliveryMode
protected int defaultPriority
protected long defaultTTL
protected boolean closed
Method Detail |
public void setDisableMessageID(boolean value) throws JMSException (src)
MessageProducer (src)
Since message IDs take some effort to create and increase a
message's size, some JMS providers may be able to optimize message
overhead if they are given a hint that the message ID is not used by
an application. By calling the setDisableMessageID
method on this message producer, a JMS client enables this potential
optimization for all messages sent by this message producer. If the JMS
provider accepts this hint,
these messages must have the message ID set to null; if the provider
ignores the hint, the message ID must be set to its normal unique value.
Message IDs are enabled by default.
setDisableMessageID
in interface MessageProducer (src)
value
- indicates if message IDs are disabled
JMSException (src)
- if the JMS provider fails to set message ID to
disabled due to some internal error.public void setDisableMessageTimestamp(boolean value) throws JMSException (src)
MessageProducer (src)
Since timestamps take some effort to create and increase a
message's size, some JMS providers may be able to optimize message
overhead if they are given a hint that the timestamp is not used by an
application. By calling the setDisableMessageTimestamp
method on this message producer, a JMS client enables this potential
optimization for all messages sent by this message producer. If the
JMS provider accepts this hint,
these messages must have the timestamp set to zero; if the provider
ignores the hint, the timestamp must be set to its normal value.
Message timestamps are enabled by default.
setDisableMessageTimestamp
in interface MessageProducer (src)
value
- indicates if message timestamps are disabled
JMSException (src)
- if the JMS provider fails to set timestamps to
disabled due to some internal error.public void setDeliveryMode(int deli) throws JMSException (src)
MessageProducer (src)
Delivery mode is set to PERSISTENT
by default.
setDeliveryMode
in interface MessageProducer (src)
deli
- the message delivery mode for this message
producer; legal values are DeliveryMode.NON_PERSISTENT
and DeliveryMode.PERSISTENT
JMSException (src)
- if the JMS provider fails to set the delivery
mode due to some internal error.MessageProducer.getDeliveryMode()
,
DeliveryMode.NON_PERSISTENT
,
DeliveryMode.PERSISTENT
,
Message.DEFAULT_DELIVERY_MODE
public void setPriority(int pri) throws JMSException (src)
MessageProducer (src)
The JMS API defines ten levels of priority value, with 0 as the lowest priority and 9 as the highest. Clients should consider priorities 0-4 as gradations of normal priority and priorities 5-9 as gradations of expedited priority. Priority is set to 4 by default.
setPriority
in interface MessageProducer (src)
pri
- the message priority for this message producer;
must be a value between 0 and 9
JMSException (src)
- if the JMS provider fails to set the priority
due to some internal error.MessageProducer.getPriority()
,
Message.DEFAULT_PRIORITY
public void setTimeToLive(int timeToLive) throws JMSException (src)
JMSException (src)
public void setTimeToLive(long timeToLive) throws JMSException (src)
MessageProducer (src)
Time to live is set to zero by default.
setTimeToLive
in interface MessageProducer (src)
timeToLive
- the message time to live in milliseconds; zero is
unlimited
JMSException (src)
- if the JMS provider fails to set the time to
live due to some internal error.MessageProducer.getTimeToLive()
,
Message.DEFAULT_TIME_TO_LIVE
public boolean getDisableMessageID() throws JMSException (src)
MessageProducer (src)
getDisableMessageID
in interface MessageProducer (src)
JMSException (src)
- if the JMS provider fails to determine if
message IDs are disabled due to some internal
error.public boolean getDisableMessageTimestamp() throws JMSException (src)
MessageProducer (src)
getDisableMessageTimestamp
in interface MessageProducer (src)
JMSException (src)
- if the JMS provider fails to determine if
timestamps are disabled due to some internal
error.public int getDeliveryMode() throws JMSException (src)
MessageProducer (src)
getDeliveryMode
in interface MessageProducer (src)
JMSException (src)
- if the JMS provider fails to get the delivery
mode due to some internal error.MessageProducer.setDeliveryMode(int)
public int getPriority() throws JMSException (src)
MessageProducer (src)
getPriority
in interface MessageProducer (src)
JMSException (src)
- if the JMS provider fails to get the priority
due to some internal error.MessageProducer.setPriority(int)
public long getTimeToLive() throws JMSException (src)
MessageProducer (src)
getTimeToLive
in interface MessageProducer (src)
JMSException (src)
- if the JMS provider fails to get the time to
live due to some internal error.MessageProducer.setTimeToLive(long)
public void close() throws JMSException (src)
MessageProducer (src)
Since a provider may allocate some resources on behalf of a
MessageProducer
outside the Java virtual machine, clients
should close them when they
are not needed. Relying on garbage collection to eventually reclaim
these resources may not be timely enough.
close
in interface MessageProducer (src)
JMSException (src)
- if the JMS provider fails to close the producer
due to some internal error.public Destination (src) getDestination() throws JMSException (src)
MessageProducer (src)
MessageProducer
.
getDestination
in interface MessageProducer (src)
Destination/
- Throws:
JMSException (src)
- if the JMS provider fails to get the destination for
this MessageProducer
due to some internal error.
public void send(Message (src) message) throws JMSException (src)
MessageProducer (src)
MessageProducer
's
default delivery mode, priority, and time to live.
send
in interface MessageProducer (src)
message
- the message to send
JMSException (src)
- if the JMS provider fails to send the message
due to some internal error.Session.createProducer(javax.jms.Destination)
,
MessageProducer
(src) public void send(Destination (src) destination, Message (src) message) throws JMSException (src)
MessageProducer (src)
MessageProducer
's default delivery mode, priority,
and time to live.
Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent.
send
in interface MessageProducer (src)
destination
- the destination to send this message tomessage
- the message to send
JMSException (src)
- if the JMS provider fails to send the message
due to some internal error.Session.createProducer(javax.jms.Destination)
,
MessageProducer
(src) public void send(Message (src) message, int deliveryMode, int priority, long ttl) throws JMSException (src)
MessageProducer (src)
send
in interface MessageProducer (src)
message
- the message to senddeliveryMode
- the delivery mode to usepriority
- the priority for this messagettl
- the message's lifetime (in milliseconds)
JMSException (src)
- if the JMS provider fails to send the message
due to some internal error.Session.createProducer(javax.jms.Destination)
public void send(Destination (src) destination, Message (src) message, int deliveryMode, int priority, long ttl) throws JMSException (src)
MessageProducer (src)
Typically, a message producer is assigned a destination at creation time; however, the JMS API also supports unidentified message producers, which require that the destination be supplied every time a message is sent.
send
in interface MessageProducer (src)
destination
- the destination to send this message tomessage
- the message to senddeliveryMode
- the delivery mode to usepriority
- the priority for this messagettl
- the message's lifetime (in milliseconds)
JMSException (src)
- if the JMS provider fails to send the message
due to some internal error.Session.createProducer(javax.jms.Destination)
public java.lang.String toString()
protected void checkClosed() throws JMSException (src)
JMSException (src)
protected SpyMessage (src) encapsulateMessage(Message (src) message) throws JMSException (src)
JMSException (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |