=default for generated implementation copy ctor
[ACE_TAO.git] / TAO / examples / Kokyu_dsrt_schedulers / EDF_Scheduler.cpp
blob3250eeba1fbac1bafa27881aaeab837f6677a7c2
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 ()
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)
36 Kokyu::DSRT_ConfigInfo config;
38 config.impl_type_ = this->disp_impl_type_;
39 config.sched_policy_ = ace_sched_policy_;
40 config.sched_scope_ = ace_sched_scope_;
42 Kokyu::DSRT_Dispatcher_Factory<EDF_Scheduler_Traits>::DSRT_Dispatcher_Auto_Ptr
43 tmp( Kokyu::DSRT_Dispatcher_Factory<EDF_Scheduler_Traits>::
44 create_DSRT_dispatcher (config) );
45 DSUI_EVENT_LOG (EDF_SCHED_FAM, CONSTRUCTOR, 0, 0, 0);
47 kokyu_dispatcher_ = tmp;
49 CORBA::Object_var object =
50 orb->resolve_initial_references ("RTScheduler_Current");
52 this->current_ =
53 RTScheduling::Current::_narrow (object.in ());
55 IOP::CodecFactory_var codec_factory;
56 CORBA::Object_var obj =
57 orb->resolve_initial_references ("CodecFactory");
59 if (CORBA::is_nil(obj.in ()))
61 ACE_ERROR ((LM_ERROR, "Nil Codec factory\n"));
63 else
65 codec_factory = IOP::CodecFactory::_narrow (obj.in ());
68 IOP::Encoding encoding;
69 encoding.format = IOP::ENCODING_CDR_ENCAPS;
70 encoding.major_version = 1;
71 encoding.minor_version = 2;
73 codec_ = codec_factory->create_codec (encoding);
76 EDF_Scheduler::~EDF_Scheduler ()
80 void
81 EDF_Scheduler::shutdown ()
83 kokyu_dispatcher_->shutdown ();
84 DSUI_EVENT_LOG (EDF_SCHED_FAM, DISPATCHER_SHUTDOWN, 0, 0, 0);
85 ACE_DEBUG ((LM_DEBUG, "kokyu DSRT dispatcher shutdown\n"));
88 EDF_Scheduling::SchedulingParameterPolicy_ptr
89 EDF_Scheduler::create_scheduling_parameter (const EDF_Scheduling::SchedulingParameter & value)
91 /* MEASURE: Time to create scheduling parameter */
92 DSUI_EVENT_LOG (EDF_SCHED_FAM, CREATE_SCHED_PARAM, 0, 0, 0);
94 EDF_Scheduling::SchedulingParameterPolicy_ptr sched_param_policy;
95 ACE_NEW_THROW_EX (sched_param_policy,
96 EDF_Sched_Param_Policy,
97 CORBA::NO_MEMORY (
98 CORBA::SystemException::_tao_minor_code (
99 TAO::VMCID,
100 ENOMEM),
101 CORBA::COMPLETED_NO));
103 sched_param_policy->value (value);
105 return sched_param_policy;
109 void
110 EDF_Scheduler::begin_new_scheduling_segment (const RTScheduling::Current::IdType &guid,
111 const char *,
112 CORBA::Policy_ptr sched_policy,
113 CORBA::Policy_ptr)
115 #ifdef KOKYU_DSRT_LOGGING
116 ACE_DEBUG ((LM_DEBUG,
117 "(%t|%T):EDF_Scheduler::begin_new_scheduling_segment enter\n"));
118 #endif
120 //#ifdef KOKYU_DSRT_LOGGING
121 int int_guid;
122 ACE_OS::memcpy (&int_guid,
123 guid.get_buffer (),
124 guid.length ());
125 // ACE_DEBUG ((LM_DEBUG, "(%t|%T): guid is %d\n", int_guid));
126 //#endif
128 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_SCHED_SEGMENT_START, int_guid, 0, 0);
129 EDF_Scheduler_Traits::QoSDescriptor_t qos;
130 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
131 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
133 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
135 qos.deadline_ = sched_param->deadline;
136 qos.importance_ = sched_param->importance;
138 kokyu_dispatcher_->schedule (guid, qos);
140 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_SCHED_SEGMENT_END, int_guid, 0, 0);
141 #ifdef KOKYU_DSRT_LOGGING
142 ACE_DEBUG ((LM_DEBUG,
143 "(%t|%T):EDF_Scheduler::begin_new_scheduling_segment exit\n"));
144 #endif
148 void
149 EDF_Scheduler::begin_nested_scheduling_segment (const RTScheduling::Current::IdType &guid,
150 const char *name,
151 CORBA::Policy_ptr sched_param,
152 CORBA::Policy_ptr implicit_sched_param)
154 int int_guid;
155 ACE_OS::memcpy (&int_guid,
156 guid.get_buffer (),
157 guid.length ());
158 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_NESTED_SCHED_SEGMENT, int_guid, 0, 0);
159 this->begin_new_scheduling_segment (guid,
160 name,
161 sched_param,
162 implicit_sched_param);
165 void
166 EDF_Scheduler::update_scheduling_segment (const RTScheduling::Current::IdType& guid,
167 const char* name,
168 CORBA::Policy_ptr sched_policy,
169 CORBA::Policy_ptr implicit_sched_param)
171 ACE_UNUSED_ARG ((name));
172 ACE_UNUSED_ARG ((implicit_sched_param));
174 int int_guid ;
175 ACE_OS::memcpy (&int_guid,
176 guid.get_buffer (),
177 guid.length ());
178 DSUI_EVENT_LOG (EDF_SCHED_FAM, BEGIN_UPDATE_SCHED_SEGMENT, int_guid, 0, 0);
179 #ifdef KOKYU_DSRT_LOGGING
180 ACE_DEBUG ((LM_DEBUG, "(%t|%T): update_sched_seg::guid is %d\n", int_guid));
181 #endif
183 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
184 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
186 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
187 EDF_Scheduler_Traits::QoSDescriptor_t qos;
189 qos.deadline_ = sched_param->deadline;
190 qos.importance_ = sched_param->importance;
192 kokyu_dispatcher_->update_schedule (guid, qos);
193 DSUI_EVENT_LOG (EDF_SCHED_FAM, END_UPDATE_SCHED_SEGMENT, int_guid, 0, 0);
196 void
197 EDF_Scheduler::end_scheduling_segment (const RTScheduling::Current::IdType &guid,
198 const char *)
200 int int_guid;
201 ACE_OS::memcpy (&int_guid,
202 guid.get_buffer (),
203 guid.length ());
204 #ifdef KOKYU_DSRT_LOGGING
205 ACE_DEBUG ((LM_DEBUG, "(%t|%T) call to end_sched_segment for guid %d\n", int_guid));
206 #endif
208 DSUI_EVENT_LOG (EDF_SCHED_FAM, END_SCHED_SEGMENT, int_guid, 0, 0);
209 kokyu_dispatcher_->cancel_schedule (guid);
212 void
213 EDF_Scheduler::end_nested_scheduling_segment (const RTScheduling::Current::IdType & guid,
214 const char *,
215 CORBA::Policy_ptr)
217 int int_guid;
218 ACE_OS::memcpy (&int_guid,
219 guid.get_buffer (),
220 guid.length ());
221 DSUI_EVENT_LOG (EDF_SCHED_FAM, END_NESTED_SCHED_SEGMENT, int_guid, 0, 0);
225 void
226 EDF_Scheduler::send_request (PortableInterceptor::ClientRequestInfo_ptr ri)
228 int int_guid;
229 RTScheduling::Current::IdType_var guid = this->current_->id ();
230 ACE_OS::memcpy (&int_guid,
231 guid->get_buffer (),
232 guid->length ());
234 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_CLIENT_SCHED_TIME, int_guid, 0, 0);
235 Kokyu::Svc_Ctxt_DSRT_QoS sc_qos;
237 CORBA::String_var operation = ri->operation ();
239 #ifdef KOKYU_DSRT_LOGGING
240 ACE_DEBUG ((LM_DEBUG,
241 "(%t|%T): send_request "
242 "from \"%s\"\n",
243 operation.in ()));
244 #endif
246 // Make the context to send the context to the target
247 IOP::ServiceContext sc;
248 sc.context_id = Client_Interceptor::SchedulingInfo;
250 CORBA::Policy_var sched_policy =
251 this->current_->scheduling_parameter();
253 CORBA::Long importance;
254 TimeBase::TimeT deadline;
255 TimeBase::TimeT period;
256 int task_id=-1;
258 if (CORBA::is_nil (sched_policy))
260 //24 hrs from now - infinity
261 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
262 deadline = deadline_tv.sec () * 10000000 + deadline_tv.usec () * 10; //100s of nanoseconds for TimeBase::TimeT
263 importance = 0;
264 period = 0; //set period 0 as default.
265 // task_id = ID_BEGIN ++;
267 else
269 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
270 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
272 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
273 deadline = sched_param->deadline;
274 importance = sched_param->importance;
275 period = sched_param->period;
276 task_id = sched_param->task_id;
278 #ifdef KOKYU_DSRT_LOGGING
279 ACE_DEBUG ((LM_DEBUG,
280 "(%t|%T): send_request guid = %d\n",
281 int_guid));
282 #endif
284 //Fill the guid in the SC Qos struct
285 sc_qos.guid.length (guid->length ());
286 guid_copy (sc_qos.guid, guid.in ());
287 sc_qos.deadline = deadline;
288 sc_qos.importance = importance;
289 sc_qos.task_id = task_id;
290 sc_qos.period = period;
291 CORBA::Any sc_qos_as_any;
292 sc_qos_as_any <<= sc_qos;
294 CORBA::OctetSeq_var cdtmp = codec_->encode (sc_qos_as_any);
295 sc.context_data = cdtmp.in ();
297 #ifdef KOKYU_DSRT_LOGGING
298 ACE_DEBUG ((LM_DEBUG,
299 ACE_TEXT ("(%t|%T): send_request : about to add sched SC\n")));
300 #endif
302 // Add this context to the service context list.
303 ri->add_request_service_context (sc, 0);
306 #ifdef KOKYU_DSRT_LOGGING
307 ACE_DEBUG ((LM_DEBUG,
308 ACE_TEXT ("(%t|%T): send_request : ")
309 ACE_TEXT ("about to call scheduler to inform block\n")));
310 #endif
312 DSUI_EVENT_LOG (EDF_SCHED_FAM, CALL_KOKYU_DISPATCH_UPDATE_SCHEDULE,
313 int_guid, 0, 0);
314 kokyu_dispatcher_->update_schedule (guid.in (),
315 Kokyu::BLOCK);
316 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_KOKYU_DISPATCH_UPDATE_SCHEDULE,
317 int_guid,0,0);
319 #ifdef KOKYU_DSRT_LOGGING
320 ACE_DEBUG ((LM_DEBUG,
321 ACE_TEXT ("(%t|%T): send_request interceptor done\n")));
322 #endif
323 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_CLIENT_SCHED_TIME, int_guid, 0, 0);
326 void
327 EDF_Scheduler::receive_request (PortableInterceptor::ServerRequestInfo_ptr ri,
328 RTScheduling::Current::IdType_out guid_out,
329 CORBA::String_out /*name*/,
330 CORBA::Policy_out sched_param_out,
331 CORBA::Policy_out /*implicit_sched_param_out*/)
333 Kokyu::Svc_Ctxt_DSRT_QoS* sc_qos_ptr;
334 RTScheduling::Current::IdType guid;
335 int int_guid;
337 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_SERVER_SCHED_TIME, 0, 0, 0);
340 #ifdef KOKYU_DSRT_LOGGING
341 ACE_DEBUG ((LM_DEBUG, "(%t|%T):entered EDF_Scheduler::receive_request\n"));
342 #endif
345 CORBA::String_var operation = ri->operation ();
347 #ifdef KOKYU_DSRT_LOGGING
348 ACE_DEBUG ((LM_DEBUG,
349 "(%t|%T): receive_request from "
350 "\"%s\"\n",
351 operation.in ()));
352 #endif
354 // Ignore the "_is_a" operation since it may have been invoked
355 // locally on the server side as a side effect of another call,
356 // meaning that the client hasn't added the service context yet.
357 if (ACE_OS::strcmp ("_is_a", operation.in ()) == 0)
358 return;
360 IOP::ServiceContext_var sc =
361 ri->get_request_service_context (Server_Interceptor::SchedulingInfo);
363 CORBA::Long importance;
364 TimeBase::TimeT deadline;
365 TimeBase::TimeT period;
366 CORBA::Long task_id=-1;
368 if (sc.ptr () == 0)
370 //Since send_request will add an QoS for any request, why can this case happen?
371 //24 hrs from now - infinity
372 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
373 deadline = deadline_tv.sec ()*1000000 + deadline_tv.usec ()*10; //100s of nanoseconds for TimeBase::TimeT
374 importance = 0;
375 period = 0;
376 // task_id = ID_BEGIN ++;
378 else
380 CORBA::OctetSeq oc_seq = CORBA::OctetSeq (sc->context_data.length (),
381 sc->context_data.length (),
382 sc->context_data.get_buffer (),
384 CORBA::Any sc_qos_as_any;
385 CORBA::Any_var scqostmp = codec_->decode (oc_seq);
386 sc_qos_as_any = scqostmp.in ();
387 //Don't store in a _var, since >>= returns a pointer to an
388 //internal buffer and we are not supposed to free it.
389 sc_qos_as_any >>= sc_qos_ptr;
391 deadline = sc_qos_ptr->deadline;
392 importance = sc_qos_ptr->importance;
393 period = sc_qos_ptr->period;
394 task_id = sc_qos_ptr->task_id;
396 guid.length (sc_qos_ptr->guid.length ());
397 guid_copy (guid, sc_qos_ptr->guid);
399 ACE_NEW (guid_out.ptr (),
400 RTScheduling::Current::IdType);
401 guid_out.ptr ()->length (guid.length ());
402 *(guid_out.ptr ()) = guid;
404 ACE_OS::memcpy (&int_guid,
405 guid.get_buffer (),
406 guid.length ());
409 #ifdef KOKYU_DSRT_LOGGING
410 ACE_DEBUG ((LM_DEBUG,
411 "(%t|%T): Importance = %d, guid = %d "
412 "in recvd service context\n",
413 importance,
414 int_guid));
415 #endif
417 EDF_Scheduling::SchedulingParameter sched_param;
418 sched_param.importance = importance;
419 sched_param.deadline = deadline;
420 sched_param.period = period;
421 sched_param.task_id = task_id;
422 sched_param_out = this->create_scheduling_parameter (sched_param);
425 EDF_Scheduler_Traits::QoSDescriptor_t qos;
426 qos.importance_ = importance;
427 qos.deadline_ = deadline;
428 qos.period_ = period;
429 qos.task_id_ = task_id;
431 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_SERVER_DISPATCH_SCHEDULE, int_guid, 0, 0);
433 /*DTTIME:
434 record the entering dispatcher time on the server side.
435 Tenth Time.
437 #ifdef KOKYU_HAS_RELEASE_GUARD
438 this->kokyu_dispatcher_->release_guard (guid, qos);
439 #else
440 this->kokyu_dispatcher_->schedule (guid, qos);
441 #endif
442 /*DTTIME:
443 record the leaving dispatcher time on the server side.
444 Eleventh Time.
447 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_SERVER_DISPATCH_SCHEDULE, int_guid, 0, 0);
449 #ifdef KOKYU_DSRT_LOGGING
450 ACE_DEBUG ((LM_DEBUG, "(%t|%T): receive_request interceptor done\n"));
451 #endif
453 DSUI_EVENT_LOG (EDF_SCHED_FAM, LEAVE_SERVER_SCHED_TIME, 0, 0, 0);
456 void
457 EDF_Scheduler::send_poll (PortableInterceptor::ClientRequestInfo_ptr)
459 int int_guid;
460 RTScheduling::Current::IdType_var guid = this->current_->id ();
461 ACE_OS::memcpy (&int_guid,
462 guid->get_buffer (),
463 guid->length ());
464 DSUI_EVENT_LOG (EDF_SCHED_FAM, SEND_POLL, int_guid, 0, 0);
467 void
468 EDF_Scheduler::send_reply (PortableInterceptor::ServerRequestInfo_ptr ri)
470 int int_guid;
471 RTScheduling::Current::IdType_var guid = this->current_->id ();
472 ACE_OS::memcpy (&int_guid,
473 guid->get_buffer (),
474 guid->length ());
475 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_SEND_REPLY, int_guid, 0, 0);
477 Kokyu::Svc_Ctxt_DSRT_QoS sc_qos;
479 CORBA::String_var operation = ri->operation ();
481 #ifdef KOKYU_DSRT_LOGGING
482 ACE_DEBUG ((LM_DEBUG,
483 "(%t|%T): send_reply from \"%s\"\n",
484 ri->operation ()));
485 #endif
487 // Make the context to send the context to the target
488 IOP::ServiceContext sc;
489 sc.context_id = Server_Interceptor::SchedulingInfo;
492 CORBA::Long importance;
493 TimeBase::TimeT deadline;
495 CORBA::Policy_var sched_policy =
496 this->current_->scheduling_parameter();
498 if (CORBA::is_nil (sched_policy))
500 #ifdef KOKYU_DSRT_LOGGING
501 ACE_DEBUG ((LM_DEBUG,
502 "(%t|%T): sched_policy nil.\n"));
503 #endif
504 //24 hrs from now - infinity
505 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
506 deadline = deadline_tv.sec ()*1000000 + deadline_tv.usec ()*10; //100s of nanoseconds for TimeBase::TimeT
507 importance = 0;
509 else
511 #ifdef KOKYU_DSRT_LOGGING
512 ACE_DEBUG ((LM_DEBUG,
513 "(%t|%T):sched_policy not nil. ",
514 "sched params set\n"));
515 #endif
516 EDF_Scheduling::SchedulingParameterPolicy_var sched_param_policy =
517 EDF_Scheduling::SchedulingParameterPolicy::_narrow (sched_policy);
518 EDF_Scheduling::SchedulingParameter_var sched_param = sched_param_policy->value ();
521 sc_qos.guid.length (guid->length ());
522 guid_copy (sc_qos.guid, guid.in ());
524 deadline = sched_param->deadline;
525 importance = sched_param->importance;
526 sc_qos.deadline = deadline;
527 sc_qos.importance = importance;
529 CORBA::Any sc_qos_as_any;
530 sc_qos_as_any <<= sc_qos;
532 CORBA::OctetSeq_var cdtmp = codec_->encode (sc_qos_as_any);
533 sc.context_data = cdtmp.in ();
535 // Add this context to the service context list.
536 ri->add_reply_service_context (sc, 1);
538 #ifdef KOKYU_DSRT_LOGGING
539 ACE_DEBUG ((LM_DEBUG, "(%t|%T):reply sc added\n"));
540 #endif
543 kokyu_dispatcher_->update_schedule (guid.in (),
544 Kokyu::BLOCK);
546 DSUI_EVENT_LOG (EDF_SCHED_FAM, EXIT_SEND_REPLY, int_guid, 0, 0);
547 #ifdef KOKYU_DSRT_LOGGING
548 ACE_DEBUG ((LM_DEBUG, "(%t|%T): send_reply interceptor done\n"));
549 #endif
552 void
553 EDF_Scheduler::send_exception (PortableInterceptor::ServerRequestInfo_ptr ri)
555 int int_guid;
556 RTScheduling::Current::IdType_var guid = this->current_->id ();
557 ACE_OS::memcpy (&int_guid,
558 guid->get_buffer (),
559 guid->length ());
560 DSUI_EVENT_LOG (EDF_SCHED_FAM, SEND_EXCEPTION, int_guid, 0, 0);
562 send_reply (ri);
565 void
566 EDF_Scheduler::send_other (PortableInterceptor::ServerRequestInfo_ptr ri)
568 int int_guid;
569 RTScheduling::Current::IdType_var guid = this->current_->id ();
570 ACE_OS::memcpy (&int_guid,
571 guid->get_buffer (),
572 guid->length ());
573 DSUI_EVENT_LOG (EDF_SCHED_FAM, SEND_OTHER, int_guid, 0, 0);
575 send_reply (ri);
578 void
579 EDF_Scheduler::receive_reply (PortableInterceptor::ClientRequestInfo_ptr ri)
581 int int_guid;
583 DSUI_EVENT_LOG (EDF_SCHED_FAM, ENTER_RECEIVE_REPLY, 0, 0, 0);
585 RTScheduling::Current::IdType guid;
587 CORBA::String_var operation = ri->operation ();
589 CORBA::Object_var target = ri->target ();
591 ACE_CString opname = operation.in ();
592 #ifdef KOKYU_DSRT_LOGGING
593 ACE_DEBUG ((LM_DEBUG,
594 "(%t|%T):receive_reply from "
595 "\"%s\"\n",
596 opname.c_str ()));
597 #endif
599 // Check that the reply service context was received as
600 // expected.
602 IOP::ServiceContext_var sc =
603 ri->get_reply_service_context (Client_Interceptor::SchedulingInfo);
605 CORBA::Long importance;
606 TimeBase::TimeT deadline;
608 if (sc.ptr () == 0)
610 ACE_DEBUG ((LM_DEBUG, "service context was not filled\n"));
611 //24 hrs from now - infinity
612 ACE_Time_Value deadline_tv = ACE_OS::gettimeofday () + ACE_Time_Value (24*60*60,0);
613 deadline = deadline_tv.sec ()*1000000 + deadline_tv.usec ()*10; //100s of nanoseconds for TimeBase::TimeT
614 importance = 0;
616 else
618 CORBA::OctetSeq oc_seq = CORBA::OctetSeq (sc->context_data.length (),
619 sc->context_data.length (),
620 sc->context_data.get_buffer (),
623 //Don't store in a _var, since >>= returns a pointer to an internal buffer
624 //and we are not supposed to free it.
625 Kokyu::Svc_Ctxt_DSRT_QoS* sc_qos_ptr;
626 CORBA::Any sc_qos_as_any;
627 CORBA::Any_var scqostmp = codec_->decode (oc_seq);
628 sc_qos_as_any = scqostmp.in ();
629 sc_qos_as_any >>= sc_qos_ptr;
631 deadline = sc_qos_ptr->deadline;
632 importance = sc_qos_ptr->importance;
634 guid.length (sc_qos_ptr->guid.length ());
635 guid_copy (guid, sc_qos_ptr->guid);
637 ACE_DEBUG ((LM_DEBUG,
638 "(%t|%T):Importance = %d in recvd service context\n",
639 importance));
642 ACE_OS::memcpy (&int_guid,
643 guid.get_buffer (),
644 guid.length ());
646 EDF_Scheduler_Traits::QoSDescriptor_t qos;
647 qos.deadline_ = qos.importance_ = importance;
648 qos.deadline_ = deadline;
649 this->kokyu_dispatcher_->schedule (guid, qos);
650 DSUI_EVENT_LOG (EDF_SCHED_FAM, EXIT_RECEIVE_REPLY, int_guid, 0, 0);
653 void
654 EDF_Scheduler::receive_exception (PortableInterceptor::ClientRequestInfo_ptr ri)
656 DSUI_EVENT_LOG (EDF_SCHED_FAM, RECEIVE_EXCEPTION, 0, 0, 0);
658 receive_reply (ri);
661 void
662 EDF_Scheduler::receive_other (PortableInterceptor::ClientRequestInfo_ptr ri)
664 DSUI_EVENT_LOG (EDF_SCHED_FAM, RECEIVE_OTHER, 0, 0, 0);
666 //Otherwise Segmentation fault when oneway call happens.
667 /* receive_reply (ri);
671 void
672 EDF_Scheduler::cancel (const RTScheduling::Current::IdType &)
674 throw CORBA::NO_IMPLEMENT ();
677 CORBA::PolicyList*
678 EDF_Scheduler::scheduling_policies ()
680 throw CORBA::NO_IMPLEMENT ();
683 void
684 EDF_Scheduler::scheduling_policies (const CORBA::PolicyList &)
686 throw CORBA::NO_IMPLEMENT ();
689 CORBA::PolicyList*
690 EDF_Scheduler::poa_policies ()
692 throw CORBA::NO_IMPLEMENT ();
695 char *
696 EDF_Scheduler::scheduling_discipline_name ()
698 throw CORBA::NO_IMPLEMENT ();
701 RTScheduling::ResourceManager_ptr
702 EDF_Scheduler::create_resource_manager (const char *,
703 CORBA::Policy_ptr)
705 throw CORBA::NO_IMPLEMENT ();
708 void
709 EDF_Scheduler::set_scheduling_parameter (PortableServer::Servant &,
710 const char *,
711 CORBA::Policy_ptr)
713 throw CORBA::NO_IMPLEMENT ();