summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-21 22:23:51 +0000
committerpradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-03-21 22:23:51 +0000
commitcb6e18cc17bf3311f2ffd3675fd7eb31b0da5a5e (patch)
tree6832ac816e6cd0ba6b2f8d8455ba09688434bcaf
parente3dc136b0e3ff2015a26577c165eba1c966b7dd4 (diff)
downloadATCD-cb6e18cc17bf3311f2ffd3675fd7eb31b0da5a5e.tar.gz
ChangeLogTag:Fri Mar 21 17:16:42 2003 Pradeep Gore <pradeep@oomworks.com>
-rw-r--r--TAO/ChangeLog24
-rw-r--r--TAO/orbsvcs/tests/Notify/Lanes/consumer.conf6
-rw-r--r--TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf7
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp77
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h3
5 files changed, 106 insertions, 11 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 5637cbcff7c..e820231f8cc 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,20 @@
+Fri Mar 21 17:16:42 2003 Pradeep Gore <pradeep@oomworks.com>
+
+ * orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp:
+ * orbsvcs/tests/Notify/lib/Periodic_Consumer.h:
+ Added an option to check if the thread priority matches the
+ priority specified in the event received.
+
+ * orbsvcs/tests/Notify/ThreadPool/consumer.conf:
+ * orbsvcs/tests/Notify/Lanes/consumer.conf:
+ Added the "-Check_Priority" option to the Periodic Consumers.
+
+Fri Mar 21 11:35:15 2003 Pradeep Gore <pradeep@oomworks.com>
+
+ * orbsvcs/orbsvcs/Notify/Default_Factory.cpp:
+ * orbsvcs/orbsvcs/Notify/RT_Factory.cpp:
+ Corrected to ACE_FACTORY_DEFINE macro.
+
Wed Mar 19 08:42:45 2003 Pradeep Gore <pradeep@oomworks.com>
* orbsvcs/orbsvcs/NotifyExt.idl:
@@ -19,6 +36,13 @@ Wed Mar 19 08:42:45 2003 Pradeep Gore <pradeep@oomworks.com>
* orbsvcs/orbsvcs/Notify/Proxy.cpp:
Overload the <activate> and <deactivate> methods to use the <proxy_poa_>.
+ * orbsvcs/orbsvcs/RT_Notification.dsp:
+ * orbsvcs/orbsvcs/RT_Notification_Static.dsp:
+ * orbsvcs/orbsvcs/RT_Notification.rc:
+ * orbsvcs/orbsvcs/RT_Notification.bor:
+ * orbsvcs/orbsvcs/Makefile.RT_Notification:
+ Added RT_Notification specific files.
+
* orbsvcs/tests/Notify/lib/Activation_Manager.cpp:
* orbsvcs/tests/Notify/lib/Activation_Manager.h:
* orbsvcs/tests/Notify/lib/Activation_Manager.idl:
diff --git a/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf b/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf
index e32bf7c5720..fb727cfeae2 100644
--- a/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf
+++ b/TAO/orbsvcs/tests/Notify/Lanes/consumer.conf
@@ -22,7 +22,7 @@ static Command_Builder "POA -Create poa_1 -PriorityModel CLIENT 1 -ThreadPoolLan
static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
##--------- Consumer 1 , connected to CA 1 --------
-static Command_Builder "PeriodicConsumer -Create c1 ca1 -POA poa_1 -Proxy c1_proxy -MaxCount 5"
+static Command_Builder "PeriodicConsumer -Create c1 ca1 -POA poa_1 -Proxy c1_proxy -MaxCount 5 -Check_Priority"
static Command_Builder "PeriodicConsumer -Subscription c1 +Path1"
static Command_Builder "Filter -CreateFilter f_c1 ff"
@@ -32,7 +32,7 @@ static Command_Builder "Filter -Add_Constraint f_c1 'LaneId = 1'"
static Command_Builder "Filter -Add_Filter f_c1 c1_proxy"
##--------- Consumer 2 , connected to CA 1 --------
-static Command_Builder "PeriodicConsumer -Create c2 ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 5"
+static Command_Builder "PeriodicConsumer -Create c2 ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 5 -Check_Priority"
static Command_Builder "PeriodicConsumer -Subscription c2 +Path2"
static Command_Builder "Filter -CreateFilter f_c2 ff"
@@ -42,7 +42,7 @@ static Command_Builder "Filter -Add_Constraint f_c2 'LaneId = 2'"
static Command_Builder "Filter -Add_Filter f_c2 c2_proxy"
##--------- Consumer 3 , connected to CA 1 --------
-static Command_Builder "PeriodicConsumer -Create c3 ca1 -POA poa_1 -Proxy c3_proxy -MaxCount 5"
+static Command_Builder "PeriodicConsumer -Create c3 ca1 -POA poa_1 -Proxy c3_proxy -MaxCount 5 -Check_Priority"
static Command_Builder "PeriodicConsumer -Subscription c3 +Path3"
static Command_Builder "Filter -CreateFilter f_c3 ff"
diff --git a/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf b/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf
index 2cc9e9c4ab9..fba1379fe1d 100644
--- a/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf
+++ b/TAO/orbsvcs/tests/Notify/ThreadPool/consumer.conf
@@ -22,13 +22,14 @@ static Command_Builder "ConsumerAdmin -Create ca1 ec1 -AND_OP"
static Command_Builder "ConsumerAdmin -Set_QoS ca1 -ThreadPool -Threads 1 -Priority 5"
##--------- Consumer 1 , connected to CA 1 --------
-static Command_Builder "PeriodicConsumer -Create c1 ca1 -POA poa_1 -Set_QoS -ThreadPool -Threads 1 -Priority 5 -Proxy c1_proxy -MaxCount 15"
+static Command_Builder "PeriodicConsumer -Create c1 ca1 -POA poa_1
+-Set_QoS -ThreadPool -Threads 1 -Priority 5 -Proxy c1_proxy -MaxCount 15 -Check_Priority"
static Command_Builder "Filter -CreateFilter f_c1 ff"
static Command_Builder "Filter -Add_Constraint f_c1 'PoolId = 5'"
static Command_Builder "Filter -Add_Filter f_c1 c1_proxy"
##--------- Consumer 2 , connected to CA 1 --------
-static Command_Builder "PeriodicConsumer -Create c2 ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 15"
+static Command_Builder "PeriodicConsumer -Create c2 ca1 -POA poa_1 -Proxy c2_proxy -MaxCount 15 -Check_Priority"
static Command_Builder "Filter -CreateFilter f_c2 ff"
static Command_Builder "Filter -Add_Constraint f_c2 'PoolId = 4'"
static Command_Builder "Filter -Add_Filter f_c2 c2_proxy"
@@ -37,7 +38,7 @@ static Command_Builder "Filter -Add_Filter f_c2 c2_proxy"
static Command_Builder "ConsumerAdmin -Create ca2 ec1 -AND_OP"
##--------- Consumer 3 , connected to CA 2 --------
-static Command_Builder "PeriodicConsumer -Create c3 ca2 -POA poa_1 -Proxy c3_proxy -MaxCount 15"
+static Command_Builder "PeriodicConsumer -Create c3 ca2 -POA poa_1 -Proxy c3_proxy -MaxCount 15 -Check_Priority"
static Command_Builder "Filter -CreateFilter f_c3 ff"
static Command_Builder "Filter -Add_Constraint f_c3 'PoolId = 1'"
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
index d44b9bff0cf..b9fdc3b980d 100644
--- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
@@ -9,11 +9,13 @@
#include "StructuredEvent.h"
#include "Task_Stats.h"
#include "Task_Callback.h"
+#include "LookupManager.h"
+#include "Priority_Mapping.h"
ACE_RCSID(RT_Notify, TAO_NS_Periodic_Consumer, "$id$")
TAO_NS_Periodic_Consumer::TAO_NS_Periodic_Consumer (void)
- :count_ (0), max_count_ (-1), client_ (0)
+ :count_ (0), max_count_ (-1), client_ (0), check_priority_ (0)
{
}
@@ -50,10 +52,16 @@ TAO_NS_Periodic_Consumer::init_state (ACE_Arg_Shifter& arg_shifter)
this->client_->done (this);
}
}
- else
- {
- break;
- }
+ else if (arg_shifter.cur_arg_strncasecmp ("-Check_Priority") == 0)
+ {
+ this->check_priority_ = 1;
+
+ arg_shifter.consume_arg ();
+ }
+ else
+ {
+ break;
+ }
} /* while */
return 0;
@@ -142,12 +150,71 @@ TAO_NS_Periodic_Consumer::push_structured_event (const CosNotification::Structur
else if (this->max_count_ == -1 && ACE_OS::strcmp (prop_seq[i].name.in (), "MaxCount") == 0)
{
prop_seq[i].value >>= this->max_count_;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Setting Maxcount = %d\n", this->max_count_));
}
}
this->stats_.init (this->max_count_);
}
+ if (this->check_priority_)
+ {
+ // Check if the event carries a Priority.
+ const CosNotification::PropertySeq& prop_seq = notification.header.variable_header;
+
+ int event_has_priority_set = 0;
+ CORBA::Short event_priority = 0;
+
+ for (CORBA::ULong i = 0; i < prop_seq.length (); ++i)
+ {
+ if (ACE_OS::strcmp (prop_seq[i].name.in (), CosNotification::Priority) == 0)
+ {
+ prop_seq[i].value >>= event_priority;
+
+ event_has_priority_set = 1;
+ break;
+ }
+ }
+
+ if (event_has_priority_set == 1)
+ {
+ // Confirm that the current thread is at the priority set in the event
+ ACE_hthread_t current;
+ ACE_Thread::self (current);
+
+ int priority;
+ if (ACE_Thread::getprio (current, priority) == -1)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - ")
+ ACE_TEXT (" ACE_Thread::get_prio\n")));
+
+ return ;
+ }
+
+ CORBA::Short native_priority = CORBA::Short (priority);
+
+ TAO_NS_Priority_Mapping* priority_mapping;
+ LOOKUP_MANAGER->resolve (priority_mapping);
+
+ CORBA::Short corba_priority;
+
+ priority_mapping->to_CORBA (native_priority, corba_priority);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "Periodic Consumer expected priority = %d, received priority = %d\n",
+ event_priority, corba_priority));
+
+ if (corba_priority != event_priority)
+ ACE_DEBUG ((LM_DEBUG,
+ "Error: Periodic Consumer expected priority = %d, received priority = %d\n",
+ event_priority, corba_priority));
+ }
+ }
+
TimeBase::TimeT send_time, now;
ACE_hrtime_t send_time_hrtime;
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
index 2b48c1847da..08deba372b9 100644
--- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
@@ -91,6 +91,9 @@ protected:
/// Client
TAO_NS_Task_Callback* client_;
+
+ /// Flag to indicate if we want to check the expected priority.
+ int check_priority_;
};
#include "ace/post.h"