Examples of LoggingFilter


Examples of org.glassfish.jersey.filter.LoggingFilter

    @Override
    public Set<Object> getSingletons() {
        final HashSet<Object> instances = new HashSet<Object>();

        instances.add(new LoggingFilter(Logger.getLogger(AsyncJaxrsApplication.class.getName()), true));

        return instances;
    }
View Full Code Here

Examples of org.rzo.yajsw.nettyutils.LoggingFilter

  public ChannelPipeline getPipeline() throws Exception
  {

    ChannelPipeline pipeline = pipeline(); // Note the static import.
    if (_debug)
      pipeline.addLast("logging1", new LoggingFilter(_controller.getLog(), "controller"));

    // allow new connections only if state != LOGGED_ON
    pipeline.addLast("checkWaiting", new ConditionFilter(new Condition()
    {
      public boolean isOk(ChannelHandlerContext ctx, ChannelEvent e)
      {
        boolean result = true;
        int currentState = _controller.getState();
        if (currentState == JVMController.STATE_LOGGED_ON)
        {
          _controller.getLog().info("app already logged on -> rejecting new connedction");
          result = false;
        }
        return result;
      }
    }));

    // create a firewall allowing only localhosts to connect
    WhitelistFilter firewall = new WhitelistFilter();
    try
    {
      firewall.allowAll(InetAddress.getAllByName("127.0.0.1"));
      firewall.allow(InetAddress.getLocalHost());
      pipeline.addLast("firewall", firewall);
    }
    catch (UnknownHostException e)
    {
      _controller.getLog().throwing(JVMController.class.getName(), "start", e);
    }

    // add a framer to split incoming bytes to message chunks
    pipeline.addLast("framer", new DelimiterBasedFrameDecoder(8192, true, Delimiters.nulDelimiter()));

    // add messge codec
    pipeline.addLast("messageEncoder", new MessageEncoder());
    pipeline.addLast("messageDecoder", new MessageDecoder());

    if (_controller.isDebug())
    {
      pipeline.addLast("logging", new LoggingFilter(_controller.getLog(), "controller"));
      _controller.getLog().info("Logging ON");
    }

    // if we found our partner close all other open connections
    pipeline.addLast("removeConnected", new ChannelGroupFilter(new Condition()
View Full Code Here

Examples of org.rzo.yajsw.nettyutils.LoggingFilter

    // executor,
        executor));
    // add logging
    if (_debug)
    {
      connector.getPipeline().addLast("logger", new LoggingFilter(log, "app"));
      log.info("Logging ON");
    }

    // add a framer to split incoming bytes to message chunks
    connector.getPipeline().addLast("framer", new DelimiterBasedFrameDecoder(8192, true, Delimiters.nulDelimiter()));
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.