Interceptors allow you to interpose other CORBA services to the ORB and extend the ORB's functionalities. They are most commonly used in, but not limited to, Security Service, Transaction Service.
Although both CORBA 2.2 and 2.3 define an interceptor interface, the definitions are pretty much useless because it does not define how the interceptor should interact with an ORB. Therefore, OMG is currently trying to define a "Portable Interceptor" which will remedy the problems and allow application users to use interceptos from different venders with their ORBs.
Because the "Portable Interceptor Spec" is still in the initial submission stage, and there are several proposed standards which define very different interfaces and capabilities, our goal is to provide an minimum subset of functionalities proposed in the initial submissions. This approach should allow TAO users to explore various use cases of interceptors while avoid adding something that will eventually be removed from the standard.
As we will eventually modify TAO's interceptor interface in the future when it become available, you will have to revise your implementation also when that occurs.
// -*- IDL -*- $Id: interceptors.html,v 1.2 1999/09/03 23:03:45 schmidt Exp $ // This file contains the interface definitions for "Portable" // Interceptor support. // ********************************************************** // Notice that the Portable Interceptor specification // is still under discussion in OMG and both the IDL // and the implementation details in TAO will eventually // change to conform with the PI spec in the future. // ********************************************************** // Author (currently): Nanbor Wang#include #include #pragma prefix "TAO" // The prefix should be changed to "omg.org" once the spec. gets // finallized. module PortableInterceptor { interface Cookie { // Cookie's are used to pass information among interceptors // within a invocation or an upcall. string myname (); }; typedef sequence Cookies; // Collections of Cookie's become Cookies'es. interface Interceptor { // Base interface for Interceptors. readonly attribute string name; }; interface ServerRequestInterceptor : Interceptor { // Server side request interceptor definition. void preinvoke (in unsigned long request_id, in boolean response_expected, in CORBA::Object objref, in string operation_name, inout IOP::ServiceContextList sc, inout NVList arguments, inout Cookies ck); // Interception pointer before invoking the servant method. // Currently, we don't pass NVList into the interceptor because // I haven't figured out how to best optimize this stuff. // In the future, NVList will contain all in and inout arguments // of the operation. void postinvoke (in unsigned long request_id, in boolean response_expected, in CORBA::Object objref, in string operation_name, inout IOP::ServiceContextList sc, inout NVList arguments, inout Cookies ck); // Interception pointer after invoking the servant method. // Currently, we don't pass NVList into the interceptor because // I haven't figured out how to best optimize this stuff. // In the future, NVList will contain all out, inout arguments // and the return value of the operation. void exception_occurred (in unsigned long request_id, in boolean response_expected, in CORBA::Object objref, in string operation_name, inout Cookies ck); // Exception interception point. }; interface ClientRequestInterceptor : Interceptor { // Client side interceptor. void preinvoke (in unsigned long request_id, in boolean response_expected, in CORBA::Object objref, in string operation_name, inout IOP::ServiceContextList sc, inout NVList arguments, inout Cookies ck); // Before remote invocation. // Currently, we don't pass NVList into the interceptor because // I haven't figured out how to best optimize this stuff. // In the future, NVList will contain all in and inout arguments // of the operation. void postinvoke (in unsigned long request_id, in boolean response_expected, in CORBA::Object objref, in string operation_name, inout IOP::ServiceContextList sc, inout NVList arguments, inout Cookies ck); // After returned from remote invocation. // Currently, we don't pass NVList into the interceptor because // I haven't figured out how to best optimize this stuff. // In the future, NVList will contain all out, inout arguments // and the return value of the operation. void exception_occurred (in unsigned long request_id, in boolean response_expected, in CORBA::Object objref, in string operation_name, inout Cookies ck); // Exception occurred. }; }; #pragma prefix ""
Currently, TAO only support request-level interceptor.
The NVList argument that passes the argument list of the operation is current empty, i.e., currently, you can not access/modify the arguments of a method invocation.
Obviously, added support for accessing the invocation arguments.
Implement a better interceptor management interface in ORB.
Review ways to support interceptors with AMI.
[EXP]
99-04-10 by Expersoft Corp., GMD Fokus,
OIS, OOC (ORBacus)
[IBM]
99-04-04 by IBM
[INP]
99-04-05 by Inprise (Visibroker) and BEA
[HPI]
99-04-08 by HP and IONA (Orbix)
[SUN]
99-04-07 by Eternal System, Expersoft and
Sun