richard@brainstorm.co.uk
)Version: 1.32
Date: 2003/07/31 23:49:31
Copyright: (C) 1998-2003 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSDistributedNotificationCenter.h
Standards:
- MacOS-X
- NotOpenStep
- GNUstep
The NSDistributedNotificationCenter provides a
versatile yet simple mechanism for objects in
different processes to communicate effectively
while knowing very little about each others
internals.
A distributed notification
center acts much like a normal notification center,
but it handles notifications on a machine-wide (or
local network wide) basis rather than just
notifications within a single process.
Objects are able to register themselves as
observers for particular notification names and
objects, and they will then receive notifications
(including optional user information consisting
of a dictionary of property-list objects) as they are
posted.
Since posting of distributed notifications involves inter-process (and sometimes inter-host) communication, it is fundamentally slower than normal notifications, and should be used relatively sparingly. In order to help with this, the NSDistributedNotificationCenter provides a notion of 'suspension', whereby a center can be suspended causing notifications for observers in the process where the center was suspended to cease receiving notifications. Observers can specify how notifications are to be handled in this case (queued or discarded) and posters can specify that particular notifications are to be delivered immediately irrespective of suspension.
Distributed notifications are mediated by a
server process which handles all notifications for a
particular center type. In GNUstep this process
is the gdnc tool, and when started without special
options, a gdnc process acts as the local centre
for the host it is running on. When started with the
GSNetwork user default set to YES
,
the gdnc tool acts as a local network wide server (you
should only run one copy of gdnc like this on your
LAN).
The gdnc process should be started at
machine boot time, but GNUstep will attempt to
start it automatically if it can't find it.
MacOS-X currently defines only a notification center for the local host. GNUstep also defines a local network center which can be used from multiple hosts. By default the system sends this to any gdnc process it can find which is configured as a network-wide server, but the GDNCHost user default may be used to specify a particular host to be contacted... this may be of use where you wish to have logically separate clusters of machines on a shared LAN.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Returns the default notification center... a shared notification center for the local host. This is simply a convenience method equivalent to calling +notificationCenterForType: with NSLocalNotificationCenterType as its argument.
Returns a notification center of the specified
type.
The
NSLocalNotificationCenterType
provides a shared access to a notificatiuon center
used by processes on the local host.
The
GSNetworkNotificationCenterType
provides a shared access to a notificatiuon center
used by processes on the local network.
MacOS-X
supports only NSLocalNotificationCenterType.
Adds an observer to the receiver. Calls -addObserver:selector:name:object:suspensionBehavior: with NSNotificationSuspensionBehaviorCoalesce.
Adds an observer to the receiver.
When a
notification matching
notificationName and anObject
is sent to the center, the object anObserver
is sent the message aSelector with the
notification info dictionary as its argument.
The suspensionBehavior governs how
the center deals with notifications when the process to
which the notification should be delivered is
suspended:
Posts the notification to the center using
postNotificationName:object:userInfo:deliverImmediately:
with the delivery flag set to NO
.
Posts the notificationName and
anObject to the center using
postNotificationName:object:userInfo:deliverImmediately:
with the user info set to nil
and the
delivery flag set to NO
.
Posts the notificationName,
anObject and userInfo to the
center using
postNotificationName:object:userInfo:deliverImmediately:
with the delivery flag set to NO
.
The primitive notification posting method...
The
userInfo dictionary may contain only
property-list objects.
The
deliverImmediately flag specifies whether
the suspension state of the receiving process is to be
ignored.
Removes the observer from the center.
Sets the suspension state of the receiver... if the receiver is suspended, it won't handle notification until it is unsuspended again, unless the notifications are posted to be delivered immediately.
Returns the current suspension state of the receiver.