Search in sources :

Example 1 with SslServiceListener

use of org.eclipse.kura.ssl.SslServiceListener in project kura by eclipse.

the class SslManagerServiceImpl method activate.

// ----------------------------------------------------------------
// 
// Activation APIs
// 
// ----------------------------------------------------------------
protected void activate(ComponentContext componentContext, Map<String, Object> properties) {
    s_logger.info("activate...");
    // 
    // save the bundle context and the properties
    this.m_ctx = componentContext;
    this.m_properties = properties;
    this.m_options = new SslManagerServiceOptions(properties);
    this.m_sslSocketFactories = new ConcurrentHashMap<ConnectionSslOptions, SSLSocketFactory>();
    ServiceTracker<SslServiceListener, SslServiceListener> listenersTracker = new ServiceTracker<SslServiceListener, SslServiceListener>(componentContext.getBundleContext(), SslServiceListener.class, null);
    // Deferred open of tracker to prevent
    // java.lang.Exception: Recursive invocation of
    // ServiceFactory.getService
    // on ProSyst
    this.m_sslServiceListeners = new SslServiceListeners(listenersTracker);
    // Then self-update our configuration to reflect the password change.
    if (!changeDefaultKeystorePassword()) {
        // 2. If the password saved in the snapshot and the password hold by
        // the CryptoService do not match change the keystore password
        // to the password in the snapshot.
        changeKeyStorePassword();
    }
}
Also used : SslManagerServiceOptions(org.eclipse.kura.ssl.SslManagerServiceOptions) SslServiceListener(org.eclipse.kura.ssl.SslServiceListener) ServiceTracker(org.osgi.util.tracker.ServiceTracker) SSLSocketFactory(javax.net.ssl.SSLSocketFactory)

Aggregations

SSLSocketFactory (javax.net.ssl.SSLSocketFactory)1 SslManagerServiceOptions (org.eclipse.kura.ssl.SslManagerServiceOptions)1 SslServiceListener (org.eclipse.kura.ssl.SslServiceListener)1 ServiceTracker (org.osgi.util.tracker.ServiceTracker)1