org.apache.activemq.transport.tcp
Class SslTransportFactory

java.lang.Object
  extended by org.apache.activemq.transport.TransportFactory
      extended by org.apache.activemq.transport.tcp.TcpTransportFactory
          extended by org.apache.activemq.transport.tcp.SslTransportFactory
Direct Known Subclasses:
StompSslTransportFactory

public class SslTransportFactory
extends TcpTransportFactory

An implementation of the TcpTransportFactory using SSL. The major contribution from this class is that it is aware of SslTransportServer and SslTransport classes. All Transports and TransportServers created from this factory will have their needClientAuth option set to false.

Version:
$Revision: $
Author:
sepandm@gmail.com (Sepand)

Constructor Summary
SslTransportFactory()
          Constructor.
 
Method Summary
 Transport compositeConfigure(Transport transport, WireFormat format, java.util.Map options)
          Overriding to allow for proper configuration through reflection.
protected  javax.net.ServerSocketFactory createServerSocketFactory()
          Creates a new SSL ServerSocketFactory.
protected  javax.net.SocketFactory createSocketFactory()
          Creates a new SSL SocketFactory.
protected  Transport createTransport(java.net.URI location, WireFormat wf)
          Overriding to use SslTransports.
 TransportServer doBind(java.lang.String brokerId, java.net.URI location)
          Overriding to use SslTransportServer and allow for proper reflection.
 void setKeyAndTrustManagers(javax.net.ssl.KeyManager[] km, javax.net.ssl.TrustManager[] tm, java.security.SecureRandom random)
          Sets the key and trust managers used in constructed socket factories.
 
Methods inherited from class org.apache.activemq.transport.tcp.TcpTransportFactory
createTcpTransport, createTcpTransportServer
 
Methods inherited from class org.apache.activemq.transport.TransportFactory
bind, compositeConnect, compositeConnect, configure, connect, connect, createWireFormat, createWireFormatFactory, doCompositeConnect, doCompositeConnect, doConnect, doConnect, getDefaultWireFormatType, serverConfigure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SslTransportFactory

public SslTransportFactory()
Constructor. Nothing special.

Method Detail

doBind

public TransportServer doBind(java.lang.String brokerId,
                              java.net.URI location)
                       throws java.io.IOException
Overriding to use SslTransportServer and allow for proper reflection.

Overrides:
doBind in class TcpTransportFactory
Throws:
java.io.IOException

compositeConfigure

public Transport compositeConfigure(Transport transport,
                                    WireFormat format,
                                    java.util.Map options)
Overriding to allow for proper configuration through reflection.

Overrides:
compositeConfigure in class TcpTransportFactory
Returns:

createTransport

protected Transport createTransport(java.net.URI location,
                                    WireFormat wf)
                             throws java.net.UnknownHostException,
                                    java.io.IOException
Overriding to use SslTransports.

Overrides:
createTransport in class TcpTransportFactory
Throws:
java.net.UnknownHostException
java.io.IOException

setKeyAndTrustManagers

public void setKeyAndTrustManagers(javax.net.ssl.KeyManager[] km,
                                   javax.net.ssl.TrustManager[] tm,
                                   java.security.SecureRandom random)
                            throws java.security.KeyManagementException
Sets the key and trust managers used in constructed socket factories. Passes given arguments to SSLContext.init(...).

Parameters:
km - The sources of authentication keys or null.
tm - The sources of peer authentication trust decisions or null.
random - The source of randomness for this generator or null.
Throws:
java.security.KeyManagementException

createServerSocketFactory

protected javax.net.ServerSocketFactory createServerSocketFactory()
Creates a new SSL ServerSocketFactory. The given factory will use user-provided key and trust managers (if the user provided them).

Overrides:
createServerSocketFactory in class TcpTransportFactory
Returns:
Newly created (Ssl)ServerSocketFactory.

createSocketFactory

protected javax.net.SocketFactory createSocketFactory()
Creates a new SSL SocketFactory. The given factory will use user-provided key and trust managers (if the user provided them).

Overrides:
createSocketFactory in class TcpTransportFactory
Returns:
Newly created (Ssl)SocketFactory.


Copyright © 2011 Apache Software Foundation. All Rights Reserved.