Tuxedo
0

Using CORBA Request-Level Interceptors

 Previous Next Contents Index View as PDF  

Interceptor::shutdown

Synopsis

Notifies an implementation of an interceptor that the interceptor is being shut down.

C++ Binding

virtual ShutdownReturnStatus 
shutdown( ShutdownReason reason,
CORBA::Exception_ptr & excep_val) = 0;

Parameters

reason

A ShutdownReason value that indicates the reason why the interceptor is being shut down. The following ShutdownReason values can be passed to the operation:


 


 


 


 


 

excep_val

A reference to an ExceptionValue in which the operation is to store any exception raised. This parameter is valid only if a value of SHUTDOWN_EXCEPTION is returned from the operation.

ExceptionValue is mapped to the class CORBA::Exception.

Exceptions

None.

Description

The shutdown operation is used by the ORB to notify an implementation of an interceptor that the interceptor is being shut down. The ORB destroys the instance of the interceptor once control is returned from the operation back to the ORB.

Return Values

SHUTDOWN_NO_EXCEPTION

Indicates that the operation has not raised an exception.

SHUTDOWN_EXCEPTION

Indicates that the operation has raised an exception. The value of the exception is stored in the excep_val parameter.

 


RequestLevelInterceptor::
RequestInterceptor Interface

The RequestLevelInterceptor::RequestInterceptor interface is the base interface of all request-level interceptors. It inherits directly from the Interceptors::Interceptor interface. The RequestLevelInterceptor::RequestInterceptor interface:

The local keyword in OMG IDL indicates that the RequestInterceptor interface is not a normal CORBA object, so it cannot be used as such.

Listing 8-3 OMG IDL for the RequestLevelInterceptor::RequestInterceptor Interface

#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 RequestInterceptor : Interceptors::Interceptor
{
void exception_occurred(
in ReplyContext reply_context,
in ExceptionValue excep_val
);
};
};
#endif /* _REQUEST_LEVEL_INTERCEPTOR_IDL */

The implementation of the RequestInterceptor interface inherits from CORBA::LocalBase rather than from CORBA::Object. CORBA::LocalBase provides an implementation of the operations _duplicate, _narrow, and _nil, similar to those of CORBA::Object.

Listing 8-4 C++ Declaration for the RequestInterceptor Interface

#ifndef _RequestLevelInterceptor_h
#define _RequestLevelInterceptor_h

#include <CORBA.h>
#include <IOP.h>
#include <GIOP.h>
#include <Interceptors.h>

class OBBEXPDLL RequestLevelInterceptor
{
public:
class RequestInterceptor;
typedef RequestInterceptor * RequestInterceptor_ptr;

struct RequestContext
{
Interceptors::Version struct_version;
CORBA::ULong request_id;
CORBA::Octet response_flags;
GIOP::TargetAddress target;
CORBA::String_var interface_id;
CORBA::String_var operation;
RequestContext &operator=(const RequestContext &_obj);
};

typedef RequestContext * RequestContext_ptr;
typedef GIOP::ReplyStatusType_1_2 ReplyStatus;

struct ReplyContext
{
Interceptors::Version struct_version;
CORBA::ULong request_id;
ReplyStatus reply_status;
};

typedef ReplyContext * ReplyContext_ptr;

class OBBEXPDLL RequestInterceptor :
public virtual Interceptors::Interceptor
{
public:
static RequestInterceptor_ptr
_duplicate(RequestInterceptor_ptr obj);
static RequestInterceptor_ptr
_narrow(RequestInterceptor_ptr obj);
inline static RequestInterceptor_ptr _nil() { return 0; }

virtual void
exception_occurred( const ReplyContext & reply_context,
CORBA::Exception_ptr excep_val) = 0;

protected:
RequestInterceptor(CORBA::LocalBase_ptr obj = 0) { }
virtual ~RequestInterceptor(){ }

private:
RequestInterceptor( const RequestInterceptor&) { }
void operator=(const RequestInterceptor&) { }
}; // class RequestInterceptor
#endif /* _RequestLevelInterceptor_h */

 

Back to Top Previous Next
Contact e-docsContact BEAwebmasterprivacy