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 interfaceNameService.LookupCallbackAn object which implementsNameService.LookupCallbackcan be registered with aNameServiceviaaddLookupCallback(com.tangosol.net.NameService.LookupCallback)to perform a lookup on names that were not found in the NameService's directory.static interfaceNameService.RequestContextAn object which implementsNameService.RequestContextstores information about the NameService request.static interfaceNameService.ResolvableDuring thelookupcall, if the retrieved object isNameService.Resolvable, then the result of theresolvecall is returned.-
Nested classes/interfaces inherited from interface com.tangosol.net.Service
Service.MemberJoinAction
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAME_DEFAULTDefault service name for the NameService.static StringTYPE_REMOTERemote name service type constant.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddLookupCallback(NameService.LookupCallback callback)Register aNameService.LookupCallbackto be used to perform lookups on names that are not bound to theNameService's directory.voidbind(String sName, Object o)Binds a name to an object.InetAddressgetLocalAddress()Retrieve the running or configured listening address.Objectlookup(String sName)Retrieves the named object.voidunbind(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.LookupCallbackto be used to perform lookups on names that are not bound to theNameService's directory.If more than one
NameService.LookupCallbackis registered, they are called in the order in which they are registered with theNameService.- Parameters:
callback- theNameService.LookupCallbackto 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 theresolvecall 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
resolvecall 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
-
-