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

java.lang.Object
  extended by org.apache.muse.ws.notification.impl.SimplePullPointDataStore
All Implemented Interfaces:
Initialization, Shutdown, PullPointDataStore

public class SimplePullPointDataStore
extends Object
implements PullPointDataStore

SimplePullPointDataStore is an in-memory container for messages received by a pullpoint resource. It stores messages in a linked hash set so that they can be retrieved in order in O(1) time. There is no maximum size for the collection, so footprint of the application could easily get out-of-hand unless the user provides additional logic to handle this (although it is not clear what else could be done aside from dropping messages). A better implementation would rely on a persistent data store and asynchronous additions and deletions.

Author:
Dan Jemiolo (danj)

Constructor Summary
SimplePullPointDataStore()
           
 
Method Summary
 void addMessage(NotificationMessage message)
           
 NotificationMessage[] getMessages(int maxNumber)
           
 boolean hasBeenInitialized()
           
 boolean hasBeenShutdown()
           
 void initialize()
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimplePullPointDataStore

public SimplePullPointDataStore()
Method Detail

addMessage

public void addMessage(NotificationMessage message)
Specified by:
addMessage in interface PullPointDataStore

getMessages

public NotificationMessage[] getMessages(int maxNumber)
Specified by:
getMessages in interface PullPointDataStore
Parameters:
maxNumber - The maximum number of messages that should be returned by the method.
Returns:
Zero or more messages (with a maximum specified by the parameter) that have been stored by the pullpoint. Once the messages are returned in this operation, they should not be included in responses to future requests.

hasBeenInitialized

public boolean hasBeenInitialized()
Specified by:
hasBeenInitialized in interface Initialization
Returns:
True, if the initialize() method has been called and run to completion successfully.

hasBeenShutdown

public boolean hasBeenShutdown()
Specified by:
hasBeenShutdown in interface Shutdown
Returns:
True, if the shutdown() method has been called and run to completion successfully. If true, no other methods should be called on this Resource object.

initialize

public void initialize()
Specified by:
initialize in interface Initialization

shutdown

public void shutdown()
Specified by:
shutdown in interface Shutdown


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