net.sf.cindy.session.bio
Class BlockingSessionAcceptor

java.lang.Object
  extended by net.sf.cindy.session.AbstractSessionAcceptor
      extended by net.sf.cindy.session.bio.BlockingSessionAcceptor
All Implemented Interfaces:
SessionAcceptor

public class BlockingSessionAcceptor
extends AbstractSessionAcceptor

Blocking session acceptor.

Version:
$id$
Author:
Roger Chen

Constructor Summary
BlockingSessionAcceptor()
           
 
Method Summary
 void close()
          Close acceptor.
 int getAcceptedCount()
          Get accepted session count.
 java.net.SocketAddress getListenAddress()
          Get the listen address which the accpetor bind with.
 int getListenPort()
          Get the listen port which the acceptor bind with.
 SessionType getSessionType()
          Get the session type of the session accepted by the acceptor.
 java.net.ServerSocket getSocket()
           
 boolean isStarted()
          Acceptor is started.
protected  Session newSession(java.nio.channels.SocketChannel sc)
           
 void start()
          Start acceptor.
 
Methods inherited from class net.sf.cindy.session.AbstractSessionAcceptor
exceptionCaught, getAcceptorHandler, getBacklog, isReuseAddress, sessionAccepted, setAcceptorHandler, setBacklog, setListenAddress, setListenPort, setReuseAddress, setServerSocketOptions, setSocketOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockingSessionAcceptor

public BlockingSessionAcceptor()
Method Detail

getSessionType

public SessionType getSessionType()
Description copied from interface: SessionAcceptor
Get the session type of the session accepted by the acceptor.

Returns:
session type

isStarted

public boolean isStarted()
Description copied from interface: SessionAcceptor
Acceptor is started.

Returns:
is started

getListenAddress

public java.net.SocketAddress getListenAddress()
Description copied from interface: SessionAcceptor
Get the listen address which the accpetor bind with.

Specified by:
getListenAddress in interface SessionAcceptor
Overrides:
getListenAddress in class AbstractSessionAcceptor
Returns:
the local address

getListenPort

public int getListenPort()
Description copied from interface: SessionAcceptor
Get the listen port which the acceptor bind with.

Specified by:
getListenPort in interface SessionAcceptor
Overrides:
getListenPort in class AbstractSessionAcceptor
Returns:
the local port

getSocket

public java.net.ServerSocket getSocket()

start

public void start()
Description copied from interface: SessionAcceptor
Start acceptor.


getAcceptedCount

public int getAcceptedCount()
Description copied from interface: SessionAcceptor
Get accepted session count.

Returns:
accepted session count

newSession

protected Session newSession(java.nio.channels.SocketChannel sc)

close

public void close()
Description copied from interface: SessionAcceptor
Close acceptor.