diff options
author | Damian Minkov <damencho@jitsi.org> | 2011-11-17 07:28:36 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2011-11-17 07:28:36 +0000 |
commit | 7f6d5954ba06e9f08f1602c4932f15f70feee56f (patch) | |
tree | ef070045975e8c2b48425b049c0bee1f243c2877 /src/net/java/sip/communicator/impl/notification/NotificationActivator.java | |
parent | 356fca64006339cda80db8bf39317c66810fbf21 (diff) | |
download | jitsi-7f6d5954ba06e9f08f1602c4932f15f70feee56f.zip jitsi-7f6d5954ba06e9f08f1602c4932f15f70feee56f.tar.gz jitsi-7f6d5954ba06e9f08f1602c4932f15f70feee56f.tar.bz2 |
Isolates notification management and triggering.
Diffstat (limited to 'src/net/java/sip/communicator/impl/notification/NotificationActivator.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/notification/NotificationActivator.java | 77 |
1 files changed, 74 insertions, 3 deletions
diff --git a/src/net/java/sip/communicator/impl/notification/NotificationActivator.java b/src/net/java/sip/communicator/impl/notification/NotificationActivator.java index 34c950c..116b29b 100644 --- a/src/net/java/sip/communicator/impl/notification/NotificationActivator.java +++ b/src/net/java/sip/communicator/impl/notification/NotificationActivator.java @@ -8,7 +8,10 @@ package net.java.sip.communicator.impl.notification; import net.java.sip.communicator.service.audionotifier.*; import net.java.sip.communicator.service.configuration.*; +import net.java.sip.communicator.service.gui.*; +import net.java.sip.communicator.service.neomedia.*; import net.java.sip.communicator.service.notification.*; +import net.java.sip.communicator.service.resources.*; import net.java.sip.communicator.service.systray.*; import net.java.sip.communicator.util.*; @@ -25,13 +28,21 @@ public class NotificationActivator { private final Logger logger = Logger.getLogger(NotificationActivator.class); - private static BundleContext bundleContext; + protected static BundleContext bundleContext; private static ConfigurationService configService; private static AudioNotifierService audioNotifierService; private static SystrayService systrayService; + + private static NotificationService notificationService; + + private static ResourceManagementService resourcesService; + + private static UIService uiService = null; + + private static MediaService mediaService; public void start(BundleContext bc) throws Exception { @@ -39,8 +50,7 @@ public class NotificationActivator try { // Create the notification service implementation - NotificationService notificationService = - new NotificationServiceImpl(); + notificationService = new NotificationServiceImpl(); if (logger.isInfoEnabled()) logger.info("Notification Service...[ STARTED ]"); @@ -48,6 +58,8 @@ public class NotificationActivator bundleContext.registerService(NotificationService.class.getName(), notificationService, null); + new NotificationManager().init(); + if (logger.isInfoEnabled()) logger.info("Notification Service ...[REGISTERED]"); @@ -125,4 +137,63 @@ public class NotificationActivator return systrayService; } + + /** + * Returns the <tt>NotificationService</tt> obtained from the bundle context. + * + * @return the <tt>NotificationService</tt> obtained from the bundle context + */ + public static NotificationService getNotificationService() + { + return notificationService; + } + + /** + * Returns the <tt>ResourceManagementService</tt>, through which we will + * access all resources. + * + * @return the <tt>ResourceManagementService</tt>, through which we will + * access all resources. + */ + public static ResourceManagementService getResources() + { + if (resourcesService == null) + { + resourcesService + = ServiceUtils.getService( + bundleContext, + ResourceManagementService.class); + } + return resourcesService; + } + + /** + * Returns the current implementation of the <tt>UIService</tt>. + * @return the current implementation of the <tt>UIService</tt> + */ + public static UIService getUIService() + { + if (uiService == null) + { + uiService = ServiceUtils.getService(bundleContext, UIService.class); + } + + return uiService; + } + + /** + * Returns an instance of the <tt>MediaService</tt> obtained from the + * bundle context. + * @return an instance of the <tt>MediaService</tt> obtained from the + * bundle context + */ + public static MediaService getMediaService() + { + if (mediaService == null) + { + mediaService + = ServiceUtils.getService(bundleContext, MediaService.class); + } + return mediaService; + } } |