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

java.lang.Object
  extended byorg.apache.muse.core.AbstractCapability
      extended byorg.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)

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.
 java.util.Collection getMessageListeners()
           
 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)
           
 
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
Parameters:
listener -

getMessageListeners

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

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