Example #1
0
 private void connectionException(Client client, Object attachment, Throwable e) {
   logger.info("exception while connecting to " + client, e);
   if (attachment == null) {
     return;
   }
   Object[] msg = (Object[]) attachment;
   if (msg[0] instanceof InvokerContext) {
     InvokerContext invokerContext = (InvokerContext) msg[0];
     InvocationRequest request = invokerContext.getRequest();
     if (request.getMessageType() == Constants.MESSAGE_TYPE_SERVICE && msg[1] != null) {
       try {
         Callback callback = (Callback) msg[1];
         if (client != null) {
           client.write(request, callback);
         } else {
           logger.error("no client found with service:" + request.getServiceName());
         }
       } catch (Throwable ex) {
         logger.error("", ex);
       }
       logger.error("", e);
     }
   }
 }
 private String getRequestUrl(InvocationRequest request) {
   return request.getServiceName() + "#" + request.getMethodName();
 }