Package org.fudgemsg.wire

Examples of org.fudgemsg.wire.FudgeMsgReader


      MediaType mediaType,
      MultivaluedMap<String, String> httpHeaders,
      InputStream entityStream) throws IOException, WebApplicationException {
   
    InputStreamReader entityReader = new InputStreamReader(entityStream, Charsets.UTF_8);
    @SuppressWarnings("resource"// wraps stream that cannot be closed here
    FudgeMsgReader reader = new FudgeMsgReader(new FudgeJSONStreamReader(getFudgeContext(), entityReader));
    FudgeMsg message = reader.nextMessage();
    if (message == null) {
      return null;
    }
    FudgeDeserializer deser = new FudgeDeserializer(getFudgeContext());
    return deser.fudgeMsgToObject(type, message);
View Full Code Here


      Annotation[] annotations,
      MediaType mediaType,
      MultivaluedMap<String, String> httpHeaders,
      InputStream entityStream) throws IOException, WebApplicationException {
   
    @SuppressWarnings("resource")
    FudgeMsgReader reader = new FudgeMsgReader(new FudgeDataInputStreamReader(getFudgeContext(), entityStream));
    FudgeMsg message = reader.nextMessage();
    if (message == null) {
      return null;
    }
    FudgeDeserializer deser = new FudgeDeserializer(getFudgeContext());
    return deser.fudgeMsgToObject(type, message);
View Full Code Here

    _receiver = receiver;
  }

  @Override
  protected void socketOpened(Socket socket, BufferedOutputStream os, BufferedInputStream is) {
    final FudgeMsgReader reader = _fudgeContext.createMessageReader(is);
    _writer.setFudgeMsgWriter(_fudgeContext, os);
    _receiverJob = new TerminatableJob() {

      @Override
      protected void runOneCycle() {
        final FudgeMsgEnvelope envelope;
        try {
          envelope = reader.nextMessageEnvelope();
        } catch (FudgeRuntimeIOException e) {
          if (exceptionForcedByClose(e.getCause())) {
            s_logger.info("Connection terminated");
          } else {
            s_logger.warn("I/O exception during recv - {} - stopping socket to flush error", e.getCause());
View Full Code Here

TOP

Related Classes of org.fudgemsg.wire.FudgeMsgReader

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.