org.apache.activemq.broker
Class SslBrokerService

java.lang.Object
  extended by org.apache.activemq.broker.BrokerService
      extended by org.apache.activemq.broker.SslBrokerService
All Implemented Interfaces:
Service

public class SslBrokerService
extends BrokerService

A BrokerService that allows access to the key and trust managers used by SSL connections. 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:
[email protected] (Sepand)

Field Summary
 
Fields inherited from class org.apache.activemq.broker.BrokerService
DEFAULT_BROKER_NAME, DEFAULT_PORT, destinationFactory, LOCAL_HOST_NAME, slaveStartSignal
 
Constructor Summary
SslBrokerService()
           
 
Method Summary
 TransportConnector addSslConnector(String bindAddress, KeyManager[] km, TrustManager[] tm, SecureRandom random)
          Adds a new transport connector for the given bind address.
 TransportConnector addSslConnector(URI bindAddress, KeyManager[] km, TrustManager[] tm, SecureRandom random)
          Adds a new transport connector for the given bind address.
protected  TransportServer createSslTransportServer(URI brokerURI, KeyManager[] km, TrustManager[] tm, SecureRandom random)
          Creates a TransportServer that uses the given key and trust managers.
 
Methods inherited from class org.apache.activemq.broker.BrokerService
addConnector, addConnector, addConnector, addConnector, addInterceptors, addJmsConnector, addNetworkConnector, addNetworkConnector, addNetworkConnector, addProxyConnector, addProxyConnector, addProxyConnector, addService, addShutdownHook, addShutdownHook, checkQueueSize, configureService, configureServices, containerShutdown, createAdminConnectionContext, createBroker, createBrokerObjectName, createDefaultDestinationInterceptor, createNetworkConnectorObjectName, createPersistenceAdapter, createPersistenceFactory, createRegionBroker, createRegionBroker, createTransportConnector, deleteAllMessages, getAdminConnectionContext, getAdminView, getBroker, getBrokerDataDirectory, getBrokerName, getBrokerObjectName, getConnectorByName, getConsumerSystemUsage, getConsumerSystemUsagePortion, getDataDirectoryFile, getDestination, getDestinationInterceptors, getDestinationPolicy, getDestinations, getJmsBridgeConnectors, getManagementContext, getMasterConnectorURI, getMessageAuthorizationPolicy, getNetworkConnectorByName, getNetworkConnectors, getNetworkConnectorURIs, getPersistenceAdapter, getPersistenceFactory, getPersistenceTaskRunnerFactory, getPersistenceThreadPriority, getPlugins, getPort, getProducerSystemUsage, getProducerSystemUsagePortion, getProxyConnectors, getRegionBroker, getServices, getSlaveStartSignal, getSslContext, getSystemExitOnShutdownExitCode, getSystemUsage, getTaskRunnerFactory, getTaskRunnerPriority, getTempDataStore, getTimeBeforePurgeTempDestinations, getTmpDataDirectory, getTransportConnectors, getTransportConnectorURIs, getTransportConnectorURIsAsMap, getVmConnectorURI, isAdvisorySupport, isCacheTempDestinations, isDedicatedTaskRunner, isDeleteAllMessagesOnStartup, isEnableStatistics, isKeepDurableSubsActive, isMonitorConnectionSplits, isPassiveSlave, isPersistent, isPopulateJMSXUserID, isShutdownOnMasterFailure, isShutdownOnSlaveFailure, isSlave, isSplitSystemUsageForProducersConsumers, isStarted, isSupportFailOver, isSystemExitOnShutdown, isUseJmx, isUseLocalHostBrokerName, isUseLoggingForShutdownErrors, isUseMirroredQueues, isUseShutdownHook, isUseTempMirroredQueues, isUseVirtualTopics, isWaitForSlave, logError, masterFailed, processHelperProperties, registerConnectorMBean, registerFTConnectorMBean, registerJmsConnectorMBean, registerNetworkConnectorMBean, registerPersistenceAdapterMBean, registerProxyConnectorMBean, removeConnector, removeDestination, removeJmsConnector, removeNetworkConnector, removeService, removeShutdownHook, removeShutdownHook, setAdminView, setAdvisorySupport, setBrokerName, setBrokerObjectName, setCacheTempDestinations, setConsumerSystemUsage, setConsumerSystemUsagePortion, setDataDirectory, setDataDirectoryFile, setDedicatedTaskRunner, setDeleteAllMessagesOnStartup, setDestinationFactory, setDestinationInterceptors, setDestinationPolicy, setDestinations, setEnableStatistics, setJmsBridgeConnectors, setKeepDurableSubsActive, setManagementContext, setMasterConnectorURI, setMessageAuthorizationPolicy, setMonitorConnectionSplits, setNetworkConnectors, setNetworkConnectorURIs, setPassiveSlave, setPersistenceAdapter, setPersistenceFactory, setPersistenceTaskRunnerFactory, setPersistenceThreadPriority, setPersistent, setPlugins, setPopulateJMSXUserID, setProducerSystemUsage, setProducerSystemUsagePortion, setProxyConnectors, setRegionBroker, setServices, setShutdownOnMasterFailure, setShutdownOnSlaveFailure, setSplitSystemUsageForProducersConsumers, setSslContext, setSupportFailOver, setSystemExitOnShutdown, setSystemExitOnShutdownExitCode, setSystemUsage, setTaskRunnerFactory, setTaskRunnerPriority, setTempDataStore, setTimeBeforePurgeTempDestinations, setTmpDataDirectory, setTransportConnectors, setTransportConnectorURIs, setUseJmx, setUseLocalHostBrokerName, setUseLoggingForShutdownErrors, setUseMirroredQueues, setUseShutdownHook, setUseTempMirroredQueues, setUseVirtualTopics, setVmConnectorURI, setWaitForSlave, slaveConnectionEstablished, start, start, startAllConnectors, startDestinations, startDestinationsInPersistenceStore, startTransportConnector, stop, stopAllConnectors, stopGracefully, toString, unregisterConnectorMBean, unregisterNetworkConnectorMBean, unregisterPersistenceAdapterMBean, waitForSlave, waitUntilStarted, waitUntilStopped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SslBrokerService

public SslBrokerService()
Method Detail

addSslConnector

public TransportConnector addSslConnector(String bindAddress,
                                          KeyManager[] km,
                                          TrustManager[] tm,
                                          SecureRandom random)
                                   throws Exception
Adds a new transport connector for the given bind address. If the transport created uses SSL, it will also use the key and trust managers provided. Otherwise, this is the same as calling addConnector.

Parameters:
bindAddress - The address to bind to.
km - The KeyManager to be used.
tm - The trustmanager to be used.
random - The source of randomness for the generator.
Returns:
the newly connected and added transport connector.
Throws:
Exception

addSslConnector

public TransportConnector addSslConnector(URI bindAddress,
                                          KeyManager[] km,
                                          TrustManager[] tm,
                                          SecureRandom random)
                                   throws Exception
Adds a new transport connector for the given bind address. If the transport created uses SSL, it will also use the key and trust managers provided. Otherwise, this is the same as calling addConnector.

Parameters:
bindAddress - The URI to bind to.
km - The KeyManager to be used.
tm - The trustmanager to be used.
random - The source of randomness for the generator.
Returns:
the newly created and added transport connector.
Throws:
Exception

createSslTransportServer

protected TransportServer createSslTransportServer(URI brokerURI,
                                                   KeyManager[] km,
                                                   TrustManager[] tm,
                                                   SecureRandom random)
                                            throws IOException,
                                                   KeyManagementException
Creates a TransportServer that uses the given key and trust managers. The last three parameters will be eventually passed to SSLContext.init.

Parameters:
brokerURI - The URI to bind to.
km - The KeyManager to be used.
tm - The trustmanager to be used.
random - The source of randomness for the generator.
Returns:
A new TransportServer that uses the given managers.
Throws:
IOException - If cannot handle URI.
KeyManagementException - Passed on from SSL.


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