Examples of NettyHttpResponse


Examples of org.serviceconnector.net.res.netty.NettyHttpResponse

  private static final Logger LOGGER = Logger.getLogger(NettyHttpResponderRequestHandler.class);

  /** {@inheritDoc} */
  @Override
  public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throws Exception {
    NettyHttpResponse response = new NettyHttpResponse(event.getChannel());
    HttpRequest httpRequest = (HttpRequest) event.getMessage();
    Channel channel = ctx.getChannel();
    InetSocketAddress localSocketAddress = (InetSocketAddress) channel.getLocalAddress();
    InetSocketAddress remoteSocketAddress = (InetSocketAddress) channel.getRemoteAddress();
    IRequest request = new NettyHttpRequest(httpRequest, localSocketAddress, remoteSocketAddress);
View Full Code Here

Examples of org.serviceconnector.net.res.netty.NettyHttpResponse

  /** {@inheritDoc} */
  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
    Throwable th = e.getCause();
    NettyHttpResponse response = new NettyHttpResponse(e.getChannel());
    if (th instanceof ClosedChannelException) {
      // never reply in case of channel closed exception
      return;
    }
    if (th instanceof java.io.IOException) {
      LOGGER.warn(th); // regular disconnect causes this expected exception
      return;
    } else {
      LOGGER.error("Responder error", th);
    }
    if (th instanceof HasFaultResponseException) {
      ((HasFaultResponseException) e).setFaultResponse(response);
      response.write();
      return;
    }
    SCMPMessageFault fault = new SCMPMessageFault(SCMPError.SC_ERROR, th.getMessage());
    fault.setMessageType(SCMPMsgType.UNDEFINED);
    response.setSCMP(fault);
    response.write();
  }
View Full Code Here

Examples of org.serviceconnector.net.res.netty.NettyHttpResponse

  private static final Logger LOGGER = Logger.getLogger(NettyHttpResponderRequestHandler.class);

  /** {@inheritDoc} */
  @Override
  public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throws Exception {
    NettyHttpResponse response = new NettyHttpResponse(event.getChannel());
    HttpRequest httpRequest = (HttpRequest) event.getMessage();
    Channel channel = ctx.getChannel();
    InetSocketAddress localSocketAddress = (InetSocketAddress) channel.getLocalAddress();
    InetSocketAddress remoteSocketAddress = (InetSocketAddress) channel.getRemoteAddress();
    IRequest request = new NettyHttpRequest(httpRequest, localSocketAddress, remoteSocketAddress);
View Full Code Here

Examples of org.serviceconnector.net.res.netty.NettyHttpResponse

  /** {@inheritDoc} */
  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
    Throwable th = e.getCause();
    NettyHttpResponse response = new NettyHttpResponse(e.getChannel());
    if (th instanceof ClosedChannelException) {
      // never reply in case of channel closed exception
      return;
    }
    if (th instanceof java.io.IOException) {
      LOGGER.info(th); // regular disconnect causes this expected exception
      return;
    } else {
      LOGGER.error("Responder error", th);
    }
    if (th instanceof HasFaultResponseException) {
      ((HasFaultResponseException) e).setFaultResponse(response);
      response.write();
      return;
    }
    SCMPMessageFault fault = new SCMPMessageFault(SCMPVersion.LOWEST, SCMPError.SC_ERROR, th.getMessage());
    fault.setMessageType(SCMPMsgType.UNDEFINED);
    response.setSCMP(fault);
    response.write();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.