use of org.apache.servicecomb.foundation.protobuf.ProtoMapper in project java-chassis by ServiceComb.
the class OperationProtobuf method initRequestCodec.
private void initRequestCodec(ScopedProtobufSchemaManager scopedProtobufSchemaManager, Invocation invocation) {
ProtoMapper mapper = scopedProtobufSchemaManager.getOrCreateProtoMapper(invocation.getSchemaMeta());
Message requestMessage = mapper.getRequestMessage(invocation.getOperationMeta().getOperationId());
if (!invocation.isConsumer()) {
initProducerRequestCodec(invocation, requestMessage, mapper);
} else {
initConsumerRequestCodec(invocation, requestMessage, mapper);
}
}
use of org.apache.servicecomb.foundation.protobuf.ProtoMapper in project incubator-servicecomb-java-chassis by apache.
the class OperationProtobuf method initRequestCodec.
private void initRequestCodec(ScopedProtobufSchemaManager scopedProtobufSchemaManager, Invocation invocation) {
ProtoMapper mapper = scopedProtobufSchemaManager.getOrCreateProtoMapper(invocation.getSchemaMeta());
Message requestMessage = mapper.getRequestMessage(invocation.getOperationMeta().getOperationId());
if (!invocation.isConsumer()) {
initProducerRequestCodec(invocation, requestMessage, mapper);
} else {
initConsumerRequestCodec(invocation, requestMessage, mapper);
}
}
use of org.apache.servicecomb.foundation.protobuf.ProtoMapper in project java-chassis by ServiceComb.
the class OperationProtobuf method initResponseCodec.
private void initResponseCodec(ScopedProtobufSchemaManager scopedProtobufSchemaManager, Invocation invocation) {
ProtoMapper mapper = scopedProtobufSchemaManager.getOrCreateProtoMapper(invocation.getSchemaMeta());
Message responseMessage = mapper.getResponseMessage(invocation.getOperationMeta().getOperationId());
JavaType responseType = invocation.findResponseType(Status.OK.getStatusCode());
if (!invocation.isConsumer()) {
initProviderResponseCode(responseMessage, mapper, responseType);
} else {
initConsumerResponseCode(responseMessage, mapper, responseType);
}
anyResponseRootSerializer = new ResponseRootSerializer(mapper.createRootSerializer(ProtoConst.ANY, Object.class), false, true);
anyResponseRootDeserializer = new ResponseRootDeserializer<>(mapper.createRootDeserializer(ProtoConst.ANY, Object.class), false);
}
use of org.apache.servicecomb.foundation.protobuf.ProtoMapper in project incubator-servicecomb-java-chassis by apache.
the class OperationProtobuf method initResponseCodec.
private void initResponseCodec(ScopedProtobufSchemaManager scopedProtobufSchemaManager, Invocation invocation) {
ProtoMapper mapper = scopedProtobufSchemaManager.getOrCreateProtoMapper(invocation.getSchemaMeta());
Message responseMessage = mapper.getResponseMessage(invocation.getOperationMeta().getOperationId());
JavaType responseType = invocation.findResponseType(Status.OK.getStatusCode());
if (!invocation.isConsumer()) {
initProviderResponseCode(responseMessage, mapper, responseType);
} else {
initConsumerResponseCode(responseMessage, mapper, responseType);
}
anyResponseRootSerializer = new ResponseRootSerializer(mapper.createRootSerializer(ProtoConst.ANY, Object.class), false, true);
anyResponseRootDeserializer = new ResponseRootDeserializer<>(mapper.createRootDeserializer(ProtoConst.ANY, Object.class), false);
}
Aggregations