本文整理汇总了Java中org.apache.zookeeper.KeeperException.SessionMovedException方法的典型用法代码示例。如果您正苦于以下问题:Java KeeperException.SessionMovedException方法的具体用法?Java KeeperException.SessionMovedException怎么用?Java KeeperException.SessionMovedException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.zookeeper.KeeperException
的用法示例。
在下文中一共展示了KeeperException.SessionMovedException方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSession
import org.apache.zookeeper.KeeperException; //导入方法依赖的package包/类
public synchronized void checkSession(long sessionId, Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException,
KeeperException.UnknownSessionException {
LOG.debug("Checking session 0x" + Long.toHexString(sessionId));
SessionImpl session = sessionsById.get(sessionId);
if (session == null) {
throw new KeeperException.UnknownSessionException();
}
if (session.isClosing()) {
throw new KeeperException.SessionExpiredException();
}
if (session.owner == null) {
session.owner = owner;
} else if (session.owner != owner) {
throw new KeeperException.SessionMovedException();
}
}
示例2: checkSession
import org.apache.zookeeper.KeeperException; //导入方法依赖的package包/类
synchronized public void checkSession(long sessionId, Object owner) throws KeeperException.SessionExpiredException, KeeperException.SessionMovedException {
SessionImpl session = sessionsById.get(sessionId);
if (session == null || session.isClosing()) {
throw new KeeperException.SessionExpiredException();
}
if (session.owner == null) {
session.owner = owner;
} else if (session.owner != owner) {
throw new KeeperException.SessionMovedException();
}
}
示例3: checkGlobalSession
import org.apache.zookeeper.KeeperException; //导入方法依赖的package包/类
public void checkGlobalSession(long sessionId, Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException {
try {
checkSession(sessionId, owner);
} catch (KeeperException.UnknownSessionException e) {
throw new KeeperException.SessionExpiredException();
}
}
示例4: checkGlobalSession
import org.apache.zookeeper.KeeperException; //导入方法依赖的package包/类
public void checkGlobalSession(long sessionId, Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException {
throw new UnsupportedOperationException();
}
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:6,代码来源:UpgradeableSessionTracker.java
示例5: checkSession
import org.apache.zookeeper.KeeperException; //导入方法依赖的package包/类
/**
* Checks whether the SessionTracker is aware of this session, the session
* is still active, and the owner matches. If the owner wasn't previously
* set, this sets the owner of the session.
*
* UnknownSessionException should never been thrown to the client. It is
* only used internally to deal with possible local session from other
* machine
*
* @param sessionId
* @param owner
*/
public void checkSession(long sessionId, Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException,
KeeperException.UnknownSessionException;
示例6: checkGlobalSession
import org.apache.zookeeper.KeeperException; //导入方法依赖的package包/类
/**
* Strictly check that a given session is a global session or not
* @param sessionId
* @param owner
* @throws KeeperException.SessionExpiredException
* @throws KeeperException.SessionMovedException
*/
public void checkGlobalSession(long sessionId, Object owner)
throws KeeperException.SessionExpiredException,
KeeperException.SessionMovedException;