org.apache.muse.ws.notification.impl
Class SimpleNotificationConsumer
java.lang.Object
org.apache.muse.core.AbstractCapability
org.apache.muse.ws.notification.impl.SimpleNotificationConsumer
- All Implemented Interfaces:
- Capability, Initialization, InitializationParameters, NotificationConsumer, Shutdown
- public class SimpleNotificationConsumer
- extends AbstractCapability
- implements NotificationConsumer
SimpleNotificationConsumer is Muse's default implementation of the
WS-Notification NotificationConsumer port type and the listener API
that augments it.
- Author:
- Dan Jemiolo (danj)
| Methods inherited from class org.apache.muse.core.AbstractCapability |
getActions, getCapabilityURI, getEnvironment, getInitializationParameter, getInitializationParameters, getLog, getMessageHandler, getPersistence, getResource, hasBeenInitialized, hasBeenShutdown, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setInitializationParameters, setLog, setMessageHandler, setMessageHandlers, setPersistence, setResource, shutdown |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.muse.core.Capability |
getActions, getCapabilityURI, getEnvironment, getLog, getMessageHandler, getPersistence, getResource, initializeCompleted, prepareShutdown, setCapabilityURI, setEnvironment, setLog, setMessageHandlers, setPersistence, setResource |
SimpleNotificationConsumer
public SimpleNotificationConsumer()
addMessageListener
public void addMessageListener(NotificationMessageListener listener)
- Description copied from interface:
NotificationConsumer
- Adds the listener to the list of listeners that will be notified
whenever a message is received by the resource.
- Specified by:
addMessageListener in interface NotificationConsumer
- Parameters:
listener -
addTopicListener
public void addTopicListener(TopicListener listener)
- Description copied from interface:
NotificationConsumer
- Adds the listener to the list of listeners that will be notified
whenever a message is received that has the given WSN Topic.
These listeners will be fired whenever a message is received that
has the listener's topic, regardless of what is returned by accepts().
- Specified by:
addTopicListener in interface NotificationConsumer
- Parameters:
listener -
createNotifyHandler
protected MessageHandler createNotifyHandler()
getMessageListeners
public java.util.Collection getMessageListeners()
- Specified by:
getMessageListeners in interface NotificationConsumer
- Returns:
- The listeners that are currently receiving notifications.
getTopicListeners
public java.util.Collection getTopicListeners(QName topic)
- Specified by:
getTopicListeners in interface NotificationConsumer
- Returns:
- The listeners that are currently receiving notifications for
the given WSN Topic.
initialize
public void initialize()
throws SoapFault
- Specified by:
initialize in interface Initialization- Overrides:
initialize in class AbstractCapability
- Throws:
SoapFault
notify
public void notify(NotificationMessage[] messages)
- This implementation spawns a thread to handle the passing of the message
to the message listeners so that the method can return immediately and
speed up the notification process for the reporter.
- Specified by:
notify in interface NotificationConsumer
- Parameters:
messages -
removeMessageListener
public void removeMessageListener(NotificationMessageListener listener)
- Specified by:
removeMessageListener in interface NotificationConsumer
removeTopicListener
public void removeTopicListener(TopicListener listener)
- Specified by:
removeTopicListener in interface NotificationConsumer