当前位置: 首页>>代码示例>>Java>>正文


Java KeeperException.SessionMovedException方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:22,代码来源:SessionTrackerImpl.java

示例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();
    }
}
 
开发者ID:maoling,项目名称:fuck_zookeeper,代码行数:12,代码来源:SessionTrackerImpl.java

示例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();
    }
}
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:10,代码来源:SessionTrackerImpl.java

示例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;
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:17,代码来源:SessionTracker.java

示例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;
 
开发者ID:didichuxing2,项目名称:https-github.com-apache-zookeeper,代码行数:11,代码来源:SessionTracker.java


注:本文中的org.apache.zookeeper.KeeperException.SessionMovedException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。