Wormhole Wiki
Brought to you by:
heisedebaise
本文主要介绍如何在项目中启用Wormhole。
在JavaSE项目中,可以使用如下代码启动Wormhole:
protected WormholeContext wormholeContext;
wormholeContext = new SimpleWormholeContext();
wormholeContext.initialize();
使用如下代码停止、销毁Wormhole:
wormholeContext.destory();
对于JavaEE项目,可以使用org.lpw.wormhole.servlet.WormholeContextListener?对Wormhole缓存进行管理,此时需要wormhole-servlet-*-.jar包支持。以下为web.xml配置参考:
<listener>
<listener-class>org.lpw.wormhole.servlet.WormholeContextListener</listener-class>
</listener>