ORBNotificationCenter

Inherits From:
NSObject

Declared In:
ADORB/ORBNotificationCenter.h

Class Description

ORBNotificationCenter is used by the ORB to implement CORBA Interceptors.
The class also implements the functionality of NSNotificationCenter.

Instance Methods

- (void)addObserver:anObserver selector:(SEL)aSelector name:(NSString *)notificationName object:anObject

Registers anObserver to receive notifications with the name notificationName and/or containing anObject. If anObject is nil anObserver will receive all the notifications with name notificationName. If notificationName is nil anObserver will receive all notifications containing anObject. If both notificationName and anObject are nil anObserver will receive all the notifications posted to the receiver.
The notification center does not retain anObserver or anObject.
aSelector may be NULL. For the starting interception points this provides that anObserver will be simply put on the "flow stack".

- (void)postNotification:(NSNotification *)notification

Posts notification to the notification center.

- (void)postNotificationName:(NSString *)notificationName object:(id)anObject

Creates notification with name notificationName and object anObject and posts it to the notification center.

- (void)postNotificationName:(NSString *)notificationName object:(id)anObject userInfo:(NSDictionary *)userInfo

Creates notification with name notificationName, object anObject and dictionary userInfo and posts it to the notification center.

- (void)removeObserver:(id)anObserver

Removes anObserver from the notification center.

- (void)removeObserver:(id)anObserver name:(NSString *)notificationName object:(id)anObject

Unregisters anObserver to receive notifications with name notificationName and object anObject. If anObject is nil anObserver is unregistered for all notifications with name notificationName and analogously if notificationName is nil.

- (void)addAllowedExceptionName:(NSString*)name

Allows interceptors to raise exceptions with name name. See Interceptors on how exceptions raised by interceptors are handled.
This does not affect regular notifications. All the exceptions raised by the observers of regular notifications are ignored.

- (void)addAllowedExceptionNamesFromArray:(NSArray*)array

Adds the exception names in array to the allowed exceptions.

- (void)removeAllowedExceptionName:(NSString*)name

Removes exception name name from the set of allowed exception names.

Interceptor Notifications

The IOR interceptors register for notification ORBDidCreateObjectProfile.

The client request interceptors register themselves with ORB by registering with the default ORB notification center for notification ORBWillSendRequest and optionally for notifications ORBDidReceiveResponse, ORBDidReceiveException and/or ORBDidReceiveOther. The default ORBNotificationCenter is returned by ORB class method + notificationCenter.

The server request interceptors register with ORB by registering with the default ORB notification center for notification ORBDidReceiveRequest and optionally for ORBDidReceiveRequestContext, ORBWillSendResponse, ORBWillSendException and/or ORBWillSendOther.

The notification object for both client and server interceptor notifications implements protocol ORBRequestInfo and userInfo dictionary contains key/value pairs shown in userInfo keys table.

The request interception notifications are handled differently by the ORB notification center than the regular notifications.
When a starting interception point notification is sent to observers a "flow stack" is created and the observers that return normally are put on this "flow stack". If an observer raises an exception the normal request flow is interrupted, the request will be not sent and no remaining observers are notified. Instead ORB behaves as though the method implementation returns the exception. The allowed exceptions are CORBASystemException and ForwardRequest exceptions.
An ending interception point notification is sent only to the observers on the "flow stack". An observer is popped from the flow stack and is notified if it subscribes for this notification. The observer may raise an exception in which case an appropriate notification is sent to the remaining observers on the flow stack. The notification's userInfo dictionary will contain this exception value.

See also Interceptors.

ORBDidCreateObjectProfile

This is an IOR interceptor notification. It is posted when CORBAObject's profile has been created and allows observer to add or remove tagged components, especially when CORBAObject is created implicitly.
The notification's object is a CORBAObject which profile is created.
The notification's userInfo dictionary contains 1 key/value pair with IDLProfile object for key @"profile".

ORBDidReceiveRequestContext

This server request interceptor notification is posted when a request is received by server and the request service context is decoded.

ORBDidReceiveRequest

This server request interceptor notification is posted before the request is sent to the target object.

ORBWillSendResponse

This server request interceptor notification is posted after the request method implementation successfully returned to the ORB.

ORBWillSendException

This server request interceptor notification is posted after the request method implementation raised an exception or a previous interceptor raised an exception.

ORBWillSendOther

This server request interceptor notification is posted after the request method implementation raised a ForwardRequest exception or a previous interceptor raised a ForwardRequest exception.

ORBWillSendRequest

This client request interceptor notification is posted before the request is sent to server.

ORBDidReceiveResponse

This client request interceptor notification is posted when a response is received from server.

ORBDidReceiveException

This client request interceptor notification is posted when an exception is received from server or an exception is raised by a previous interceptor.

ORBDidReceiveOther

This client request interceptor notification is posted when a LOCATION_FORWARD response is received from server or a ForwardRequest exception is raised by a previous interceptor.