blob: 4c439b4f05b78e85689a0d49e5c15d38088948ba [file] [log] [blame]
package samples.dependonconfiguration;
import java.util.Dictionary;
import org.osgi.service.cm.ConfigurationException;
import org.osgi.service.cm.ManagedService;
public class Task implements ManagedService {
private String m_interval;
public void execute() {
System.out.println("Scheduling task with interval " + m_interval);
}
public void updated(Dictionary properties) throws ConfigurationException {
if (properties != null) {
m_interval = (String) properties.get("interval");
if (m_interval == null) {
throw new ConfigurationException("interval", "must be specified");
}
}
}
}