org.littleshoot.util.mina
Class MinaTcpServer

java.lang.Object
  extended by org.littleshoot.util.mina.MinaTcpServer
All Implemented Interfaces:
MinaServer

public class MinaTcpServer
extends Object
implements MinaServer

A MINA TCP server.


Constructor Summary
MinaTcpServer(org.littleshoot.mina.filter.codec.ProtocolCodecFactory codecFactory, org.littleshoot.mina.common.IoServiceListener ioServiceListener, org.littleshoot.mina.common.IoHandler handler)
          Creates a new MINA TCP server.
MinaTcpServer(org.littleshoot.mina.filter.codec.ProtocolCodecFactory codecFactory, org.littleshoot.mina.common.IoServiceListener ioServiceListener, org.littleshoot.mina.common.IoHandler handler, String baseThreadName)
          Creates a new MINA TCP server.
 
Method Summary
 void addIoServiceListener(org.littleshoot.mina.common.IoServiceListener serviceListener)
          Adds the specified IoServiceListener to the server.
 void start(int port)
          Starts the MINA server.
 void stop()
          Stops the MINA server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinaTcpServer

public MinaTcpServer(org.littleshoot.mina.filter.codec.ProtocolCodecFactory codecFactory,
                     org.littleshoot.mina.common.IoServiceListener ioServiceListener,
                     org.littleshoot.mina.common.IoHandler handler)
Creates a new MINA TCP server.

Parameters:
codecFactory - The codec factory to use with the acceptor.
ioServiceListener - The listener for IO service events.
handler - The IoHandler for processing incoming data.

MinaTcpServer

public MinaTcpServer(org.littleshoot.mina.filter.codec.ProtocolCodecFactory codecFactory,
                     org.littleshoot.mina.common.IoServiceListener ioServiceListener,
                     org.littleshoot.mina.common.IoHandler handler,
                     String baseThreadName)
Creates a new MINA TCP server.

Parameters:
codecFactory - The codec factory to use with the acceptor.
ioServiceListener - The listener for IO service events.
handler - The IoHandler for processing incoming data.
baseThreadName - The base name that will be used for threads processing data arriving on the server.
Method Detail

start

public void start(int port)
           throws IOException
Description copied from interface: MinaServer
Starts the MINA server.

Specified by:
start in interface MinaServer
Parameters:
port - The port to listen on.
Throws:
IOException - If we cannot bind to the port.

stop

public void stop()
Description copied from interface: MinaServer
Stops the MINA server.

Specified by:
stop in interface MinaServer

addIoServiceListener

public void addIoServiceListener(org.littleshoot.mina.common.IoServiceListener serviceListener)
Description copied from interface: MinaServer
Adds the specified IoServiceListener to the server.

Specified by:
addIoServiceListener in interface MinaServer
Parameters:
serviceListener - The listener to add.


Copyright © 2013 LittleShoot. All Rights Reserved.