Package com.tangosol.net
Interface Service
-
- All Superinterfaces:
ClassLoaderAware
,Controllable
,Service
- All Known Subinterfaces:
CacheService
,DistributedCacheService
,InvocationService
,NameService
,PagedTopicService
,PartitionedService
,ProxyService
,TopicService
- All Known Implementing Classes:
WrapperCacheService
,WrapperInvocationService
,WrapperService
public interface Service extends Service
This Service interface represents a controllable service that operates in a clustered network environment.- Since:
- Coherence 1.1
- Author:
- gg 2002.02.08
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Service.MemberJoinAction
MemberJoinAction is taken to allow a new member to join a clustered Service.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addMemberListener(MemberListener listener)
Add a Member listener.Cluster
getCluster()
Return the Cluster object that this Service is a part of.ServiceDependencies
getDependencies()
Return the service's dependencies.ServiceInfo
getInfo()
Return the ServiceInfo object for this Service.int
getMinimumServiceVersion()
Return the minimum version for the members in this set.ResourceRegistry
getResourceRegistry()
Retrieves a Service scopedResourceRegistry
.Serializer
getSerializer()
Return a Serializer used by this Service.Object
getUserContext()
Return the user context object associated with this Service.boolean
isSuspended()
Returnstrue
if this service is currently suspended.boolean
isVersionCompatible(int nVersion)
Check whether the members of this service run a version that is greater than or equal to the specified version.boolean
isVersionCompatible(int nYear, int nMonth, int nPatch)
Check whether the members of this service run a version that is greater than or equal to the specified version.boolean
isVersionCompatible(int nMajor, int nMinor, int nMicro, int nPatchSet, int nPatch)
Check whether the members of this service run a version that is greater than or equal to the specified version.boolean
isVersionCompatible(IntPredicate predicate)
Check whether the members of this service run a minimum service version that matches a specifiedIntPredicate
.void
removeMemberListener(MemberListener listener)
Remove a Member listener.void
setDependencies(ServiceDependencies deps)
Configure the Service.void
setUserContext(Object oCtx)
Associate a user context object with this Service.-
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.util.Service
addServiceListener, removeServiceListener
-
-
-
-
Method Detail
-
getCluster
Cluster getCluster()
Return the Cluster object that this Service is a part of.- Returns:
- the Cluster object
-
getInfo
ServiceInfo getInfo()
Return the ServiceInfo object for this Service.- Returns:
- the ServiceInfo object
-
addMemberListener
void addMemberListener(MemberListener listener)
Add a Member listener.MemberListeners will be invoked in the order in which they are registered.
- Parameters:
listener
- theMemberListener
to add
-
removeMemberListener
void removeMemberListener(MemberListener listener)
Remove a Member listener.- Parameters:
listener
- theMemberListener
to remove
-
getUserContext
Object getUserContext()
Return the user context object associated with this Service.The data type and semantics of this context object are entirely application specific and are opaque to the Service itself.
- Returns:
- an associated user context object or null if a context has not been set
- Since:
- Coherence 3.0
-
setUserContext
void setUserContext(Object oCtx)
Associate a user context object with this Service.- Parameters:
oCtx
- a user context object- Since:
- Coherence 3.0
-
getSerializer
Serializer getSerializer()
Return a Serializer used by this Service.- Returns:
- the Serializer object
- Since:
- Coherence 3.4
-
setDependencies
void setDependencies(ServiceDependencies deps)
Configure the Service.This method can only be called before the Service is started.
- Parameters:
deps
- the dependencies object carrying configuration information specific to this Service- Throws:
IllegalStateException
- thrown if the Service is already runningIllegalArgumentException
- thrown if the configuration information is invalid- Since:
- Coherence 12.1.3
-
getDependencies
ServiceDependencies getDependencies()
Return the service's dependencies.- Returns:
- the service's dependencies
- Since:
- Coherence 12.2.1
-
getResourceRegistry
ResourceRegistry getResourceRegistry()
Retrieves a Service scopedResourceRegistry
. The resource registry is used to:- Register resources with the Service and make them accessible to the application code bound to this Service.
- Dispose of resources when the Service is shut down; see
the
ResourceRegistry
API for details on how to enable cleanup of resources.
- Returns:
- a Service scoped resource registry
- Since:
- Coherence 12.2.1
-
isSuspended
boolean isSuspended()
Returnstrue
if this service is currently suspended.- Returns:
true
if this service is currently suspended- Since:
- 22.06
- See Also:
Cluster.suspendService(String)
,Cluster.resumeService(String)
-
isVersionCompatible
boolean isVersionCompatible(int nMajor, int nMinor, int nMicro, int nPatchSet, int nPatch)
Check whether the members of this service run a version that is greater than or equal to the specified version.- Parameters:
nMajor
- the major version numbernMinor
- the minor version numbernMicro
- the micro version numbernPatchSet
- the patch set version numbernPatch
- the patch version number- Returns:
true
if the members of the service are all running a version that is greater than or equal to the specified version
-
isVersionCompatible
boolean isVersionCompatible(int nYear, int nMonth, int nPatch)
Check whether the members of this service run a version that is greater than or equal to the specified version.- Parameters:
nYear
- the year version numbernMonth
- the month version numbernPatch
- the patch version number- Returns:
true
if the members of the service are all running a version that is greater than or equal to the specified version
-
isVersionCompatible
boolean isVersionCompatible(int nVersion)
Check whether the members of this service run a version that is greater than or equal to the specified version.- Parameters:
nVersion
- the encoded version to compare- Returns:
true
if the members of the service are all running a version that is greater than or equal to the specified version
-
isVersionCompatible
boolean isVersionCompatible(IntPredicate predicate)
Check whether the members of this service run a minimum service version that matches a specifiedIntPredicate
.- Parameters:
predicate
- anIntPredicate
to apply to the minimum encoded service version- Returns:
true
if the minimum service version matches the predicate
-
getMinimumServiceVersion
int getMinimumServiceVersion()
Return the minimum version for the members in this set.- Returns:
- the minimum version for the members in this set
-
-