Package org.rzo.netty.ahessian.rpc.message

Examples of org.rzo.netty.ahessian.rpc.message.HessianRPCReplyMessage


  }

  public void invalidateAllPendingCalls()
  {

    final HessianRPCReplyMessage message = new HessianRPCReplyMessage(null, new RuntimeException("connection closed"), null);
    for (Future future : new ArrayList<Future>(_openCalls.values()))
    {
      ((HessianProxyFuture) future).set(message);
    }
    _openCalls.clear();
View Full Code Here


      }
     
      private Future immediateFuture(Object result)
      {
        HessianProxyFuture future = new HessianProxyFuture();
        future.set(new HessianRPCReplyMessage(result, null, null));
        return future;
      }
View Full Code Here

  {
    _lock.lock();
    _timeout = null;
    try
    {
      this.set(new HessianRPCReplyMessage(null, new TimeoutException(),null));
    }
    finally
    {
      _lock.unlock();
    }
View Full Code Here

  @Override
  public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception
  {
    if (e.getMessage() instanceof HessianRPCReplyMessage)
    {
      final HessianRPCReplyMessage message = (HessianRPCReplyMessage) e.getMessage();
      {
        final Long id = message.getCallId();
        if (id != null)
        {
          final HessianProxyFuture future = (HessianProxyFuture) _openCalls.get(id);
          if (future == null)
          {
            ahessianLogger.warn("no future found for call-id " + id);
            return;
          }
          if (message.getCompleted() == null || Boolean.TRUE.equals(message.getCompleted()))
            if ((!future.hasCallbacks()))
            {
              _openCalls.remove(id);
            }
          if (_doneListener != null && _openCalls.isEmpty())
            _doneListener.run();
          if (future != null)
            // setting message in future may fire listeners -> run
            // in separate thread
            _executor.execute(new Runnable()
            {
              public void run()
              {
                future.set(message);
                // check in case this was a callback
                if (future.isDone())
                  if (!future.hasCallbacks())
                  {
                    _openCalls.remove(id);

                  }
              }
            });
          else
            ahessianLogger.warn("no future for call reply " + id + " " + message.getValue());
        }
        else
          ahessianLogger.warn("message missing id " + message);

      }
View Full Code Here

    catch (Throwable ex)
    {
      Constants.ahessianLogger.warn("", ex);
      fault = ex;
    }
    HessianRPCReplyMessage reply = new HessianRPCReplyMessage(result, fault, message);
    reply.setCompleted(true);
    reply.setCallId((Long) message.getHeaders().get(CALL_ID_HEADER_KEY));
    reply.setGroup((Integer) message.getHeaders().get(GROUP_HEADER_KEY));
    writeResult(reply);
  }
View Full Code Here

  private void sendReply(Object result, Object fault)
  {
    if (_completed)
      _headers.put(COMPLETED_HEADER_KEY, Boolean.TRUE);
    //TODO set reply headers
    _service.writeResult(new HessianRPCReplyMessage(result, fault, _message));
  }
View Full Code Here

          {
            ServiceSessionProvider.remove();
            Constants.ahessianLogger.warn("", ex);
            fault = ex;
          }
          HessianRPCReplyMessage reply = new HessianRPCReplyMessage(result, fault, message);
          reply.setCompleted(true);
          reply.setCallId((Long) message.getHeaders().get(CALL_ID_HEADER_KEY));
          reply.setGroup((Integer) message.getHeaders().get(GROUP_HEADER_KEY));

          writeResult(reply);         
        }
        
       });
View Full Code Here

TOP

Related Classes of org.rzo.netty.ahessian.rpc.message.HessianRPCReplyMessage

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.