org.apache.muse.ws.notification.impl
Class SimpleNotificationConsumer

java.lang.Object
  extended by org.apache.muse.core.AbstractCapability
      extended by org.apache.muse.ws.notification.impl.SimpleNotificationConsumer
All Implemented Interfaces:
Capability, Initialization, InitializationParameters, Shutdown, NotificationConsumer

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)

Constructor Summary
SimpleNotificationConsumer()
           
 
Method Summary
 void addMessageListener(NotificationMessageListener listener)
          Adds the listener to the list of listeners that will be notified whenever a message is received by the resource.
 void addTopicListener(TopicListener listener)
          Adds the listener to the list of listeners that will be notified whenever a message is received that has the given WSN Topic.
protected  MessageHandler createNotifyHandler()
           
 Collection getMessageListeners()
           
 Collection getTopicListeners(QName topic)
           
 void initialize()
           
 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.
 void removeMessageListener(NotificationMessageListener listener)
           
 void removeTopicListener(TopicListener listener)
           
 
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
 
Methods inherited from interface org.apache.muse.core.Initialization
hasBeenInitialized
 
Methods inherited from interface org.apache.muse.core.InitializationParameters
getInitializationParameter, getInitializationParameters, setInitializationParameters
 
Methods inherited from interface org.apache.muse.core.Shutdown
hasBeenShutdown, shutdown
 

Constructor Detail

SimpleNotificationConsumer

public SimpleNotificationConsumer()
Method Detail

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

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

createNotifyHandler

protected MessageHandler createNotifyHandler()

getMessageListeners

public Collection getMessageListeners()
Specified by:
getMessageListeners in interface NotificationConsumer
Returns:
The listeners that are currently receiving notifications.

getTopicListeners

public 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

removeMessageListener

public void removeMessageListener(NotificationMessageListener listener)
Specified by:
removeMessageListener in interface NotificationConsumer

removeTopicListener

public void removeTopicListener(TopicListener listener)
Specified by:
removeTopicListener in interface NotificationConsumer


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.