Merge pull request #2303 from jwillemsen/jwi-803
[ACE_TAO.git] / TAO / DevGuideExamples / PortableInterceptors / IOR / ClientInitializer.cpp
blobef9543c5d75124231f5561a3babc665ad00bc90e
1 #include "ClientInitializer.h"
2 #include "ClientInterceptor.h"
3 #include <iostream>
5 ClientInitializer::ClientInitializer ()
9 void
10 ClientInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr)
14 void
15 ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
17 // get Codec factory
18 IOP::CodecFactory_var codec_factory = info->codec_factory();
20 // Create and register the request interceptors.
21 PortableInterceptor::ClientRequestInterceptor_ptr ci =
22 PortableInterceptor::ClientRequestInterceptor::_nil ();
24 try
26 ci = new ClientInterceptor (codec_factory);
28 catch(...)
30 std::cerr << "Exception occurred trying to create ClientInterceptor." << std::endl;
33 PortableInterceptor::ClientRequestInterceptor_var ci_interceptor =
34 ci;
36 info->add_client_request_interceptor (ci_interceptor.in ());