Search in sources :

Example 1 with SpringComponentLifecycleManager

use of com.ctrip.xpipe.lifecycle.SpringComponentLifecycleManager in project x-pipe by ctripcorp.

the class MetaServerPrepareResourcesAndStart method setupResouces.

private ApplicationContext setupResouces(DcMeta dcMeta) throws Exception {
    ApplicationContext applicationContext = SpringComponentLifecycleManager.getApplicationContext();
    logger.info("[setupResouces][set zkConnectionString]");
    ZkClient zkClient = applicationContext.getBean(ZkClient.class);
    zkClient.setZkAddress(zkAddress);
    logger.info("[setupResouces][start MetaServerLifecycleManager]");
    SpringComponentLifecycleManager metaServerLifecycleManager = applicationContext.getBean(SpringComponentLifecycleManager.class);
    metaServerLifecycleManager.startAll();
    return applicationContext;
}
Also used : ZkClient(com.ctrip.xpipe.zk.ZkClient) ApplicationContext(org.springframework.context.ApplicationContext) SpringComponentLifecycleManager(com.ctrip.xpipe.lifecycle.SpringComponentLifecycleManager)

Aggregations

SpringComponentLifecycleManager (com.ctrip.xpipe.lifecycle.SpringComponentLifecycleManager)1 ZkClient (com.ctrip.xpipe.zk.ZkClient)1 ApplicationContext (org.springframework.context.ApplicationContext)1