net.rim.pushsdk.acknowledgement
Interface NotificationListenerService

All Known Implementing Classes:
NotificationListenerServiceImpl

public interface NotificationListenerService

Business logic relating to the notification of the acknowledgement listeners.

The addListeners(Map> newListeners) method may be called to register listeners to be called back on certain events.

Author:
mdandrea

Method Summary
 void addListeners(Map<String,List<NotificationListener>> newListeners)
          Adds NotificationListener(s) to the collection of listeners that will be notified when a new result notification is received.
 void destroy()
          Attempts to stop threads when the bean is destroyed.
 int getNotificationListenerActiveThreadCount()
          Returns the number of threads actively calling notification listeners.
 int getNotificationListenerThreadPoolSize()
          Returns the number of threads currently in the thread pool (active and idle).
 int getNotificationListenerWorkQueueSize()
          Returns the size of the work queue which holds tasks (Runnables) waiting to be picked up and processed using an active thread.
 void notifyListeners(Notification notification)
          Note that this method is used internally by the SDK and should not normally be externally invoked or overridden.
 void setPushSDKProperties(PushSDKProperties pushSDKProperties)
          Support for dependency injection.
 

Method Detail

addListeners

void addListeners(Map<String,List<NotificationListener>> newListeners)
Adds NotificationListener(s) to the collection of listeners that will be notified when a new result notification is received.

Parameters:
newListeners - map of listeners that register for receiving result notifications. The map keys are push application ids, the values are the listeners that register for the application's notifications.

notifyListeners

void notifyListeners(Notification notification)
Note that this method is used internally by the SDK and should not normally be externally invoked or overridden. Notifies the listeners about a received result notification.

Parameters:
notification - value object that represents a notification

getNotificationListenerActiveThreadCount

int getNotificationListenerActiveThreadCount()
Returns the number of threads actively calling notification listeners.

Returns:
the number of active processing threads

getNotificationListenerThreadPoolSize

int getNotificationListenerThreadPoolSize()
Returns the number of threads currently in the thread pool (active and idle).

Returns:
the number of threads in the thread pool

getNotificationListenerWorkQueueSize

int getNotificationListenerWorkQueueSize()
Returns the size of the work queue which holds tasks (Runnables) waiting to be picked up and processed using an active thread.

Returns:
the size of the work queue

destroy

void destroy()
Attempts to stop threads when the bean is destroyed.


setPushSDKProperties

void setPushSDKProperties(PushSDKProperties pushSDKProperties)
Support for dependency injection. Inject an implementation of a PushSDKProperties collaborating object - this is used to read global configuration properties.

Parameters:
pushSDKProperties - an instance of a PushSDKProperties implementation (must be thread safe)


Copyright © 2011 Research In Motion. All Rights Reserved.