Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / examples / Kokyu_dsrt_schedulers / EDF_Scheduler.cpp
blob688e14eff77edfd3f4b9e5131246abab9ce67640
1 #include "EDF_Scheduler.h"
2 #include "Kokyu_qosC.h"
3 #include "utils.h"
4 #include "tao/RTScheduling/Request_Interceptor.h"
5 #include "tao/CodecFactory/CodecFactory.h"
6 #include "tao/ORB_Constants.h"
8 #include "edf_scheduler_config.h"
9 #include "edf_sched_dsui_families.h"
10 #include <dsui.h>
12 #include <iostream>
13 using namespace std;
15 EDF_Scheduling::SchedulingParameter
16 EDF_Sched_Param_Policy::value (void)
18 return this->value_;
21 void
22 EDF_Sched_Param_Policy::value (const EDF_Scheduling::SchedulingParameter& value)
24 this->value_ = value;
27 EDF_Scheduler::EDF_Scheduler (CORBA::ORB_ptr orb,
28 Kokyu::DSRT_Dispatcher_Impl_t disp_impl_type,
29 int ace_sched_policy,
30 int ace_sched_scope)
31 : orb_ (CORBA::ORB::_duplicate (orb)),
32 disp_impl_type_ (disp_impl_type),
33 ace_sched_policy_ (ace_sched_policy),
34 ace_sched_scope_ (ace_sched_scope)
37 Kokyu::DSRT_ConfigInfo config;
39 config.impl_type_ = this->disp_impl_type_;
40 config.sched_policy_ = ace_sched_policy_;
41 config.sched_scope_ = ace_sched_scope_;
43 Kokyu::DSRT_Dispatcher_Factory<EDF_Scheduler_Traits>::DSRT_Dispatcher_Auto_Ptr
44 tmp( Kokyu::DSRT_Dispatcher_Factory<EDF_Scheduler_Traits>::
45 create_DSRT_dispatcher (config) );
46 DSUI_EVENT_LOG (EDF_SCHED_FAM, CONSTRUCTOR, 0, 0, 0);
48 kokyu_dispatcher_ = tmp;
50 CORBA::Object_var object =
51 orb->resolve_initial_references ("RTScheduler_Current");
53 this->current_ =
54 RTScheduling::Current::_narrow (object.in ());
56 IOP::CodecFactory_var codec_factory;
57 CORBA::Object_var obj =
58 orb->resolve_initial_references ("CodecFactory");
60 if (CORBA::is_nil(obj.in ()))
62 ACE_ERROR ((LM_ERROR, "Nil Codec factory\n"));
64 else
66 codec_factory = IOP::CodecFactory::_narrow (obj.in ());
69 IOP::Encoding encoding;
70 encoding.format = IOP::ENCODING_CDR_ENCAPS;
71 encoding.major_version = 1;
72 encoding.minor_version = 2;
74 codec_ = codec_factory->create_codec (encoding);
77 EDF_Scheduler::~EDF_Scheduler (void)
81 void
82 EDF_Scheduler::shutdown (void)
84 kokyu_dispatcher_->shutdown ();
85 DSUI_EVENT_LOG (EDF_SCHED_FAM, DISPATCHER_SHUTDOWN, 0, 0, 0);
86 ACE_DEBUG ((LM_DEBUG, "kokyu DSRT dispatcher shutdown\n"));
89 EDF_Scheduling::SchedulingParameterPolicy_ptr
90 EDF_Scheduler::create_scheduling_parameter (const EDF_Scheduling::SchedulingParameter & value)
92 /* MEASURE: Time to create scheduling parameter */
93 DSUI_EVENT_LOG (EDF_SCHED_FAM, CREATE_SCHED_PARAM, 0, 0, 0);
95 EDF_Scheduling::SchedulingParameterPolicy_ptr sched_param_policy;
96 ACE_NEW_THROW_EX (sched_param_policy,
97 EDF_Sched_Param_Policy,
98 CORBA::NO_MEMORY (
99 CORBA::SystemException::_tao_minor_code (
100 TAO::VMCID,
101 ENOMEM),
102 CORBA::COMPLETED_NO));
104 sched_param_policy->value (value);
106 return sched_param_policy;
110 void
111 EDF_Scheduler::begin_new_scheduling_segment (const RTScheduling::Current::IdType &guid,
112 const char *,
113 CORBA::Policy_ptr sched_policy,
114 CORBA::Policy_ptr)
116 #ifdef KOKYU_DSRT_LOGGING
117 ACE_DEBUG ((LM_DEBUG,
118 "(%t|%T):EDF_Scheduler::begin_new_scheduling_segment enter\n"));
119 #endif
121 //#ifdef KOKYU_DSRT_LOGGING
122 int int_guid;
123 ACE_OS::memcpy (&int_guid,
124 guid.get_buffer (),
125 guid.length ());
126 // ACE_DEBUG ((LM_DEBUG, "(%t|%T): guid is %d\n", int_guid));
127 //#endif
129 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_SCHED_SEGMENT_START, int_guid, 0, 0);
130 EDF_Scheduler_Traits::QoSDescriptor_t qos;
131 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
132 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
134 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
136 qos.deadline_ = sched_param->deadline;
137 qos.importance_ = sched_param->importance;
139 kokyu_dispatcher_->schedule (guid, qos);
141 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_SCHED_SEGMENT_END, int_guid, 0, 0);
142 #ifdef KOKYU_DSRT_LOGGING
143 ACE_DEBUG ((LM_DEBUG,
144 "(%t|%T):EDF_Scheduler::begin_new_scheduling_segment exit\n"));
145 #endif
149 void
150 EDF_Scheduler::begin_nested_scheduling_segment (const RTScheduling::Current::IdType &guid,
151 const char *name,
152 CORBA::Policy_ptr sched_param,
153 CORBA::Policy_ptr implicit_sched_param)
155 int int_guid;
156 ACE_OS::memcpy (&int_guid,
157 guid.get_buffer (),
158 guid.length ());
159 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_NESTED_SCHED_SEGMENT, int_guid, 0, 0);
160 this->begin_new_scheduling_segment (guid,
161 name,
162 sched_param,
163 implicit_sched_param);
166 void
167 EDF_Scheduler::update_scheduling_segment (const RTScheduling::Current::IdType& guid,
168 const char* name,
169 CORBA::Policy_ptr sched_policy,
170 CORBA::Policy_ptr implicit_sched_param)
172 ACE_UNUSED_ARG ((name));
173 ACE_UNUSED_ARG ((implicit_sched_param));
175 int int_guid ;
176 ACE_OS::memcpy (&int_guid,
177 guid.get_buffer (),
178 guid.length ());
179 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_UPDATE_SCHED_SEGMENT, int_guid, 0, 0);
180 #ifdef KOKYU_DSRT_LOGGING
181 ACE_DEBUG ((LM_DEBUG, "(%t|%T): update_sched_seg::guid is %d\n", int_guid));
182 #endif
184 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
185 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
187 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
188 EDF_Scheduler_Traits::QoSDescriptor_t qos;
190 qos.deadline_ = sched_param->deadline;
191 qos.importance_ = sched_param->importance;
193 kokyu_dispatcher_->update_schedule (guid, qos);
194 DSUI_EVENT_LOG (EDF_SCHED_FAM, END_UPDATE_SCHED_SEGMENT, int_guid, 0, 0);
197 void
198 EDF_Scheduler::end_scheduling_segment (const RTScheduling::Current::IdType &guid,
199 const char *)
202 int int_guid;
203 ACE_OS::memcpy (&int_guid,
204 guid.get_buffer (),
205 guid.length ());
206 #ifdef KOKYU_DSRT_LOGGING
207 ACE_DEBUG ((LM_DEBUG, "(%t|%T) call to end_sched_segment for guid %d\n", int_guid));
208 #endif
210 DSUI_EVENT_LOG (EDF_SCHED_FAM, END_SCHED_SEGMENT, int_guid, 0, 0);
211 kokyu_dispatcher_->cancel_schedule (guid);
214 void
215 EDF_Scheduler::end_nested_scheduling_segment (const RTScheduling::Current::IdType & guid,
216 const char *,
217 CORBA::Policy_ptr)
219 int int_guid;
220 ACE_OS::memcpy (&int_guid,
221 guid.get_buffer (),
222 guid.length ());
223 DSUI_EVENT_LOG (EDF_SCHED_FAM, END_NESTED_SCHED_SEGMENT, int_guid, 0, 0);
227 void
228 EDF_Scheduler::send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
230 int int_guid;
231 RTScheduling::Current::IdType_var guid = this->current_->id ();
232 ACE_OS::memcpy (&int_guid,
233 guid->get_buffer (),
234 guid->length ());
236 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_CLIENT_SCHED_TIME, int_guid, 0, 0);
237 Kokyu::Svc_Ctxt_DSRT_QoS sc_qos;
239 CORBA::String_var operation = ri->operation ();
241 #ifdef KOKYU_DSRT_LOGGING
242 ACE_DEBUG ((LM_DEBUG,
243 "(%t|%T): send_request "
244 "from \"%s\"\n",
245 operation.in ()));
246 #endif
248 // Make the context to send the context to the target
249 IOP::ServiceContext sc;
250 sc.context_id = Client_Interceptor::SchedulingInfo;
252 CORBA::Policy_var sched_policy =
253 this->current_->scheduling_parameter();
255 CORBA::Long importance;
256 TimeBase::TimeT deadline;
257 TimeBase::TimeT period;
258 int task_id=-1;
260 if (CORBA::is_nil (sched_policy))
262 //24 hrs from now - infinity
263 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
264 deadline = deadline_tv.sec () * 10000000 + deadline_tv.usec () * 10; //100s of nanoseconds for TimeBase::TimeT
265 importance = 0;
266 period = 0; //set period 0 as default.
267 // task_id = ID_BEGIN ++;
269 else
271 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
272 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
274 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
275 deadline = sched_param->deadline;
276 importance = sched_param->importance;
277 period = sched_param->period;
278 task_id = sched_param->task_id;
280 #ifdef KOKYU_DSRT_LOGGING
281 ACE_DEBUG ((LM_DEBUG,
282 "(%t|%T): send_request guid = %d\n",
283 int_guid));
284 #endif
286 //Fill the guid in the SC Qos struct
287 sc_qos.guid.length (guid->length ());
288 guid_copy (sc_qos.guid, guid.in ());
289 sc_qos.deadline = deadline;
290 sc_qos.importance = importance;
291 sc_qos.task_id = task_id;
292 sc_qos.period = period;
293 CORBA::Any sc_qos_as_any;
294 sc_qos_as_any <<= sc_qos;
296 CORBA::OctetSeq_var cdtmp = codec_->encode (sc_qos_as_any);
297 sc.context_data = cdtmp.in ();
299 #ifdef KOKYU_DSRT_LOGGING
300 ACE_DEBUG ((LM_DEBUG,
301 ACE_TEXT ("(%t|%T): send_request : about to add sched SC\n")));
302 #endif
304 // Add this context to the service context list.
305 ri->add_request_service_context (sc, 0);
308 #ifdef KOKYU_DSRT_LOGGING
309 ACE_DEBUG ((LM_DEBUG,
310 ACE_TEXT ("(%t|%T): send_request : ")
311 ACE_TEXT ("about to call scheduler to inform block\n")));
312 #endif
314 DSUI_EVENT_LOG (EDF_SCHED_FAM, CALL_KOKYU_DISPATCH_UPDATE_SCHEDULE,
315 int_guid, 0, 0);
316 kokyu_dispatcher_->update_schedule (guid.in (),
317 Kokyu::BLOCK);
318 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_KOKYU_DISPATCH_UPDATE_SCHEDULE,
319 int_guid,0,0);
321 #ifdef KOKYU_DSRT_LOGGING
322 ACE_DEBUG ((LM_DEBUG,
323 ACE_TEXT ("(%t|%T): send_request interceptor done\n")));
324 #endif
325 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_CLIENT_SCHED_TIME, int_guid, 0, 0);
328 void
329 EDF_Scheduler::receive_request (PortableInterceptor::ServerRequestInfo_ptr ri,
330 RTScheduling::Current::IdType_out guid_out,
331 CORBA::String_out /*name*/,
332 CORBA::Policy_out sched_param_out,
333 CORBA::Policy_out /*implicit_sched_param_out*/)
336 Kokyu::Svc_Ctxt_DSRT_QoS* sc_qos_ptr;
337 RTScheduling::Current::IdType guid;
338 int int_guid;
340 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_SERVER_SCHED_TIME, 0, 0, 0);
344 #ifdef KOKYU_DSRT_LOGGING
345 ACE_DEBUG ((LM_DEBUG, "(%t|%T):entered EDF_Scheduler::receive_request\n"));
346 #endif
349 CORBA::String_var operation = ri->operation ();
351 #ifdef KOKYU_DSRT_LOGGING
352 ACE_DEBUG ((LM_DEBUG,
353 "(%t|%T): receive_request from "
354 "\"%s\"\n",
355 operation.in ()));
356 #endif
358 // Ignore the "_is_a" operation since it may have been invoked
359 // locally on the server side as a side effect of another call,
360 // meaning that the client hasn't added the service context yet.
361 if (ACE_OS::strcmp ("_is_a", operation.in ()) == 0)
362 return;
364 IOP::ServiceContext_var sc =
365 ri->get_request_service_context (Server_Interceptor::SchedulingInfo);
367 CORBA::Long importance;
368 TimeBase::TimeT deadline;
369 TimeBase::TimeT period;
370 CORBA::Long task_id=-1;
372 if (sc.ptr () == 0)
374 //Since send_request will add an QoS for any request, why can this case happen?
375 //24 hrs from now - infinity
376 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
377 deadline = deadline_tv.sec ()*1000000 + deadline_tv.usec ()*10; //100s of nanoseconds for TimeBase::TimeT
378 importance = 0;
379 period = 0;
380 // task_id = ID_BEGIN ++;
382 else
384 CORBA::OctetSeq oc_seq = CORBA::OctetSeq (sc->context_data.length (),
385 sc->context_data.length (),
386 sc->context_data.get_buffer (),
388 CORBA::Any sc_qos_as_any;
389 CORBA::Any_var scqostmp = codec_->decode (oc_seq);
390 sc_qos_as_any = scqostmp.in ();
391 //Don't store in a _var, since >>= returns a pointer to an
392 //internal buffer and we are not supposed to free it.
393 sc_qos_as_any >>= sc_qos_ptr;
395 deadline = sc_qos_ptr->deadline;
396 importance = sc_qos_ptr->importance;
397 period = sc_qos_ptr->period;
398 task_id = sc_qos_ptr->task_id;
400 guid.length (sc_qos_ptr->guid.length ());
401 guid_copy (guid, sc_qos_ptr->guid);
403 ACE_NEW (guid_out.ptr (),
404 RTScheduling::Current::IdType);
405 guid_out.ptr ()->length (guid.length ());
406 *(guid_out.ptr ()) = guid;
408 ACE_OS::memcpy (&int_guid,
409 guid.get_buffer (),
410 guid.length ());
413 #ifdef KOKYU_DSRT_LOGGING
414 ACE_DEBUG ((LM_DEBUG,
415 "(%t|%T): Importance = %d, guid = %d "
416 "in recvd service context\n",
417 importance,
418 int_guid));
419 #endif
421 EDF_Scheduling::SchedulingParameter sched_param;
422 sched_param.importance = importance;
423 sched_param.deadline = deadline;
424 sched_param.period = period;
425 sched_param.task_id = task_id;
426 sched_param_out = this->create_scheduling_parameter (sched_param);
429 EDF_Scheduler_Traits::QoSDescriptor_t qos;
430 qos.importance_ = importance;
431 qos.deadline_ = deadline;
432 qos.period_ = period;
433 qos.task_id_ = task_id;
435 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_SERVER_DISPATCH_SCHEDULE, int_guid, 0, 0);
437 /*DTTIME:
438 record the entering dispatcher time on the server side.
439 Tenth Time.
441 #ifdef KOKYU_HAS_RELEASE_GUARD
442 this->kokyu_dispatcher_->release_guard (guid, qos);
443 #else
444 this->kokyu_dispatcher_->schedule (guid, qos);
445 #endif
446 /*DTTIME:
447 record the leaving dispatcher time on the server side.
448 Eleventh Time.
451 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_SERVER_DISPATCH_SCHEDULE, int_guid, 0, 0);
453 #ifdef KOKYU_DSRT_LOGGING
454 ACE_DEBUG ((LM_DEBUG, "(%t|%T): receive_request interceptor done\n"));
455 #endif
457 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_SERVER_SCHED_TIME, 0, 0, 0);
460 void
461 EDF_Scheduler::send_poll (PortableInterceptor::ClientRequestInfo_ptr)
463 int int_guid;
464 RTScheduling::Current::IdType_var guid = this->current_->id ();
465 ACE_OS::memcpy (&int_guid,
466 guid->get_buffer (),
467 guid->length ());
468 DSUI_EVENT_LOG (EDF_SCHED_FAM, SEND_POLL, int_guid, 0, 0);
471 void
472 EDF_Scheduler::send_reply (PortableInterceptor::ServerRequestInfo_ptr ri)
474 int int_guid;
475 RTScheduling::Current::IdType_var guid = this->current_->id ();
476 ACE_OS::memcpy (&int_guid,
477 guid->get_buffer (),
478 guid->length ());
479 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_SEND_REPLY, int_guid, 0, 0);
481 Kokyu::Svc_Ctxt_DSRT_QoS sc_qos;
483 CORBA::String_var operation = ri->operation ();
485 #ifdef KOKYU_DSRT_LOGGING
486 ACE_DEBUG ((LM_DEBUG,
487 "(%t|%T): send_reply from \"%s\"\n",
488 ri->operation ()));
489 #endif
491 // Make the context to send the context to the target
492 IOP::ServiceContext sc;
493 sc.context_id = Server_Interceptor::SchedulingInfo;
496 CORBA::Long importance;
497 TimeBase::TimeT deadline;
499 CORBA::Policy_var sched_policy =
500 this->current_->scheduling_parameter();
502 if (CORBA::is_nil (sched_policy))
504 #ifdef KOKYU_DSRT_LOGGING
505 ACE_DEBUG ((LM_DEBUG,
506 "(%t|%T): sched_policy nil.\n"));
507 #endif
508 //24 hrs from now - infinity
509 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
510 deadline = deadline_tv.sec ()*1000000 + deadline_tv.usec ()*10; //100s of nanoseconds for TimeBase::TimeT
511 importance = 0;
513 else
515 #ifdef KOKYU_DSRT_LOGGING
516 ACE_DEBUG ((LM_DEBUG,
517 "(%t|%T):sched_policy not nil. ",
518 "sched params set\n"));
519 #endif
520 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
521 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
522 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
525 sc_qos.guid.length (guid->length ());
526 guid_copy (sc_qos.guid, guid.in ());
528 deadline = sched_param->deadline;
529 importance = sched_param->importance;
530 sc_qos.deadline = deadline;
531 sc_qos.importance = importance;
533 CORBA::Any sc_qos_as_any;
534 sc_qos_as_any <<= sc_qos;
536 CORBA::OctetSeq_var cdtmp = codec_->encode (sc_qos_as_any);
537 sc.context_data = cdtmp.in ();
539 // Add this context to the service context list.
540 ri->add_reply_service_context (sc, 1);
542 #ifdef KOKYU_DSRT_LOGGING
543 ACE_DEBUG ((LM_DEBUG, "(%t|%T):reply sc added\n"));
544 #endif
547 kokyu_dispatcher_->update_schedule (guid.in (),
548 Kokyu::BLOCK);
550 DSUI_EVENT_LOG (EDF_SCHED_FAM, EXIT_SEND_REPLY, int_guid, 0, 0);
551 #ifdef KOKYU_DSRT_LOGGING
552 ACE_DEBUG ((LM_DEBUG, "(%t|%T): send_reply interceptor done\n"));
553 #endif
556 void
557 EDF_Scheduler::send_exception (PortableInterceptor::ServerRequestInfo_ptr ri)
559 int int_guid;
560 RTScheduling::Current::IdType_var guid = this->current_->id ();
561 ACE_OS::memcpy (&int_guid,
562 guid->get_buffer (),
563 guid->length ());
564 DSUI_EVENT_LOG (EDF_SCHED_FAM, SEND_EXCEPTION, int_guid, 0, 0);
566 send_reply (ri);
569 void
570 EDF_Scheduler::send_other (PortableInterceptor::ServerRequestInfo_ptr ri)
572 int int_guid;
573 RTScheduling::Current::IdType_var guid = this->current_->id ();
574 ACE_OS::memcpy (&int_guid,
575 guid->get_buffer (),
576 guid->length ());
577 DSUI_EVENT_LOG (EDF_SCHED_FAM, SEND_OTHER, int_guid, 0, 0);
579 send_reply (ri);
582 void
583 EDF_Scheduler::receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
585 int int_guid;
587 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_RECEIVE_REPLY, 0, 0, 0);
589 RTScheduling::Current::IdType guid;
591 CORBA::String_var operation = ri->operation ();
593 CORBA::Object_var target = ri->target ();
595 ACE_CString opname = operation.in ();
596 #ifdef KOKYU_DSRT_LOGGING
597 ACE_DEBUG ((LM_DEBUG,
598 "(%t|%T):receive_reply from "
599 "\"%s\"\n",
600 opname.c_str ()));
601 #endif
603 // Check that the reply service context was received as
604 // expected.
606 IOP::ServiceContext_var sc =
607 ri->get_reply_service_context (Client_Interceptor::SchedulingInfo);
609 CORBA::Long importance;
610 TimeBase::TimeT deadline;
612 if (sc.ptr () == 0)
614 ACE_DEBUG ((LM_DEBUG, "service context was not filled\n"));
615 //24 hrs from now - infinity
616 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
617 deadline = deadline_tv.sec ()*1000000 + deadline_tv.usec ()*10; //100s of nanoseconds for TimeBase::TimeT
618 importance = 0;
620 else
622 CORBA::OctetSeq oc_seq = CORBA::OctetSeq (sc->context_data.length (),
623 sc->context_data.length (),
624 sc->context_data.get_buffer (),
627 //Don't store in a _var, since >>= returns a pointer to an internal buffer
628 //and we are not supposed to free it.
629 Kokyu::Svc_Ctxt_DSRT_QoS* sc_qos_ptr;
630 CORBA::Any sc_qos_as_any;
631 CORBA::Any_var scqostmp = codec_->decode (oc_seq);
632 sc_qos_as_any = scqostmp.in ();
633 sc_qos_as_any >>= sc_qos_ptr;
635 deadline = sc_qos_ptr->deadline;
636 importance = sc_qos_ptr->importance;
638 guid.length (sc_qos_ptr->guid.length ());
639 guid_copy (guid, sc_qos_ptr->guid);
641 ACE_DEBUG ((LM_DEBUG,
642 "(%t|%T):Importance = %d in recvd service context\n",
643 importance));
646 ACE_OS::memcpy (&int_guid,
647 guid.get_buffer (),
648 guid.length ());
650 EDF_Scheduler_Traits::QoSDescriptor_t qos;
651 qos.deadline_ = qos.importance_ = importance;
652 qos.deadline_ = deadline;
653 this->kokyu_dispatcher_->schedule (guid, qos);
654 DSUI_EVENT_LOG (EDF_SCHED_FAM, EXIT_RECEIVE_REPLY, int_guid, 0, 0);
657 void
658 EDF_Scheduler::receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri)
660 DSUI_EVENT_LOG (EDF_SCHED_FAM, RECEIVE_EXCEPTION, 0, 0, 0);
662 receive_reply (ri);
665 void
666 EDF_Scheduler::receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
669 DSUI_EVENT_LOG (EDF_SCHED_FAM, RECEIVE_OTHER, 0, 0, 0);
671 //Otherwise Segmentation fault when oneway call happens.
672 /* receive_reply (ri);
676 void
677 EDF_Scheduler::cancel (const RTScheduling::Current::IdType &)
679 throw CORBA::NO_IMPLEMENT ();
682 CORBA::PolicyList*
683 EDF_Scheduler::scheduling_policies (void)
685 throw CORBA::NO_IMPLEMENT ();
688 void
689 EDF_Scheduler::scheduling_policies (const CORBA::PolicyList &)
691 throw CORBA::NO_IMPLEMENT ();
694 CORBA::PolicyList*
695 EDF_Scheduler::poa_policies (void)
697 throw CORBA::NO_IMPLEMENT ();
700 char *
701 EDF_Scheduler::scheduling_discipline_name (void)
703 throw CORBA::NO_IMPLEMENT ();
706 RTScheduling::ResourceManager_ptr
707 EDF_Scheduler::create_resource_manager (const char *,
708 CORBA::Policy_ptr)
710 throw CORBA::NO_IMPLEMENT ();
713 void
714 EDF_Scheduler::set_scheduling_parameter (PortableServer::Servant &,
715 const char *,
716 CORBA::Policy_ptr)
718 throw CORBA::NO_IMPLEMENT ();