aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/protocol/jabber/JabberActivator.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/jabber/JabberActivator.java')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/JabberActivator.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/JabberActivator.java b/src/net/java/sip/communicator/impl/protocol/jabber/JabberActivator.java
index 3b1f100..a66bfb7 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/JabberActivator.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/JabberActivator.java
@@ -10,6 +10,7 @@ import java.util.*;
import org.osgi.framework.*;
import net.java.sip.communicator.service.configuration.*;
+import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.media.*;
@@ -48,6 +49,10 @@ public class JabberActivator
*/
private static ProtocolProviderFactoryJabberImpl jabberProviderFactory = null;
+ private UriHandlerJabberImpl uriHandlerImpl = null;
+
+ private static UIService uiService = null;
+
/**
* Called when this bundle is started so the Framework can perform the
* bundle-specific activities necessary to start this bundle.
@@ -67,6 +72,13 @@ public class JabberActivator
jabberProviderFactory = new ProtocolProviderFactoryJabberImpl();
+ /*
+ * Install the UriHandler prior to registering the factory service in
+ * order to allow it to detect when the stored accounts are loaded
+ * (because they may be asynchronously loaded).
+ */
+ uriHandlerImpl = new UriHandlerJabberImpl(jabberProviderFactory);
+
//reg the jabber account man.
jabberPpFactoryServReg = context.registerService(
ProtocolProviderFactory.class.getName(),
@@ -153,5 +165,31 @@ public class JabberActivator
{
jabberProviderFactory.stop();
jabberPpFactoryServReg.unregister();
+
+ if (uriHandlerImpl != null)
+ {
+ uriHandlerImpl.dispose();
+ uriHandlerImpl = null;
+ }
+ }
+
+ /**
+ * Returns a reference to the UIService implementation currently registered
+ * in the bundle context or null if no such implementation was found.
+ *
+ * @return a reference to a UIService implementation currently registered
+ * in the bundle context or null if no such implementation was found.
+ */
+ public static UIService getUIService()
+ {
+ if(uiService == null)
+ {
+ ServiceReference uiServiceReference
+ = bundleContext.getServiceReference(
+ UIService.class.getName());
+ uiService = (UIService)bundleContext
+ .getService(uiServiceReference);
+ }
+ return uiService;
}
}