1 #include "tao/Service_Context_Handler_Registry.h"
2 #include "tao/TAO_Server_Request.h"
3 #include "tao/Service_Context_Handler.h"
5 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
8 TAO_Service_Context_Registry::process_service_contexts (
9 IOP::ServiceContextList
&sc
,
10 TAO_Transport
& transport
,
11 TAO_ServerRequest
*request
)
13 for (CORBA::ULong index
= 0;
14 index
!= sc
.length ();
17 IOP::ServiceContext
const & context
= sc
[index
];
19 iterator handler_iter
= this->registry_
.find (context
.context_id
);
21 if (handler_iter
!= registry_
.end ())
23 return handler_iter
->second
->process_service_context (transport
, context
, request
);
30 TAO_Service_Context_Registry::generate_service_context (
32 TAO_Transport
& transport
,
33 TAO_Operation_Details
&opdetails
,
34 TAO_Target_Specification
&spec
,
38 for (Table::iterator x
= this->registry_
.begin ();
39 x
!= this->registry_
.end ();
42 if ((*x
).second
->generate_service_context (
43 stub
, transport
, opdetails
, spec
, msg
) == -1)
52 TAO_Service_Context_Registry::~TAO_Service_Context_Registry ()
54 for (Table::iterator x
= this->registry_
.begin ();
55 x
!= this->registry_
.end ();
63 TAO_Service_Context_Registry::bind (
65 TAO_Service_Context_Handler
* handler
)
67 value_type
const value
=
68 std::make_pair (key_type (id
), data_type (handler
));
70 std::pair
<iterator
, bool> result
= this->registry_
.insert (value
);
72 return (result
.second
? 0 : 1);
75 TAO_Service_Context_Handler
*
76 TAO_Service_Context_Registry::operator[] (IOP::ServiceId id
)
81 TAO_END_VERSIONED_NAMESPACE_DECL