Package com.tangosol.net
Interface NameService
-
- All Superinterfaces:
ClassLoaderAware
,Controllable
,Service
,Service
public interface NameService extends Service
A NameService is a service that accepts connections from external clients (e.g. Coherence*Extend) and provides a name lookup service.- Since:
- 12.1.2
- Author:
- phf 2012.03.05
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
NameService.LookupCallback
An object which implementsNameService.LookupCallback
can be registered with aNameService
viaaddLookupCallback(com.tangosol.net.NameService.LookupCallback)
to perform a lookup on names that were not found in the NameService's directory.static interface
NameService.RequestContext
An object which implementsNameService.RequestContext
stores information about the NameService request.static interface
NameService.Resolvable
During thelookup
call, if the retrieved object isNameService.Resolvable
, then the result of theresolve
call is returned.-
Nested classes/interfaces inherited from interface com.tangosol.net.Service
Service.MemberJoinAction
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME_DEFAULT
Default service name for the NameService.static String
TYPE_REMOTE
Remote name service type constant.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addLookupCallback(NameService.LookupCallback callback)
Register aNameService.LookupCallback
to be used to perform lookups on names that are not bound to theNameService
's directory.void
bind(String sName, Object o)
Binds a name to an object.InetAddress
getLocalAddress()
Retrieve the running or configured listening address.Object
lookup(String sName)
Retrieves the named object.void
unbind(String sName)
Unbinds the named object.-
Methods inherited from interface com.tangosol.io.ClassLoaderAware
getContextClassLoader, setContextClassLoader
-
Methods inherited from interface com.tangosol.util.Controllable
configure, isRunning, shutdown, start, stop
-
Methods inherited from interface com.tangosol.net.Service
addMemberListener, getCluster, getDependencies, getInfo, getMinimumServiceVersion, getResourceRegistry, getSerializer, getUserContext, isSuspended, isVersionCompatible, isVersionCompatible, isVersionCompatible, isVersionCompatible, removeMemberListener, setDependencies, setUserContext
-
Methods inherited from interface com.tangosol.util.Service
addServiceListener, removeServiceListener
-
-
-
-
Field Detail
-
NAME_DEFAULT
static final String NAME_DEFAULT
Default service name for the NameService.- See Also:
- Constant Field Values
-
TYPE_REMOTE
static final String TYPE_REMOTE
Remote name service type constant.- See Also:
- Constant Field Values
-
-
Method Detail
-
addLookupCallback
void addLookupCallback(NameService.LookupCallback callback)
Register aNameService.LookupCallback
to be used to perform lookups on names that are not bound to theNameService
's directory.If more than one
NameService.LookupCallback
is registered, they are called in the order in which they are registered with theNameService
.- Parameters:
callback
- theNameService.LookupCallback
to register- Since:
- 12.2.1
-
bind
void bind(String sName, Object o) throws NamingException
Binds a name to an object.- Parameters:
sName
- the name to bind; may not be emptyo
- the object to bind; possibly null- Throws:
NameAlreadyBoundException
- if name is already boundNamingException
- if a naming exception is encountered
-
getLocalAddress
InetAddress getLocalAddress()
Retrieve the running or configured listening address.- Returns:
- the running or configured listening address
- Since:
- 12.2.1
-
lookup
Object lookup(String sName) throws NamingException
Retrieves the named object. If the retrieved object isNameService.Resolvable
, then the result of theresolve
call is returned.- Parameters:
sName
- the name of the object to look up- Returns:
- the object bound to the specified name or the result of the
resolve
call if the bound object isNameService.Resolvable
- Throws:
NamingException
- if a naming exception is encountered
-
unbind
void unbind(String sName) throws NamingException
Unbinds the named object.- Parameters:
sName
- the name to bind; may not be empty- Throws:
NamingException
- if a naming exception is encountered
-
-