aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny van Heumen <danny@dannyvanheumen.nl>2013-11-12 21:50:43 +0100
committerDanny van Heumen <danny@dannyvanheumen.nl>2014-07-30 18:29:57 +0200
commit4dab0a4d3133e05dc0cace395fcffdeaee0415a5 (patch)
tree2df84288349af8d915f57bb04b3df78acb64c85e
parentc2e2a52ac46afa555d1bc714b39a58e6b287edad (diff)
downloadjitsi-4dab0a4d3133e05dc0cace395fcffdeaee0415a5.zip
jitsi-4dab0a4d3133e05dc0cace395fcffdeaee0415a5.tar.gz
jitsi-4dab0a4d3133e05dc0cace395fcffdeaee0415a5.tar.bz2
Rewritten IrcAccRegWizz after the IcqAccRegWizz since the original
implementation causes problems during loading.
-rw-r--r--src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java97
1 files changed, 33 insertions, 64 deletions
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java
index ee846a7..f97651f 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java
@@ -20,67 +20,51 @@ import org.osgi.framework.*;
* @author Lionel Ferreira & Michael Tarantino
*/
public class IrcAccRegWizzActivator
- implements BundleActivator
+ extends AbstractServiceDependentActivator
{
private static Logger logger = Logger.getLogger(
IrcAccRegWizzActivator.class.getName());
+
+ static BundleContext bundleContext;
+
+ private static UIService uiService;
+
+ private static WizardContainer wizardContainer;
- /**
- * A currently valid bundle context.
- */
- public static BundleContext bundleContext;
-
- /**
- * The <tt>UIService</tt>.
- */
- public static UIService uiService;
+ private IrcAccountRegistrationWizard ircWizard;
- /**
- * Starts this bundle.
- * @param bc the currently valid <tt>BundleContext</tt>.
- */
- public void start(BundleContext bc)
+ public void start(Object dependentService)
{
if (logger.isInfoEnabled())
logger.info("Loading irc account wizard.");
- bundleContext = bc;
-
- ServiceReference uiServiceRef = bundleContext
- .getServiceReference(UIService.class.getName());
-
- UIService uiService
- = (UIService) bundleContext.getService(uiServiceRef);
-
- WizardContainer wizardContainer
- = uiService.getAccountRegWizardContainer();
-
- IrcAccountRegistrationWizard ircWizard
- = new IrcAccountRegistrationWizard(wizardContainer);
-
- Hashtable<String, String> containerFilter
- = new Hashtable<String, String>();
-
- containerFilter.put(
- ProtocolProviderFactory.PROTOCOL,
- ProtocolNames.IRC);
-
- bundleContext.registerService(
- AccountRegistrationWizard.class.getName(),
- ircWizard,
- containerFilter);
+ uiService = (UIService)dependentService;
+
+ wizardContainer = uiService.getAccountRegWizardContainer();
+
+ ircWizard = new IrcAccountRegistrationWizard(wizardContainer);
+
+ Hashtable<String, String> containerFilter = new Hashtable<String, String>();
+ containerFilter.put(ProtocolProviderFactory.PROTOCOL, ProtocolNames.IRC);
+
+ bundleContext.registerService(AccountRegistrationWizard.class.getName(), ircWizard, containerFilter);
if (logger.isInfoEnabled())
logger.info("IRC account registration wizard [STARTED].");
}
-
- /**
- * Called when this bundle is stopped so the Framework can perform the
- * bundle-specific activities necessary to stop the bundle.
- *
- * @param context The execution context of the bundle being stopped.
- */
- public void stop(BundleContext context)
+
+ public Class<?> getDependentServiceClass()
+ {
+ return UIService.class;
+ }
+
+ @Override
+ public void setBundleContext(BundleContext context)
+ {
+ bundleContext = context;
+ }
+
+ public void stop(BundleContext bundleContext)
{
}
@@ -108,22 +92,7 @@ public class IrcAccRegWizzActivator
return (ProtocolProviderFactory) bundleContext.getService(serRefs[0]);
}
-
- /**
- * Returns the bundleContext that we received when we were started.
- *
- * @return a currently valid instance of a bundleContext.
- */
- public BundleContext getBundleContext()
- {
- return bundleContext;
- }
-
- /**
- * Returns the <tt>UIService</tt>.
- *
- * @return the <tt>UIService</tt>
- */
+
public static UIService getUIService()
{
return uiService;