From d3db0d29a166e91a096f6e8daa959107811a0b84 Mon Sep 17 00:00:00 2001 From: George Politis Date: Mon, 9 Jun 2014 20:39:04 +0200 Subject: Fixes IllegalStateException: Invalid BundleContext in the OTR bundle. --- src/net/java/sip/communicator/plugin/otr/OtrActivator.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/net/java') diff --git a/src/net/java/sip/communicator/plugin/otr/OtrActivator.java b/src/net/java/sip/communicator/plugin/otr/OtrActivator.java index d474524..aa4e5ab 100644 --- a/src/net/java/sip/communicator/plugin/otr/OtrActivator.java +++ b/src/net/java/sip/communicator/plugin/otr/OtrActivator.java @@ -78,7 +78,7 @@ public class OtrActivator /** * The {@link ScOtrEngine} of the {@link OtrActivator}. */ - public static ScOtrEngine scOtrEngine; + public static ScOtrEngineImpl scOtrEngine; /** * The {@link ScOtrKeyManager} of the {@link OtrActivator}. @@ -103,6 +103,11 @@ public class OtrActivator private static MessageHistoryService messageHistoryService; /** + * The {@link OtrContactManager} of the {@link OtrActivator}. + */ + private static OtrContactManager otrContactManager; + + /** * Gets an {@link AccountID} by its UID. * * @param uid The {@link AccountID} UID. @@ -303,12 +308,13 @@ public class OtrActivator // Init static variables, don't proceed without them. scOtrEngine = new ScOtrEngineImpl(); + otrContactManager = new OtrContactManager(); otrTransformLayer = new OtrTransformLayer(); // Register Transformation Layer bundleContext.addServiceListener(this); - bundleContext.addServiceListener((ServiceListener) scOtrEngine); - bundleContext.addServiceListener(new OtrContactManager()); + bundleContext.addServiceListener(scOtrEngine); + bundleContext.addServiceListener(otrContactManager); ServiceReference[] protocolProviderRefs = ServiceUtils.getServiceReferences( @@ -417,6 +423,8 @@ public class OtrActivator // Unregister transformation layer. // start listening for newly register or removed protocol providers bundleContext.removeServiceListener(this); + bundleContext.removeServiceListener(scOtrEngine); + bundleContext.removeServiceListener(otrContactManager); ServiceReference[] protocolProviderRefs = null; try -- cgit v1.1