Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Portable_Interceptors / Benchmark / Client_ORBInitializer.cpp
blobbfea67d3b52a214dafa601ebdb1b775d181e741d
1 // -*- C++ -*-
2 #include "Client_ORBInitializer.h"
3 #include "client_interceptors.h"
4 #include "Interceptor_Type.h"
6 Client_ORBInitializer::Client_ORBInitializer (int interceptor_type)
7 : interceptor_type_ (interceptor_type)
11 void
12 Client_ORBInitializer::pre_init (
13 PortableInterceptor::ORBInitInfo_ptr)
17 void
18 Client_ORBInitializer::post_init (
19 PortableInterceptor::ORBInitInfo_ptr info)
22 PortableInterceptor::ClientRequestInterceptor_ptr tmp =
23 PortableInterceptor::ClientRequestInterceptor::_nil ();
25 switch (this->interceptor_type_)
27 default:
28 case IT_NONE:
29 return;
31 case IT_NOOP:
33 // Installing the Vault interceptor
34 ACE_NEW_THROW_EX (tmp,
35 Vault_Client_Request_NOOP_Interceptor (),
36 CORBA::NO_MEMORY ());
37 break;
39 case IT_CONTEXT:
41 // Installing the Vault interceptor
42 ACE_NEW_THROW_EX (tmp,
43 Vault_Client_Request_Context_Interceptor (),
44 CORBA::NO_MEMORY ());
45 break;
47 case IT_DYNAMIC:
49 // Installing the Vault interceptor
50 ACE_NEW_THROW_EX (tmp,
51 Vault_Client_Request_Dynamic_Interceptor (),
52 CORBA::NO_MEMORY ());
53 break;
57 PortableInterceptor::ClientRequestInterceptor_var interceptor = tmp;
59 info->add_client_request_interceptor (interceptor.in ());