public class NameClient extends Object implements Stage, Naming
Constructor and Description |
---|
NameClient(String serverAddr,
int serverPort,
IdentifierFactory factory,
int retryCount,
int retryTimeout,
Cache<Identifier,InetSocketAddress> cache)
Deprecated.
|
NameClient(String serverAddr,
int serverPort,
IdentifierFactory factory,
int retryCount,
int retryTimeout,
Cache<Identifier,InetSocketAddress> cache,
LocalAddressProvider localAddressProvider)
Constructs a naming client
|
NameClient(String serverAddr,
int serverPort,
long timeout,
IdentifierFactory factory,
int retryCount,
int retryTimeout,
Cache<Identifier,InetSocketAddress> cache)
Deprecated.
|
NameClient(String serverAddr,
int serverPort,
long timeout,
IdentifierFactory factory,
int retryCount,
int retryTimeout,
Cache<Identifier,InetSocketAddress> cache,
LocalAddressProvider localAddressProvider)
Constructs a naming client
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes resources
|
InetSocketAddress |
lookup(Identifier id)
Finds an address for an identifier
|
void |
register(Identifier id,
InetSocketAddress addr)
Registers an (identifier, address) mapping
|
InetSocketAddress |
remoteLookup(Identifier id)
Retrieves an address for an identifier remotely
|
void |
unregister(Identifier id)
Unregisters an identifier
|
@Deprecated public NameClient(String serverAddr, int serverPort, IdentifierFactory factory, int retryCount, int retryTimeout, Cache<Identifier,InetSocketAddress> cache)
public NameClient(String serverAddr, int serverPort, IdentifierFactory factory, int retryCount, int retryTimeout, Cache<Identifier,InetSocketAddress> cache, LocalAddressProvider localAddressProvider)
serverAddr
- a server addressserverPort
- a server port numberfactory
- an identifier factorycache
- a cache@Deprecated public NameClient(String serverAddr, int serverPort, long timeout, IdentifierFactory factory, int retryCount, int retryTimeout, Cache<Identifier,InetSocketAddress> cache)
public NameClient(String serverAddr, int serverPort, long timeout, IdentifierFactory factory, int retryCount, int retryTimeout, Cache<Identifier,InetSocketAddress> cache, LocalAddressProvider localAddressProvider)
serverAddr
- a server addressserverPort
- a server port numbertimeout
- timeout in msfactory
- an identifier factorycache
- a cachepublic void register(Identifier id, InetSocketAddress addr) throws Exception
register
in interface NamingRegistry
id
- an identifieraddr
- an Internet socket addressException
public void unregister(Identifier id) throws IOException
unregister
in interface NamingRegistry
id
- an identifierIOException
public InetSocketAddress lookup(Identifier id) throws Exception
lookup
in interface NamingLookup
id
- an identifierIOException
Exception
public InetSocketAddress remoteLookup(Identifier id) throws Exception
id
- an identifierException
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2015 The Apache Software Foundation. All rights reserved.