@Sharable private class ShutdownHandler extends SimpleChannelInboundHandler<String> { private final ExecutorService service = Executors.newCachedThreadPool(); @Override protected void channelRead0(final ChannelHandlerContext ctx, final String msg) throws Exception { if (shouldShutdown(msg)) { shutdownListener.onShutdown(); shutdownMonitorSelf(); } } private void shutdownMonitorSelf() { service.execute(new Runnable() { @Override public void run() { stop(); } }); } private boolean shouldShutdown(final String message) { try { return shutdownKey.equals(wrap(message).readFirstLine()); } catch (IOException e) { throw new MocoException(e); } } } }
@Sharable public final class MocoSocketHandler extends SimpleChannelInboundHandler<ByteBuf> { private final ImmutableList<Setting<SocketResponseSetting>> settings;
@Sharable public final class MocoHandler extends SimpleChannelInboundHandler<FullHttpRequest> { private static final int DEFAULT_STATUS = HttpResponseStatus.OK.code();
@Sharable public final class DropWizardMetricsHandler extends ChannelInboundHandlerAdapter { private MetricRegistry metrics;
@Sharable private class ShutdownHandler extends SimpleChannelInboundHandler<String> { private final ExecutorService service = Executors.newCachedThreadPool(); @Override protected void channelRead0(final ChannelHandlerContext ctx, final String msg) throws Exception { if (shouldShutdown(msg)) { shutdownListener.onShutdown(); shutdownMonitorSelf(); } } private void shutdownMonitorSelf() { service.execute(new Runnable() { @Override public void run() { stop(); } }); } private boolean shouldShutdown(final String message) { try { return shutdownKey.equals(wrap(message).readFirstLine()); } catch (IOException e) { throw new MocoException(e); } } } }
@Sharable public final class DropWizardMetricsHandler extends ChannelInboundHandlerAdapter { private MetricRegistry metrics;
@Sharable public class HttpStaticFileServerHandler extends SimpleChannelInboundHandler<FullHttpRequest> {
@Sharable public class BridgeRuntime extends HttpStaticFileServerHandler {
@Sharable public class BridgeRuntime extends HttpStaticFileServerHandler {