加个监听器:
代码语言:javascript复制DubboProtocol.getDubboProtocol().destroy();
代码语言:javascript复制/
服务监听器
@author marker
Created by marker on 2016/12/27.
/
public class DubboServiceListener implements ServletContextListener {
/ 日志记录 */
private Logger logger = LoggerFactory.getLogger(DubboServiceListener.class);
@Override
public void contextInitialized(ServletContextEvent sce) {
System.out.println("初始化");
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
logger.info("销毁dubbo实例中....");
DubboRegistryFactory.destroyAll();
DubboProtocol.getDubboProtocol().destroy();
logger.info("销毁dubbo服务完成!");
}
}