Package com.google.code.yanf4j.core.impl

Examples of com.google.code.yanf4j.core.impl.HandlerAdapter


        Configuration configuration = new Configuration();
        configuration.setReadThreadCount(10);
        configuration.setWriteThreadCount(1);
        configuration.setDispatchMessageThreadCount(11);
        this.controller = new TCPController(configuration);
        this.controller.setHandler(new HandlerAdapter());
        Assert.assertEquals(10, this.controller.getReadThreadCount());
        Assert.assertEquals(1, this.controller.getWriteThreadCount());
        Assert.assertEquals(11, this.controller.getDispatchMessageThreadCount());

        this.controller.setReadThreadCount(0);
View Full Code Here



    @Test
    public void testNoCodecFactory() throws Exception {
        this.controller = new TCPController(new Configuration());
        this.controller.setHandler(new HandlerAdapter());
        Assert.assertNull(this.controller.getCodecFactory());
        this.controller.start();
        Assert.assertTrue(this.controller.getCodecFactory() instanceof ByteBufferCodecFactory);
    }
View Full Code Here

    TCPController controller;
    AtomicInteger sessionCounter = new AtomicInteger(0);

    public void start() {
      controller = new TCPController();
      controller.setHandler(new HandlerAdapter() {

        @Override
        public void onSessionClosed(Session session) {
          sessionCounter.decrementAndGet();
        }
View Full Code Here

    TCPController controller;
    AtomicInteger sessionCounter = new AtomicInteger(0);

    public void start() {
      controller = new TCPController();
      controller.setHandler(new HandlerAdapter() {

        @Override
        public void onSessionClosed(Session session) {
        }
View Full Code Here

    assertEquals("1.28", decodedCommand.getResult());
  }

  public MemcachedTCPSession buildSession() {
    NioSessionConfig sessionConfig = new NioSessionConfig(null,
        new HandlerAdapter(), null, new ByteBufferCodecFactory(), null,
        null, null, true, 0, 0);
    return new MemcachedTCPSession(sessionConfig, 16 * 1024, null, 0,
        new TextCommandFactory());
  }
View Full Code Here

TOP

Related Classes of com.google.code.yanf4j.core.impl.HandlerAdapter

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.