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


Java Operation.ProtocolRequest方法代码示例

本文整理汇总了Java中edu.uw.zookeeper.protocol.Operation.ProtocolRequest方法的典型用法代码示例。如果您正苦于以下问题:Java Operation.ProtocolRequest方法的具体用法?Java Operation.ProtocolRequest怎么用?Java Operation.ProtocolRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在edu.uw.zookeeper.protocol.Operation的用法示例。


在下文中一共展示了Operation.ProtocolRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static OperationEvent create(
        long sessionId, 
        Operation.ProtocolRequest<?> request, 
        long requestNanos,
        Operation.ProtocolResponse<?> response,
        long responseNanos) {
    return new OperationEvent(sessionId, request, requestNanos, response, responseNanos);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-clients,代码行数:9,代码来源:OperationEvent.java

示例2: OperationEvent

import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public OperationEvent(
        long sessionId, 
        Operation.ProtocolRequest<?> request, 
        long requestNanos,
        Operation.ProtocolResponse<?> response,
        long responseNanos) {
    super();
    this.sessionId = sessionId;
    this.request = request;
    this.requestNanos = requestNanos;
    this.response = response;
    this.responseNanos = responseNanos;
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-clients,代码行数:14,代码来源:OperationEvent.java

示例3: timeout

import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public static OperationEvent timeout(
        long sessionId, Operation.ProtocolRequest<?> request) {
    return new OperationEvent(sessionId, request, TIMEOUT, null, TIMEOUT);
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-clients,代码行数:5,代码来源:OperationEvent.java

示例4: getRequest

import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public Operation.ProtocolRequest<?> getRequest() {
    return request;
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-clients,代码行数:4,代码来源:OperationEvent.java

示例5: deserializeValue

import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
@Override
protected OperationEvent deserializeValue(JsonParser json,
        DeserializationContext ctxt) throws IOException,
        JsonProcessingException {            
    JsonToken token = json.getCurrentToken();
    if (token == null) {
        token = json.nextToken();
        if (token == null) {
            return null;
        }
    }
    if (token != JsonToken.VALUE_NUMBER_INT) {
        throw ctxt.wrongTokenException(json, JsonToken.VALUE_NUMBER_INT, "");
    }
    long sessionId = json.getLongValue();
    json.clearCurrentToken();
    Operation.ProtocolRequest<?> request = (token == JsonToken.VALUE_NULL) ? null : (Operation.ProtocolRequest<?>) ctxt.findContextualValueDeserializer(ctxt.constructType(Operation.ProtocolRequest.class), null).deserialize(json, ctxt);
    token = json.getCurrentToken();
    if (token == null) {
        token = json.nextToken();
    }
    long requestNanos;
    if (request != null) {
        if (token != JsonToken.VALUE_NUMBER_INT) {
            throw ctxt.wrongTokenException(json, JsonToken.VALUE_NUMBER_INT, "");
        }
        requestNanos = json.getLongValue();
        token = json.nextToken();
    } else {
        requestNanos = TIMEOUT;
    }
    Operation.ProtocolResponse<?> response = (token == JsonToken.VALUE_NULL) ? null : (Operation.ProtocolResponse<?>) ctxt.findContextualValueDeserializer(ctxt.constructType(Operation.ProtocolResponse.class), null).deserialize(json, ctxt);
    if (json.hasCurrentToken()) {
        json.clearCurrentToken();
    }
    long responseNanos;
    if (response != null) {
        if (token != JsonToken.VALUE_NUMBER_INT) {
            throw ctxt.wrongTokenException(json, JsonToken.VALUE_NUMBER_INT, "");
        }
        responseNanos = json.getLongValue();
        token = json.nextToken();
    } else {
        responseNanos = TIMEOUT;
    }
    OperationEvent value = new OperationEvent(sessionId, request, requestNanos, response, responseNanos);
    return value;
}
 
开发者ID:lisaglendenning,项目名称:zookeeper-clients,代码行数:49,代码来源:OperationEvent.java


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