|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.util.notifications.MessageWindowNotificationManager
public class MessageWindowNotificationManager
Implements NotificationManager
using a MessageWindow
.
Currently this implementation is only useful on Windows platforms. It is safe
to use on other platforms, but it will not send or receive any messages.
Unlike the Visual Studio implementation, this class does not support "immediate" notification sending (all notifications will be queued and sent in batches).
Also, all queued notifications are always "collapsed" on both params (which is optional but always used in the VS implementation). This means a notification that exactly matches an already-queued notification will not be queued.
Constructor Summary | |
---|---|
MessageWindowNotificationManager()
Creates a MessageWindowNotificationManager . |
Method Summary | |
---|---|
void |
addListener(NotificationListener listener)
Adds a notification listener. |
protected void |
clearListeners()
Removes all the listeners. |
void |
close()
|
protected void |
fireNotificationReceived(Notification notification,
long param1,
long param2)
Fires the NotificationListener.notificationReceived(Notification, long, long)
event. |
void |
removeListener(NotificationListener listener)
Removes a notification listener. |
void |
sendNotification(Notification notification,
int param1,
int param2)
Sends a Notification . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageWindowNotificationManager()
MessageWindowNotificationManager
. On Windows this
constructor creates a hidden message-only window (MessageWindow
)
to do IPC. On non-Windows platforms, the class sends or receives no
messages.
The application must be in a state where window creation will succeed when this constructor is used.
Method Detail |
---|
public void close()
Closing a NotificationManager
flushes the send queue and removes
all listeners.
public void sendNotification(Notification notification, int param1, int param2)
Notification
. The message may be queued before being
sent.
notification
- the notification to send (must not be null
)param1
- the first parameter to sendparam2
- the second parameter to sendpublic void addListener(NotificationListener listener)
addListener
in interface NotificationManager
listener
- the listener to addpublic void removeListener(NotificationListener listener)
removeListener
in interface NotificationManager
listener
- the listener to removeprotected void clearListeners()
protected void fireNotificationReceived(Notification notification, long param1, long param2)
NotificationListener.notificationReceived(Notification, long, long)
event.
notification
- the notification to send (must not be null
)param1
- the first parameterparam2
- the second parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |