本文整理汇总了Java中org.apache.zookeeper.server.util.PortForwarder类的典型用法代码示例。如果您正苦于以下问题:Java PortForwarder类的具体用法?Java PortForwarder怎么用?Java PortForwarder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PortForwarder类属于org.apache.zookeeper.server.util包,在下文中一共展示了PortForwarder类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startForwarding
import org.apache.zookeeper.server.util.PortForwarder; //导入依赖的package包/类
/**
* @return
* @throws IOException
*/
private List<PortForwarder> startForwarding() throws IOException {
List<PortForwarder> res = new ArrayList<PortForwarder>();
res.add(new PortForwarder(8301, 7301));
res.add(new PortForwarder(8401, 7401));
res.add(new PortForwarder(7302, 8302));
res.add(new PortForwarder(7402, 8402));
res.add(new PortForwarder(7303, 8303));
res.add(new PortForwarder(7403, 8403));
return res;
}
示例2: stopForwarding
import org.apache.zookeeper.server.util.PortForwarder; //导入依赖的package包/类
/**
* @param pfs
* @throws Exception
*/
private void stopForwarding(List<PortForwarder> pfs) throws Exception {
for (PortForwarder pf : pfs) {
pf.shutdown();
}
}