Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / DevGuideExamples / PortableInterceptors / IOR / ServerIORInterceptor.cpp
blob44fd3a08df639c634d7593ed3857581b179d7dde
1 #include "ServerIORInterceptor.h"
2 #include <iostream>
3 char *
4 ServerIORInterceptor::name ()
6 return CORBA::string_dup ("ServerIORInterceptor");
9 void
10 ServerIORInterceptor::destroy ()
14 void
15 ServerIORInterceptor::establish_components (
16 PortableInterceptor::IORInfo_ptr info)
18 const char * permission = "ServerRequiresAuth";
20 // arbitrary tag.
21 CORBA::ULong tagID = 9654;
23 IOP::TaggedComponent myTag;
25 myTag.tag = tagID;
26 const CORBA::ULong len =
27 static_cast<CORBA::ULong> (ACE_OS::strlen (permission));
28 myTag.component_data.length (len + 1);
30 CORBA::Octet *buf = myTag.component_data.get_buffer();
32 ACE_OS::memcpy (buf, permission, len + 1);
34 // add tagged component
35 info->add_ior_component (myTag);
37 std::cout << "Created Tagged IOR." << std::endl;
40 void
41 ServerIORInterceptor::components_established (
42 PortableInterceptor::IORInfo_ptr /*info*/)
46 void
47 ServerIORInterceptor::adapter_manager_state_changed (
48 const char* /*id*/,
49 PortableInterceptor::AdapterState /*state*/)
53 void
54 ServerIORInterceptor::adapter_state_changed (
55 const PortableInterceptor::ObjectReferenceTemplateSeq& /*templates*/,
56 PortableInterceptor::AdapterState /*state*/)