if (cmd instanceof CacheViewControlCommand) {
((CacheViewControlCommand) cmd).init(cacheViewsManager);
try {
return new SuccessfulResponse(cmd.perform(null));
} catch (Exception e) {
return new ExceptionResponse(e);
}
}
String cacheName = cmd.getCacheName();
ComponentRegistry cr = gcr.getNamedComponentRegistry(cacheName);
if (cr == null) {
if (!globalConfiguration.isStrictPeerToPeer()) {
if (trace) log.tracef("Strict peer to peer off, so silently ignoring that %s cache is not defined", cacheName);
return null;
}
log.namedCacheDoesNotExist(cacheName);
return new ExceptionResponse(new NamedCacheNotFoundException(cacheName, "Cache has not been started on node " + transport.getAddress()));
}
final Configuration localConfig = cr.getComponent(Configuration.class);
cmd.injectComponents(localConfig, cr);