public class TopicService extends Object implements ManagedService, RemoteService, EventPublishingService, StatisticsAwareService<LocalTopicStats>
| Modifier and Type | Field and Description |
|---|---|
static int |
ORDERING_LOCKS_LENGTH |
static String |
SERVICE_NAME |
| Constructor and Description |
|---|
TopicService() |
| Modifier and Type | Method and Description |
|---|---|
UUID |
addMessageListener(String name,
MessageListener listener,
boolean localOnly) |
ITopic |
createDistributedObject(String name,
boolean local)
Creates a distributed object on the local member only (when
local is
true), else cluster-wide. |
void |
destroyDistributedObject(String objectId,
boolean local)
Destroys a distributed object.
|
void |
dispatchEvent(Object event,
Object listener)
Notifies the service of a published event.
|
LocalTopicStatsImpl |
getLocalTopicStats(String name) |
Lock |
getOrderLock(String key) |
Map<String,LocalTopicStats> |
getStats()
Return the service statistics for the local instance.
|
ConcurrentMap<String,LocalTopicStatsImpl> |
getStatsMap() |
void |
incrementPublishes(String topicName)
Increments the number of published messages on the ITopic
with the name
topicName. |
void |
incrementReceivedMessages(String topicName)
Increments the number of received messages on the ITopic
with the name
topicName. |
void |
init(NodeEngine nodeEngine,
Properties properties)
Initializes this service.
|
void |
publishMessage(String topicName,
Object payload,
boolean multithreaded) |
boolean |
removeMessageListener(String name,
UUID registrationId) |
void |
reset()
Resets this service back to its initial state.
|
void |
shutdown(boolean terminate)
Shuts down this service.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDistributedObject, destroyDistributedObjectpublic static final String SERVICE_NAME
public static final int ORDERING_LOCKS_LENGTH
public void init(NodeEngine nodeEngine, Properties properties)
ManagedServiceinit in interface ManagedServicenodeEngine - the NodeEngine that this service belongs toproperties - the Properties (can be used to pass settings to the service)public ConcurrentMap<String,LocalTopicStatsImpl> getStatsMap()
public void reset()
ManagedServiceTODO: what is the purpose of reset
reset in interface ManagedServicepublic void shutdown(boolean terminate)
ManagedServiceTODO: what is the purpose of the terminate variable
shutdown in interface ManagedServiceterminate - true to shut down this servicepublic ITopic createDistributedObject(String name, boolean local)
RemoteServicelocal is
true), else cluster-wide.createDistributedObject in interface RemoteServicename - the name for the created distributed objectlocal - when true then only perform required proxy creation
actions on the local member, otherwise perform cluster-wide
proxy creation.public void destroyDistributedObject(String objectId, boolean local)
RemoteServicedestroyDistributedObject in interface RemoteServiceobjectId - the name of the distributed object to destroypublic void dispatchEvent(Object event, Object listener)
EventPublishingServicedispatchEvent in interface EventPublishingServiceevent - the published eventlistener - the listener registered for this eventpublic LocalTopicStatsImpl getLocalTopicStats(String name)
public void incrementPublishes(String topicName)
topicName.topicName - the name of the ITopicpublic void incrementReceivedMessages(String topicName)
topicName.topicName - the name of the ITopic@Nonnull public UUID addMessageListener(@Nonnull String name, @Nonnull MessageListener listener, boolean localOnly)
public boolean removeMessageListener(@Nonnull String name, @Nonnull UUID registrationId)
public Map<String,LocalTopicStats> getStats()
StatisticsAwareServicegetStats in interface StatisticsAwareService<LocalTopicStats>Copyright © 2019 Hazelcast, Inc.. All rights reserved.