Interface TopicService
- All Superinterfaces:
ClassLoaderAware
,Controllable
,Service
,Service
- All Known Subinterfaces:
PagedTopicService
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.net.Service
Service.MemberJoinAction
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroyTopic
(NamedTopic<?> topic) Release and destroy the specified topic.default int
ensureChannelCount
(String sName, int cChannel) Ensure the specified topic has at least the required number of channels.int
ensureChannelCount
(String sName, int cRequired, int cChannel) Ensure the specified topic has at least the required number of channels.<T> NamedTopic
<T> ensureTopic
(String sName, ClassLoader loader) Obtain a Topic interface that providesint
getChannelCount
(String sName) Return the number of channels the topic has.Set
<com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId> getSubscriberGroups
(String sTopicName) Returns thesubscriber groups
for a topic known to this service.Return theTopicBackingMapManager
.Returns the names of the topics known to this service.void
releaseTopic
(NamedTopic<?> topic) Release local resources associated with the specified instance of the topic.void
Set aTopicBackingMapManager
to be used by thisTopicService
to create underlying stores for the topic data.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 Details
-
TYPE_PAGED_TOPIC
PagedTopic service type constant.DistributedTopic service provides the means for handling a collection of paged topics across a cluster with concurrent access control.
- See Also:
-
TYPE_REMOTE
RemoteTopic service type constant.RemoteTopic service provides the means for handling a collection of topics managed by a remote JVM with concurrent access control.
- See Also:
-
TYPE_REMOTE_GRPC
RemoteGrpcTopic service type constant.RemoteGrpcTopic service provides the means for handling a collection of topic resources managed by a remote JVM with concurrent access control connecting over gRPC.
- See Also:
-
-
Method Details
-
ensureTopic
Obtain a Topic interface that provides- Parameters:
sName
- - the name, within this TopicService, that uniquely identifies a topicloader
- ClassLoader that should be used to deserialize messages sent to the topic by other members of the cluster; null is legal, and implies the default ClassLoader, which will typically be the context ClassLoader for this service- Returns:
- a NamedTopic interface which can be used to access the resources of the specified topic
-
releaseTopic
Release local resources associated with the specified instance of the topic. This invalidates a reference obtained by using theensureTopic(String, ClassLoader)
method.Releasing a topic reference to a topic makes the topic reference no longer usable, but does not affect the topic itself. In other words, all other references to the topic will still be valid, and the topic data is not affected by releasing the reference.
The reference that is released using this method can no longer be used; any attempt to use the reference will result in an exception.
The purpose for releasing a topic reference is to allow the topic implementation to release the ClassLoader used to deserialize items in the topic. The topic implementation ensures that all references to that ClassLoader are released. This implies that objects in the topic that were loaded by that ClassLoader will be re-serialized to release their hold on that ClassLoader. The result is that the ClassLoader can be garbage-collected by Java in situations where the topic is operating in an application server and applications are dynamically loaded and unloaded.
- Parameters:
topic
- the topic object to be released- See Also:
-
destroyTopic
Release and destroy the specified topic.Warning: This method is used to completely destroy the specified topic across the cluster. All references in the entire cluster to this topic will be invalidated, the data will be cleared, and all resources will be released.
- Parameters:
topic
- the cache object to be released- See Also:
-
getTopicBackingMapManager
TopicBackingMapManager getTopicBackingMapManager()Return theTopicBackingMapManager
.- Returns:
- the TopicBackingMapManager
-
setTopicBackingMapManager
Set aTopicBackingMapManager
to be used by thisTopicService
to create underlying stores for the topic data. Some topic services may choose to ignore this setting.- Parameters:
manager
- aTopicBackingMapManager
- Throws:
IllegalStateException
- thrown if the service is already running
-
getChannelCount
Return the number of channels the topic has.- Parameters:
sName
- the name of the topic- Returns:
- the number of channels the topic has
-
ensureChannelCount
Ensure the specified topic has at least the required number of channels.- Parameters:
sName
- the name of the topiccChannel
- the required channel count- Returns:
- the number of channels the topic has
-
ensureChannelCount
Ensure the specified topic has at least the required number of channels.- Parameters:
sName
- the name of the topiccRequired
- the minimum required channel countcChannel
- the channel count to set if the current count is less thancRequired
- Returns:
- the number of channels the topic has
-
getTopicNames
Returns the names of the topics known to this service.- Returns:
- the names of the topics known to this service
-
getSubscriberGroups
Set<com.tangosol.internal.net.topic.impl.paged.model.SubscriberGroupId> getSubscriberGroups(String sTopicName) Returns thesubscriber groups
for a topic known to this service.- Returns:
- the
subscriber groups
for a topic known to this service
-