@SuppressWarnings("resource")
FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(path);
context.registerShutdownHook();
Cache cache = context.getBean(Cache.class);
ManagementService ms = ManagementService.getExistingManagementService(cache);
CacheServerMXBean cacheServerManager = ms.getLocalCacheServerMXBean(port);
if (!cacheServerManager.isRunning()) {
System.out.println("failed to start cache server ");
System.exit(1);
}
System.out.println("cache server running");
}