summaryrefslogtreecommitdiff
path: root/TAO/tao/Interceptor.pidl
blob: 8e8e64787063aa88d4754d38b326654ce07c5c6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// -*- IDL -*- $Id$

// 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 <nanbor@cs.wustl.edu>

#include <corba.pidl>
#include <IOP.pidl>

#pragma prefix "TAO"

module PortableInterceptor
{
  interface Cookie
    {
      // Cookie's are used to pass information among interceptors
      // within a invocation or an upcall.
      string myname ();
    };

  typedef sequence<Cookie>  Cookies;
  // Collections of Cookie's become Cookies'es.

  interface RequestInfo
    {
      unsigned long get_request_id ();
      /*
      boolean set_request_id (in unsigned long rid);
      // This method is disabled for now because I don't know
      // the purpose of changing request id and how does it
      // fit into TAO's current structure.
      */

      boolean response_expected ();
      // This method will eventually changed to support
      // AMI.

      CORBA::Object get_object ();
      // Get the object reference the targeting object.

      string get_operation ();
      // We don't allow changing operation for now.
      // Otherwise, we'll change

      CORBA::NVList get_arguments ();
      boolean set_arguments (in CORBA::NVList args);
      // Accessing and changing the operation arguments/return value.
    };

  interface Interceptor
    {
      // Base interface for Interceptors.
      readonly attribute string name;
    };

  interface ServerRequestInterceptor : Interceptor
    {
      // Server side request interceptor definition.

      void preinvoke (inout RequestInfo ri,
                      inout IOP::ServiceContextList sc,
                      inout Cookies ck);
      // Interception pointer before invoking the servant method.

      void postinvoke (inout RequestInfo ri,
                       inout IOP::ServiceContextList sc,
                       inout Cookies ck);
      // Interception pointer after invoking the servant method.

      void exception_occurred (inout RequestInfo ri,
                               inout IOP::ServiceContextList sc,
                               inout Cookies ck);
      // Exception interception point.
    };

  interface ClientRequestInterceptor : Interceptor
    {
      // Client side interceptor.

      void preinvoke (inout RequestInfo ri,
                      inout IOP::ServiceContextList sc,
                      inout Cookies ck);
      // Before remote invocation.

      void postinvoke (inout RequestInfo ri,
                       inout IOP::ServiceContextList sc,
                       inout Cookies ck);
      // After returned from remote invocation.

      void exception_occurred (inout RequestInfo ri,
                               inout IOP::ServiceContextList sc,
                               inout Cookies ck);
      // Exception occurred.
    };
};

#pragma prefix ""