public final class NetworkService<T> extends Object implements Stage, ConnectionFactory<T>
| Constructor and Description |
|---|
NetworkService(IdentifierFactory factory,
int nsPort,
String nameServerAddr,
int nameServerPort,
Codec<T> codec,
TransportFactory tpFactory,
EventHandler<Message<T>> recvHandler,
EventHandler<Exception> exHandler) |
NetworkService(IdentifierFactory factory,
int nsPort,
String nameServerAddr,
int nameServerPort,
int retryCount,
int retryTimeout,
Codec<T> codec,
TransportFactory tpFactory,
EventHandler<Message<T>> recvHandler,
EventHandler<Exception> exHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Codec<T> |
getCodec() |
IdentifierFactory |
getIdentifierFactory() |
Identifier |
getMyId() |
Naming |
getNameClient() |
Transport |
getTransport() |
Connection<T> |
newConnection(Identifier destId)
Creates a new connection
|
void |
registerId(Identifier id) |
void |
unregisterId(Identifier id) |
public NetworkService(IdentifierFactory factory, int nsPort, String nameServerAddr, int nameServerPort, Codec<T> codec, TransportFactory tpFactory, EventHandler<Message<T>> recvHandler, EventHandler<Exception> exHandler)
@Inject public NetworkService(IdentifierFactory factory, int nsPort, String nameServerAddr, int nameServerPort, int retryCount, int retryTimeout, Codec<T> codec, TransportFactory tpFactory, EventHandler<Message<T>> recvHandler, EventHandler<Exception> exHandler)
public void registerId(Identifier id)
public void unregisterId(Identifier id)
public Identifier getMyId()
public Transport getTransport()
public Naming getNameClient()
public IdentifierFactory getIdentifierFactory()
public void close() throws Exception
close in interface AutoCloseableExceptionpublic Connection<T> newConnection(Identifier destId)
ConnectionFactorynewConnection in interface ConnectionFactory<T>destId - a destination identifierCopyright © 2015 The Apache Software Foundation. All rights reserved.