TIBCO Enterprise Message Service
Version 4.3.0

com.tibco.tibrv
Class TibrvJMSTransport

java.lang.Object
  extended bycom.tibco.tibrv.TibrvNetTransport
      extended bycom.tibco.tibrv.TibrvJMSTransport

public class TibrvJMSTransport
extends com.tibco.tibrv.TibrvNetTransport

Network transport using TIBCO Enterprise Message Service JMS client to connect to the network. This transport can be used by Java Applets and Java applications. TibrvJMSTransport does not require JNI library. It connects to the TIBCO Enterprise Message Service server directly. To receive notification in case the underlying EMS transport is terminated, use Tibrv.setErrorCallback() method.

See Also:
Serialized Form

Constructor Summary
TibrvJMSTransport()
          Creates JMS transport connecting to the TIBCO Enterprise Message Service server running on the local computer with default port.
TibrvJMSTransport(java.lang.String serverURL)
          Creates JMS transport connecting to the TIBCO Enterprise Message Service server specified by serverURL parameter.
TibrvJMSTransport(java.lang.String serverURL, java.lang.String clientId, java.lang.String userName, java.lang.String password)
          Creates JMS transport connecting as specified user to the TIBCO Enterprise Message Service server.
TibrvJMSTransport(java.lang.String serverURL, java.lang.String clientId, java.lang.String userName, java.lang.String password, java.util.Hashtable sslParameters)
          Creates JMS transport connecting via SSL to the TIBCO Enterprise Message Service server.
TibrvJMSTransport(java.lang.String serverURL, java.lang.String clientId, java.lang.String userName, java.lang.String password, java.util.Hashtable sslParameters, boolean emulateReconnect)
          Create JMS transport which has the ability to reconnect to a server among a list of comma separated JMS servers in the event of current connection is down.
 
Method Summary
 void destroy()
          Destroys this transport and all associated listeners.
 java.lang.String getCurrentConnectedServer()
          Get the url of currently connected server.
 java.lang.String getDurableListenerMode()
          Returns currently configured durable listener name prefix [Beta feature].
 boolean isPersistentDelivery()
          Returns true if persistent delivery mode is set for this transport.
 void recoverConnection()
          This method is used to reestablish a connection with an EMS server.
 void setDurableListenerMode(java.lang.String durableNamePrefix)
          Set or cancel durable listener mode [Beta feature].
 void setPersistentDelivery(boolean persistent)
          Set persistent delivery mode for this transport.
 java.lang.String toString()
          Returns string representation of this transport
 void unsubscribe(java.lang.String durableNamePrefix, java.lang.String subject)
          Unsubscribe durable JMS subscriber previously created for Rendezvous listener in durable listener mode [Beta feature].
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TibrvJMSTransport

public TibrvJMSTransport()
                  throws TibrvException
Creates JMS transport connecting to the TIBCO Enterprise Message Service server running on the local computer with default port.


TibrvJMSTransport

public TibrvJMSTransport(java.lang.String serverURL)
                  throws TibrvException
Creates JMS transport connecting to the TIBCO Enterprise Message Service server specified by serverURL parameter.


TibrvJMSTransport

public TibrvJMSTransport(java.lang.String serverURL,
                         java.lang.String clientId,
                         java.lang.String userName,
                         java.lang.String password)
                  throws TibrvException
Creates JMS transport connecting as specified user to the TIBCO Enterprise Message Service server.


TibrvJMSTransport

public TibrvJMSTransport(java.lang.String serverURL,
                         java.lang.String clientId,
                         java.lang.String userName,
                         java.lang.String password,
                         java.util.Hashtable sslParameters)
                  throws TibrvException
Creates JMS transport connecting via SSL to the TIBCO Enterprise Message Service server. SSL parameters which can be set in the sslParameters Hashtable are documented in com.tibco.tibjms.TibjmsSSL class.


TibrvJMSTransport

public TibrvJMSTransport(java.lang.String serverURL,
                         java.lang.String clientId,
                         java.lang.String userName,
                         java.lang.String password,
                         java.util.Hashtable sslParameters,
                         boolean emulateReconnect)
                  throws TibrvException
Create JMS transport which has the ability to reconnect to a server among a list of comma separated JMS servers in the event of current connection is down. The server is picked in round robin fashion. The reconnect will start with last connected server.

Method Detail

destroy

public void destroy()
Destroys this transport and all associated listeners.


toString

public java.lang.String toString()
Returns string representation of this transport


setPersistentDelivery

public void setPersistentDelivery(boolean persistent)
Set persistent delivery mode for this transport.


isPersistentDelivery

public boolean isPersistentDelivery()
Returns true if persistent delivery mode is set for this transport.


setDurableListenerMode

public void setDurableListenerMode(java.lang.String durableNamePrefix)
                            throws TibrvException
Set or cancel durable listener mode [Beta feature]. If parameter durableNamePrefix specifies non-empty string, all subsequent calls to create Rendezvous listeners on this transport will use durable JMS subscribers created on a Session with AUTO_ACKNOWLEDGE acknowledge mode and with name durableNamePrefix:subject-name. Such subscribers remain present even if corresponding Rendezvous listener is closed via TibrvListener.destroy(). If an application creates identical Rendesvous listener again, it will receive messages sent to it while it was offline. To completely destroy durable listener, it must be first destroyed via call to TibrvListener.destroy() and then unsubscribed via call to unsubscribe() method. If this method is called with null parameter it cancels durable listener mode such that subsequent calls to create Rendezvous listeners will not use durable JMS subscribers. This method can be also used to change durable subscriber name prefix at any time.

Parameters:
durableNamePrefix - set durable listener mode if not empty, cancel durable subscriber mode if this parameter is null.
Throws:
java.lang.IllegalArgumentException - if parameter is an empty string.
TibrvException - if listener creation failed for any reason.

getDurableListenerMode

public java.lang.String getDurableListenerMode()
Returns currently configured durable listener name prefix [Beta feature]. Returns null if durable listener mode is not set.


recoverConnection

public void recoverConnection()
                       throws TibrvException
This method is used to reestablish a connection with an EMS server. The transport has to be created with emulate reconnect mode set to true if non-fault-tolarent behavior of a ',' separated server URL list is desired.

Throws:
TibrvException - if a new connection was not established.

getCurrentConnectedServer

public java.lang.String getCurrentConnectedServer()
Get the url of currently connected server.

Returns:
server url

unsubscribe

public void unsubscribe(java.lang.String durableNamePrefix,
                        java.lang.String subject)
                 throws TibrvException
Unsubscribe durable JMS subscriber previously created for Rendezvous listener in durable listener mode [Beta feature]. Notice this method must be called only after corresponding Rendezvous listener has beed destroyed. If Rendezvous listener is not destroyed this method throws exception.

Parameters:
durableNamePrefix - durable name prefix specified at the time Rendezvous listener was created.
subject - listener subject.
Throws:
TibrvException - if listener with such name prefix and subject was never created or if it is open (not destroyed).

TIBCO Enterprise Message Service
Version 4.3.0

Copyright © TIBCO Software Inc. All rights reserved