Cache<?, ?> cache = cr.getComponent(Cache.class);
CommandInitializer initializer = cr.getComponent(CommandInitializer.class);
EmbeddedCacheManager cacheManager = cr.getGlobalComponentRegistry().getComponent(EmbeddedCacheManager.class);
initializer.setCache(cache, cacheManager);
QueryBox queryBox = new QueryBox();
queryBox.setCache(cache.getAdvancedCache());
cr.registerComponent(queryBox, QueryBox.class);
// Register query mbeans
registerQueryMBeans(cache.getAdvancedCache(), cr, cacheName);
}