Package ch.softappeal.yass.core.remote

Examples of ch.softappeal.yass.core.remote.Request


  @SuppressWarnings("unchecked")
  @Override public Message read(final Reader reader) throws Exception {
    final byte type = reader.readByte();
    if (type == REQUEST) {
      return new Request(
        contractSerializer.read(reader),
        contractSerializer.read(reader),
        toArray((List)contractSerializer.read(reader))
      );
    }
View Full Code Here


  private static final List<?> NO_ARGUMENTS = Collections.emptyList();

  @Override public void write(final Object message, final Writer writer) throws Exception {
    if (message instanceof Request) {
      writer.writeByte(REQUEST);
      final Request request = (Request)message;
      contractSerializer.write(request.serviceId, writer);
      contractSerializer.write(request.methodId, writer);
      contractSerializer.write((request.arguments == null) ? NO_ARGUMENTS : Arrays.asList(request.arguments), writer);
    } else if (message instanceof ValueReply) {
      writer.writeByte(VALUE_REPLY);
View Full Code Here

  @SuppressWarnings({"unchecked", "IfMayBeConditional"})
  @Override public Message read(final Reader reader) throws Exception {
    final byte type = reader.readByte();
    if (type == REQUEST) {
      //noinspection rawtypes
      return new Request(
        serializer.read(reader),
        serializer.read(reader),
        toArray((List)serializer.read(reader))
      );
    } else if (type == VALUE_REPLY) {
View Full Code Here

  @Override public void write(final Object message, final Writer writer) throws Exception {
    //noinspection ChainOfInstanceofChecks
    if (message instanceof Request) {
      writer.writeByte(REQUEST);
      final Request request = (Request)message;
      serializer.write(request.serviceId, writer);
      serializer.write(request.methodId, writer);
      serializer.write((request.arguments == null) ? NO_ARGUMENTS : Arrays.asList(request.arguments), writer);
    } else if (message instanceof ValueReply) {
      writer.writeByte(VALUE_REPLY);
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override public Message read(final Reader reader) throws Exception {
    final byte type = reader.readByte();
    if (type == REQUEST) {
      return new Request(
        serializer.read(reader),
        serializer.read(reader),
        toArray((List)serializer.read(reader))
      );
    }
View Full Code Here

  private static final List<?> NO_ARGUMENTS = Collections.emptyList();

  @Override public void write(final Object message, final Writer writer) throws Exception {
    if (message instanceof Request) {
      writer.writeByte(REQUEST);
      final Request request = (Request)message;
      serializer.write(request.serviceId, writer);
      serializer.write(request.methodId, writer);
      serializer.write((request.arguments == null) ? NO_ARGUMENTS : Arrays.asList(request.arguments), writer);
    } else if (message instanceof ValueReply) {
      writer.writeByte(VALUE_REPLY);
View Full Code Here

  @SuppressWarnings({"unchecked", "IfMayBeConditional"})
  @Override public Message read(final Reader reader) throws Exception {
    final byte type = reader.readByte();
    if (type == REQUEST) {
      //noinspection rawtypes
      return new Request(
        serializer.read(reader),
        serializer.read(reader),
        serializer.read(reader),
        toArray((List)serializer.read(reader))
      );
View Full Code Here

  @Override public void write(final Object message, final Writer writer) throws Exception {
    //noinspection ChainOfInstanceofChecks
    if (message instanceof Request) {
      writer.writeByte(REQUEST);
      final Request request = (Request)message;
      serializer.write(request.context, writer);
      serializer.write(request.serviceId, writer);
      serializer.write(request.methodId, writer);
      serializer.write((request.arguments == null) ? NO_ARGUMENTS : Arrays.asList(request.arguments), writer);
    } else if (message instanceof ValueReply) {
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override public Message read(final Reader reader) throws Exception {
    final byte type = reader.readByte();
    if (type == REQUEST) {
      return new Request(
        contractSerializer.read(reader),
        contractSerializer.read(reader),
        toArray((List<Object>)contractSerializer.read(reader))
      );
    }
View Full Code Here

  private static final List<?> NO_ARGUMENTS = Collections.emptyList();

  @Override public void write(final Object message, final Writer writer) throws Exception {
    if (message instanceof Request) {
      writer.writeByte(REQUEST);
      final Request request = (Request)message;
      contractSerializer.write(request.serviceId, writer);
      contractSerializer.write(request.methodId, writer);
      contractSerializer.write((request.arguments == null) ? NO_ARGUMENTS : Arrays.asList(request.arguments), writer);
    } else if (message instanceof ValueReply) {
      writer.writeByte(VALUE_REPLY);
View Full Code Here

TOP

Related Classes of ch.softappeal.yass.core.remote.Request

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.