public synchronized void updated(String pid, Dictionary dict) throws ConfigurationException {
String name = (String) dict.get(KEY_LOG_NAME);
if ((name == null) || "".equals(name)) {
throw new ConfigurationException(KEY_LOG_NAME, "Log name has to be specified.");
}
Mode mode = Mode.PUSH;
String modeValue = (String) dict.get(KEY_MODE);
if ("pull".equals(modeValue)) {
mode = Mode.PULL;
}
else if ("pushpull".equals(modeValue)) {
mode = Mode.PUSHPULL;
}
Component oldComponent, newComponent;
Properties props = new Properties();
props.put(KEY_LOG_NAME, name);
props.put("taskName", LogSyncTask.class.getName());
props.put("description", "Syncs log (name=" + name + ", mode=" + mode.toString() + ") with a server.");
String filter = "(&(" + Constants.OBJECTCLASS + "=" + LogStore.class.getName() + ")(name=" + name + "))";
LogSyncTask service = new LogSyncTask(name, name, mode);
newComponent = m_manager.createComponent()
.setInterface(new String[] { Runnable.class.getName(), LogSync.class.getName() }, props)
.setImplementation(service)