|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.core.service.AbstractIoService
org.apache.mina.core.service.AbstractIoAcceptor
org.apache.mina.core.polling.AbstractPollingIoAcceptor<AprSession,Long>
org.apache.mina.transport.socket.apr.AprSocketAcceptor
public final class AprSocketAcceptor
TODO Add documentation
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoAcceptor |
---|
AbstractIoAcceptor.AcceptorOperationFuture |
Nested classes/interfaces inherited from class org.apache.mina.core.service.AbstractIoService |
---|
AbstractIoService.ServiceOperationFuture |
Field Summary |
---|
Fields inherited from class org.apache.mina.core.service.AbstractIoAcceptor |
---|
bindLock |
Fields inherited from class org.apache.mina.core.service.AbstractIoService |
---|
disposalLock |
Constructor Summary | |
---|---|
AprSocketAcceptor()
|
|
AprSocketAcceptor(Executor executor,
IoProcessor<AprSession> processor)
|
|
AprSocketAcceptor(int processorCount)
|
|
AprSocketAcceptor(IoProcessor<AprSession> processor)
|
Method Summary | |
---|---|
protected AprSession |
accept(IoProcessor<AprSession> processor,
Long handle)
Accept a client connection for a server socket and return a new IoSession
associated with the given IoProcessor |
protected void |
close(Long handle)
Close a server socket. |
protected void |
destroy()
Destroy the polling system, will be called when this IoAcceptor
implementation will be disposed. |
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 IoSession s
created by this service. |
TransportMetadata |
getTransportMetadata()
Returns the TransportMetadata that this service runs on. |
protected void |
init()
Initialize the polling system, will be called at construction time. |
boolean |
isReuseAddress()
|
protected SocketAddress |
localAddress(Long handle)
Get the local address associated with a given server socket |
protected Long |
open(SocketAddress localAddress)
Open a server socket for a given local address. |
protected boolean |
select()
Check for acceptable connections, interrupt when at least a server is ready for accepting. |
protected Iterator<Long> |
selectedHandles()
Iterator for the set of server sockets found with acceptable incoming connections
during the last AbstractPollingIoAcceptor.select() call. |
void |
setBacklog(int backlog)
Sets the size of the backlog. |
void |
setDefaultLocalAddress(InetSocketAddress localAddress)
|
void |
setReuseAddress(boolean reuseAddress)
|
protected void |
wakeup()
Interrupt the AbstractPollingIoAcceptor.select() method. |
Methods inherited from class org.apache.mina.core.polling.AbstractPollingIoAcceptor |
---|
bind0, dispose0, newSession, unbind0 |
Methods inherited from class org.apache.mina.core.service.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.core.service.IoAcceptor |
---|
bind, bind, bind, bind, getDefaultLocalAddresses, getLocalAddresses, isCloseOnDeactivation, newSession, setCloseOnDeactivation, setDefaultLocalAddress, setDefaultLocalAddresses, setDefaultLocalAddresses, setDefaultLocalAddresses, unbind, unbind, unbind, unbind |
Methods inherited from interface org.apache.mina.core.service.IoService |
---|
addListener, broadcast, dispose, getActivationTime, getFilterChain, getFilterChainBuilder, getHandler, getIdleState, getManagedSessionCount, getManagedSessions, getScheduledWriteBytes, getScheduledWriteMessages, getSessionDataStructureFactory, getStatistics, isActive, isDisposed, isDisposing, removeListener, setFilterChainBuilder, setHandler, setSessionDataStructureFactory |
Constructor Detail |
---|
public AprSocketAcceptor()
public AprSocketAcceptor(int processorCount)
public AprSocketAcceptor(IoProcessor<AprSession> processor)
public AprSocketAcceptor(Executor executor, IoProcessor<AprSession> processor)
Method Detail |
---|
protected AprSession accept(IoProcessor<AprSession> processor, Long handle) throws Exception
AbstractPollingIoAcceptor
IoSession
associated with the given IoProcessor
accept
in class AbstractPollingIoAcceptor<AprSession,Long>
processor
- the IoProcessor
to associate with the IoSession
handle
- the server handle
IoSession
Exception
- any exception thrown by the underlying systems callsprotected Long open(SocketAddress localAddress) throws Exception
AbstractPollingIoAcceptor
open
in class AbstractPollingIoAcceptor<AprSession,Long>
localAddress
- the associated local address
Exception
- any exception thrown by the underlying systems callsprotected void init() throws Exception
AbstractPollingIoAcceptor
init
in class AbstractPollingIoAcceptor<AprSession,Long>
Exception
- any exception thrown by the underlying system callsprotected void destroy() throws Exception
AbstractPollingIoAcceptor
IoAcceptor
implementation will be disposed.
destroy
in class AbstractPollingIoAcceptor<AprSession,Long>
Exception
- any exception thrown by the underlying systems callsprotected SocketAddress localAddress(Long handle) throws Exception
AbstractPollingIoAcceptor
localAddress
in class AbstractPollingIoAcceptor<AprSession,Long>
handle
- the server socket
SocketAddress
associated with this handle
Exception
- any exception thrown by the underlying systems callsprotected boolean select() throws Exception
AbstractPollingIoAcceptor
AbstractPollingIoAcceptor.selectedHandles()
select
in class AbstractPollingIoAcceptor<AprSession,Long>
Exception
- any exception thrown by the underlying systems callsprotected Iterator<Long> selectedHandles()
AbstractPollingIoAcceptor
Iterator
for the set of server sockets found with acceptable incoming connections
during the last AbstractPollingIoAcceptor.select()
call.
selectedHandles
in class AbstractPollingIoAcceptor<AprSession,Long>
protected void close(Long handle) throws Exception
AbstractPollingIoAcceptor
close
in class AbstractPollingIoAcceptor<AprSession,Long>
handle
- the server socket
Exception
- any exception thrown by the underlying systems callsprotected void wakeup()
AbstractPollingIoAcceptor
AbstractPollingIoAcceptor.select()
method. Used when the poll set need to be modified.
wakeup
in class AbstractPollingIoAcceptor<AprSession,Long>
public int getBacklog()
SocketAcceptor
getBacklog
in interface SocketAcceptor
public boolean isReuseAddress()
isReuseAddress
in interface SocketAcceptor
ServerSocket.getReuseAddress()
public void setBacklog(int backlog)
SocketAcceptor
setBacklog
in interface SocketAcceptor
public InetSocketAddress getLocalAddress()
AbstractIoAcceptor
getLocalAddress
in interface IoAcceptor
getLocalAddress
in interface SocketAcceptor
getLocalAddress
in class AbstractIoAcceptor
public InetSocketAddress getDefaultLocalAddress()
AbstractIoAcceptor
IoAcceptor.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 IoAcceptor
getDefaultLocalAddress
in interface SocketAcceptor
getDefaultLocalAddress
in class AbstractIoAcceptor
public void setDefaultLocalAddress(InetSocketAddress localAddress)
setDefaultLocalAddress
in interface SocketAcceptor
public void setReuseAddress(boolean reuseAddress)
setReuseAddress
in interface SocketAcceptor
ServerSocket.setReuseAddress(boolean)
public TransportMetadata getTransportMetadata()
IoService
TransportMetadata
that this service runs on.
getTransportMetadata
in interface IoService
public SocketSessionConfig getSessionConfig()
AbstractIoService
IoSession
s
created by this service.
getSessionConfig
in interface IoService
getSessionConfig
in interface SocketAcceptor
getSessionConfig
in class AbstractIoService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |