|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.mina.common.AbstractIoService
org.apache.mina.common.AbstractIoAcceptor
org.apache.mina.common.AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>
org.apache.mina.transport.socket.nio.NioSocketAcceptor
public final class NioSocketAcceptor
IoAcceptor for socket transport (TCP/IP). This class
handles incoming TCP/IP based socket connections.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.mina.common.AbstractIoAcceptor |
|---|
AbstractIoAcceptor.AcceptorOperationFuture |
| Nested classes/interfaces inherited from class org.apache.mina.common.AbstractIoService |
|---|
AbstractIoService.ServiceOperationFuture |
| Field Summary |
|---|
| Fields inherited from class org.apache.mina.common.AbstractIoAcceptor |
|---|
bindLock |
| Constructor Summary | |
|---|---|
NioSocketAcceptor()
Create an acceptor with a single processing thread using a NewThreadExecutor |
|
NioSocketAcceptor(Executor executor,
IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor)
|
|
NioSocketAcceptor(int processorCount)
|
|
NioSocketAcceptor(IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor)
|
|
| Method Summary | |
|---|---|
protected org.apache.mina.transport.socket.nio.NioSession |
accept(IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor,
ServerSocketChannel handle)
|
protected void |
close(ServerSocketChannel handle)
|
protected void |
destroy()
|
int |
getBacklog()
Returns the size of the backlog. |
InetSocketAddress |
getDefaultLocalAddress()
Returns the default local address to bind when no argument is specified in IoAcceptor.bind() method. |
InetSocketAddress |
getLocalAddress()
Returns the local address which is bound currently. |
SocketSessionConfig |
getSessionConfig()
Returns the default configuration of the new IoSessions
created by this service. |
TransportMetadata |
getTransportMetadata()
Returns the TransportMetadata that this service runs on. |
protected void |
init()
|
boolean |
isReuseAddress()
|
protected SocketAddress |
localAddress(ServerSocketChannel handle)
|
protected ServerSocketChannel |
open(SocketAddress localAddress)
|
protected boolean |
select()
|
protected Iterator<ServerSocketChannel> |
selectedHandles()
|
void |
setBacklog(int backlog)
Sets the size of the backlog. |
void |
setDefaultLocalAddress(InetSocketAddress localAddress)
|
void |
setReuseAddress(boolean reuseAddress)
|
protected void |
wakeup()
|
| Methods inherited from class org.apache.mina.common.AbstractPollingIoAcceptor |
|---|
bind0, dispose0, newSession, unbind0 |
| Methods inherited from class org.apache.mina.common.AbstractIoAcceptor |
|---|
bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, toString, unbind, unbind, unbind, unbind |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.mina.common.IoAcceptor |
|---|
bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, newSession, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, unbind, unbind, unbind, unbind |
| Constructor Detail |
|---|
public NioSocketAcceptor()
public NioSocketAcceptor(int processorCount)
public NioSocketAcceptor(IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor)
public NioSocketAcceptor(Executor executor,
IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor)
| Method Detail |
|---|
protected void init()
throws Exception
init in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>Exception
protected void destroy()
throws Exception
destroy in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>Exceptionpublic TransportMetadata getTransportMetadata()
IoServiceTransportMetadata that this service runs on.
getTransportMetadata in interface IoServicepublic SocketSessionConfig getSessionConfig()
IoServiceIoSessions
created by this service.
getSessionConfig in interface IoServicegetSessionConfig in interface SocketServicegetSessionConfig in class AbstractIoServicepublic InetSocketAddress getLocalAddress()
IoAcceptor
getLocalAddress in interface IoAcceptorgetLocalAddress in interface SocketAcceptorgetLocalAddress in class AbstractIoAcceptorpublic InetSocketAddress getDefaultLocalAddress()
IoAcceptorIoAcceptor.bind() method. Please note that the default will not be
used if any local address is specified. If more than one address are
set, only one of them will be returned, but it's not necessarily the
firstly specified address in IoAcceptor.setDefaultLocalAddresses(List).
getDefaultLocalAddress in interface IoAcceptorgetDefaultLocalAddress in interface SocketAcceptorgetDefaultLocalAddress in class AbstractIoAcceptorpublic void setDefaultLocalAddress(InetSocketAddress localAddress)
setDefaultLocalAddress in interface SocketAcceptorpublic boolean isReuseAddress()
isReuseAddress in interface SocketAcceptorServerSocket.getReuseAddress()public void setReuseAddress(boolean reuseAddress)
setReuseAddress in interface SocketAcceptorServerSocket.setReuseAddress(boolean)public int getBacklog()
SocketAcceptor
getBacklog in interface SocketAcceptorpublic void setBacklog(int backlog)
SocketAcceptor
setBacklog in interface SocketAcceptor
protected org.apache.mina.transport.socket.nio.NioSession accept(IoProcessor<org.apache.mina.transport.socket.nio.NioSession> processor,
ServerSocketChannel handle)
throws Exception
accept in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>Exception
protected ServerSocketChannel open(SocketAddress localAddress)
throws Exception
open in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>Exception
protected SocketAddress localAddress(ServerSocketChannel handle)
throws Exception
localAddress in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>Exception
protected boolean select()
throws Exception
select in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>Exceptionprotected Iterator<ServerSocketChannel> selectedHandles()
selectedHandles in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>
protected void close(ServerSocketChannel handle)
throws Exception
close in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>Exceptionprotected void wakeup()
wakeup in class AbstractPollingIoAcceptor<org.apache.mina.transport.socket.nio.NioSession,ServerSocketChannel>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||