Package org.apache.mina.filter.logging

Examples of org.apache.mina.filter.logging.LoggingFilter


    public void start() throws IOException {
       
        acceptor = new NioSocketAcceptor();

        acceptor.getFilterChain().addLast( "logger",
                                           new LoggingFilter() );
        acceptor.getFilterChain().addLast( "codec",
                                           new ProtocolCodecFilter( new ObjectSerializationCodecFactory() ) );

        acceptor.setHandler( handler );
        acceptor.getSessionConfig().setReadBufferSize( 2048 );
View Full Code Here


        IoBuffer.setAllocator(new SimpleBufferAllocator());

        acceptor = new NioSocketAcceptor();

//        cfg.getFilterChain().addLast("mimemessage1", new MimeMessageIOFilter() );
        acceptor.getFilterChain().addLast("logger", new LoggingFilter());
        acceptor.getFilterChain().addLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("US-ASCII"))));
        acceptor.getFilterChain().addLast("stream", new StreamWriteFilter() );
        acceptor.setHandler( new PopIOHandlerAdapter(this) );
        try {
            //cfg.getFilterChain().addLast("codec", new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName("UTF-8"))));
View Full Code Here

     
      acceptor.setHandler(new ServerPacketMinaHandler(this));
     
      DefaultIoFilterChainBuilder chain = acceptor.getFilterChain();

          chain.addLast("logger", new LoggingFilter());


//        DatagramSessionConfig dcfg = acceptor.getSessionConfig();
// 
//        dcfg.setReuseAddress(true);
View Full Code Here

    List threadsBefore = getThreadNames();

    final IoAcceptor acceptor = new NioSocketAcceptor();

    acceptor.getFilterChain().addLast( "logger", new LoggingFilter() );
    acceptor.getFilterChain().addLast( "codec", new ProtocolCodecFilter( new TextLineCodecFactory( Charset.forName( "UTF-8" ))));

    acceptor.setHandlernew ServerHandler() );

    acceptor.getSessionConfig().setReadBufferSize( 2048 );
    acceptor.getSessionConfig().setIdleTime( IdleStatus.BOTH_IDLE, 10 );
    acceptor.bind( new InetSocketAddress(PORT) );
    System.out.println("Server running ...");

    final NioSocketConnector connector = new NioSocketConnector();

    // Set connect timeout.
    connector.setConnectTimeoutMillis(30 * 1000L);

    connector.setHandler(new ClientHandler());
    connector.getFilterChain().addLast( "logger", new LoggingFilter() );
    connector.getFilterChain().addLast( "codec", new ProtocolCodecFilter( new TextLineCodecFactory( Charset.forName( "UTF-8" ))));

    // Start communication.
    ConnectFuture cf = connector.connect(new InetSocketAddress("localhost", 9123));
    cf.awaitUninterruptibly();
View Full Code Here

        LOG.info("starting echo server");

        final NioTcpServer acceptor = new NioTcpServer();

        // create the filter chain for this service
        acceptor.setFilters(new LoggingFilter("LoggingFilter1"));

        acceptor.setIoHandler(new AbstractIoHandler() {
            @Override
            public void sessionOpened(final IoSession session) {
                LOG.info("session opened {}", session);
View Full Code Here

        address = new VmPipeAddress(configuration.getPort());
        connector = new VmPipeConnector();

        // connector config
        if (minaLogger) {
            connector.getFilterChain().addLast("logger", new LoggingFilter());
        }
        appendIoFiltersToChain(filters, connector.getFilterChain());
        if (configuration.getSslContextParameters() != null) {
            LOG.warn("Using vm protocol"
                     + ", but an SSLContextParameters instance was provided.  SSLContextParameters is only supported on the TCP protocol.");
View Full Code Here

        } else {
            workerPool = new UnorderedThreadPoolExecutor(configuration.getMaximumPoolSize());
        }
        connector.getFilterChain().addLast("threadPool", new ExecutorFilter(workerPool));
        if (minaLogger) {
            connector.getFilterChain().addLast("logger", new LoggingFilter());
        }
        appendIoFiltersToChain(filters, connector.getFilterChain());
        if (configuration.getSslContextParameters() != null) {
            connector.getFilterChain().addFirst("sslFilter", new SslFilter(configuration.getSslContextParameters().createSSLContext(), configuration.isAutoStartTls()));
        }
View Full Code Here

            workerPool = new UnorderedThreadPoolExecutor(configuration.getMaximumPoolSize());
        }
        connectorConfig = connector.getSessionConfig();
        connector.getFilterChain().addLast("threadPool", new ExecutorFilter(workerPool));
        if (minaLogger) {
            connector.getFilterChain().addLast("logger", new LoggingFilter());
        }
        appendIoFiltersToChain(filters, connector.getFilterChain());
        if (configuration.getSslContextParameters() != null) {
            LOG.warn("Using datagram protocol, " + configuration.getProtocol()
                     + ", but an SSLContextParameters instance was provided.  SSLContextParameters is only supported on the TCP protocol.");
View Full Code Here

      NioSocketAcceptor acceptor = new NioSocketAcceptor();
      
      DefaultIoFilterChainBuilder filterChainBuilder = new DefaultIoFilterChainBuilder();
      //filterChainBuilder.addLast("executorFilter", new OrderedThreadPoolExecutor());
      filterChainBuilder.addLast("xmppCodec", new ProtocolCodecFilter(new XMPPProtocolCodecFactory()));
      filterChainBuilder.addLast("loggingFilter", new LoggingFilter());
      acceptor.setFilterChainBuilder(filterChainBuilder);
     
        XmppIoHandlerAdapter adapter = new XmppIoHandlerAdapter();
        adapter.setServerRuntimeContext(serverRuntimeContext);
        acceptor.setHandler(adapter);
View Full Code Here

                    throw new AssertionError("Wrong message type");
                }
            }

        });
        sess.getFilterChain().addFirst("logger", new LoggingFilter());
        BufferedWriteFilter bFilter = new BufferedWriteFilter(10);
        sess.getFilterChain().addLast("buffer", bFilter);

        IoBuffer data = IoBuffer.allocate(1);
        for (byte i = 0; i < 20; i++) {
View Full Code Here

TOP

Related Classes of org.apache.mina.filter.logging.LoggingFilter

Copyright © 2018 www.massapicom. 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.