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 |
---|---|
String |
addMessageListener(String name,
MessageListener listener,
boolean localOnly) |
ITopic |
createDistributedObject(String name)
Creates a distributed object.
|
void |
destroyDistributedObject(String objectId)
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 ManagedService
|
void |
publishMessage(String topicName,
Object payload,
boolean multithreaded) |
boolean |
removeMessageListener(String name,
String registrationId) |
void |
reset()
reset this ManagedService back to initial state.
|
void |
shutdown(boolean terminate)
Shuts down this ManagedService.
|
public static final String SERVICE_NAME
public static final int ORDERING_LOCKS_LENGTH
public void init(NodeEngine nodeEngine, Properties properties)
ManagedService
init
in interface ManagedService
nodeEngine
- the NodeEngine that this ManagedService belongs to.properties
- the Properties. Can be used to pass settings to the service.public ConcurrentMap<String,LocalTopicStatsImpl> getStatsMap()
public void reset()
ManagedService
reset
in interface ManagedService
public void shutdown(boolean terminate)
ManagedService
shutdown
in interface ManagedService
terminate
- true to shut down the ManagedServicepublic ITopic createDistributedObject(String name)
RemoteService
createDistributedObject
in interface RemoteService
name
- the name for the created distributed objectpublic void destroyDistributedObject(String objectId)
RemoteService
destroyDistributedObject
in interface RemoteService
objectId
- the name of the distributed object to destroypublic void dispatchEvent(Object event, Object listener)
EventPublishingService
dispatchEvent
in interface EventPublishingService
event
- the published eventlistener
- the listener registered for this eventpublic LocalTopicStatsImpl getLocalTopicStats(String name)
public void incrementPublishes(String topicName)
topicName
.topicName
- the name of the ITopic
public void incrementReceivedMessages(String topicName)
topicName
.topicName
- the name of the ITopic
public String addMessageListener(String name, MessageListener listener, boolean localOnly)
public Map<String,LocalTopicStats> getStats()
StatisticsAwareService
getStats
in interface StatisticsAwareService<LocalTopicStats>
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.