LOG.info("RegistryContextListener has been loaded");
try {
RegistryBuilder.buildRegistry();
this.serverRegistry = GDataServerRegistry.getRegistry();
/*
* catch all exceptions and destroy the registry to release all resources.
* some components start lots of threads, the will remain running if the registry is not destroyed
*/
} catch (Throwable e) {
GDataServerRegistry.getRegistry().destroy();
LOG.error("can not register required components", e);
throw new RuntimeException("Can not register required components",
e);
}