+ Set<String> caches = (Set<String>)props.get("cachenames");
+ if (caches != null) {
+ logger.trace("cachenames provided below:");
+ for (String cache : caches) {
+ if (this.cacheUpdateAware.get(cache) != null) {
+ logger.error("cachename:{} on container:{} has already a listener", cache, this.containerName);
+ } else {
+ GetUpdatesContainer<?, ?> up = new GetUpdatesContainer(s, this.containerName, cache);
+ if (up != null) {
+ try {
+ this.clusterService.addListener(this.containerName,
+ cache, up);
+ this.cacheUpdateAware.put(cache, up);
+ logger.trace("cachename:{} on container:{} has " +
+ "been registered", cache,
+ this.containerName);
+ } catch (CacheListenerAddException exc) {
+ logger.debug("Cache {} didn't exist when {} tried to register to its updates", cache, s);
+ // Do nothing, the important is that
+ // we don't register the listener in
+ // the shadow, and we are not doing
+ // that.
+ }
+ }
+ }
+ }
+ }