本文整理汇总了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);
}
示例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;
}
示例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);
}
示例4: getRequest
import edu.uw.zookeeper.protocol.Operation; //导入方法依赖的package包/类
public Operation.ProtocolRequest<?> getRequest() {
return request;
}
示例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;
}