public class TibjmsConnectionFactory extends TibjmsxCFImpl implements ConnectionFactory, java.io.Externalizable, javax.naming.Referenceable, java.lang.Cloneable
Constructor and Description |
---|
TibjmsConnectionFactory()
Create an empty connection factory.
|
TibjmsConnectionFactory(java.lang.String serverUrl)
Create a connection factory with the given server URL.
|
TibjmsConnectionFactory(java.lang.String serverUrl,
java.lang.String clientId)
Create a connection factory with the given server URL and client id.
|
TibjmsConnectionFactory(java.lang.String serverUrl,
java.lang.String clientId,
java.util.Map properties)
Create a connection factory with the given server URL, client id, and properties.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
Connection |
createConnection()
Creates a connection with the default user identity.
|
Connection |
createConnection(java.lang.String userName,
java.lang.String password)
Creates a connection with the specified user identity.
|
JMSContext |
createContext()
Creates a JMSContext with the default user identity
and an unspecified sessionMode.
|
JMSContext |
createContext(int sessionMode)
Creates a JMSContext with the default user identity
and the specified session mode.
|
JMSContext |
createContext(java.lang.String userName,
java.lang.String password)
Creates a JMSContext with the specified user identity
and an unspecified sessionMode.
|
JMSContext |
createContext(java.lang.String userName,
java.lang.String password,
int sessionMode)
Creates a JMSContext with the specified user identity
and the specified session mode.
|
java.lang.String |
getSSLProxyHost()
Get the SSL proxy host from this connection factory.
|
java.lang.String |
getSSLProxyPassword()
Get the SSL proxy password from a connection factory.
|
int |
getSSLProxyPort()
Get the SSL proxy port from this connection factory.
|
java.lang.String |
getSSLProxyUser()
Get the SSL proxy username from a connection factory.
|
void |
readExternal(java.io.ObjectInput in) |
void |
setClientID(java.lang.String clientID) |
void |
setConnAttemptCount(int attempts) |
void |
setConnAttemptDelay(int delay) |
void |
setConnAttemptTimeout(int timeout)
Set the Connect Attempt timeout for a given connection.
|
void |
setMetric(int metric)
This sets the metric that will be used to select an ems server during load balancing switchover.
|
void |
setMulticastDaemon(java.lang.String port)
Deprecated.
As of release 8.3
|
void |
setMulticastEnabled(boolean enabled)
Deprecated.
As of release 8.3
|
void |
setReconnAttemptCount(int attempts) |
void |
setReconnAttemptDelay(int delay) |
void |
setReconnAttemptTimeout(int timeout)
Set the Reconnect Attempt timeout for a given connection
Note: This timeout is per url and per reconnect_attempt.
|
void |
setServerUrl(java.lang.String serverUrl)
Connections created by this connection factory will connect to the server
at the given URL
|
void |
setSSLAuthOnly(java.lang.Boolean authOnly)
Set client connections to use SSL only during initial connection
authentication.
|
void |
setSSLCipherSuites(java.lang.String suites)
Set cipher suites to be used by SSL connections.
|
void |
setSSLDebugTrace(java.lang.Boolean debugTrace)
Enables debug tracing.
|
void |
setSSLEnableVerifyHost(java.lang.Boolean enableVerifyHost)
Set if the host certificate should be verified by the client.
|
void |
setSSLEnableVerifyHostName(java.lang.Boolean enableVerifyHostName)
Set if the name in the host certificate should be verified or not.
|
void |
setSSLExpectedHostName(java.lang.String expectedHostName)
Set the name which is expected to be set in the host certificate.
|
void |
setSSLIdentity(byte[] identity)
The client's digital certificate.
|
void |
setSSLIdentity(java.lang.String sslIdentity)
The client's digital certificate.
|
void |
setSSLIdentityEncoding(java.lang.String sslIdentityEncoding)
The encoding of the client identity specified in the setSSLIdentity() method.
|
void |
setSSLIssuerCertificate(byte[] certificate,
java.lang.String encoding)
Issuer certificates are certificates that authenticate the client's
certificate; the certificate authority (CA) that issued the client's
certificate supplies these.
|
void |
setSSLIssuerCertificate(java.lang.String certificate)
Issuer certificates are certificates that authenticate the client's
certificate; the certificate authority (CA) that issued the client's
certificate supplies these.
|
void |
setSSLIssuerCertificate(java.lang.String certificate,
java.lang.String encoding)
Issuer certificates are certificates that authenticate the client's
certificate; the certificate authority (CA) that issued the client's
certificate supplies these.
|
void |
setSSLPassword(java.lang.String sslPassword)
Set the private key password for SSL.
|
void |
setSSLPrivateKey(byte[] sslPrivateKey)
Set the private key corresponding to the identity certificate.
|
void |
setSSLPrivateKey(java.lang.String sslPrivateKey)
Set the private key corresponding to the identity certificate.
|
void |
setSSLPrivateKeyEncoding(java.lang.String sslPrivateKeyEncoding)
Set the private key corresponding to the identity certificate.
|
void |
setSSLProxy(java.lang.String host,
int port)
Set the connection factory's parameters for connecting through an SSL
proxy.
|
void |
setSSLProxyAuth(java.lang.String username,
java.lang.String password)
Set a connection factory's username and password for connecting through
an SSL proxy.
|
void |
setSSLTrace(java.lang.Boolean trace) |
void |
setSSLTrustedCertificate(byte[] certificate,
java.lang.String trustedEncoding)
Trusted certificates are certificates that authenticate the server's
certificate; the certificate authority (CA) that issued the server's
certificate supplies these.
|
void |
setSSLTrustedCertificate(java.lang.String certificate)
Trusted certificates are certificates that authenticate the server's
certificate; the certificate authority (CA) that issued the server's
certificate supplies these.
|
void |
setSSLTrustedCertificate(java.lang.String certificate,
java.lang.String trustedEncoding)
Trusted certificates are certificates that authenticate the server's
certificate; the certificate authority (CA) that issued the server's
certificate supplies these.
|
void |
setSSLVendor(java.lang.String vendor)
Set SSL vendor to the specified vendor.
|
void |
setUserName(java.lang.String username) |
void |
setUserPassword(java.lang.String password) |
void |
writeExternal(java.io.ObjectOutput out) |
public TibjmsConnectionFactory()
TibjmsConnectionFactory(null, null, null)
.TibjmsContext
public TibjmsConnectionFactory(java.lang.String serverUrl)
TibjmsConnectionFactory(serverUrl, null, null)
.serverUrl
- Connections created by this connection factory will connect to
the server at this URL.public TibjmsConnectionFactory(java.lang.String serverUrl, java.lang.String clientId)
TibjmsConnectionFactory(serverUrl, clientId, null)
.serverUrl
- Connections created by this connection factory will connect to
the server at this URL.clientId
- public TibjmsConnectionFactory(java.lang.String serverUrl, java.lang.String clientId, java.util.Map properties)
serverUrl
- Connections created by this connection factory will connect to
the server at this URL.clientId
- properties
- public Connection createConnection() throws JMSException
ConnectionFactory
Connection.start
method
is explicitly called.createConnection
in interface ConnectionFactory
JMSException
- if the JMS provider fails to create the
connection due to some internal error.JMSSecurityException
- if client authentication fails due to
an invalid user name or password.public Connection createConnection(java.lang.String userName, java.lang.String password) throws JMSException
ConnectionFactory
Connection.start
method
is explicitly called.createConnection
in interface ConnectionFactory
userName
- the caller's user namepassword
- the caller's passwordJMSException
- if the JMS provider fails to create the
connection due to some internal error.JMSSecurityException
- if client authentication fails due to
an invalid user name or password.public JMSContext createContext()
ConnectionFactory
A connection and session are created for use by the new JMSContext. The connection is created in stopped mode but will be automatically started when a JMSConsumer is created.
The behaviour of the session that is created depends on whether this method is called in a Java SE environment, in the Java EE application client container, or in the Java EE web or EJB container. If this method is called in the Java EE web or EJB container then the behaviour of the session also depends on whether or not there is an active JTA transaction in progress.
In a Java SE environment or in the Java EE application client container:
JMSContext.AUTO_ACKNOWLEDGE
For a definition of the meaning of this acknowledgement mode see the link below.
In a Java EE web or EJB container, when there is an active JTA transaction in progress:
JMSContext
's commit
or rollback
methods.
In the Java EE web or EJB container, when there is no active JTA transaction in progress:
JMSContext.AUTO_ACKNOWLEDGE
For a definition of the meaning of this acknowledgement mode see the link below.
createContext
in interface ConnectionFactory
JMSContext.AUTO_ACKNOWLEDGE
,
ConnectionFactory.createContext(int)
,
ConnectionFactory.createContext(java.lang.String, java.lang.String)
,
ConnectionFactory.createContext(java.lang.String, java.lang.String, int)
,
JMSContext.createContext(int)
public JMSContext createContext(int sessionMode)
ConnectionFactory
A connection and session are created for use by the new JMSContext. The JMSContext is created in stopped mode but will be automatically started when a JMSConsumer is created.
The effect of setting the sessionMode
argument depends on whether this method is called in a Java SE environment,
in the Java EE application client container, or in the Java EE web or EJB container.
If this method is called in the Java EE web or EJB container then the
effect of setting the sessionMode
argument also depends on
whether or not there is an active JTA transaction in progress.
In a Java SE environment or in the Java EE application client container:
sessionMode
is set to JMSContext.SESSION_TRANSACTED
then the session
will use a local transaction which may subsequently be committed or rolled back
by calling the JMSContext
's commit
or rollback
methods.
sessionMode
is set to any of
JMSContext.CLIENT_ACKNOWLEDGE
,
JMSContext.AUTO_ACKNOWLEDGE
or
JMSContext.DUPS_OK_ACKNOWLEDGE
.
then the session will be non-transacted and
messages received by this session will be acknowledged
according to the value of sessionMode
.
For a definition of the meaning of these acknowledgement modes see the links below.
In a Java EE web or EJB container, when there is an active JTA transaction in progress:
sessionMode
is ignored.
The session will participate in the JTA transaction and will be committed or rolled back
when that transaction is committed or rolled back,
not by calling the JMSContext
's commit
or rollback
methods.
Since the argument is ignored, developers are recommended to use
createSession()
, which has no arguments, instead of this method.
In the Java EE web or EJB container, when there is no active JTA transaction in progress:
acknowledgeMode
must be set to either of
JMSContext.AUTO_ACKNOWLEDGE
or
JMSContext.DUPS_OK_ACKNOWLEDGE
.
The session will be non-transacted and messages received by this session will be acknowledged
automatically according to the value of acknowledgeMode
.
For a definition of the meaning of these acknowledgement modes see the links below.
The values JMSContext.SESSION_TRANSACTED
and JMSContext.CLIENT_ACKNOWLEDGE
may not be used.
createContext
in interface ConnectionFactory
sessionMode
- indicates which of four possible session modes will be used.
JMSContext.SESSION_TRANSACTED
,
JMSContext.CLIENT_ACKNOWLEDGE
,
JMSContext.AUTO_ACKNOWLEDGE
and
JMSContext.DUPS_OK_ACKNOWLEDGE
.
JMSContext.AUTO_ACKNOWLEDGE
and
JMSContext.DUPS_OK_ACKNOWLEDGE
.
In this case the values JMSContext.TRANSACTED
and JMSContext.CLIENT_ACKNOWLEDGE
are not permitted.
JMSContext.SESSION_TRANSACTED
,
JMSContext.CLIENT_ACKNOWLEDGE
,
JMSContext.AUTO_ACKNOWLEDGE
,
JMSContext.DUPS_OK_ACKNOWLEDGE
,
ConnectionFactory.createContext()
,
ConnectionFactory.createContext(java.lang.String, java.lang.String)
,
ConnectionFactory.createContext(java.lang.String, java.lang.String, int)
,
JMSContext.createContext(int)
public JMSContext createContext(java.lang.String userName, java.lang.String password)
ConnectionFactory
A connection and session are created for use by the new JMSContext. The connection is created in stopped mode but will be automatically started when a JMSConsumer.
The behaviour of the session that is created depends on whether this method is called in a Java SE environment, in the Java EE application client container, or in the Java EE web or EJB container. If this method is called in the Java EE web or EJB container then the behaviour of the session also depends on whether or not there is an active JTA transaction in progress.
In a Java SE environment or in the Java EE application client container:
JMSContext.AUTO_ACKNOWLEDGE
For a definition of the meaning of this acknowledgement mode see the link below.
In a Java EE web or EJB container, when there is an active JTA transaction in progress:
JMSContext
's commit
or rollback
methods.
In the Java EE web or EJB container, when there is no active JTA transaction in progress:
JMSContext.AUTO_ACKNOWLEDGE
For a definition of the meaning of this acknowledgement mode see the link below.
createContext
in interface ConnectionFactory
userName
- the caller's user namepassword
- the caller's passwordJMSContext.AUTO_ACKNOWLEDGE
,
ConnectionFactory.createContext()
,
ConnectionFactory.createContext(int)
,
ConnectionFactory.createContext(java.lang.String, java.lang.String, int)
,
JMSContext.createContext(int)
public JMSContext createContext(java.lang.String userName, java.lang.String password, int sessionMode)
ConnectionFactory
A connection and session are created for use by the new JMSContext. The JMSContext is created in stopped mode but will be automatically started when a JMSConsumer is created.
The effect of setting the sessionMode
argument depends on whether this method is called in a Java SE environment,
in the Java EE application client container, or in the Java EE web or EJB container.
If this method is called in the Java EE web or EJB container then the
effect of setting the sessionMode
argument also depends on
whether or not there is an active JTA transaction in progress.
In a Java SE environment or in the Java EE application client container:
sessionMode
is set to JMSContext.SESSION_TRANSACTED
then the session
will use a local transaction which may subsequently be committed or rolled back
by calling the JMSContext
's commit
or rollback
methods.
sessionMode
is set to any of
JMSContext.CLIENT_ACKNOWLEDGE
,
JMSContext.AUTO_ACKNOWLEDGE
or
JMSContext.DUPS_OK_ACKNOWLEDGE
.
then the session will be non-transacted and
messages received by this session will be acknowledged
according to the value of sessionMode
.
For a definition of the meaning of these acknowledgement modes see the links below.
In a Java EE web or EJB container, when there is an active JTA transaction in progress:
sessionMode
is ignored.
The session will participate in the JTA transaction and will be committed or rolled back
when that transaction is committed or rolled back,
not by calling the JMSContext
's commit
or rollback
methods.
Since the argument is ignored, developers are recommended to use
createSession()
, which has no arguments, instead of this method.
In the Java EE web or EJB container, when there is no active JTA transaction in progress:
acknowledgeMode
must be set to either of
JMSContext.AUTO_ACKNOWLEDGE
or
JMSContext.DUPS_OK_ACKNOWLEDGE
.
The session will be non-transacted and messages received by this session will be acknowledged
automatically according to the value of acknowledgeMode
.
For a definition of the meaning of these acknowledgement modes see the links below.
The values JMSContext.SESSION_TRANSACTED
and JMSContext.CLIENT_ACKNOWLEDGE
may not be used.
createContext
in interface ConnectionFactory
userName
- the caller's user namepassword
- the caller's passwordsessionMode
- indicates which of four possible session modes will be used.
JMSContext.SESSION_TRANSACTED
,
JMSContext.CLIENT_ACKNOWLEDGE
,
JMSContext.AUTO_ACKNOWLEDGE
and
JMSContext.DUPS_OK_ACKNOWLEDGE
.
JMSContext.AUTO_ACKNOWLEDGE
and
JMSContext.DUPS_OK_ACKNOWLEDGE
.
In this case the values JMSContext.TRANSACTED
and JMSContext.CLIENT_ACKNOWLEDGE
are not permitted.
JMSContext.SESSION_TRANSACTED
,
JMSContext.CLIENT_ACKNOWLEDGE
,
JMSContext.AUTO_ACKNOWLEDGE
,
JMSContext.DUPS_OK_ACKNOWLEDGE
,
ConnectionFactory.createContext()
,
ConnectionFactory.createContext(int)
,
ConnectionFactory.createContext(java.lang.String, java.lang.String)
,
JMSContext.createContext(int)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public void setServerUrl(java.lang.String serverUrl) throws JMSException
serverUrl
- JMSException
public void setClientID(java.lang.String clientID) throws JMSException
clientID
- The clientID that will be sent to the server when a Conneciton
is created.JMSException
public void setMetric(int metric) throws JMSException
metric
- The metric to use during load balancing switchover.JMSException
Tibjms
public void setConnAttemptCount(int attempts)
attempts
- The number of times the connection object attempts to
establish a connection to the server.public void setConnAttemptDelay(int delay)
delay
- The delay time between successive attempts to establish a
connection to the server. Its value is the time (in
milliseconds) between connection attempts.public void setReconnAttemptCount(int attempts)
attempts
- The number of times that a connection object attempts to
reestablish a connection to the server.public void setReconnAttemptDelay(int delay)
delay
- The delay time between successive attempts to reconnect to the
server. Its value is the time (in milliseconds) between
reconnection attempts.public void setUserName(java.lang.String username)
username
- The connection object presents this user identity to the
server.public void setUserPassword(java.lang.String password)
password
- The connection object authenticates the user identity with
this password.public void setSSLVendor(java.lang.String vendor)
vendor
- Specifies the SSL implementation to be used for creating SSL
connections.JMSSecurityException
- if specified vendor is not supported.TibjmsSSL
public void setSSLTrace(java.lang.Boolean trace)
trace
- Set true to enable tracing of SSL related operations.public void setSSLDebugTrace(java.lang.Boolean debugTrace)
debugTrace
- Set to true to enable debug tracing.public void setSSLEnableVerifyHost(java.lang.Boolean enableVerifyHost)
enableVerifyHost
- public void setSSLEnableVerifyHostName(java.lang.Boolean enableVerifyHostName)
enableVerifyHostName
- public void setSSLExpectedHostName(java.lang.String expectedHostName)
expectedHostName
- public void setSSLAuthOnly(java.lang.Boolean authOnly)
true
then connections use
SSL only for authentication and switch to TCP protocol for all subsequent
messaging. If parameter is false
then SSL is used for the
lifetime of the connection, which is the default mode. Connections use
this setting at the time they are created. Changing this setting only
affects connection created after the change. By default this parameter is
disabled.authOnly
- Set true to only use SSL for authentication, false to use SSL
for the lifetime of the connections.public void setSSLTrustedCertificate(java.lang.String certificate)
certificate
- public void setSSLTrustedCertificate(java.lang.String certificate, java.lang.String trustedEncoding)
certificate
- trustedEncoding
- public void setSSLTrustedCertificate(byte[] certificate, java.lang.String trustedEncoding)
certificate
- The certificate, represented as raw bytes.trustedEncoding
- public void setSSLIssuerCertificate(java.lang.String certificate)
certificate
- public void setSSLIssuerCertificate(java.lang.String certificate, java.lang.String encoding)
certificate
- encoding
- public void setSSLIssuerCertificate(byte[] certificate, java.lang.String encoding)
certificate
- The certificate as binary dataencoding
- The encoding type for this certificatepublic void setSSLIdentity(java.lang.String sslIdentity)
sslIdentity
- public void setSSLIdentity(byte[] identity)
identity
- public void setSSLIdentityEncoding(java.lang.String sslIdentityEncoding)
sslIdentityEncoding
- public void setSSLPrivateKey(java.lang.String sslPrivateKey)
sslPrivateKey
- public void setSSLPrivateKey(byte[] sslPrivateKey)
sslPrivateKey
- public void setSSLPrivateKeyEncoding(java.lang.String sslPrivateKeyEncoding)
sslPrivateKeyEncoding
- public void setSSLPassword(java.lang.String sslPassword)
sslPassword
- public void setSSLCipherSuites(java.lang.String suites)
suites
- public void setSSLProxy(java.lang.String host, int port) throws JMSException
host
- the connection factory establishes SSL communication through
a web proxy at this host. Supply a simple hostname, a fully qualified
hostname with domain name, or an IP address (dot notation).port
- the connection factory establishes SSL communication through
a web proxy on this port.JMSException
- if the proxy host is null or empty, the port is zero or the protocol
of the connection factory's URL is not SSL.public void setSSLProxyAuth(java.lang.String username, java.lang.String password) throws JMSException
username
- the connection factory authenticates itself to the SSL
proxy using this username.password
- the connection factory authenticates itself to the SSL
proxy using this password.JMSException
- if the protocol of the connection factory's URL is not SSL.public java.lang.String getSSLProxyHost() throws JMSException
JMSException
- if the protocol of the connection factory's URL is not SSL.public int getSSLProxyPort() throws JMSException
JMSException
- if the protocol of the connection factory's URL is not SSL.public java.lang.String getSSLProxyUser() throws JMSException
JMSException
- if the protocol of the connection factory's URL is not SSL.public java.lang.String getSSLProxyPassword() throws JMSException
JMSException
- if the protocol of the connection factory's URL is not SSL.public void setConnAttemptTimeout(int timeout)
timeout
- the timeout is in millisecondspublic void setReconnAttemptTimeout(int timeout)
timeout
- the timeout is in milliseconds@Deprecated public void setMulticastEnabled(boolean enabled)
enabled
- true
to enable multicast, false
to disable multicast@Deprecated public void setMulticastDaemon(java.lang.String port) throws JMSException
port
- the port of the multicast daemonJMSException
Copyright © Cloud Software Group, Inc. All rights reserved