public class TcpIncomingConnector<T> extends Object implements IncomingConnector<T>, AsyncStoppable
| Constructor and Description |
|---|
TcpIncomingConnector(ExecutorFactory executorFactory,
MessageSerializer<T> serializer,
InetAddressFactory addressFactory,
IdGenerator<?> idGenerator) |
| Modifier and Type | Method and Description |
|---|---|
Address |
accept(Action<ConnectEvent<Connection<T>>> action,
boolean allowRemote)
Allocates a new incoming endpoint.
|
void |
requestStop()
Requests that this stoppable commence a graceful stop.
|
void |
stop()
Requests a graceful stop of this object.
|
public TcpIncomingConnector(ExecutorFactory executorFactory, MessageSerializer<T> serializer, InetAddressFactory addressFactory, IdGenerator<?> idGenerator)
public Address accept(Action<ConnectEvent<Connection<T>>> action, boolean allowRemote)
IncomingConnectoraccept in interface IncomingConnector<T>action - the action to execute on incoming connection. The supplied action is not required to be thread-safe.allowRemote - If true, only allow connections from remote machines. If false, allow only from the local machine.public void requestStop()
AsyncStoppableRequests that this stoppable commence a graceful stop. Does not block. You should call Stoppable.stop() to wait for the stop process to complete.
Generally, an AsyncStoppable should continue to complete existing work after this method has returned.
It should, however, stop accepting new work.
Requesting stopping does not guarantee the stoppable actually stops. Requesting stopping means preparing for stopping; stopping accepting new work. You have to call stop at some point anyway if your intention is to completely stop the stoppable.
requestStop in interface AsyncStoppableCopyright © 2013. All rights reserved