Using CORBA Request-Level Interceptors
Is called by the ORB to allow the interceptor to clean up any state that the interceptor might have been managing that is specific to a request.
virtual void
exception_occurred( const ReplyContext & reply_context,
CORBA::Exception_ptr excep_val) = 0;
A reference to a ReplyContext
that contains information about the context in which the reply is being performed.
The exception_occurred
operation is called on a request-level interceptor implementation in one of three cases:
Request
object that was used to initiate a deferred synchronous DII. The exception_occurred
method is called instead of the client_response
or target_response
method of that interceptor. The ORB calls the exception_occurred
method to allow the interceptor implementation to clean up any state that it might have been managing that is specific to a request.
This is the base interface of all request-level interceptors. It inherits directly from the RequestLevelInterceptor::RequestInterceptor
interface. The interface contains the set of operations and attributes that are supported by all client-side request-level interceptors.
Listing 8-5 OMG IDL Definition
//File: RequestLevelInterceptor.idl
#ifndef _REQUEST_LEVEL_INTERCEPTOR_IDL
#define _REQUEST_LEVEL_INTERCEPTOR_IDL
#include <orb.idl>
#include <Giop.idl>
#include <Interceptors.idl>
#pragma prefix "beasys.com"
module RequestLevelInterceptor
{
local ClientRequestInterceptor : RequestInterceptor
{
InvokeReturnStatus
client_invoke(
in RequestContext request_context,
in ServiceContextList service_context,
in CORBA::DataInputStream request_arg_stream,
in CORBA::DataOutputStream reply_arg_stream,
out ExceptionValue excep_val
);
ResponseReturnStatus
client_response(
in ReplyContext reply_context,
in ServiceContextList service_context,
in CORBA::DataInputStream arg_stream,
out ExceptionValue excep_val
);
};
};
#endif /* _REQUEST_LEVEL_INTERCEPTOR_IDL */
The implementation of the operations _duplicate
, _narrow
, and _nil
are inherited indirectly from the implementation of the CORBA::LocalBase
interface provided by the CORBA ORB in the BEA Tuxedo product.
#ifndef _RequestLevelInterceptor_h
#define _RequestLevelInterceptor_h
#include <CORBA.h>
#include <IOP.h>
#include <GIOP.h>
#include <Interceptors.h>
class OBBEXPDLL RequestLevelInterceptor
{
public:
class ClientRequestInterceptor;
typedef ClientRequestInterceptor *
ClientRequestInterceptor_ptr;
class OBBEXPDLL ClientRequestInterceptor :
public virtual RequestInterceptor
{
public:
static ClientRequestInterceptor_ptr
_duplicate(ClientRequestInterceptor_ptr obj);
static ClientRequestInterceptor_ptr
_narrow(ClientRequestInterceptor_ptr obj);
inline static ClientRequestInterceptor_ptr
_nil() { return 0; }
virtual Interceptors::InvokeReturnStatus
client_invoke(
const RequestContext & request_context,
ServiceContextList_ptr service_context,
CORBA::DataInputStream_ptr request_arg_stream,
CORBA::DataOutputStream_ptr reply_arg_stream,
CORBA::Exception_ptr & excep_val ) = 0;
virtual Interceptors::ResponseReturnStatus
client_response(
const ReplyContext & reply_context,
ServiceContextList_ptr service_context,
CORBA::DataInputStream_ptr arg_stream,
CORBA::Exception_ptr & excep_val ) = 0;
protected:
ClientRequestInterceptor(CORBA::LocalBase_ptr obj = 0) { }
virtual ~ClientRequestInterceptor(){ }
private:
ClientRequestInterceptor( const ClientRequestInterceptor&)
{ }
void operator=(const ClientRequestInterceptor&) { }
}; // class ClientRequestInterceptor
};
#endif /* _RequestLevelInterceptor_h */