public class TopicProducerImpl extends Object implements DestinationProducer
| Constructor and Description |
|---|
TopicProducerImpl(XMLMessageProducer messageProducer,
Destination defaultTopic) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the message producer.
|
BytesMessage |
createBytesMessage()
Applications use this method to create a
BytesMessage. |
BytesXMLMessage |
createBytesXMLMessage()
Applications use this method to create a
BytesXMLMessage. |
BytesXMLMessage |
createBytesXMLMessage(byte[] value)
Applications use this method to create a
BytesXMLMessage. |
SDTMap |
createMap()
Create maps for use as user
properties or as structured
payload. |
MapMessage |
createMapMessage()
Applications use this method to create a
MapMessage. |
SDTStream |
createStream()
Create streams for use as structured
payload. |
StreamMessage |
createStreamMessage()
Applications use this method to create a
StreamMessage. |
StreamXMLMessage |
createStreamXMLMessage()
Applications use this method to create a
StreamXMLMessage. |
StreamXMLMessage |
createStreamXMLMessage(InputStream stream)
Applications use this method to create a
StreamXMLMessage. |
TextMessage |
createTextMessage()
Applications use this method to create a
TextMessage. |
TextXMLMessage |
createTextXMLMessage()
Applications use this method to create a
TextXMLMessage. |
TextXMLMessage |
createTextXMLMessage(String text)
Applications use this method to create a
TextXMLMessage. |
XMLContentMessage |
createXMLContentMessage()
Applications use this method to create a
XMLContentMessage. |
boolean |
equals(Object obj) |
JCSMPStreamingPublishEventHandler |
getStreamingCallbackHandler() |
int |
hashCode() |
void |
send(XMLMessage message)
Sends to the default destination
|
void |
send(XMLMessage message,
Destination topic)
Sends a message to a specific destination.
|
public TopicProducerImpl(XMLMessageProducer messageProducer, Destination defaultTopic) throws JCSMPException
JCSMPExceptionpublic void send(XMLMessage message, Destination topic) throws JCSMPException
DestinationProducerA new message ID is assigned to the message automatically every time this method is called. The message also becomes read-only, and it cannot be modified by the client application.
send in interface DestinationProducermessage - The message to be sent.topic - The destination to send to.JCSMPException - upon failure.InvalidOperationException - when called on a closed producer.public void send(XMLMessage message) throws JCSMPException
DestinationProducersend in interface DestinationProducermessage - The message to be sent.JCSMPException - upon failure.InvalidOperationException - when called on a closed producer.public void close()
Producerpublic BytesXMLMessage createBytesXMLMessage() throws JCSMPException
ProducerBytesXMLMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createBytesXMLMessage in interface ProducerBytesXMLMessage.InvalidOperationException - when called on a closed producer.JCSMPExceptionpublic BytesXMLMessage createBytesXMLMessage(byte[] value) throws JCSMPException
ProducerBytesXMLMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createBytesXMLMessage in interface Producervalue - The message content.BytesXMLMessage.InvalidOperationException - when called on a closed producer.JCSMPExceptionpublic StreamXMLMessage createStreamXMLMessage() throws JCSMPException
ProducerStreamXMLMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createStreamXMLMessage in interface ProducerStreamXMLMessage.InvalidOperationException - when called on a closed producer.JCSMPExceptionpublic StreamXMLMessage createStreamXMLMessage(InputStream stream) throws IOException, JCSMPException
ProducerStreamXMLMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createStreamXMLMessage in interface Producerstream - The InputStream from which to read message content.StreamXMLMessage.IOException - If error reading from stream.InvalidOperationException - when called on a closed producer.JCSMPExceptionpublic TextXMLMessage createTextXMLMessage() throws JCSMPException
ProducerTextXMLMessage.
NOTE: Applications shall not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createTextXMLMessage in interface ProducerTextXMLMessage.InvalidOperationException - when called on a closed producer.JCSMPExceptionpublic TextXMLMessage createTextXMLMessage(String text) throws JCSMPException
ProducerTextXMLMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createTextXMLMessage in interface Producertext - The message content.TextXMLMessage.InvalidOperationException - when called on a closed producer.JCSMPExceptionpublic SDTMap createMap()
Producerproperties or as structured
payload. There
is nothing tying the returned map to the producer that created it. The
map can be used by any producer in any message.public SDTStream createStream()
Producerpayload. There is nothing tying the returned stream to the producer that
created it. The stream can be used by any producer in any message.createStream in interface Producerpublic BytesMessage createBytesMessage() throws JCSMPException
ProducerBytesMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createBytesMessage in interface ProducerInvalidOperationException - when called on a closed producer.JCSMPExceptionpublic XMLContentMessage createXMLContentMessage() throws JCSMPException
ProducerXMLContentMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createXMLContentMessage in interface ProducerInvalidOperationException - when called on a closed producer.JCSMPExceptionpublic MapMessage createMapMessage() throws JCSMPException
ProducerMapMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createMapMessage in interface ProducerInvalidOperationException - when called on a closed producer.JCSMPExceptionpublic StreamMessage createStreamMessage() throws JCSMPException
ProducerStreamMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createStreamMessage in interface ProducerInvalidOperationException - when called on a closed producer.JCSMPExceptionpublic TextMessage createTextMessage() throws JCSMPException
ProducerTextMessage.
NOTE: Applications must not cache the created object based on the assumption that the method returns a new object each time. The JCSMP implementation can reuse the same object by resetting its content.
createTextMessage in interface ProducerInvalidOperationException - when called on a closed producer.JCSMPExceptionpublic JCSMPStreamingPublishEventHandler getStreamingCallbackHandler() throws JCSMPException
getStreamingCallbackHandler in interface Producernull, otherwise.InvalidOperationException - when called on a closed producer.JCSMPExceptionCopyright 2004-2019 Solace Corporation. All rights reserved.