ADORB framework support two kinds of interceptors - the IOR interceptors and the request interceptors.
Interceptors simply register themselves with the ORB notification center for specific notifications that are posted by ORB at specific interception points.
The ORB notification center is returned by the ORB
class method
+ notificationCenter
.
An IOR interceptor registers with the ORB notification center for notification name ORBDidCreateObjectProfile
.
The notification is posted after the profile is created for a local CORBAObject.
This allows the interceptor to add IOR components (objects of class IDLTaggedComponent) to the CORBAObject profile, particularly when the CORBAObject is created implicitly for an activatable object
(see Object Activation).
The notification object is the CORBAObject. The notification userInfo dictionary contains one key/value pair with
the CORBAObject's profile for key @"profile"
.
A request Interceptor is designed to intercept the flow of a request/reply sequence
through the ORB at specific points so that services can query the request information
and manipulate the service contexts that are propagated between clients and servers.
The primary use of request Interceptors is to enable ORB services to transfer context
information between clients and servers.
See OMG specification formal/04-03-12 (CORBA specification) for detailed specification.
ADORB implementation differs from the OMG specification in that that an interceptor can use any method names instead of fixed by the specification and that an interceptor registers with ORB simply by subscribing for specific notifications. The send_poll
interception point is not supported by ADORB.
ORB posts the following notifications during the request/reply flow
Notification | Description |
---|---|
ORBWillSendRequest |
This client-side interception point corresponds to send_request . |
ORBDidReceiveRequestContext |
This server-side interception point corresponds to receive_request_service_contexts . |
ORBDidReceiveRequest |
This server-side interception point corresponds to receive_request . |
ORBWillSendResponse |
This server-side interception point corresponds to send_reply . |
ORBWillSendException |
This server-side interception point corresponds to send_exception . |
ORBWillSendOther |
This server-side interception point corresponds to send_other . |
ORBDidReceiveResponse |
This client-side interception point corresponds to receive_reply . |
ORBDidReceiveException |
This client-side interception point corresponds to receive_exception . |
ORBDidReceiveOther |
This client-side interception point corresponds to receive_other . |
The following values are used as keys in the userInfo dictionary for the interceptor notifications.
Key | Description |
---|---|
ORBServiceContextKey | Request Service Context dictionary for notifications ORBWillSendRequest, ORBDidReceiveRequestContext and ORBDidReceiveRequest. Response service context for other interceptor notifications. |
ORBOperationNameKey | Operation name |
ORBObjectKey | Target object |
ORBRequestIdKey | Request ID, NSNumber |
ORBExceptionKey | NSException, if any |
ORBReplyStatusKey | Reply status, NSNumber |
ORBOnewayKey | NSNumber(BOOL), whether the operation is one-way. |