org.jboss.mx.notification
Class AsynchNotificationBroadcasterSupport

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src) 
      extended byorg.jboss.mx.notification.AsynchNotificationBroadcasterSupport
All Implemented Interfaces:
NotificationBroadcaster (src) , NotificationEmitter (src)
Direct Known Subclasses:
InvokerTest (src)

public class AsynchNotificationBroadcasterSupport
extends JBossNotificationBroadcasterSupport (src)

A notification broadcaster with asynch notifications


Nested Class Summary
 class AsynchNotificationBroadcasterSupport.AsynchNotifier (src)
           
 
Constructor Summary
AsynchNotificationBroadcasterSupport()
          Construct a new Asyncrhonous broadcaster Calls this(defaultNotificationTimeout, defaultPool)
AsynchNotificationBroadcasterSupport(long notificationTimeout)
          Construct a new Asyncrhonous broadcaster.
AsynchNotificationBroadcasterSupport(long notificationTimeout, ThreadPool (src)  pool)
          Construct a new Asyncrhonous broadcaster
 
Method Summary
static long getDefaultNotificationTimeout()
           
 long getNotificationTimeout()
           
 ThreadPool (src) getThreadPool()
           
 void handleNotification(NotificationListener (src)  listener, Notification (src)  notification, java.lang.Object handback)
          Handle the notification, asynchronously invoke the listener.
static void setDefaultNotificationTimeout(long defaultNotificationTimeout)
           
static void setDefaultThreadPool(ThreadPool (src)  tp)
           
 void setNotificationTimeout(long notificationTimeout)
           
 void setThreadPool(ThreadPool (src)  pool)
           
protected  void stopThreadPool(boolean immeadiate)
          Invoke stop on the thread pool if its not the class default pool.
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
addNotificationListener, getNotificationInfo, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsynchNotificationBroadcasterSupport

public AsynchNotificationBroadcasterSupport()
Construct a new Asyncrhonous broadcaster Calls this(defaultNotificationTimeout, defaultPool)


AsynchNotificationBroadcasterSupport

public AsynchNotificationBroadcasterSupport(long notificationTimeout)
Construct a new Asyncrhonous broadcaster. Calls this(notificationTimeout, defaultPool)

Parameters:
notificationTimeout - the notification completion timeout in MS. A 0 value means no timeout.

AsynchNotificationBroadcasterSupport

public AsynchNotificationBroadcasterSupport(long notificationTimeout,
                                            ThreadPool (src)  pool)
Construct a new Asyncrhonous broadcaster

Parameters:
notificationTimeout - - the notification completion timeout in MS. A 0 value means no timeout.
pool - - the thread pool to use for the asynchronous notifcations
Method Detail

setDefaultThreadPool

public static void setDefaultThreadPool(ThreadPool (src)  tp)

getDefaultNotificationTimeout

public static long getDefaultNotificationTimeout()

setDefaultNotificationTimeout

public static void setDefaultNotificationTimeout(long defaultNotificationTimeout)

getNotificationTimeout

public long getNotificationTimeout()

setNotificationTimeout

public void setNotificationTimeout(long notificationTimeout)

getThreadPool

public ThreadPool (src)  getThreadPool()

setThreadPool

public void setThreadPool(ThreadPool (src)  pool)

handleNotification

public void handleNotification(NotificationListener (src)  listener,
                               Notification (src)  notification,
                               java.lang.Object handback)
Handle the notification, asynchronously invoke the listener.

Overrides:
handleNotification in class JBossNotificationBroadcasterSupport (src)
Parameters:
listener - the listener to notify
notification - the notification
handback - the handback object

stopThreadPool

protected void stopThreadPool(boolean immeadiate)
Invoke stop on the thread pool if its not the class default pool.

Parameters:
immeadiate - the immeadiate flag passed to the TheadPool#stop