com.tibco.tibjms
Class Tibjms
java.lang.Object
com.tibco.tibjms.Tibjms
- public class Tibjms
- extends java.lang.Object
Defines miscellaneous constants and System Properties
used by TIBCO Enterprise Message Service client.
Field Summary |
static java.lang.String |
DEFAULT_FACTORY_PASSWORD
Defines the name of the ConnectionFactory property specifying
default user password set for Connections created by the factory. |
static java.lang.String |
DEFAULT_FACTORY_USERNAME
Defines the name of the ConnectionFactory property specifying
default user name set for Connections created by the factory. |
static int |
EXPLICIT_CLIENT_ACKNOWLEDGE
Defines explicit client acknowledge mode. |
static int |
EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE
Defines explicit client acknowledge mode with dups_ok. |
static java.lang.String |
FACTORY_CONNECT_ATTEMPT_COUNT
Defines the name of the ConnectionFactory property specifying
the maximum iterations a client program will go through its URL list
until it establishes its first connection to an EMS server. |
static java.lang.String |
FACTORY_CONNECT_ATTEMPT_DELAY
Defines the name of the ConnectionFactory property specifying the
interval between iterations a client program will try to establishe
its first connection to an EMS server. |
static java.lang.String |
FACTORY_LOAD_BALANCE_METRIC
Defines the name of the ConnectionFactory property specifying
the metric to be used for load balancing by the factory. |
static int |
FACTORY_LOAD_BALANCE_METRIC_BYTE_RATE
Indicates that the connection factory load balances connections across
multiple servers by creating a connection to the server with the lowest
total byte rate (input and output). |
static int |
FACTORY_LOAD_BALANCE_METRIC_CONNECTIONS
Indicates that the connection factory load balances connections across
multiple servers by creating a connection to the server with the fewest
number of connections. |
static int |
FACTORY_LOAD_BALANCE_METRIC_NONE
Indicates that no load balancing metric has been set for the connection
factory. |
static java.lang.String |
FACTORY_RECONNECT_ATTEMPT_COUNT
Defines the name of the ConnectionFactory property specifying
the maximum iterations a client program will try to re-establish
a connection to an EMS server after losing previous connection. |
static java.lang.String |
FACTORY_RECONNECT_ATTEMPT_DELAY
Defines the name of the ConnectionFactory property specifying
the interval between reconnection attempts. |
static java.lang.String |
JMS_TIBCO_CM_PUBLISHER
Provider specific message property which may be set if imported message
has been published by TIBCO Rendezvous Certified Messaging application. |
static java.lang.String |
JMS_TIBCO_CM_SEQUENCE
Provider specific message property which may be set if imported message
has been published by TIBCO Rendezvous Certified Messaging application. |
static java.lang.String |
JMS_TIBCO_COMPRESS
Provider specific message property which is set by the
application if this message should be compressed before
it is sent to the server. |
static java.lang.String |
JMS_TIBCO_DISABLE_SENDER
Provider specific message property which may be set to prevent the server
from including the user name into message when sending this message to
consumers. |
static java.lang.String |
JMS_TIBCO_IMPORTED
Provider specific message property which is set by the provider if the
message has been imported from TIBCO Rendezvous or TIBCO SmartSockets. |
static java.lang.String |
JMS_TIBCO_MSG_EXT
Provider specific message property which is set by the provider
or the application when message extensions are used. |
static java.lang.String |
JMS_TIBCO_MSG_TRACE
Provider specific message property which can be set by the
application if this message should be traced in the server
and optionally in the client. |
static java.lang.String |
JMS_TIBCO_PRESERVE_UNDELIVERED
Provider specific message property which is set by the
application if this message should be placed into special
system queue in case it could not be delivered. |
static java.lang.String |
JMS_TIBCO_SENDER
Provider specific message property which may be set in a received message if
message has been sent on a destination with sender name property. |
static java.lang.String |
JMS_TIBCO_SS_SENDER
Provider specific message property which is set if imported message
has been published by TIBCO SmartSockets application. |
static int |
NO_ACKNOWLEDGE
Defines no acknowledge acknowledge mode. |
static java.lang.String |
PROP_CLOSE_IN_CALLBACK
Defines the name of the System Property controlling if a
MessageConsumer.close(), Session.close() or Connection.close()
methods can be called in the MessageListener callback. |
static java.lang.String |
PROP_CONNECT_ATTEMPTS
Defines the name of the System Property controlling the
number of attempts the connections make to connect to the server. |
static java.lang.String |
PROP_DAEMON_DISPATCHER
Defines the name of the System Property controlling the type of
Session dispatcher threads. |
static java.lang.String |
PROP_FT_SWITCH_EXCEPTION
Defines the name of the System Property controlling if ExceptionListener
set on the Connection should be called after fault-tolerant switch. |
static java.lang.String |
PROP_MESSAGE_ENCODING
Defines the name of the System Property setting the global encoding
name for String values in the message properties and data fields. |
static java.lang.String |
PROP_PING_INTERVAL
Defines the name of the System Property setting the ping interval
for inactive connections. |
static java.lang.String |
PROP_RECONNECT_ATTEMPTS
Defines the name of the System Property controlling the
number of attempt the connections make to reconnect to the backup
server during the fault-tolerant switch. |
static java.lang.String |
PROP_SOCKET_CONNECT_TIMEOUT
Defines the name of the System Property controlling the
low-level timeout of connecting the socket to the server. |
static java.lang.String |
PROP_SOCKET_RECEIVE
Defines the name of the System Property setting the size of
the socket receive buffer size in kilobytes for client connections. |
static java.lang.String |
PROP_SOCKET_SEND
Defines the name of the System Property setting the size of
the socket send buffer size in kilobytes for client connections. |
static java.lang.String |
PROP_SSL_DEBUG_TRACE
Defines the name of the System Property specifying
debug tracing for SSL connections using Entrust SSL Vendor. |
static java.lang.String |
PROP_SSL_TRACE
Defines the name of the System Property specifying tracing
for SSL connections. |
static int |
RELIABLE_DELIVERY
Defines reliable delivery mode. |
Method Summary |
static int |
calculateMessageSize(Message msg)
Calculates and returns total size of the message wire representation. |
static Message |
createFromBytes(byte[] bytes)
Create a message from specified byte array. |
static boolean |
getAllowCallbackInClose()
Deprecated. This method has been misnamed and replaced
by getAllowCloseInCallback . |
static boolean |
getAllowCloseInCallback()
Returns if allowed to call close() in callbacks. |
static byte[] |
getAsBytes(Message message)
Return a copy of the message data as a byte array, suitable for archiving in a file. |
static java.lang.String |
getConnectAttempts()
Returns the connect attempts setting. |
static java.lang.String |
getConnectionActiveURL(Connection connection)
Returns a string representing the URL of the server that this connection
is currently connected to. |
static java.lang.String |
getEncoding()
Retursn global string encoding for messages. |
static boolean |
getExceptionOnFTSwitch()
Returns if exception listener is called on FT switch. |
static int |
getMessageBodySize(Message msg)
Returns the total wire size of the message body for a message
which was received or sent. |
static java.lang.String |
getMessageEncoding(Message message)
Returns string encoding name set for this message. |
static int |
getMessageHeadersSize(Message msg)
Returns the total wire size of the message headers for a message
which was received or sent. |
static int |
getMessagePropertiesSize(Message msg)
Returns the total wire size of the message properties for a message
which was received or sent. |
static int |
getMessageSize(Message msg)
Returns the total wire size of the message which was received or sent. |
static int |
getPingInterval()
Returns the ping interval in seconds used by inactive connections. |
static java.lang.String |
getReconnectAttempts()
Returns the reconnect attempts setting. |
static boolean |
getSessionDispatcherDaemon()
Returns if session dispatcher threads are daemon. |
static long |
getSocketConnectTimeout()
Returns the timeout in milliseconds used by low-level socket connect calls. |
static int |
getSocketReceiveBufferSize()
Returns the size of socket receive buffer. |
static int |
getSocketSendBufferSize()
Returns the size of socket send buffer. |
static void |
makeWriteable(Message message)
Set message to writeable state without resetting its content. |
static void |
setAllowCallbackInClose(boolean allow)
Deprecated. This method has been misnamed and replaced
by setAllowCloseInCallback . |
static void |
setAllowCloseInCallback(boolean allow)
Sets if MessageConsumer.close(), Session.close() or Connection.close()
methods can be called in the MessageListener callback. |
static void |
setConnectAttempts(java.lang.String specs)
Sets the parameters for the number of attempts the connections
make to connect to the server. |
static void |
setEncoding(java.lang.String encodingName)
Set global string encoding for messages. |
static void |
setExceptionOnFTSwitch(boolean callExceptionListener)
Sets if ExceptionListener set on the Connection should be called after
fault-tolerant switch. |
static void |
setMessageEncoding(Message message,
java.lang.String encodingName)
Set string encoding for message. |
static void |
setPingInterval(int seconds)
Sets the ping interval in seconds used by inactive connections. |
static void |
setReconnectAttempts(java.lang.String specs)
Sets the parameter for the number of attempts the connections
make to reconnect to the backup server during fault-tolerant switch. |
static void |
setSessionDispatcherDaemon(boolean makeDaemon)
Sets if Session dispatcher threads should be daemon. |
static void |
setSocketConnectTimeout(long milliseconds)
Sets the timeout in milliseconds used by low-level socket connect calls. |
static void |
setSocketReceiveBufferSize(int size)
Sets the size of the socket receive buffer size for client connections. |
static void |
setSocketSendBufferSize(int size)
Sets the size of the socket send buffer size for client connections. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RELIABLE_DELIVERY
public static final int RELIABLE_DELIVERY
- Defines reliable delivery mode.
This delivery mode is a proprietary
extension and when used offers increased performance of the message
producers using this mode.
This is defined as an integer value 22.
- See Also:
- Constant Field Values
NO_ACKNOWLEDGE
public static final int NO_ACKNOWLEDGE
- Defines no acknowledge acknowledge mode.
This acknowledge mode
is a proprietary extension and when used offers increased performance
of the message consumers. Messages delivered to the sessions using
this acknowledge mode do not require acknowledgement and are
never redelivered regardless if the delivery has been successfull or not.
This can only be used by Topic sessions but not by Queue sessions.
This is defined as an integer value 22.
- See Also:
- Constant Field Values
EXPLICIT_CLIENT_ACKNOWLEDGE
public static final int EXPLICIT_CLIENT_ACKNOWLEDGE
- Defines explicit client acknowledge mode.
This acknowledge mode is a proprietary extension.
Sessions using this acknowledge mode must acknowledge each message
explicitly calling the acknowledge() method for all messages.
The application can call aknowledge() in any order.
The general rule that acknowledging a
message will acknowledge all previous messages does not apply.
This is defined as an integer value 23.
- See Also:
- Constant Field Values
EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE
public static final int EXPLICIT_CLIENT_DUPS_OK_ACKNOWLEDGE
- Defines explicit client acknowledge mode with dups_ok.
This acknowledge mode is a proprietary extension. This acknowledge mode
implements the same explicit acknowledge logic as
the EXPLICIT_CLIENT_ACKNOWLEDGE mode. However while
EXPLICIT_CLIENT_ACKNOWLEDGE guarantees the success
of the acknowledge operation upon return, this mode does not
and, similarly to DUPS_OK_ACKNOWLEDGE mode, acknowledges message
lazily with the possibility that some acknowledged messages
may be redelivered. Like for EXPLICIT_CLIENT_ACKNOWLEDGE, this mode
requires a JMS application to explicitly call acknowledge() method,
in any order, for each message it wants to acknowledge.
This is defined as an integer value 24.
- See Also:
- Constant Field Values
JMS_TIBCO_IMPORTED
public static final java.lang.String JMS_TIBCO_IMPORTED
- Provider specific message property which is set by the provider if the
message has been imported from TIBCO Rendezvous or TIBCO SmartSockets.
This property is defined as String "JMS_TIBCO_IMPORTED".
- See Also:
- Constant Field Values
JMS_TIBCO_SENDER
public static final java.lang.String JMS_TIBCO_SENDER
- Provider specific message property which may be set in a received message if
message has been sent on a destination with sender name property.
When set in the message, the property value is a String specifying
the name of the user who sent this message.
This property is defined as String "JMS_TIBCO_SENDER".
- See Also:
- Constant Field Values
JMS_TIBCO_DISABLE_SENDER
public static final java.lang.String JMS_TIBCO_DISABLE_SENDER
- Provider specific message property which may be set to prevent the server
from including the user name into message when sending this message to
consumers. This property is ignored by the server if the destination is
specified to enforce the inclusion of the user name.
This property, if used, must be set to boolean value 'true' by the message
producer before sending the message.
This property is defined as String "JMS_TIBCO_DISABLE_SENDER".
- See Also:
- Constant Field Values
JMS_TIBCO_SS_SENDER
public static final java.lang.String JMS_TIBCO_SS_SENDER
- Provider specific message property which is set if imported message
has been published by TIBCO SmartSockets application.
Property value is a String specifying the SmartSockets sender name.
This property is defined as String "JMS_TIBCO_SS_SENDER".
- See Also:
- Constant Field Values
JMS_TIBCO_CM_PUBLISHER
public static final java.lang.String JMS_TIBCO_CM_PUBLISHER
- Provider specific message property which may be set if imported message
has been published by TIBCO Rendezvous Certified Messaging application.
When set in the imported message, the property value is a String specifying
the CM publisher name.
This property is defined as String "JMS_TIBCO_CM_PUBLISHER".
- See Also:
- Constant Field Values
JMS_TIBCO_CM_SEQUENCE
public static final java.lang.String JMS_TIBCO_CM_SEQUENCE
- Provider specific message property which may be set if imported message
has been published by TIBCO Rendezvous Certified Messaging application.
When set in the imported message, the property value is long number specifying
the CM sequence number of the imported message.
This property is defined as String "JMS_TIBCO_CM_SEQUENCE".
- See Also:
- Constant Field Values
JMS_TIBCO_MSG_EXT
public static final java.lang.String JMS_TIBCO_MSG_EXT
- Provider specific message property which is set by the provider
or the application when message extensions are used.
Message extensions allow to include StreamMessage and MapMessage objects
as well as arrays of primitive types as values into StreamMessage and MapMessage
messages.
This property is defined as String "JMS_TIBCO_MSG_EXT".
- See Also:
- Constant Field Values
JMS_TIBCO_MSG_TRACE
public static final java.lang.String JMS_TIBCO_MSG_TRACE
- Provider specific message property which can be set by the
application if this message should be traced in the server
and optionally in the client. Value of this property can be
can be an empty string or null, or a string "body" if message
trace should print the message data fields.
This property is defined as String "JMS_TIBCO_MSG_TRACE".
- See Also:
- Constant Field Values
JMS_TIBCO_COMPRESS
public static final java.lang.String JMS_TIBCO_COMPRESS
- Provider specific message property which is set by the
application if this message should be compressed before
it is sent to the server.
This property is defined as String "JMS_TIBCO_COMPRESS".
- See Also:
- Constant Field Values
JMS_TIBCO_PRESERVE_UNDELIVERED
public static final java.lang.String JMS_TIBCO_PRESERVE_UNDELIVERED
- Provider specific message property which is set by the
application if this message should be placed into special
system queue in case it could not be delivered.
This property is defined as String "JMS_TIBCO_PRESERVE_UNDELIVERED".
- See Also:
- Constant Field Values
PROP_MESSAGE_ENCODING
public static final java.lang.String PROP_MESSAGE_ENCODING
- Defines the name of the System Property setting the global encoding
name for String values in the message properties and data fields.
This property is defined as String "tibco.tibjms.msg.encoding".
- See Also:
- Constant Field Values
PROP_SOCKET_RECEIVE
public static final java.lang.String PROP_SOCKET_RECEIVE
- Defines the name of the System Property setting the size of
the socket receive buffer size in kilobytes for client connections.
The value of this property is a string encoding the number of kilobytes,
e.g. "256".
Some operating systems may ignore this setting.
This property is defined as String "tibco.tibjms.socket.receive".
- See Also:
- Constant Field Values
PROP_SOCKET_SEND
public static final java.lang.String PROP_SOCKET_SEND
- Defines the name of the System Property setting the size of
the socket send buffer size in kilobytes for client connections.
The value of this property is a string encoding the number of kilobytes,
e.g. "256".
Some operating systems may ignore this setting.
This property is defined as String "tibco.tibjms.socket.send".
- See Also:
- Constant Field Values
PROP_DAEMON_DISPATCHER
public static final java.lang.String PROP_DAEMON_DISPATCHER
- Defines the name of the System Property controlling the type of
Session dispatcher threads.
When JMS application uses message listeners, TIBCO Enterprise Message
Service client creates internal dispatcher threads for each Session which has
at least one asynchronous message consumer. By default those dispatcher
threads are not set to be daemon threads. If this system property
is defined then the Session dispatcher threads will be created as
daemon threads.
This property is defined as String "tibco.tibjms.daemon.dispatcher".
- See Also:
- Constant Field Values
PROP_FT_SWITCH_EXCEPTION
public static final java.lang.String PROP_FT_SWITCH_EXCEPTION
- Defines the name of the System Property controlling if ExceptionListener
set on the Connection should be called after fault-tolerant switch.
When JMS application performs fault-tolerant switch it may notify
the Connection's ExceptionListener by calling it with JMSException
providing the information about fault-tolerant switch. If this property
is set, the Connection's ExceptionListener is called with the JMSException
which has the vendor error code (JMSException.getErrorCode()) set to
the String in the form:
FT-SWITCH: <new-server-url>
A JMS application can recognize such calls by analyzing the error code
in the passed JMSException and perform necessary actions. Notice that
the ExceptionListener is called with the special JMSException
only when fault-tolerant switch has been performed succesfully. In case
the fault-tolerant switch has failed, the Connection's ExceptionListener
will be called with regular JMSException (it will not have error code in the
form 'FT-SWITCH: ') specifying that the connection to
JMS Server has been terminated. Notice that if this property is not
set then by default Connection's ExceptionListener is not called
after a successfull fault-tolerant switch.
This property is defined as String "tibco.tibjms.ft.switch.exception".
- See Also:
- Constant Field Values
PROP_CLOSE_IN_CALLBACK
public static final java.lang.String PROP_CLOSE_IN_CALLBACK
- Defines the name of the System Property controlling if a
MessageConsumer.close(), Session.close() or Connection.close()
methods can be called in the MessageListener callback.
According to the JMS specifications, calling any of those methods
must wait for the MessageListener callback to return before
the close() method can return to the calling application.
Consequently, if the close() method is called inside the callback
it causes a deadlock. If this property is set then the close() method
can be called inside the callback and it will not wait for the same
callback to return.
This property is defined as String "tibco.tibjms.close.in.callback".
- See Also:
- Constant Field Values
PROP_SOCKET_CONNECT_TIMEOUT
public static final java.lang.String PROP_SOCKET_CONNECT_TIMEOUT
- Defines the name of the System Property controlling the
low-level timeout of connecting the socket to the server.
This only used with Java version 1.4.0 or higher.
Default value used is "3000".
This property is defined as String "tibco.tibjms.socket.connect.timeout".
- See Also:
- Constant Field Values
PROP_CONNECT_ATTEMPTS
public static final java.lang.String PROP_CONNECT_ATTEMPTS
- Defines the name of the System Property controlling the
number of attempts the connections make to connect to the server.
When too many clients connect to the same server, the server may not
be able to accept all connections at the same time. This parameter
specifies the number of attempts and delay between the attempt
the connections perform in order to connect to the server. The value
of this property is a String in the form "NN[,DELAY]" where NN is the
number of attempts and DELAY is delay in milliseconds between the
attempts. Minimum value of NN is 1, minimum value of DELAY is 250
milliseconds.
Default value used is "2,500".
This property is defined as String "tibco.tibjms.connect.attempts".
- See Also:
- Constant Field Values
PROP_RECONNECT_ATTEMPTS
public static final java.lang.String PROP_RECONNECT_ATTEMPTS
- Defines the name of the System Property controlling the
number of attempt the connections make to reconnect to the backup
server during the fault-tolerant switch. This property is similar to
PROP_CONNECT_ATTEMPTS. The difference is that it may be necessary
to use different parameters during reconnect than during the initial
connect. Initial connect of the clients to the server is normally
distributed in time and there are less chances of the server exceeding its
maximum accept queue. During fault-tolerant switch, all connected clients
automatically try to reconnect to the backup server, approximately at
the same time. When the number of connections is large, it may require
more attempts to reconnect than the initial connect. The value
of this property is a String in the form "NN[,DELAY]" where NN is the
number of attempts and DELAY is delay in milliseconds between the
attempts. Minimum value of NN is 1, minimum value of DELAY is 250
milliseconds.
Default value used is "4,500".
This property is defined as String "tibco.tibjms.reconnect.attempts".
- See Also:
- Constant Field Values
PROP_PING_INTERVAL
public static final java.lang.String PROP_PING_INTERVAL
- Defines the name of the System Property setting the ping interval
for inactive connections. When a connection does not send nor receives
any data, it may not be able to detect network failure in certain
situations. To avoid this, inactive connections periodically send "ping"
messages to the server. Default interval is 60 seconds. In some cases
it may take several intervals to detect network failure.
The value of this property is a string encoding the ping interval in seconds,
e.g. "60". Zero value disables ping messages.
This property is defined as String "tibco.tibjms.ping.interval".
- See Also:
- Constant Field Values
PROP_SSL_TRACE
public static final java.lang.String PROP_SSL_TRACE
- Defines the name of the System Property specifying tracing
for SSL connections.
This property is defined as String "tibco.tibjms.ssl.trace".
- See Also:
- Constant Field Values
PROP_SSL_DEBUG_TRACE
public static final java.lang.String PROP_SSL_DEBUG_TRACE
- Defines the name of the System Property specifying
debug tracing for SSL connections using Entrust SSL Vendor.
This property is defined as String "tibco.tibjms.ssl.debug.trace".
- See Also:
- Constant Field Values
DEFAULT_FACTORY_USERNAME
public static final java.lang.String DEFAULT_FACTORY_USERNAME
- Defines the name of the ConnectionFactory property specifying
default user name set for Connections created by the factory.
This property is defined as String "com.tibco.tibjms.factory.username".
- See Also:
- Constant Field Values
DEFAULT_FACTORY_PASSWORD
public static final java.lang.String DEFAULT_FACTORY_PASSWORD
- Defines the name of the ConnectionFactory property specifying
default user password set for Connections created by the factory.
This property is defined as String "com.tibco.tibjms.factory.password".
- See Also:
- Constant Field Values
FACTORY_LOAD_BALANCE_METRIC
public static final java.lang.String FACTORY_LOAD_BALANCE_METRIC
- Defines the name of the ConnectionFactory property specifying
the metric to be used for load balancing by the factory.
This property is defined as String "com.tibco.tibjms.factory.metric".
- See Also:
- Constant Field Values
FACTORY_LOAD_BALANCE_METRIC_NONE
public static final int FACTORY_LOAD_BALANCE_METRIC_NONE
- Indicates that no load balancing metric has been set for the connection
factory.
- See Also:
- Constant Field Values
FACTORY_LOAD_BALANCE_METRIC_CONNECTIONS
public static final int FACTORY_LOAD_BALANCE_METRIC_CONNECTIONS
- Indicates that the connection factory load balances connections across
multiple servers by creating a connection to the server with the fewest
number of connections.
- See Also:
- Constant Field Values
FACTORY_LOAD_BALANCE_METRIC_BYTE_RATE
public static final int FACTORY_LOAD_BALANCE_METRIC_BYTE_RATE
- Indicates that the connection factory load balances connections across
multiple servers by creating a connection to the server with the lowest
total byte rate (input and output).
- See Also:
- Constant Field Values
FACTORY_CONNECT_ATTEMPT_COUNT
public static final java.lang.String FACTORY_CONNECT_ATTEMPT_COUNT
- Defines the name of the ConnectionFactory property specifying
the maximum iterations a client program will go through its URL list
until it establishes its first connection to an EMS server.
This property is defined as String "com.tibco.tibjms.connect.attemptcount"
- See Also:
- Constant Field Values
FACTORY_CONNECT_ATTEMPT_DELAY
public static final java.lang.String FACTORY_CONNECT_ATTEMPT_DELAY
- Defines the name of the ConnectionFactory property specifying the
interval between iterations a client program will try to establishe
its first connection to an EMS server.
This property is defined as String "com.tibco.tibjms.connect.attemptdelay"
- See Also:
- Constant Field Values
FACTORY_RECONNECT_ATTEMPT_COUNT
public static final java.lang.String FACTORY_RECONNECT_ATTEMPT_COUNT
- Defines the name of the ConnectionFactory property specifying
the maximum iterations a client program will try to re-establish
a connection to an EMS server after losing previous connection.
This property is defined as String "com.tibco.tibjms.reconnect.attemptcount"
- See Also:
- Constant Field Values
FACTORY_RECONNECT_ATTEMPT_DELAY
public static final java.lang.String FACTORY_RECONNECT_ATTEMPT_DELAY
- Defines the name of the ConnectionFactory property specifying
the interval between reconnection attempts.
This property is defined as String "com.tibco.tibjms.reconnect.attemptdelay"
- See Also:
- Constant Field Values
getMessageSize
public static int getMessageSize(Message msg)
- Returns the total wire size of the message which was received or sent.
If a message was modified after it has been received, or if a message
was created by the application but never sent, this method will produce
incorrect result. In those cases call calculateMessageSize() before
calling this method as well as getMessageBodySize and similar.
Notice that total wire size of the message is the exact number of bytes
sent over the network when an application sends the message. The total
wire size of the message may be slightly greater than the summ of the
wire size of message headers, properties and the body, due to extra
control information encoded in the overal message wire representation.
If the body of the message is compressed, this method returns the size
of the wire representation using compressed body bytes.
Notice that the server may add additional control information into
the message before sending it to consumers. Thus the size of the
received message is normally slightly bigger than the size of the
same message when it was sent.
- Throws:
java.lang.IllegalArgumentException
- if parameter is null
or is a foreign JMS message implementation.
getMessageHeadersSize
public static int getMessageHeadersSize(Message msg)
- Returns the total wire size of the message headers for a message
which was received or sent.
If a message was modified after it has been received, or if a message
was created by the application but never sent, this method will produce
incorrect result. In those cases call calculateMessageSize() before
calling this method.
- Throws:
java.lang.IllegalArgumentException
- if parameter is null
or is a foreign JMS message implementation.
getMessagePropertiesSize
public static int getMessagePropertiesSize(Message msg)
- Returns the total wire size of the message properties for a message
which was received or sent.
If a message was modified after it has been received, or if a message
was created by the application but never sent, this method will produce
incorrect result. In those cases call calculateMessageSize() before
calling this method.
- Throws:
java.lang.IllegalArgumentException
- if parameter is null
or is a foreign JMS message implementation.
getMessageBodySize
public static int getMessageBodySize(Message msg)
- Returns the total wire size of the message body for a message
which was received or sent.
If a message was modified after it has been received, or if a message
was created by the application but never sent, this method will produce
incorrect result. In those cases call calculateMessageSize() before
calling this method.
If the body of the message is compressed, this method returns the size
of the compressed wire representation.
- Throws:
java.lang.IllegalArgumentException
- if parameter is null
or is a foreign JMS message implementation.
calculateMessageSize
public static int calculateMessageSize(Message msg)
throws JMSException
- Calculates and returns total size of the message wire representation.
This method always creates internally the actual
wire format of the message regardless of the state of the message.
- Throws:
java.lang.IllegalArgumentException
- if parameter is null
or is a foreign JMS message implementation.
JMSException
- if an error occurred while building
message wire representation.
setAllowCloseInCallback
public static void setAllowCloseInCallback(boolean allow)
- Sets if MessageConsumer.close(), Session.close() or Connection.close()
methods can be called in the MessageListener callback.
According to the JMS specifications, calling any of those methods
must wait for the MessageListener callback to return before
the close() method can return to the calling application.
Consequently, if the close() method is called inside the callback
it causes a deadlock. If calling close() inside the callback is allowed,
then close() method called inside the callback will not wait for the same
callback to return.
getAllowCloseInCallback
public static boolean getAllowCloseInCallback()
- Returns if allowed to call close() in callbacks.
setAllowCallbackInClose
public static void setAllowCallbackInClose(boolean allow)
- Deprecated. This method has been misnamed and replaced
by
setAllowCloseInCallback
.
getAllowCallbackInClose
public static boolean getAllowCallbackInClose()
- Deprecated. This method has been misnamed and replaced
by
getAllowCloseInCallback
.
setExceptionOnFTSwitch
public static void setExceptionOnFTSwitch(boolean callExceptionListener)
- Sets if ExceptionListener set on the Connection should be called after
fault-tolerant switch.
When JMS application performs fault-tolerant switch it may notify
the Connection's ExceptionListener by calling it with JMSException
providing the information about fault-tolerant switch. If calling
the Connection's ExceptionListener is set, it is called with the JMSException
which has the vendor error code (JMSException.getErrorCode()) set to
the String in the form:
FT-SWITCH: <new-server-url>
A JMS application can recognize such calls by analyzing the error code
in the passed JMSException and perform necessary actions. Notice that
the ExceptionListener is called with the special JMSException
only when fault-tolerant switch has been performed succesfully. In case
the fault-tolerant switch has failed, the Connection's ExceptionListener
will be called with regular JMSException (it will not have error code in the
form 'FT-SWITCH: ') specifying that the connection to
JMS Server has been terminated. Notice that by default
Connection's ExceptionListener is not called
after a successfull fault-tolerant switch.
getExceptionOnFTSwitch
public static boolean getExceptionOnFTSwitch()
- Returns if exception listener is called on FT switch.
setSessionDispatcherDaemon
public static void setSessionDispatcherDaemon(boolean makeDaemon)
- Sets if Session dispatcher threads should be daemon.
When JMS application uses message listeners, TIBCO Enterprise Message Service
client creates internal dispatcher threads for each Session which has
at least one asynchronous message consumer. By default session
dispatcher threads are not set to be daemon threads.
getSessionDispatcherDaemon
public static boolean getSessionDispatcherDaemon()
- Returns if session dispatcher threads are daemon.
setConnectAttempts
public static void setConnectAttempts(java.lang.String specs)
- Sets the parameters for the number of attempts the connections
make to connect to the server.
When too many clients connect to the same server, the server may not
be able to accept all connections at the same time. This parameter
specifies the number of attempts and delay between the attempt
the connections perform in order to connect to the server. The value
of this parameter is a String in the form "NN[,DELAY]" where NN is the
number of attempts and DELAY is delay in milliseconds between the
attempts. Minimum value of NN is 1, minimum value of DELAY is 250
milliseconds.
Default value used is "2,500".
getConnectAttempts
public static java.lang.String getConnectAttempts()
- Returns the connect attempts setting.
setReconnectAttempts
public static void setReconnectAttempts(java.lang.String specs)
- Sets the parameter for the number of attempts the connections
make to reconnect to the backup server during fault-tolerant switch.
This parameter is similar to the parameter set by setConnectAttempts method.
The difference is that it may be necessary
to use different parameters during reconnect than during the initial
connect. Initial connect of the clients to the server is normally
distributed in time and there are less chances of the server exceeding its
maximum accept queue. During fault-tolerant switch, all connected clients
automatically try to reconnect to the backup server, approximately at
the same time. When the number of connections is large, it may require
more attempts to reconnect than the initial connect. The value
of this parameter is a String in the form "NN[,DELAY]" where NN is the
number of attempts and DELAY is delay in milliseconds between the
attempts. Minimum value of NN is 1, minimum value of DELAY is 250
milliseconds.
Default value used is "4,500".
getReconnectAttempts
public static java.lang.String getReconnectAttempts()
- Returns the reconnect attempts setting.
setSocketReceiveBufferSize
public static void setSocketReceiveBufferSize(int size)
- Sets the size of the socket receive buffer size for client connections.
Some operating systems may ignore this setting.
getSocketReceiveBufferSize
public static int getSocketReceiveBufferSize()
- Returns the size of socket receive buffer.
setSocketSendBufferSize
public static void setSocketSendBufferSize(int size)
- Sets the size of the socket send buffer size for client connections.
Some operating systems may ignore this setting.
getSocketSendBufferSize
public static int getSocketSendBufferSize()
- Returns the size of socket send buffer.
setPingInterval
public static void setPingInterval(int seconds)
- Sets the ping interval in seconds used by inactive connections.
Zero value disables pinging inactive connections.
This method, if necessary, should be called before the first
connection is created by the application.
Subsequent calls have no effect.
getPingInterval
public static int getPingInterval()
- Returns the ping interval in seconds used by inactive connections.
setSocketConnectTimeout
public static void setSocketConnectTimeout(long milliseconds)
- Sets the timeout in milliseconds used by low-level socket connect calls.
This only used with Java version 1.4.0 or higher.
getSocketConnectTimeout
public static long getSocketConnectTimeout()
- Returns the timeout in milliseconds used by low-level socket connect calls.
This only used with Java version 1.4.0 or higher.
setEncoding
public static void setEncoding(java.lang.String encodingName)
throws JMSException
- Set global string encoding for messages.
Specified encoding will apply to all String values and names of properties
and message fields but does not apply to message header fields and
writeUTF method of BytesMessage.
- Throws:
JMSException
getEncoding
public static java.lang.String getEncoding()
- Retursn global string encoding for messages.
Returns null if encoding is not set. If global encoding is not
set, encoding can be set for each message. Otherwise messages use
default encoding UTF8 to encode strings in the wire representation
of the message.
setMessageEncoding
public static void setMessageEncoding(Message message,
java.lang.String encodingName)
throws JMSException
- Set string encoding for message.
This will override global encoding setting.
Specified encoding will apply to all String values and names of properties
and message fields but does not apply to message header fields and
writeUTF method of BytesMessage.
- Throws:
JMSException
getMessageEncoding
public static java.lang.String getMessageEncoding(Message message)
- Returns string encoding name set for this message.
Returns null if no encoding was set, in that case message
uses default encoding UTF8.
getAsBytes
public static byte[] getAsBytes(Message message)
throws JMSException
- Return a copy of the message data as a byte array, suitable for archiving in a file.
To reconstruct the message from bytes use method createFromBytes().
Parameter must be an instance of TIBCO Enterprise Message Service message object.
- Throws:
JMSException
createFromBytes
public static Message createFromBytes(byte[] bytes)
throws JMSException
- Create a message from specified byte array.
Specified byte array must be previously obtained using method getAsBytes().
Created message is set to read-only state, use setWriteable method to enable
message modification without erasing its content.
- Throws:
JMSException
makeWriteable
public static void makeWriteable(Message message)
throws JMSException
- Set message to writeable state without resetting its content.
- Throws:
JMSException
getConnectionActiveURL
public static java.lang.String getConnectionActiveURL(Connection connection)
throws JMSException
- Returns a string representing the URL of the server that this connection
is currently connected to.
- Throws:
JMSException
Copyright © TIBCO Software Inc. All rights reserved