aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/notification
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2009-08-04 16:34:22 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2009-08-04 16:34:22 +0000
commit19f509b6524fea5b253e1166841c7e0947b06573 (patch)
treed01c8de25454dfbea7f0d6ee71acc466fd6102ff /src/net/java/sip/communicator/impl/notification
parente1d01dd9a0858ea5b53b1d17a1a0451b4d25fda7 (diff)
downloadjitsi-19f509b6524fea5b253e1166841c7e0947b06573.zip
jitsi-19f509b6524fea5b253e1166841c7e0947b06573.tar.gz
jitsi-19f509b6524fea5b253e1166841c7e0947b06573.tar.bz2
- Provides an alternative storage backend to XML in the ConfigurationService implementation which uses Properties for the sake for better execution speed and garbage collection behavior.
- Implements batch configuration property modifications which allow a caller to modify a set of properties with a single saving of the configuration file.
Diffstat (limited to 'src/net/java/sip/communicator/impl/notification')
-rw-r--r--src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java b/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java
index 5d25742..7ffdb7b 100644
--- a/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/notification/NotificationServiceImpl.java
@@ -491,7 +491,6 @@ public class NotificationServiceImpl
configService.setProperty(
eventTypeNodeName + ".active",
Boolean.toString(isActive));
-
return;
}
@@ -510,6 +509,8 @@ public class NotificationServiceImpl
actionTypeNodeName = actionTypeRootPropName;
}
+ Map<String, Object> configProperties = new HashMap<String, Object>();
+
// If we didn't find the given actionType in the configuration we save
// it here.
if(actionTypeNodeName == null)
@@ -518,7 +519,7 @@ public class NotificationServiceImpl
+ ".actionType"
+ Long.toString(System.currentTimeMillis());
- configService.setProperty(actionTypeNodeName, actionType);
+ configProperties.put(actionTypeNodeName, actionType);
}
if(actionHandler instanceof SoundNotificationHandler)
@@ -526,19 +527,19 @@ public class NotificationServiceImpl
SoundNotificationHandler soundHandler
= (SoundNotificationHandler) actionHandler;
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".soundFileDescriptor",
soundHandler.getDescriptor());
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".loopInterval",
soundHandler.getLoopInterval());
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".enabled",
Boolean.toString(isActive));
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".default",
Boolean.toString(isDefault));
}
@@ -547,15 +548,15 @@ public class NotificationServiceImpl
PopupMessageNotificationHandler messageHandler
= (PopupMessageNotificationHandler) actionHandler;
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".defaultMessage",
messageHandler.getDefaultMessage());
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".enabled",
Boolean.toString(isActive));
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".default",
Boolean.toString(isDefault));
}
@@ -564,15 +565,15 @@ public class NotificationServiceImpl
LogMessageNotificationHandler logMessageHandler
= (LogMessageNotificationHandler) actionHandler;
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".logType",
logMessageHandler.getLogType());
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".enabled",
Boolean.toString(isActive));
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".default",
Boolean.toString(isDefault));
}
@@ -581,18 +582,21 @@ public class NotificationServiceImpl
CommandNotificationHandler commandHandler
= (CommandNotificationHandler) actionHandler;
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".commandDescriptor",
commandHandler.getDescriptor());
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".enabled",
Boolean.toString(isActive));
- configService.setProperty(
+ configProperties.put(
actionTypeNodeName + ".default",
Boolean.toString(isDefault));
}
+
+ if (configProperties.size() > 0)
+ configService.setProperties(configProperties);
}
/**