1 #include "tao/RTCORBA/RT_Policy_i.h"
3 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
5 #include "tao/ORB_Core.h"
6 #include "tao/Policy_Manager.h"
9 #include "tao/AnyTypeCode/Any.h"
10 #include "tao/SystemException.h"
12 #include "ace/OS_NS_string.h"
14 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 TAO_PriorityModelPolicy::TAO_PriorityModelPolicy (
17 RTCORBA::PriorityModel priority_model
,
18 RTCORBA::Priority server_priority
)
21 , RTCORBA::PriorityModelPolicy ()
22 , ::CORBA::LocalObject ()
23 , priority_model_ (priority_model
)
24 , server_priority_ (server_priority
)
28 TAO_PriorityModelPolicy::TAO_PriorityModelPolicy (const TAO_PriorityModelPolicy
&rhs
)
31 , RTCORBA::PriorityModelPolicy ()
32 , ::CORBA::LocalObject ()
33 , priority_model_ (rhs
.priority_model_
)
34 , server_priority_ (rhs
.server_priority_
)
38 TAO_PriorityModelPolicy::TAO_PriorityModelPolicy ()
39 : priority_model_ (RTCORBA::SERVER_DECLARED
),
44 TAO_PriorityModelPolicy::~TAO_PriorityModelPolicy ()
49 TAO_PriorityModelPolicy::create (const CORBA::Any
&)
52 * @@ The following code should be changed once the OMG spec has
53 * been fixed such that a RTCORBA::PriorityModelPolicy can be
54 * created by using the ORB::create_policy interface.
56 throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE
);
59 RTCORBA::PriorityModel
60 TAO_PriorityModelPolicy::get_priority_model ()
62 return this->priority_model_
;
65 RTCORBA::PriorityModel
66 TAO_PriorityModelPolicy::priority_model ()
68 return this->priority_model_
;
72 TAO_PriorityModelPolicy::server_priority ()
74 return this->server_priority_
;
78 TAO_PriorityModelPolicy::policy_type ()
80 return RTCORBA::PRIORITY_MODEL_POLICY_TYPE
;
84 TAO_PriorityModelPolicy::copy ()
86 TAO_PriorityModelPolicy
* tmp
= 0;
87 ACE_NEW_THROW_EX (tmp
,
88 TAO_PriorityModelPolicy (*this),
89 CORBA::NO_MEMORY (TAO::VMCID
,
90 CORBA::COMPLETED_NO
));
96 TAO_PriorityModelPolicy::destroy ()
101 TAO_PriorityModelPolicy::_tao_encode (TAO_OutputCDR
&out_cdr
)
103 // Note: the fields are encoded according to
104 // the order specified in the RTCORBA 1.0 spec (ptc/99-05-03)
107 return ((out_cdr
<< priority_model_
) && (out_cdr
<< server_priority_
));
111 TAO_PriorityModelPolicy::_tao_decode (TAO_InputCDR
&in_cdr
)
113 return ((in_cdr
>> priority_model_
) && (in_cdr
>> server_priority_
));
116 TAO_Cached_Policy_Type
117 TAO_PriorityModelPolicy::_tao_cached_type () const
119 return TAO_CACHED_POLICY_PRIORITY_MODEL
;
123 TAO_PriorityModelPolicy::_tao_scope () const
125 // Note that this policy is propagated to the client even though
126 // it is not specified here. The reason for this is that the
127 // server priority field is set dynamically depending on the model
128 // and the servant's priority. Therefore, it can't be simply
129 // copied to the list of client exposed policies.
130 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_ORB_SCOPE
|
131 TAO_POLICY_POA_SCOPE
);
134 // ****************************************************************
136 TAO_ThreadpoolPolicy::TAO_ThreadpoolPolicy (RTCORBA::ThreadpoolId id
)
139 , RTCORBA::ThreadpoolPolicy ()
140 , ::CORBA::LocalObject ()
145 TAO_ThreadpoolPolicy::TAO_ThreadpoolPolicy (const TAO_ThreadpoolPolicy
&rhs
)
148 , RTCORBA::ThreadpoolPolicy ()
149 , ::CORBA::LocalObject ()
154 TAO_ThreadpoolPolicy::~TAO_ThreadpoolPolicy ()
159 TAO_ThreadpoolPolicy::create (const CORBA::Any
&val
)
161 RTCORBA::ThreadpoolId value
;
162 if (!(val
>>= value
))
163 throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE
);
165 TAO_ThreadpoolPolicy
*tmp
= 0;
166 ACE_NEW_THROW_EX (tmp
,
167 TAO_ThreadpoolPolicy (value
),
168 CORBA::NO_MEMORY (TAO::VMCID
,
169 CORBA::COMPLETED_NO
));
174 RTCORBA::ThreadpoolId
175 TAO_ThreadpoolPolicy::threadpool ()
181 TAO_ThreadpoolPolicy::policy_type ()
183 return RTCORBA::THREADPOOL_POLICY_TYPE
;
187 TAO_ThreadpoolPolicy::copy ()
189 TAO_ThreadpoolPolicy
* tmp
= 0;
190 ACE_NEW_THROW_EX (tmp
,
191 TAO_ThreadpoolPolicy (*this),
192 CORBA::NO_MEMORY (TAO::VMCID
,
193 CORBA::COMPLETED_NO
));
199 TAO_ThreadpoolPolicy::destroy ()
203 TAO_Cached_Policy_Type
204 TAO_ThreadpoolPolicy::_tao_cached_type () const
206 return TAO_CACHED_POLICY_THREADPOOL
;
210 TAO_ThreadpoolPolicy::_tao_scope () const
212 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_ORB_SCOPE
|
213 TAO_POLICY_POA_SCOPE
);
216 // ****************************************************************
218 TAO_PrivateConnectionPolicy::TAO_PrivateConnectionPolicy ()
221 , RTCORBA::PrivateConnectionPolicy ()
222 , ::CORBA::LocalObject ()
226 TAO_PrivateConnectionPolicy::TAO_PrivateConnectionPolicy (const TAO_PrivateConnectionPolicy
&)
229 , RTCORBA::PrivateConnectionPolicy ()
230 , ::CORBA::LocalObject ()
234 TAO_PrivateConnectionPolicy::~TAO_PrivateConnectionPolicy ()
239 TAO_PrivateConnectionPolicy::create (const CORBA::Any
&)
241 TAO_PrivateConnectionPolicy
*tmp
= 0;
242 ACE_NEW_THROW_EX (tmp
,
243 TAO_PrivateConnectionPolicy (),
244 CORBA::NO_MEMORY (TAO::VMCID
,
245 CORBA::COMPLETED_NO
));
251 TAO_PrivateConnectionPolicy::policy_type ()
253 return RTCORBA::PRIVATE_CONNECTION_POLICY_TYPE
;
257 TAO_PrivateConnectionPolicy::copy ()
259 TAO_PrivateConnectionPolicy
* tmp
= 0;
260 ACE_NEW_THROW_EX (tmp
,
261 TAO_PrivateConnectionPolicy (*this),
262 CORBA::NO_MEMORY (TAO::VMCID
,
263 CORBA::COMPLETED_NO
));
269 TAO_PrivateConnectionPolicy::destroy ()
273 TAO_Cached_Policy_Type
274 TAO_PrivateConnectionPolicy::_tao_cached_type () const
276 return TAO_CACHED_POLICY_RT_PRIVATE_CONNECTION
;
280 TAO_PrivateConnectionPolicy::_tao_scope () const
282 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_OBJECT_SCOPE
|
283 TAO_POLICY_THREAD_SCOPE
|
284 TAO_POLICY_ORB_SCOPE
);
287 // ****************************************************************
289 TAO_PriorityBandedConnectionPolicy::TAO_PriorityBandedConnectionPolicy (const RTCORBA::PriorityBands
&bands
)
292 , RTCORBA::PriorityBandedConnectionPolicy ()
293 , ::CORBA::LocalObject ()
294 , priority_bands_ (bands
)
298 TAO_PriorityBandedConnectionPolicy::TAO_PriorityBandedConnectionPolicy (const TAO_PriorityBandedConnectionPolicy
&rhs
)
301 , RTCORBA::PriorityBandedConnectionPolicy ()
302 , ::CORBA::LocalObject ()
303 , priority_bands_ (rhs
.priority_bands_
)
307 TAO_PriorityBandedConnectionPolicy::TAO_PriorityBandedConnectionPolicy ()
311 TAO_PriorityBandedConnectionPolicy::~TAO_PriorityBandedConnectionPolicy ()
316 TAO_PriorityBandedConnectionPolicy::create (const CORBA::Any
&val
)
318 const RTCORBA::PriorityBands
*value
= 0;
319 if (!(val
>>= value
))
320 throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE
);
322 TAO_PriorityBandedConnectionPolicy
*tmp
= 0;
323 ACE_NEW_THROW_EX (tmp
,
324 TAO_PriorityBandedConnectionPolicy (*value
),
325 CORBA::NO_MEMORY (TAO::VMCID
,
326 CORBA::COMPLETED_NO
));
331 RTCORBA::PriorityBands
*
332 TAO_PriorityBandedConnectionPolicy::priority_bands ()
334 RTCORBA::PriorityBands
*tmp
= 0;
335 ACE_NEW_THROW_EX (tmp
,
336 RTCORBA::PriorityBands (this->priority_bands_
),
337 CORBA::NO_MEMORY (TAO::VMCID
,
338 CORBA::COMPLETED_NO
));
344 TAO_PriorityBandedConnectionPolicy::policy_type ()
346 return RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE
;
350 TAO_PriorityBandedConnectionPolicy::copy ()
352 TAO_PriorityBandedConnectionPolicy
*tmp
= 0;
353 ACE_NEW_THROW_EX (tmp
,
354 TAO_PriorityBandedConnectionPolicy (*this),
355 CORBA::NO_MEMORY (TAO::VMCID
,
356 CORBA::COMPLETED_NO
));
362 TAO_PriorityBandedConnectionPolicy::destroy ()
367 TAO_PriorityBandedConnectionPolicy::_tao_encode (TAO_OutputCDR
&out_cdr
)
369 return out_cdr
<< this->priority_bands_
;
373 TAO_PriorityBandedConnectionPolicy::_tao_decode (TAO_InputCDR
&in_cdr
)
375 return in_cdr
>> this->priority_bands_
;
378 TAO_Cached_Policy_Type
379 TAO_PriorityBandedConnectionPolicy::_tao_cached_type () const
381 return TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION
;
385 TAO_PriorityBandedConnectionPolicy::_tao_scope () const
387 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_DEFAULT_SCOPE
|
388 TAO_POLICY_CLIENT_EXPOSED
);
391 RTCORBA::PriorityBands
&
392 TAO_PriorityBandedConnectionPolicy::priority_bands_rep ()
394 return this->priority_bands_
;
397 // ****************************************************************
399 TAO_ServerProtocolPolicy::TAO_ServerProtocolPolicy (const RTCORBA::ProtocolList
&protocols
)
402 , RTCORBA::ServerProtocolPolicy ()
403 , ::CORBA::LocalObject ()
404 , protocols_ (protocols
)
408 TAO_ServerProtocolPolicy::TAO_ServerProtocolPolicy (const TAO_ServerProtocolPolicy
&rhs
)
411 , RTCORBA::ServerProtocolPolicy ()
412 , ::CORBA::LocalObject ()
413 , protocols_ (rhs
.protocols_
)
417 TAO_ServerProtocolPolicy::~TAO_ServerProtocolPolicy ()
422 TAO_ServerProtocolPolicy::create (const CORBA::Any
&val
)
424 const RTCORBA::ProtocolList
*value
= 0;
425 if (!(val
>>= value
))
426 throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE
);
428 TAO_ServerProtocolPolicy
*tmp
= 0;
429 ACE_NEW_THROW_EX (tmp
,
430 TAO_ServerProtocolPolicy (*value
),
431 CORBA::NO_MEMORY (TAO::VMCID
,
432 CORBA::COMPLETED_NO
));
437 RTCORBA::ProtocolList
*
438 TAO_ServerProtocolPolicy::protocols ()
440 RTCORBA::ProtocolList
*tmp
= 0;
441 ACE_NEW_THROW_EX (tmp
,
442 RTCORBA::ProtocolList (this->protocols_
),
443 CORBA::NO_MEMORY (TAO::VMCID
,
444 CORBA::COMPLETED_NO
));
450 TAO_ServerProtocolPolicy::policy_type ()
452 return RTCORBA::SERVER_PROTOCOL_POLICY_TYPE
;
456 TAO_ServerProtocolPolicy::copy ()
458 TAO_ServerProtocolPolicy
* tmp
= 0;
459 ACE_NEW_THROW_EX (tmp
,
460 TAO_ServerProtocolPolicy (*this),
461 CORBA::NO_MEMORY (TAO::VMCID
,
462 CORBA::COMPLETED_NO
));
468 TAO_ServerProtocolPolicy::destroy ()
472 TAO_Cached_Policy_Type
473 TAO_ServerProtocolPolicy::_tao_cached_type () const
475 return TAO_CACHED_POLICY_RT_SERVER_PROTOCOL
;
479 TAO_ServerProtocolPolicy::_tao_scope () const
481 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_ORB_SCOPE
|
482 TAO_POLICY_POA_SCOPE
);
485 RTCORBA::ProtocolList
&
486 TAO_ServerProtocolPolicy::protocols_rep ()
491 // ****************************************************************
493 TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy ()
498 TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy (const RTCORBA::ProtocolList
&protocols
)
501 , RTCORBA::ClientProtocolPolicy ()
502 , ::CORBA::LocalObject ()
503 , protocols_ (protocols
)
507 TAO_ClientProtocolPolicy::TAO_ClientProtocolPolicy (const TAO_ClientProtocolPolicy
&rhs
)
510 , RTCORBA::ClientProtocolPolicy ()
511 , ::CORBA::LocalObject ()
512 , protocols_ (rhs
.protocols_
)
516 TAO_ClientProtocolPolicy::~TAO_ClientProtocolPolicy ()
521 TAO_ClientProtocolPolicy::create (const CORBA::Any
&val
)
523 const RTCORBA::ProtocolList
*value
= 0;
524 if (!(val
>>= value
))
525 throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE
);
527 TAO_ClientProtocolPolicy
*tmp
= 0;
528 ACE_NEW_THROW_EX (tmp
,
529 TAO_ClientProtocolPolicy (*value
),
530 CORBA::NO_MEMORY (TAO::VMCID
,
531 CORBA::COMPLETED_NO
));
536 RTCORBA::ProtocolList
*
537 TAO_ClientProtocolPolicy::protocols ()
539 RTCORBA::ProtocolList
*tmp
= 0;
540 ACE_NEW_THROW_EX (tmp
,
541 RTCORBA::ProtocolList (this->protocols_
),
542 CORBA::NO_MEMORY (TAO::VMCID
,
543 CORBA::COMPLETED_NO
));
549 TAO_ClientProtocolPolicy::policy_type ()
551 return RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE
;
555 TAO_ClientProtocolPolicy::copy ()
557 TAO_ClientProtocolPolicy
* tmp
= 0;
558 ACE_NEW_THROW_EX (tmp
,
559 TAO_ClientProtocolPolicy (*this),
560 CORBA::NO_MEMORY (TAO::VMCID
,
561 CORBA::COMPLETED_NO
));
567 TAO_ClientProtocolPolicy::destroy ()
571 TAO_Cached_Policy_Type
572 TAO_ClientProtocolPolicy::_tao_cached_type () const
574 return TAO_CACHED_POLICY_RT_CLIENT_PROTOCOL
;
578 TAO_ClientProtocolPolicy::_tao_scope () const
580 return static_cast<TAO_Policy_Scope
> (TAO_POLICY_DEFAULT_SCOPE
|
581 TAO_POLICY_CLIENT_EXPOSED
);
585 TAO_ClientProtocolPolicy::_tao_encode (TAO_OutputCDR
&out_cdr
)
587 CORBA::Boolean is_write_ok
= out_cdr
<< this->protocols_
.length ();
589 for (CORBA::ULong i
= 0;
590 (i
< this->protocols_
.length ()) && is_write_ok
;
594 (out_cdr
<< this->protocols_
[i
].protocol_type
)
596 this->protocols_
[i
].orb_protocol_properties
->_tao_encode (out_cdr
)
598 this->protocols_
[i
].transport_protocol_properties
->_tao_encode (out_cdr
);
605 TAO_ClientProtocolPolicy::_tao_decode (TAO_InputCDR
&in_cdr
)
608 CORBA::Boolean is_read_ok
= in_cdr
>> length
;
610 this->protocols_
.length (length
);
612 for (CORBA::ULong i
= 0; (i
< length
) && is_read_ok
; i
++)
614 is_read_ok
= in_cdr
>> this->protocols_
[i
].protocol_type
;
616 this->protocols_
[i
].orb_protocol_properties
=
617 TAO_Protocol_Properties_Factory::create_orb_protocol_property
618 (this->protocols_
[i
].protocol_type
);
620 this->protocols_
[i
].transport_protocol_properties
=
621 TAO_Protocol_Properties_Factory::create_transport_protocol_property
622 (this->protocols_
[i
].protocol_type
, in_cdr
.orb_core ());
625 && (this->protocols_
[i
].orb_protocol_properties
.ptr () != 0))
627 this->protocols_
[i
].orb_protocol_properties
->_tao_decode (in_cdr
);
630 && (this->protocols_
[i
].transport_protocol_properties
.ptr () != 0))
632 this->protocols_
[i
].transport_protocol_properties
->_tao_decode (in_cdr
);
638 RTCORBA::ProtocolList
&
639 TAO_ClientProtocolPolicy::protocols_rep ()
644 // ****************************************************************
646 TAO_TCP_Protocol_Properties::TAO_TCP_Protocol_Properties (CORBA::Long send_buffer_size
,
647 CORBA::Long recv_buffer_size
,
648 CORBA::Boolean keep_alive
,
649 CORBA::Boolean dont_route
,
650 CORBA::Boolean no_delay
,
651 CORBA::Boolean enable_network_priority
)
652 : send_buffer_size_ (send_buffer_size
),
653 recv_buffer_size_ (recv_buffer_size
),
654 keep_alive_ (keep_alive
),
655 dont_route_ (dont_route
),
656 no_delay_ (no_delay
),
657 enable_network_priority_ (enable_network_priority
)
661 TAO_TCP_Protocol_Properties::~TAO_TCP_Protocol_Properties ()
666 TAO_TCP_Protocol_Properties::send_buffer_size ()
668 return this->send_buffer_size_
;
672 TAO_TCP_Protocol_Properties::send_buffer_size (CORBA::Long send_buffer_size
)
674 this->send_buffer_size_
= send_buffer_size
;
678 TAO_TCP_Protocol_Properties::recv_buffer_size ()
680 return this->recv_buffer_size_
;
684 TAO_TCP_Protocol_Properties::recv_buffer_size (CORBA::Long recv_buffer_size
)
686 this->recv_buffer_size_
= recv_buffer_size
;
690 TAO_TCP_Protocol_Properties::keep_alive ()
692 return this->keep_alive_
;
696 TAO_TCP_Protocol_Properties::keep_alive (CORBA::Boolean keep_alive
)
698 this->keep_alive_
= keep_alive
;
702 TAO_TCP_Protocol_Properties::dont_route ()
704 return this->dont_route_
;
708 TAO_TCP_Protocol_Properties::dont_route (CORBA::Boolean dont_route
)
710 this->dont_route_
= dont_route
;
713 CORBA::Boolean
TAO_TCP_Protocol_Properties::no_delay ()
715 return this->no_delay_
;
719 TAO_TCP_Protocol_Properties::no_delay (CORBA::Boolean no_delay
)
721 this->no_delay_
= no_delay
;
725 TAO_TCP_Protocol_Properties::enable_network_priority ()
727 return this->enable_network_priority_
;
731 TAO_TCP_Protocol_Properties::enable_network_priority (CORBA::Boolean enable
)
733 this->enable_network_priority_
= enable
;
737 TAO_TCP_Protocol_Properties::_tao_encode (TAO_OutputCDR
& out_cdr
)
739 return ((out_cdr
<< this->send_buffer_size_
)
741 (out_cdr
<< this->recv_buffer_size_
)
743 (out_cdr
.write_boolean (this->keep_alive_
))
745 (out_cdr
.write_boolean (this->dont_route_
))
747 (out_cdr
.write_boolean (this->no_delay_
)));
751 TAO_TCP_Protocol_Properties::_tao_decode (TAO_InputCDR
&in_cdr
)
753 return ((in_cdr
>> this->send_buffer_size_
)
755 (in_cdr
>> this->recv_buffer_size_
)
757 (in_cdr
.read_boolean (this->keep_alive_
))
759 (in_cdr
.read_boolean (this->dont_route_
))
761 (in_cdr
.read_boolean (this->no_delay_
)));
764 // ****************************************************************
766 TAO_UnixDomain_Protocol_Properties::TAO_UnixDomain_Protocol_Properties
767 (CORBA::Long send_buffer_size
,
768 CORBA::Long recv_buffer_size
)
769 : send_buffer_size_ (send_buffer_size
),
770 recv_buffer_size_ (recv_buffer_size
)
774 TAO_UnixDomain_Protocol_Properties::~TAO_UnixDomain_Protocol_Properties ()
779 TAO_UnixDomain_Protocol_Properties::send_buffer_size ()
781 return this->send_buffer_size_
;
785 TAO_UnixDomain_Protocol_Properties::send_buffer_size (CORBA::Long send_buffer_size
)
787 this->send_buffer_size_
= send_buffer_size
;
791 TAO_UnixDomain_Protocol_Properties::recv_buffer_size ()
793 return this->recv_buffer_size_
;
797 TAO_UnixDomain_Protocol_Properties::recv_buffer_size (CORBA::Long recv_buffer_size
)
799 this->recv_buffer_size_
= recv_buffer_size
;
803 TAO_UnixDomain_Protocol_Properties::_tao_encode (TAO_OutputCDR
&out_cdr
)
805 return ((out_cdr
<< this->send_buffer_size_
)
806 && (out_cdr
<< this->recv_buffer_size_
));
810 TAO_UnixDomain_Protocol_Properties::_tao_decode (TAO_InputCDR
&in_cdr
)
812 return ((in_cdr
>> this->send_buffer_size_
)
813 && (in_cdr
>> this->recv_buffer_size_
));
816 // ****************************************************************
818 TAO_SharedMemory_Protocol_Properties::TAO_SharedMemory_Protocol_Properties (CORBA::Long send_buffer_size
,
819 CORBA::Long recv_buffer_size
,
820 CORBA::Boolean keep_alive
,
821 CORBA::Boolean dont_route
,
822 CORBA::Boolean no_delay
,
823 CORBA::Long preallocate_buffer_size
,
824 const char *mmap_filename
,
825 const char *mmap_lockname
)
826 : send_buffer_size_ (send_buffer_size
),
827 recv_buffer_size_ (recv_buffer_size
),
828 keep_alive_ (keep_alive
),
829 dont_route_ (dont_route
),
830 no_delay_ (no_delay
),
831 preallocate_buffer_size_ (preallocate_buffer_size
),
832 mmap_filename_ (mmap_filename
),
833 mmap_lockname_ (mmap_lockname
)
837 TAO_SharedMemory_Protocol_Properties::~TAO_SharedMemory_Protocol_Properties ()
843 TAO_SharedMemory_Protocol_Properties::send_buffer_size ()
845 return this->send_buffer_size_
;
849 TAO_SharedMemory_Protocol_Properties::send_buffer_size (CORBA::Long send_buffer_size
)
851 this->send_buffer_size_
= send_buffer_size
;
855 TAO_SharedMemory_Protocol_Properties::recv_buffer_size ()
857 return this->recv_buffer_size_
;
861 TAO_SharedMemory_Protocol_Properties::recv_buffer_size (CORBA::Long recv_buffer_size
)
863 this->recv_buffer_size_
= recv_buffer_size
;
867 TAO_SharedMemory_Protocol_Properties::keep_alive ()
869 return this->keep_alive_
;
873 TAO_SharedMemory_Protocol_Properties::keep_alive (CORBA::Boolean keep_alive
)
875 this->keep_alive_
= keep_alive
;
879 TAO_SharedMemory_Protocol_Properties::dont_route ()
881 return this->dont_route_
;
885 TAO_SharedMemory_Protocol_Properties::dont_route (CORBA::Boolean dont_route
)
887 this->dont_route_
= dont_route
;
891 TAO_SharedMemory_Protocol_Properties::no_delay ()
893 return this->no_delay_
;
897 TAO_SharedMemory_Protocol_Properties::no_delay (CORBA::Boolean no_delay
)
899 this->no_delay_
= no_delay
;
903 TAO_SharedMemory_Protocol_Properties::preallocate_buffer_size ()
905 return this->preallocate_buffer_size_
;
909 TAO_SharedMemory_Protocol_Properties::preallocate_buffer_size (CORBA::Long preallocate_buffer_size
)
911 this->preallocate_buffer_size_
= preallocate_buffer_size
;
915 TAO_SharedMemory_Protocol_Properties::mmap_filename ()
917 return this->mmap_filename_
.rep ();
921 TAO_SharedMemory_Protocol_Properties::mmap_filename (const char * mmap_filename
)
923 this->mmap_filename_
.set (mmap_filename
);
927 TAO_SharedMemory_Protocol_Properties::mmap_lockname ()
929 return this->mmap_lockname_
.rep ();
933 TAO_SharedMemory_Protocol_Properties::mmap_lockname (const char * mmap_lockname
)
935 this->mmap_lockname_
.set (mmap_lockname
);
939 TAO_SharedMemory_Protocol_Properties::_tao_encode (TAO_OutputCDR
&out_cdr
)
941 return ((out_cdr
<< this->send_buffer_size_
)
943 (out_cdr
<< this->recv_buffer_size_
)
945 (out_cdr
.write_boolean (this->keep_alive_
))
947 (out_cdr
.write_boolean (this->dont_route_
))
949 (out_cdr
.write_boolean (this->no_delay_
))
951 (out_cdr
<< this->preallocate_buffer_size_
)
953 (out_cdr
<< this->mmap_filename_
)
955 (out_cdr
<< this->mmap_lockname_
));
959 TAO_SharedMemory_Protocol_Properties::_tao_decode (TAO_InputCDR
&in_cdr
)
961 return ((in_cdr
>> this->send_buffer_size_
)
963 (in_cdr
>> this->recv_buffer_size_
)
965 (in_cdr
.read_boolean (this->keep_alive_
))
967 (in_cdr
.read_boolean (this->dont_route_
))
969 (in_cdr
.read_boolean (this->no_delay_
))
971 (in_cdr
>> this->preallocate_buffer_size_
)
973 (in_cdr
>> this->mmap_filename_
)
975 (in_cdr
>> this->mmap_lockname_
));
978 // ****************************************************************
980 TAO_UserDatagram_Protocol_Properties::TAO_UserDatagram_Protocol_Properties (
981 CORBA::Long send_buffer_size
,
982 CORBA::Long recv_buffer_size
,
983 CORBA::Boolean enable_network_priority
)
984 : send_buffer_size_ (send_buffer_size
),
985 recv_buffer_size_ (recv_buffer_size
),
986 enable_network_priority_ (enable_network_priority
)
990 TAO_UserDatagram_Protocol_Properties::~TAO_UserDatagram_Protocol_Properties ()
995 TAO_UserDatagram_Protocol_Properties::enable_network_priority ()
997 return this->enable_network_priority_
;
1001 TAO_UserDatagram_Protocol_Properties::enable_network_priority (CORBA::Boolean enable
)
1003 this->enable_network_priority_
= enable
;
1007 TAO_UserDatagram_Protocol_Properties::send_buffer_size ()
1009 return this->send_buffer_size_
;
1013 TAO_UserDatagram_Protocol_Properties::send_buffer_size (CORBA::Long send_buffer_size
)
1015 this->send_buffer_size_
= send_buffer_size
;
1019 TAO_UserDatagram_Protocol_Properties::recv_buffer_size ()
1021 return this->recv_buffer_size_
;
1025 TAO_UserDatagram_Protocol_Properties::recv_buffer_size (CORBA::Long recv_buffer_size
)
1027 this->recv_buffer_size_
= recv_buffer_size
;
1031 TAO_UserDatagram_Protocol_Properties::_tao_encode (TAO_OutputCDR
&)
1037 TAO_UserDatagram_Protocol_Properties::_tao_decode (TAO_InputCDR
&)
1042 // ****************************************************************
1044 TAO_StreamControl_Protocol_Properties::TAO_StreamControl_Protocol_Properties (CORBA::Long send_buffer_size
,
1045 CORBA::Long recv_buffer_size
,
1046 CORBA::Boolean keep_alive
,
1047 CORBA::Boolean dont_route
,
1048 CORBA::Boolean no_delay
,
1049 CORBA::Boolean enable_network_priority
)
1050 : send_buffer_size_ (send_buffer_size
),
1051 recv_buffer_size_ (recv_buffer_size
),
1052 keep_alive_ (keep_alive
),
1053 dont_route_ (dont_route
),
1054 no_delay_ (no_delay
),
1055 enable_network_priority_ (enable_network_priority
)
1059 TAO_StreamControl_Protocol_Properties::~TAO_StreamControl_Protocol_Properties ()
1064 TAO_StreamControl_Protocol_Properties::send_buffer_size ()
1066 return this->send_buffer_size_
;
1070 TAO_StreamControl_Protocol_Properties::send_buffer_size (CORBA::Long send_buffer_size
)
1072 this->send_buffer_size_
= send_buffer_size
;
1076 TAO_StreamControl_Protocol_Properties::recv_buffer_size ()
1078 return this->recv_buffer_size_
;
1082 TAO_StreamControl_Protocol_Properties::recv_buffer_size (CORBA::Long recv_buffer_size
)
1084 this->recv_buffer_size_
= recv_buffer_size
;
1088 TAO_StreamControl_Protocol_Properties::keep_alive ()
1090 return this->keep_alive_
;
1094 TAO_StreamControl_Protocol_Properties::keep_alive (CORBA::Boolean keep_alive
)
1096 this->keep_alive_
= keep_alive
;
1100 TAO_StreamControl_Protocol_Properties::dont_route ()
1102 return this->dont_route_
;
1106 TAO_StreamControl_Protocol_Properties::dont_route (CORBA::Boolean dont_route
)
1108 this->dont_route_
= dont_route
;
1111 CORBA::Boolean
TAO_StreamControl_Protocol_Properties::no_delay ()
1113 return this->no_delay_
;
1117 TAO_StreamControl_Protocol_Properties::no_delay (CORBA::Boolean no_delay
)
1119 this->no_delay_
= no_delay
;
1123 TAO_StreamControl_Protocol_Properties::enable_network_priority ()
1125 return this->enable_network_priority_
;
1129 TAO_StreamControl_Protocol_Properties::enable_network_priority (CORBA::Boolean enable
)
1131 this->enable_network_priority_
= enable
;
1135 TAO_StreamControl_Protocol_Properties::_tao_encode (TAO_OutputCDR
& out_cdr
)
1137 return ((out_cdr
<< this->send_buffer_size_
)
1139 (out_cdr
<< this->recv_buffer_size_
)
1141 (out_cdr
.write_boolean (this->keep_alive_
))
1143 (out_cdr
.write_boolean (this->dont_route_
))
1145 (out_cdr
.write_boolean (this->no_delay_
)));
1149 TAO_StreamControl_Protocol_Properties::_tao_decode (TAO_InputCDR
&in_cdr
)
1151 return ((in_cdr
>> this->send_buffer_size_
)
1153 (in_cdr
>> this->recv_buffer_size_
)
1155 (in_cdr
.read_boolean (this->keep_alive_
))
1157 (in_cdr
.read_boolean (this->dont_route_
))
1159 (in_cdr
.read_boolean (this->no_delay_
)));
1162 // ****************************************************************
1164 TAO_GIOP_Protocol_Properties::TAO_GIOP_Protocol_Properties ()
1168 TAO_GIOP_Protocol_Properties::~TAO_GIOP_Protocol_Properties ()
1173 TAO_GIOP_Protocol_Properties::_tao_encode (TAO_OutputCDR
&)
1179 TAO_GIOP_Protocol_Properties::_tao_decode (TAO_InputCDR
&)
1184 // ****************************************************************
1186 RTCORBA::ProtocolProperties
*
1187 TAO_Protocol_Properties_Factory::create_transport_protocol_property (IOP::ProfileId id
,
1188 TAO_ORB_Core
*orb_core
)
1190 RTCORBA::ProtocolProperties
* property
= 0;
1192 if (id
== IOP::TAG_INTERNET_IOP
)
1194 int send_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_sndbuf_size () : 0;
1195 int recv_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_rcvbuf_size () : 0;
1196 int no_delay
= orb_core
? orb_core
->orb_params ()->nodelay () : 0;
1197 CORBA::Boolean keep_alive
= orb_core
? orb_core
->orb_params ()->sock_keepalive () : true;
1198 CORBA::Boolean dont_route
= orb_core
? orb_core
->orb_params ()->sock_dontroute () : false;
1199 CORBA::Boolean enable_network_priority
= false;
1201 ACE_NEW_RETURN (property
,
1202 TAO_TCP_Protocol_Properties (send_buffer_size
,
1207 enable_network_priority
),
1211 else if (id
== TAO_TAG_SHMEM_PROFILE
)
1213 int send_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_sndbuf_size () : 0;
1214 int recv_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_rcvbuf_size () : 0;
1215 int no_delay
= orb_core
? orb_core
->orb_params ()->nodelay () : 0;
1216 CORBA::Boolean keep_alive
= true;
1217 CORBA::Boolean dont_route
= false;
1218 CORBA::Long preallocate_buffer_size
= false;
1219 const char *mmap_filename
= "";
1220 const char *mmap_lockname
= "";
1222 ACE_NEW_RETURN (property
,
1223 TAO_SharedMemory_Protocol_Properties (send_buffer_size
,
1228 preallocate_buffer_size
,
1234 else if (id
== TAO_TAG_UIOP_PROFILE
)
1236 int const send_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_sndbuf_size () : 0;
1237 int const recv_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_rcvbuf_size () : 0;
1239 ACE_NEW_RETURN (property
,
1240 TAO_UnixDomain_Protocol_Properties (send_buffer_size
,
1245 else if (id
== TAO_TAG_DIOP_PROFILE
)
1247 int const send_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_sndbuf_size () : 0;
1248 int const recv_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_rcvbuf_size () : 0;
1249 CORBA::Boolean enable_network_priority
= false;
1251 ACE_NEW_RETURN (property
,
1252 TAO_UserDatagram_Protocol_Properties (send_buffer_size
,
1254 enable_network_priority
),
1258 else if (id
== TAO_TAG_SCIOP_PROFILE
)
1260 int send_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_sndbuf_size () : 0;
1261 int recv_buffer_size
= orb_core
? orb_core
->orb_params ()->sock_rcvbuf_size () : 0;
1262 int no_delay
= orb_core
? orb_core
->orb_params ()->nodelay () : 0;
1263 CORBA::Boolean keep_alive
= true;
1264 CORBA::Boolean dont_route
= false;
1265 CORBA::Boolean enable_network_priority
= false;
1267 ACE_NEW_RETURN (property
,
1268 TAO_StreamControl_Protocol_Properties (send_buffer_size
,
1273 enable_network_priority
),
1280 RTCORBA::ProtocolProperties
*
1281 TAO_Protocol_Properties_Factory::create_orb_protocol_property (IOP::ProfileId id
)
1283 RTCORBA::ProtocolProperties
* property
= 0;
1285 if (id
== IOP::TAG_INTERNET_IOP
)
1286 ACE_NEW_RETURN (property
,
1287 TAO_GIOP_Protocol_Properties
,
1290 // Right now the only supported ORB protocol is GIOP
1291 // so we couple this with every protocol property.
1292 // The else statement is not necessary, but it
1293 // is here just to make clear that as soon as
1294 // new ORB protocol are supported other case
1295 // should be considered.
1297 ACE_NEW_RETURN (property
,
1298 TAO_GIOP_Protocol_Properties
,
1303 TAO_END_VERSIONED_NAMESPACE_DECL
1305 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */