Return old notify service but as deprecated (start does nothing) in order to avoid loading the old jar from the felix cache.

cusax-fix
Damian Minkov 16 years ago
parent 2cb2bd85aa
commit eedf28ab5c

@ -818,7 +818,7 @@
bundle-plugin-yahooaccregwizz,bundle-plugin-aimaccregwizz,
bundle-version,bundle-version-impl,bundle-shutdown-timeout,
bundle-growlnotification,bundle-swingnotification,bundle-galagonotification,
bundle-sparkle, bundle-plugin-branding,
bundle-sparkle, bundle-plugin-branding, bundle-audionotifier,
bundle-osdependent,bundle-browserlauncher,bundle-gibberish,
bundle-gibberish-slick,bundle-plugin-gibberishaccregwizz,
bundle-plugin-call-history-form,

@ -131,6 +131,7 @@ felix.auto.start.60= \
reference:file:sc-bundles/callhistory.jar \
reference:file:sc-bundles/filehistory.jar \
reference:file:sc-bundles/metahistory.jar \
reference:file:sc-bundles/audionotifier.jar \
reference:file:sc-bundles/keybindings.jar \
reference:file:sc-bundles/notification.jar

@ -41,39 +41,42 @@ public class AudioNotifierActivator implements BundleActivator
*/
public void start(BundleContext bContext) throws Exception
{
try {
AudioNotifierActivator.bundleContext = bContext;
//Create the audio notifier service
audioNotifier = new AudioNotifierServiceImpl();
ServiceReference configReference = bundleContext
.getServiceReference(ConfigurationService.class.getName());
configService = (ConfigurationService) bundleContext
.getService(configReference);
audioNotifier.setMute(
!configService
.getBoolean(
"net.java.sip.communicator.impl.sound.isSoundEnabled",
true));
logger.logEntry();
logger.info("Audio Notifier Service...[ STARTED ]");
bundleContext
.registerService(
AudioNotifierService.class.getName(),
audioNotifier,
null);
logger.info("Audio Notifier Service ...[REGISTERED]");
} finally {
logger.logExit();
}
// this service is deprecated, will leave it for now
// we suspect that even we remove it from starting
// felix starts the version it has in its cache
// try {
// AudioNotifierActivator.bundleContext = bContext;
//
// //Create the audio notifier service
// audioNotifier = new AudioNotifierServiceImpl();
//
// ServiceReference configReference = bundleContext
// .getServiceReference(ConfigurationService.class.getName());
//
// configService = (ConfigurationService) bundleContext
// .getService(configReference);
//
// audioNotifier.setMute(
// !configService
// .getBoolean(
// "net.java.sip.communicator.impl.sound.isSoundEnabled",
// true));
//
// logger.logEntry();
//
// logger.info("Audio Notifier Service...[ STARTED ]");
//
// bundleContext
// .registerService(
// AudioNotifierService.class.getName(),
// audioNotifier,
// null);
//
// logger.info("Audio Notifier Service ...[REGISTERED]");
//
// } finally {
// logger.logExit();
// }
}
/**
@ -88,19 +91,19 @@ public void start(BundleContext bContext) throws Exception
*/
public void stop(BundleContext bContext) throws Exception
{
//TODO: Stop all currently playing sounds here
try {
configService.setProperty(
"net.java.sip.communicator.impl.sound.isSoundEnabled",
Boolean.toString(!audioNotifier.isMute()));
}
catch (PropertyVetoException e1) {
logger.error("The proposed property change "
+ "represents an unacceptable value");
}
logger.info("AudioNotifier Service ...[STOPPED]");
// deprecated
// try {
// configService.setProperty(
// "net.java.sip.communicator.impl.sound.isSoundEnabled",
// Boolean.toString(!audioNotifier.isMute()));
//
// }
// catch (PropertyVetoException e1) {
// logger.error("The proposed property change "
// + "represents an unacceptable value");
// }
//
// logger.info("AudioNotifier Service ...[STOPPED]");
}
public static ResourceManagementService getResources()

Loading…
Cancel
Save