Class SslTransportFactory
java.lang.Object
org.apache.activemq.transport.TransportFactory
org.apache.activemq.transport.tcp.TcpTransportFactory
org.apache.activemq.transport.tcp.SslTransportFactory
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompositeConfigure(Transport transport, WireFormat format, Map options) Overriding to allow for proper configuration through reflection but delegate to get common configurationprotected ServerSocketFactoryCreates a new SSL ServerSocketFactory.protected ServerSocketFactorycreateServerSocketFactory(SslContext sslContext) Overriding to derive the SSL server socket factory from the given SslContext, falling back to the JVM default when none is supplied.protected SocketFactoryprotected SocketFactorycreateSocketFactory(SslContext sslContext) Overriding to derive the SSL socket factory from the given SslContext, falling back to the JVM default when none is supplied.protected SslTransportServercreateSslTransportServer(URI location, SSLServerSocketFactory serverSocketFactory) Allows subclasses of SslTransportFactory to create custom instances of SslTransportServer.protected TcpTransportcreateTcpTransport(WireFormat wf, SocketFactory socketFactory, URI location, URI localLocation) Overriding to use SslTransports.protected TcpTransportServercreateTcpTransportServer(URI location, ServerSocketFactory serverSocketFactory) Overriding to use SslTransportServer and allow for proper reflection.createTransport(WireFormat wireFormat, Socket socket, TcpTransport.InitBuffer initBuffer) Methods inherited from class TcpTransportFactory
createInactivityMonitor, createTcpTransportServer, createTransport, createTransport, createTransport, doBind, doBind, doCompositeConnect, doConnect, isUseInactivityMonitor, toSSLContextMethods inherited from class TransportFactory
bind, compositeConnect, compositeConnect, compositeConnect, configure, connect, connect, connect, createWireFormat, createWireFormatFactory, doCompositeConnect, doCompositeConnect, doConnect, doConnect, doConnectInternal, findTransportFactory, getDefaultWireFormatType, getOption, registerTransportFactory, serverConfigure
-
Constructor Details
-
SslTransportFactory
public SslTransportFactory()
-
-
Method Details
-
createServerSocketFactory
Overriding to derive the SSL server socket factory from the given SslContext, falling back to the JVM default when none is supplied.- Overrides:
createServerSocketFactoryin classTcpTransportFactory- Parameters:
sslContext- the SslContext to use, or null for the JVM default.- Throws:
IOException
-
createTcpTransportServer
protected TcpTransportServer createTcpTransportServer(URI location, ServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException Overriding to use SslTransportServer and allow for proper reflection.- Overrides:
createTcpTransportServerin classTcpTransportFactory- Parameters:
location-serverSocketFactory-- Returns:
- a new TcpTransportServer instance.
- Throws:
IOExceptionURISyntaxException
-
createSslTransportServer
protected SslTransportServer createSslTransportServer(URI location, SSLServerSocketFactory serverSocketFactory) throws IOException, URISyntaxException Allows subclasses of SslTransportFactory to create custom instances of SslTransportServer.- Parameters:
location-serverSocketFactory-- Returns:
- a new SslTransportServer initialized from the given location and socket factory.
- Throws:
IOExceptionURISyntaxException
-
compositeConfigure
Overriding to allow for proper configuration through reflection but delegate to get common configuration- Overrides:
compositeConfigurein classTcpTransportFactory- Parameters:
transport-format-options-- Returns:
-
createSocketFactory
Overriding to derive the SSL socket factory from the given SslContext, falling back to the JVM default when none is supplied.- Overrides:
createSocketFactoryin classTcpTransportFactory- Parameters:
sslContext- the SslContext to use, or null for the JVM default.- Throws:
IOException
-
createTcpTransport
protected TcpTransport createTcpTransport(WireFormat wf, SocketFactory socketFactory, URI location, URI localLocation) throws UnknownHostException, IOException Overriding to use SslTransports.- Overrides:
createTcpTransportin classTcpTransportFactory- Parameters:
wf-socketFactory-location-localLocation-- Returns:
- a new TcpTransport instance connected to the given location.
- Throws:
IOExceptionUnknownHostException
-
createServerSocketFactory
Creates a new SSL ServerSocketFactory. The given factory will use user-provided key and trust managers (if the user provided them).- Overrides:
createServerSocketFactoryin classTcpTransportFactory- Returns:
- Newly created (Ssl)ServerSocketFactory.
- Throws:
IOException
-
createSocketFactory
- Overrides:
createSocketFactoryin classTcpTransportFactory- Throws:
IOException
-
createTransport
public SslTransport createTransport(WireFormat wireFormat, Socket socket, TcpTransport.InitBuffer initBuffer) throws IOException - Overrides:
createTransportin classTcpTransportFactory- Throws:
IOException
-