org.apache.activemq
Class ActiveMQSslConnectionFactory

java.lang.Object
  extended by org.apache.activemq.jndi.JNDIBaseStorable
      extended by org.apache.activemq.ActiveMQConnectionFactory
          extended by org.apache.activemq.ActiveMQSslConnectionFactory
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, javax.jms.ConnectionFactory, javax.jms.QueueConnectionFactory, javax.jms.TopicConnectionFactory, javax.naming.Referenceable, JNDIStorableInterface, StatsCapable

public class ActiveMQSslConnectionFactory
extends ActiveMQConnectionFactory

An ActiveMQConnectionFactory that allows access to the key and trust managers used for SslConnections. There is no reason to use this class unless SSL is being used AND the key and trust managers need to be specified from within code. In fact, if the URI passed to this class does not have an "ssl" scheme, this class will pass all work on to its superclass.

Author:
sepandm@gmail.com
See Also:
Serialized Form

Field Summary
protected  javax.net.ssl.KeyManager[] keyManager
           
protected  java.security.SecureRandom secureRandom
           
protected  javax.net.ssl.TrustManager[] trustManager
           
 
Fields inherited from class org.apache.activemq.ActiveMQConnectionFactory
alwaysSessionAsync, brokerURL, clientID, DEFAULT_BROKER_URL, DEFAULT_CONNECTION_EXECUTOR, DEFAULT_PASSWORD, DEFAULT_USER, dispatchAsync, password, userName
 
Constructor Summary
ActiveMQSslConnectionFactory()
           
 
Method Summary
protected  Transport createTransport()
          Overriding to make special considerations for SSL connections.
 void setKeyAndTrustManagers(javax.net.ssl.KeyManager[] km, javax.net.ssl.TrustManager[] tm, java.security.SecureRandom random)
          Sets the key and trust managers used when creating SSL connections.
 
Methods inherited from class org.apache.activemq.ActiveMQConnectionFactory
buildFromMap, buildFromProperties, copy, createActiveMQConnection, createActiveMQConnection, createActiveMQConnection, createConnection, createConnection, createQueueConnection, createQueueConnection, createTopicConnection, createTopicConnection, getBrokerURL, getClientID, getClientIdGenerator, getClientIDPrefix, getCloseTimeout, getPassword, getPrefetchPolicy, getRedeliveryPolicy, getStats, getUserName, isAlwaysSessionAsync, isCopyMessageOnSend, isDisableTimeStampsByDefault, isDispatchAsync, isNestedMapAndListEnabled, isObjectMessageSerializationDefered, isOptimizeAcknowledge, isOptimizedMessageDispatch, isStatsEnabled, isUseAsyncSend, isUseCompression, isUseRetroactiveConsumer, isUseSyncSend, isWatchTopicAdvisories, populateProperties, setAlwaysSessionAsync, setBrokerURL, setClientID, setClientIdGenerator, setClientIDPrefix, setCloseTimeout, setCopyMessageOnSend, setDisableTimeStampsByDefault, setDispatchAsync, setNestedMapAndListEnabled, setObjectMessageSerializationDefered, setOptimizeAcknowledge, setOptimizedMessageDispatch, setPassword, setPrefetchPolicy, setRedeliveryPolicy, setStatsEnabled, setUseAsyncSend, setUseCompression, setUseRetroactiveConsumer, setUserName, setUseSyncSend, setWatchTopicAdvisories
 
Methods inherited from class org.apache.activemq.jndi.JNDIBaseStorable
getProperties, getReference, readExternal, setProperties, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyManager

protected javax.net.ssl.KeyManager[] keyManager

trustManager

protected javax.net.ssl.TrustManager[] trustManager

secureRandom

protected java.security.SecureRandom secureRandom
Constructor Detail

ActiveMQSslConnectionFactory

public ActiveMQSslConnectionFactory()
Method Detail

setKeyAndTrustManagers

public void setKeyAndTrustManagers(javax.net.ssl.KeyManager[] km,
                                   javax.net.ssl.TrustManager[] tm,
                                   java.security.SecureRandom random)
Sets the key and trust managers used when creating SSL connections.

Parameters:
km - The KeyManagers used.
tm - The TrustManagers used.
random - The SecureRandom number used.

createTransport

protected Transport createTransport()
                             throws javax.jms.JMSException
Overriding to make special considerations for SSL connections. If we are not using SSL, the superclass's method is called. If we are using SSL, an SslConnectionFactory is used and it is given the needed key and trust managers.

Overrides:
createTransport in class ActiveMQConnectionFactory
Returns:
The newly created Transport.
Throws:
javax.jms.JMSException - If unable to create trasnport.


Copyright © 2010 Apache Software Foundation. All Rights Reserved.