Ejemplo n.º 1
0
 private void handleFatal(Throwable t) {
   // If this method has been called, all other handlers failed
   // this is all we can do
   logger.fatal(LocaleMessage.fatalException(t), t);
   MuleServer.getMuleContext().dispose();
   System.exit(-1);
 }
Ejemplo n.º 2
0
  public void onException(ErrorMessage msg) throws MuleException {
    Class eClass = null;
    ExceptionHandler eh = null;

    try {
      eClass = msg.getException().toException().getClass();
      eh = getHandler(eClass);
      eh.onException(msg);
    } catch (Exception e) {
      logger.error(e);

      if (eh instanceof DefaultHandler) {
        logger.error(LocaleMessage.defaultFatalHandling(FatalHandler.class));
        handleFatal(e);

      } else if (eh instanceof FatalHandler) {
        logger.fatal(LocaleMessage.fatalHandling(e));
        MuleServer.getMuleContext().dispose();
        System.exit(-1);
      } else {
        logger.error(LocaleMessage.defaultHandling(DefaultHandler.class, eh, e));
        handleDefault(msg, e);
      }
    }
  }
Ejemplo n.º 3
0
    public HttpWorker(Socket socket) throws IOException {
      String encoding = endpoint.getEncoding();
      if (encoding == null) {
        encoding = MuleServer.getMuleContext().getConfiguration().getDefaultEncoding();
      }

      conn = new HttpServerConnection(socket, encoding, (HttpConnector) connector);

      cookieSpec =
          MapUtils.getString(
              endpoint.getProperties(),
              HttpConnector.HTTP_COOKIE_SPEC_PROPERTY,
              ((HttpConnector) connector).getCookieSpec());
      enableCookies =
          MapUtils.getBooleanValue(
              endpoint.getProperties(),
              HttpConnector.HTTP_ENABLE_COOKIES_PROPERTY,
              ((HttpConnector) connector).isEnableCookies());

      final SocketAddress clientAddress = socket.getRemoteSocketAddress();
      if (clientAddress != null) {
        remoteClientAddress = clientAddress.toString();
      }
    }