reSubBucket = bucketName; // More than one subscriber, would be an error
reSubRec = rec;
getLogger().debug("Subscribing an object for reconfiguration updates "
+ rec.getClass().getName());
Bucket bucket = getBucketConfiguration(bucketName);
if(bucket == null) {
throw new ConfigurationException("Could not get bucket configuration "
+ "for: " + bucketName);
}
ReconfigurableObserver obs = new ReconfigurableObserver(rec);
BucketMonitor monitor = this.monitors.get(bucketName);
if (monitor == null) {
URI streamingURI = bucket.getStreamingURI();
monitor = new BucketMonitor(this.loadedBaseUri.resolve(streamingURI),
this.restUsr, this.restPwd, configurationParser, this);
this.monitors.put(bucketName, monitor);
monitor.addObserver(obs);
monitor.startMonitor();