summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/PortableInterceptors/Auth/ServerInitializer.cpp
blob: c0078d24f432fdfc8577382aa21a1349936be9c3 (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
// $Id$

#include "ServerInitializer.h"
#include "ServerInterceptor.h"

#if defined (ACE_HAS_STANDARD_CPP_LIBRARY) && (ACE_HAS_STANDARD_CPP_LIBRARY == 1)
#include <iostream>
#else
#include <iostream.h>
#endif

ServerInitializer::ServerInitializer ()
{
}

void
ServerInitializer::pre_init (
                             PortableInterceptor::ORBInitInfo_ptr)
{
}

void
ServerInitializer::post_init (
                              PortableInterceptor::ORBInitInfo_ptr info)
{

  // Create and register the request interceptors.
  PortableInterceptor::ServerRequestInterceptor_ptr si =
    PortableInterceptor::ServerRequestInterceptor::_nil ();

  try
    {
      si = new ServerInterceptor ();
    }
  catch(...)
    {
      std::cerr << "Exception occured trying to create ServerInterceptor." << std::endl;
    }

  PortableInterceptor::ServerRequestInterceptor_var si_interceptor =
    si;

  info->add_server_request_interceptor (si_interceptor.in ());
}