public class StandardSessionAcceptor extends Object implements SessionAcceptor
SessionAcceptor.| Modifier and Type | Method and Description |
|---|---|
void |
accept(SessionListener listener)
Returns immediately and calls listener asynchronously, but no more than
once.
|
void |
acceptAll(Object shared)
Returns immediately and starts automatically accepting all sessions
asynchronously, sending a shared object.
|
void |
close()
Prevents new sessions from being accepted and closes all existing
sessions created from this acceptor.
|
static SessionAcceptor |
create(Environment environment,
ChannelBrokerAcceptor brokerAcceptor) |
Object |
getLocalAddress() |
String |
toString() |
public static SessionAcceptor create(Environment environment, ChannelBrokerAcceptor brokerAcceptor)
environment - shared environment for creating sessionsbrokerAcceptor - accepted brokers must always connect to same remote serverpublic Object getLocalAddress()
getLocalAddress in interface SessionAcceptorpublic void accept(SessionListener listener)
SessionAcceptoracceptAll method may be called at any
time to switch to automatic session acceptance.accept in interface SessionAcceptorpublic void acceptAll(Object shared)
SessionAcceptoraccept
method may be called at any time to switch to manual session acceptance.acceptAll in interface SessionAcceptorshared - shared remote or serializable object to send to accepted
sessionspublic void close()
throws IOException
SessionAcceptorclose in interface Closeableclose in interface AutoCloseableclose in interface SessionAcceptorIOExceptionCopyright © 2006–2015 Cojen. All rights reserved.