VisiBroker for .NET provides a set of interfaces known as interceptors which provide a framework for plugging-in additional ORB behavior such as security, transactions, or logging. These interceptor interfaces are based on a callback mechanism. For example, using the interceptors, you can be notified of communications between clients and servers, and modify these communications if you wish, effectively altering the behavior of the ORB.
• Request Interceptors can enable the ORB services to transfer context information between clients and servers. Request Interceptors are further divided into Client Request Interceptors and Server Request Interceptors.
• An IOR interceptor is used to enable an ORB service to add information in an IOR describing the server's or object's ORB-service-related capabilities. For example, a security service (like SSL) can add its tagged component into the IOR so that clients recognizing that component can establish the connection with the server based on the information in the component.All the interceptor classes mentioned above are derived from a common class: Interceptor. This Interceptor class has defined common methods that are available to its inherited classes.A request interceptor is used to intercept flow of a request/reply sequence at specific interception points so that services can transfer context information between clients and servers. For each interception point, the ORB gives an object through which the Interceptor can access request information. There are two kinds of request interceptors and their respective request information interfaces:
• ClientRequestInterceptor and ClientRequestInfo
• ServerRequestInterceptor and ServerRequestInfoClientRequestInterceptor has its interception points implemented on the client side. There are five interception points defined in ClientRequestInterceptor by OMG as shown in the following table.
Lets a client-side Interceptor query a request during a Time-Independent Invocation (TII)1 polling get reply sequence.
1TII is not implemented in VisiBroker for .NET. As a result, the SendPoll( ) interception point will never be invoked.
• The starting interception points are: SendRequest and SendPoll. On any given request/reply sequence, one and only one of these interception points is called.
•
•
• A ReceiveException is called with the system exception BAD_INV_ORDER with a minor code of 4 (ORB has shutdown) if a request is canceled because of ORB shutdown.
• A ReceiveException is called with the system exception TRANSIENT with a minor code of 3 if a request is canceled for any other reason.
SendRequest is followed by ReceiveReply - a start point is followed by an end point SendRequest is followed by ReceiveOther - a start point is followed by an end pointServerRequestInterceptor has its interception points implemented on the server-side. There are five interception points defined in ServerRequestInterceptor. The following table shows the ServerRequestInterceptor Interception points.
Lets a server-side Interceptor get its service context information from the incoming request and transfer it to PortableInterceptor.Current's slot.
• The starting interception point is: ReceiveRequestServiceContexts. This interception point is called on any given request/reply sequence.
• The ending interception points are: SendReply, SendException and SendOther. On any given request/reply sequence, one and only one of these interception points is called.
• The intermediate interception point is ReceiveRequest. It is called after ReceiveRequestServiceContexts and before an ending interception point.
• On an exception, ReceiveRequest may not be called.
• An ending interception point is called if and only if ReceiveRequestServiceContext runs successfully.
• A SendException is called with the system exception BAD_INV_ORDER with a minor code of 4 (ORB has shutdown) if a request is canceled because of ORB shutdown.
• A SendException is called with the system exception TRANSIENT with a minor code of 3 if a request is canceled for any other reason.
The order of interception points: ReceiveRequestServiceContexts, ReceiveRequest, SendReply - a start point is followed by an intermediate point which is followed by an end point .IORInterceptor gives applications the ability to add information describing the server's or object's ORB service related capabilities to object references to enable the ORB service implementation in the client to function properly. This is done by calling the interception point, EstablishComponents. An instance of IORInfo is passed to the interception point.The PortableInterceptor.Current object (hereafter referred to as PICurrent) is a table of slots that can be used by Portable Interceptors implementations to associate thread-specific information with the currently active request context. Use of PICurrent is optional, and would typically be used if a client's thread-specific information is required within an Interceptor.PICurrent is obtained through a call to:The Codec provides a mechanism for interceptors to transfer components between their IDL data types and their CDR encapsulation representations.This class is used to create a Codec object by specifying the encoding format, the major and minor versions. CodecFactory can be obtained a call to:Portable Interceptors must be registered with the ORB before they can be used. To register a Portable Interceptor the janeva.orb.init property is provided.Note, that it is possible to specify a list of janeva.pi.init settings to configure multiple Portable Interceptors:Each janeva.orb.init instance does not overwrite the previous one, but adds it to a Portable Interceptor list.Portable Interceptors specified by OMG are scoped globally. VisiBroker for .NET has defined "POA scoped Server Request Interceptor", a public extension to the Portable Interceptors, by adding a new module call PortableInterceptorExt. This new module holds a local interface, IORInfoExt, which is inherited from PortableInterceptor.IORInfo and has additional methods to install POA scoped server request interceptor.
• Arguments, Result, Exceptions, Contexts, and OperationContexts are only available for DII invocations.
• ReceivedException and ReceivedExceptionId will always return a CORBA.UNKNOWN exception and its respective repository id if a user exception is thrown by the application.
• Exceptions does not return any value; it will raise a CORBA.NO_RESOURCES exception in both dynamic invocations and static stub based invocation.
• Contexts returns the list of contexts that are available during operation invocation.
• SendingException returns the correct user exception only in the case of dynamic invocation (provided the user exception can be inserted into an Any or its TypeCode information is available).
•