summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/PortableInterceptors/IOR/ServerIORInterceptor.cpp
blob: 42bb29ef0044473160c2a09d8dc8ea7dd7765f0b (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// $Id$

#include "ServerIORInterceptor.h"
#include <iostream>
char *
ServerIORInterceptor::name ()
{
  return CORBA::string_dup ("ServerIORInterceptor");
}

void
ServerIORInterceptor::destroy ()
{
}

void
ServerIORInterceptor::establish_components (
                                            PortableInterceptor::IORInfo_ptr info)
{
  const char * permission = "ServerRequiresAuth";

  // arbitrary tag.
  CORBA::ULong tagID = 9654;

  IOP::TaggedComponent myTag;

  myTag.tag =  tagID;
  myTag.component_data.length (ACE_OS::strlen(permission) + 1 );

  CORBA::Octet *buf = myTag.component_data.get_buffer();

  ACE_OS::memcpy (buf, permission, ACE_OS::strlen(permission) + 1);

  // add tagged component
  info->add_ior_component (myTag);

  std::cout << "Created Tagged IOR." << std::endl;
}

void
ServerIORInterceptor::components_established (
          PortableInterceptor::IORInfo_ptr /*info*/)
{
}

void
ServerIORInterceptor::adapter_manager_state_changed (
                             const char* /*id*/, 
                             PortableInterceptor::AdapterState /*state*/)
{
}

void
ServerIORInterceptor::adapter_state_changed (
    const PortableInterceptor::ObjectReferenceTemplateSeq& /*templates*/,
    PortableInterceptor::AdapterState /*state*/)
{
}