net.rim.pushsdk.acknowledgement
Class NotificationListenerServiceImpl

java.lang.Object
  extended by net.rim.pushsdk.acknowledgement.NotificationListenerServiceImpl
All Implemented Interfaces:
NotificationListenerService

public class NotificationListenerServiceImpl
extends Object
implements NotificationListenerService

Implementation of the NotificationListenerService interface.

Dependencies that must be injected to properly initialize this object for use:
- pushSDKProperties

Author:
mdandrea

Constructor Summary
NotificationListenerServiceImpl()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationListenerServiceImpl

public NotificationListenerServiceImpl()
Method Detail

setPushSDKProperties

public void setPushSDKProperties(PushSDKProperties pushSDKProperties)
Description copied from interface: NotificationListenerService
Support for dependency injection. Inject an implementation of a PushSDKProperties collaborating object - this is used to read global configuration properties.

Specified by:
setPushSDKProperties in interface NotificationListenerService
Parameters:
pushSDKProperties - an instance of a PushSDKProperties implementation (must be thread safe)

destroy

public void destroy()
Description copied from interface: NotificationListenerService
Attempts to stop threads when the bean is destroyed.

Specified by:
destroy in interface NotificationListenerService

getNotificationListenerActiveThreadCount

public int getNotificationListenerActiveThreadCount()
Description copied from interface: NotificationListenerService
Returns the number of threads actively calling notification listeners.

Specified by:
getNotificationListenerActiveThreadCount in interface NotificationListenerService
Returns:
the number of active processing threads

getNotificationListenerThreadPoolSize

public int getNotificationListenerThreadPoolSize()
Description copied from interface: NotificationListenerService
Returns the number of threads currently in the thread pool (active and idle).

Specified by:
getNotificationListenerThreadPoolSize in interface NotificationListenerService
Returns:
the number of threads in the thread pool

getNotificationListenerWorkQueueSize

public int getNotificationListenerWorkQueueSize()
Description copied from interface: NotificationListenerService
Returns the size of the work queue which holds tasks (Runnables) waiting to be picked up and processed using an active thread.

Specified by:
getNotificationListenerWorkQueueSize in interface NotificationListenerService
Returns:
the size of the work queue

addListeners

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

Specified by:
addListeners in interface NotificationListenerService
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

public void notifyListeners(Notification notification)
Description copied from interface: NotificationListenerService
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.

Specified by:
notifyListeners in interface NotificationListenerService
Parameters:
notification - value object that represents a notification


Copyright © 2011 Research In Motion. All Rights Reserved.