org.apache.activemq.transport.tcp
Class SslTransportServer

java.lang.Object
  extended by org.apache.activemq.util.ServiceSupport
      extended by org.apache.activemq.transport.TransportServerSupport
          extended by org.apache.activemq.transport.TransportServerThreadSupport
              extended by org.apache.activemq.transport.tcp.TcpTransportServer
                  extended by org.apache.activemq.transport.tcp.SslTransportServer
All Implemented Interfaces:
Runnable, Service, TransportServer, ServiceListener

public class SslTransportServer
extends TcpTransportServer

An SSL TransportServer. Allows for client certificate authentication (refer to setNeedClientAuth for details). NOTE: Client certificate authentication is disabled by default.


Field Summary
 
Fields inherited from class org.apache.activemq.transport.tcp.TcpTransportServer
backlog, connectionTimeout, currentTransportCount, dynamicManagement, logWriterName, maximumConnections, maxInactivityDuration, maxInactivityDurationInitalDelay, minmumWireFormatVersion, serverSocket, serverSocketFactory, socketBufferSize, socketHandlerThread, socketQueue, soTimeout, startLogging, trace, transportFactory, useQueueForAccept, wireFormatFactory
 
Fields inherited from class org.apache.activemq.transport.TransportServerSupport
transportOptions
 
Constructor Summary
SslTransportServer(SslTransportFactory transportFactory, URI location, SSLServerSocketFactory serverSocketFactory)
          Creates a ssl transport server for the specified url using the provided serverSocketFactory
 
Method Summary
 void bind()
          Binds this socket to the previously specified URI.
protected  Transport createTransport(Socket socket, WireFormat format)
          Used to create Transports for this server.
 boolean getNeedClientAuth()
          Returns whether client authentication should be required.
 boolean getWantClientAuth()
          Returns whether client authentication should be requested.
 void setNeedClientAuth(boolean needAuth)
          Sets whether client authentication should be required Must be called before bind() Note: Calling this method clears the wantClientAuth flag in the underlying implementation.
 void setWantClientAuth(boolean wantAuth)
          Sets whether client authentication should be requested.
 
Methods inherited from class org.apache.activemq.transport.tcp.TcpTransportServer
doStart, doStop, getBacklog, getConnectionTimeout, getLogWriterName, getMaximumConnections, getMaxInactivityDuration, getMaxInactivityDurationInitalDelay, getMinmumWireFormatVersion, getSocketAddress, getSocketBufferSize, getSoTimeout, getWireFormatFactory, handleSocket, isDynamicManagement, isStartLogging, isTrace, isUseQueueForAccept, resolveHostName, run, setBacklog, setBrokerInfo, setConnectionTimeout, setDynamicManagement, setLogWriterName, setMaximumConnections, setMaxInactivityDuration, setMaxInactivityDurationInitalDelay, setMinmumWireFormatVersion, setSocketBufferSize, setSoTimeout, setStartLogging, setTrace, setUseQueueForAccept, setWireFormatFactory, started, stopped, toString
 
Methods inherited from class org.apache.activemq.transport.TransportServerThreadSupport
getStackSize, isDaemon, isJoinOnStop, setDaemon, setJoinOnStop, setStackSize
 
Methods inherited from class org.apache.activemq.transport.TransportServerSupport
getAcceptListener, getBindLocation, getConnectURI, onAcceptError, setAcceptListener, setBindLocation, setConnectURI, setTransportOption
 
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, postStop, preStart, removeServiceListener, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.activemq.Service
start, stop
 

Constructor Detail

SslTransportServer

public SslTransportServer(SslTransportFactory transportFactory,
                          URI location,
                          SSLServerSocketFactory serverSocketFactory)
                   throws IOException,
                          URISyntaxException
Creates a ssl transport server for the specified url using the provided serverSocketFactory

Parameters:
transportFactory - The factory used to create transports when connections arrive.
location - The location of the broker to bind to.
serverSocketFactory - The factory used to create this server.
Throws:
IOException - passed up from TcpTransportFactory.
URISyntaxException - passed up from TcpTransportFactory.
Method Detail

setNeedClientAuth

public void setNeedClientAuth(boolean needAuth)
Sets whether client authentication should be required Must be called before bind() Note: Calling this method clears the wantClientAuth flag in the underlying implementation.


getNeedClientAuth

public boolean getNeedClientAuth()
Returns whether client authentication should be required.


getWantClientAuth

public boolean getWantClientAuth()
Returns whether client authentication should be requested.


setWantClientAuth

public void setWantClientAuth(boolean wantAuth)
Sets whether client authentication should be requested. Must be called before bind() Note: Calling this method clears the needClientAuth flag in the underlying implementation.


bind

public void bind()
          throws IOException
Binds this socket to the previously specified URI. Overridden to allow for proper handling of needClientAuth.

Overrides:
bind in class TcpTransportServer
Throws:
IOException - passed up from TcpTransportServer.

createTransport

protected Transport createTransport(Socket socket,
                                    WireFormat format)
                             throws IOException
Used to create Transports for this server. Overridden to allow the use of SslTransports (instead of TcpTransports).

Overrides:
createTransport in class TcpTransportServer
Parameters:
socket - The incoming socket that will be wrapped into the new Transport.
format - The WireFormat being used.
Returns:
The newly return (SSL) Transport.
Throws:
IOException


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.