public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<CacheManagerComponent> ctx) {
boolean trace = log.isTraceEnabled();
if (trace) log.trace("Discover resources with context");
Set<DiscoveredResourceDetails> discoveredResources = new HashSet<DiscoveredResourceDetails>();
EmsConnection conn = ctx.getParentResourceComponent().getEmsConnection();
if (trace) log.trace("Connection to ems server established");
String pattern = getAllCachesPattern(ctx.getParentResourceContext().getResourceKey());
if (trace) log.tracef("Pattern to query is %s", pattern);
ObjectNameQueryUtility queryUtility = new ObjectNameQueryUtility(pattern);
List<EmsBean> beans = conn.queryBeans(queryUtility.getTranslatedQuery());
if (trace) log.tracef("Querying [%s] returned beans: %s", queryUtility.getTranslatedQuery(), beans);
for (EmsBean bean : beans) {
/* A discovered resource must have a unique key, that must
* stay the same when the resource is discovered the next