use of org.infinispan.cli.resources.CacheKeyResource in project infinispan by infinispan.
the class ContextImpl method changeResource.
@Override
public CommandResult changeResource(Class<? extends Resource> fromResource, String resourceType, String name) throws CommandException {
try {
Resource resource;
if (fromResource != null) {
resource = connection.getActiveResource().findAncestor(fromResource).getChild(resourceType, name);
} else {
resource = connection.getActiveResource().getResource(name);
}
if (!(resource instanceof CacheKeyResource)) {
connection.setActiveResource(resource);
}
refreshPrompt();
return CommandResult.SUCCESS;
} catch (IOException e) {
throw new CommandException(e);
}
}
Aggregations