Java CAPS JMS Reference

JMS OTD Methods

This topic describes the Java methods available for use with objects of the type com.stc.connectors.jms.JMS, and can be accessed from:

createBytesMessage()

requestReplyTo(message, destName)

createBytesMessage(msg)

requestReplyTo(timeout, message, destName)

createMapMessage()

send(message)

createMessage()

send(message, deliveryMode, priority, timeToLive)

createMessage(msg)

sendBytes(payload)

createStreamMessage()

sendBytes(payload, deliveryMode, priority, timeToLive)

createTextMessage()

sendBytesTo(payload, destination)

createTextMessage(msg)

sendBytesTo(payload, destination, deliveryMode, priority, timeToLive)

getDeliveryMode()

sendText(payload)

getDestination()

sendText(payload, deliveryMode, priority, timeToLive)

getMessageServerURL()

sendTextTo(payload, destination)

getPriority()

sendTextTo(payload, destination, deliveryMode, priority, timeToLive)

getTimeToLive()

sendTo(message, destination)

receive(timeout)

sendTo(message, destination, deliveryMode, priority, timeToLive)

receive(timeout, destination)

setDeliveryMode(arg0)

receiveNoWait()

setDestination(arg0)

receiveNoWait(destination)

setMessageServerURL(arg0)

requestReply(message)

setPriority(arg0)

requestReply(timeout, message)

setTimeToLive(arg0)

createBytesMessage()

Description

Creates an empty byte message.

Parameters

None.

Return Value

Returns 

Type 

The byte message object. 

com.stc.connectors.jms.Message

Exceptions

None.

createBytesMessage(msg)

Description

Creates a byte message with the specified byte array value.

Parameters

Name 

Type 

Description 

msg

byte[]

The byte array value for the bytes message 

Return Value

Returns 

Type 

The message object with data msg.

com.stc.connectors.jms.Message

Exceptions

None.

createMapMessage()

Description

Creates a map message.

Parameters

None.

Return Value

Returns 

Type 

The MapMessage object.

com.stc.connectors.jms.Message

Exceptions

None.

createMessage()

Description

Creates an empty message (no payload), which is the most efficient method for event notification.

Parameters

None.

Return Value

Returns 

Type 

The message object. 

com.stc.connectors.jms.Message

Exceptions

None.

createMessage(msg)

Description

Creates a message of type com.stc.connectors.jms.Message, which wraps around the message variable of type javax.jms.Message.

Parameters

Name 

Type 

Description 

msg

javax.jms.Message

The message variable. 

Return Value

Returns 

Type 

The message object, with data from JMS Message object. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException, IOException.

createStreamMessage()

Description

Creates an empty stream message. Use the method setStreamMessage(arg0, arg1) to add the payload.

Parameters

None.

Return Value

Returns 

Type 

The stream message object. 

com.stc.connectors.jms.Message

Exceptions

None.

createTextMessage()

Description

Creates an empty text message. Use the method setTextMessage(arg0) to add the payload.

Parameters

None.

Return Value

Returns 

Type 

The TextMessage object.

com.stc.connectors.jms.Message

Exceptions

None.

createTextMessage(msg)

Description

Creates a text message that includes the specified text, producing a ready-to-deliver TextMessage object.

Parameters

Name 

Type 

Description 

msg

String

The string to populate the msg object with.

Return Value

Returns 

Type 

The message object with data msg.

com.stc.connectors.jms.Message

Exceptions

None.

getDeliveryMode()

Description

Gets and returns the value of the JMS delivery mode.

Parameters

None.

Return Value

Returns 

Type 

The value of the JMS deliveryMode property.

java.lang.String

Exceptions

None.

getDestination()

Description

Gets and returns the name of the queue or topic.

Parameters

None.

Return Value

Returns 

Type 

The message destination name. 

java.lang.String

Exceptions

None.

Also Accessible From

getMessageServerURL()

Description

Gets and returns the value of the message server URL.

Parameters

None.

Return Value

Returns 

Type 

The value of the message server URL. 

java.lang.String

Exceptions

None.

getPriority()

Description

Gets and returns the value of the JMS priority.

Parameters

None.

Return Value

Returns 

Type 

The value of the JMS priority property.

int

Exceptions

None.

getTimeToLive()

Description

Gets and returns the specified time period, in milliseconds, following the dispatch time that a message should be retained by the message system.

Parameters

None.

Return Value

Returns 

Type 

The default time period of the JMS timeToLive property, in milliseconds.

long

Exceptions

None.

receive(timeout)

Description

Receives the next message of type com.stc.connectors.jms.Message that arrives from the destination configured in the Connectivity Map Editor during the specified timeout interval.

Parameters

Name 

Type 

Description 

timeout

long

The number of milliseconds before the receive method times out.

Return Value

Returns 

Type 

The next message produced, or null if the timeout expires. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException.

receive(timeout, destination)

Description

Receives the next message of type com.stc.connectors.jms.Message that arrives from the specified message destination during the specified timeout interval.

Parameters

Name 

Type 

Description 

timeout

long

The number of milliseconds before the receive method times out.

destination

java.lang.String

The name of the topic or queue from which this method receives messages. 

Return Value

Returns 

Type 

The next message produced, or null if the timeout expires. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException.

receiveNoWait()

Description

Receives the next message of type com.stc.connectors.jms.Message, if one is immediately available.

Parameters

None.

Return Value

Returns 

Type 

The next message produced, or null if no message is available. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException.

receiveNoWait(destination)

Description

Receives the next message of type com.stc.connectors.jms.Message from the specified message destination if a message is immediately available.

Parameters

Name 

Type 

Description 

destination

java.lang.String

The name of the topic or queue from which this method receives messages. 

Return Value

Returns 

Type 

The next message produced, or null if no message is available. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException.

requestReply(message)

Description

Sends a message of type com.stc.connectors.jms.Message to the destination configured in the Connectivity Map Editor, and waits for the reply message by using Topic/QueueRequestor.

Parameters

Name 

Type 

Description 

message

com.stc.connectors.jms.Message

The message object to send 

Return Value

Returns 

Type 

The reply message. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException when a message is null or when the JMS provider fails to send and receive the message due to an internal error.

requestReply(timeout, message)

Description

Sends a message of type com.stc.connectors.jms.Message to the destination configured in the Connectivity Map Editor, and receives the reply message by using Topic/QueueRequestor during the specified timeout interval.

Parameters

Name 

Type 

Description 

timeout

java.lang.long

The timeout in milliseconds 

message

com.stc.connectors.jms.Message

The message object to send 

Return Value

Returns 

Type 

The reply message, if available during the timeout interval. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException if a message is null, the JMS provider fails to send and receive the message due to an internal error, or timeout expires.

requestReplyTo(message, destName)

Description

Sends a message of type com.stc.connectors.jms.Message to the explicitly named destination, and waits for the reply message by using Topic/QueueRequestor.

Parameters

Name 

Type 

Description 

message

com.stc.connectors.jms.Message

The message object to send 

destName

java.lang.String

The destination name 

Return Value

Returns 

Type 

The reply message. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException when a message is null, destName is null, or the JMS provider fails to send and receive the message due to an internal error.

requestReplyTo(timeout, message, destName)

Description

Sends a message of type com.stc.connectors.jms.Message to the explicitly named destination, and receives the reply message by using Topic/QueueRequestor.

Parameters

Name 

Type 

Description 

timeout

java.lang.long

The timeout in milliseconds 

message

com.stc.connectors.jms.Message

The message object to send 

destName

java.lang.String

The destination name 

Return Value

Returns 

Type 

The reply message, if available during the timeout interval. 

com.stc.connectors.jms.Message

Exceptions

Throws JMSException when a message is null, destName is null, when the JMS provider fails to send and receive the message due to an internal error, or timeout expires.

send(message)

Description

Sends a message of type com.stc.connectors.jms.Message to the destination configured in the Connectivity Map Editor, using the JMS session’s default settings for message priority, time to live, and delivery mode.

Parameters

Name 

Type 

Description 

message

com.stc.connectors.jms.Message

The message variable type to be sent. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

send(message, deliveryMode, priority, timeToLive)

Description

Sends a message of type com.stc.connectors.jms.Message to the destination configured in the Connectivity Map Editor, using the values specified for message priority, time to live, and delivery mode.

Parameters

Name 

Type 

Description 

message

com.stc.connectors.jms.Message

The message variable to be created. 

deliveryMode

int

The message delivery mode. 1 indicates nonpersistent messages, 2 indicates persistent messages. 

priority

int

The message priority (0 through 9, with 9 being the highest priority). 

timeToLive

long

The length of time in milliseconds before the message expires. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendBytes(payload)

Description

Sends a message of type byte[] to the destination configured in the Connectivity Map Editor, using the JMS session’s default settings for message priority, time to live, and delivery mode.

Parameters

Name 

Type 

Description 

payload

byte[]

The message byte array value. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendBytes(payload, deliveryMode, priority, timeToLive)

Description

Sends a message of type byte[] to the destination configured in the Connectivity Map Editor, using the specified parameters.

Parameters

Name 

Type 

Description 

payload

byte[]

The byte array value. 

deliveryMode

int

The message delivery mode. 1 indicates nonpersistent messages, 2 indicates persistent messages. 

priority

int

The message priority (0 through 9, with 9 being the highest priority). 

timeToLive

long

The length of time in milliseconds before the message expires. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendBytesTo(payload, destination)

Description

Sends a message of type byte[] to the specified destination, using the JMS session’s default settings for message priority, time to live, and delivery mode.

Parameters

Name 

Type 

Description 

payload

byte[]

The byte array value. 

destination

java.lang.String

The name of the topic or queue from which this method receives messages. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendBytesTo(payload, destination, deliveryMode, priority, timeToLive)

Description

Sends a message of type byte[] to the destination configured in the Connectivity Map Editor, using the specified parameters.

Parameters

Name 

Type 

Description 

payload

byte[]

The byte array value. 

deliveryMode

int

The message delivery mode. 1 indicates non-persistent messages, 2 indicates persistent messages. 

priority

int

The message priority (0 through 9, with 9 being the highest priority). 

timetolive

long

The amount in milliseconds before the message expires. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendText(payload)

Description

Sends a message of type java.lang.String to the destination configured in the Connectivity Map Editor, using the JMS session’s default settings for message priority, time to live, and delivery mode.

Parameters

Name 

Type 

Description 

payload

java.lang.String

The text in the message. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendText(payload, deliveryMode, priority, timeToLive)

Description

Sends a message of type java.lang.String to the destination configured in the Connectivity Map Editor, using the specified parameters.

Parameters

Name 

Type 

Description 

payload

java.lang.String

The text in the message. 

deliveryMode

int

The message delivery mode. 1 indicates non-persistent messages, 2 indicates persistent messages. 

priority

int

The message priority (0 through 9, with 9 being the highest priority). 

timeToLive

long

The length of time in milliseconds before the message expires. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendTextTo(payload, destination)

Description

Sends a message of type java.lang.String to the specified destination, using the JMS session’s default settings for message priority, time to live, and delivery mode.

Parameters

Name 

Type 

Description 

payload

java.lang.String

The text in the message. 

destination

java.lang.String

The name of the topic or queue to which this method should send the message. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendTextTo(payload, destination, deliveryMode, priority, timeToLive)

Description

Sends a message of type java.lang.String to the specified destination, using the specified parameters.

Parameters

Name 

Type 

Description 

payload

java.lang.String

The text in the message. 

destination

java.lang.String

The name of the topic or queue to which this method should send the message. 

deliveryMode

int

The message delivery mode. 1 indicates non-persistent messages, 2 indicates persistent messages. 

priority

int

The message priority (0 through 9, with 9 being the highest priority). 

timeToLive

long

The length of time in milliseconds before the message expires. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendTo(message, destination)

Description

Sends a message of type com.stc.connectors.jms.Message to the specified destination, using the JMS session’s default settings for message priority, time to live, and delivery mode.

Parameters

Name 

Type 

Description 

msg

com.stc.connectors.jms.Message

The message to be sent. 

destination

java.lang.String

The name of the topic or queue to which this method should send the message. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

sendTo(message, destination, deliveryMode, priority, timeToLive)

Description

Sends a message of type com.stc.connectors.jms.Message to the specified destination, using the specified parameters.

Parameters

Name 

Type 

Description 

message

com.stc.connectors.jms.Message

The message variable type. 

destination

java.lang.String

The name of the topic or queue from which this method receives messages. 

deliveryMode

int

The message delivery mode. 1 indicates non-persistent messages, 2 indicates persistent messages. 

priority

int

The message priority (0 through 9, with 9 being the highest priority). 

timeToLive

long

The length of time in milliseconds before the message expires. 

Return Value

None.

Exceptions

Throws JMSException if a message is null or if the JMS provider fails to send the message due to an internal error.

setDeliveryMode(arg0)

Description

Sets the value of the JMS delivery mode.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The value of the JMS deliveryMode property.

Return Value

None.

Exceptions

None.

setDestination(arg0)

Description

Specifies the queue or topic.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The message destination name. 

Return Value

None.

Exceptions

None.

Also Accessible From

setMessageServerURL(arg0)

Description

Sets the value of the message server URL.

Parameters

Name 

Type 

Description 

arg0

java.lang.String

The value of the message server URL. 

Return Value

None.

Exceptions

None.

setPriority(arg0)

Description

Sets the value of the JMS priority.

Parameters

Name 

Type 

Description 

arg0

int

The value of the JMS priority property.

Return Value

None.

Exceptions

None.

setTimeToLive(arg0)

Description

Sets the default time period, in milliseconds, following the dispatch time that a message should be retained by the message system.

Parameters

Name 

Type 

Description 

arg0

long

The default time period for the JMS timeToLive property, in milliseconds

Return Value

None.

Exceptions

None.