@Singleton @Named(value="HK2TopicDistributionService") @ContractsProvided(value={TopicDistributionService.class,InstanceLifecycleListener.class,DynamicConfigurationListener.class}) public class DefaultTopicDistributionService extends Object implements TopicDistributionService, InstanceLifecycleListener, DynamicConfigurationListener
HK2_DEFAULT_TOPIC_DISTRIBUTOR
Constructor and Description |
---|
DefaultTopicDistributionService() |
Modifier and Type | Method and Description |
---|---|
void |
configurationChanged()
This method is called when the set of descriptors
in this service locator has been changed.
|
void |
distributeMessage(Topic<?> topic,
Object message)
Must distribute the message to all of the matching topic subscribers.
|
Filter |
getFilter()
This returns a filter that tells the system whether a particular descriptor should be handled by this lifecycle
listener.
|
void |
lifecycleEvent(InstanceLifecycleEvent lifecycleEvent)
This method will be called when any lifecycle event occurs.
|
public void distributeMessage(Topic<?> topic, Object message)
TopicDistributionService
distributeMessage
in interface TopicDistributionService
topic
- The topic to which to distribute the message. Must not be nullmessage
- The message to send to the topic. Must not be nullpublic Filter getFilter()
InstanceLifecycleListener
getFilter
in interface InstanceLifecycleListener
public void lifecycleEvent(InstanceLifecycleEvent lifecycleEvent)
InstanceLifecycleListener
lifecycleEvent
in interface InstanceLifecycleListener
lifecycleEvent
- The event that has occurred, will not be nullpublic void configurationChanged()
DynamicConfigurationListener
DynamicConfiguration.commit()
so care should be taken
to do any work quickly. Any exception thrown from this method
will be ignored. A commit that failed will not be reported to
this methodconfigurationChanged
in interface DynamicConfigurationListener
Copyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.