diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-29 19:24:18 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-01-29 19:24:18 +0000 |
commit | f55f154005665515c9cb596c30d64918776c5da7 (patch) | |
tree | 9d3fae454f27cd8829aa56bc3d9e11712fb14513 /CIAO | |
parent | 475ed1f274432cbe0bb302a95701e7151d7497f5 (diff) | |
download | ATCD-f55f154005665515c9cb596c30d64918776c5da7.tar.gz |
Mon Jan 29 19:23:14 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'CIAO')
-rw-r--r-- | CIAO/ChangeLog | 16 | ||||
-rw-r--r-- | CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp | 4 | ||||
-rw-r--r-- | CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp | 23 | ||||
-rw-r--r-- | CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp | 6 | ||||
-rw-r--r-- | CIAO/ciao/Swapping_Servant_Home_Impl_Base.h | 6 | ||||
-rw-r--r-- | CIAO/ciao/Upgradeable_Context_Impl_T.cpp | 12 | ||||
-rw-r--r-- | CIAO/examples/BasicSP/README.html | 8 | ||||
-rwxr-xr-x | CIAO/examples/BasicSP/descriptors/run_test.pl | 175 |
8 files changed, 213 insertions, 37 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 025b79521f3..bc8c6f18277 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,19 @@ +Mon Jan 29 19:23:14 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * ciao/Swapping_Servant_Home_Impl_Base.{h,cpp}: + * ciao/Upgradeable_Context_Impl_T.cpp: + * DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp + Layout changes + + * DAnCE/DomainApplicationManager/Deployment_Configuration.cpp: + Fixed parsing of node manager file + + * examples/BasicSP/descriptors/run_test.pl: + New script to run this example automatically + + * exampls/BasicSP/README.html: + Fixed incorrect path and mpc generation command + Sun Jan 28 19:59:14 2007 William R. Otte <wotte@dre.vanderbilt.edu> * CIAO version 0.5.6 released. diff --git a/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp b/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp index fba4b35cef2..83775494498 100644 --- a/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp +++ b/CIAO/DAnCE/DomainApplicationManager/Deployment_Configuration.cpp @@ -45,7 +45,7 @@ CIAO::Deployment_Configuration::init (const char *filename) char* string = 0; // Read from the file line by line - while ((string = reader.read ('\n', '\0')) != 0) + while ((string = reader.read ('\n')) != 0) { // Search from the right to the first space const char* ior_start = ACE_OS::strrchr (string, ' '); @@ -54,7 +54,7 @@ CIAO::Deployment_Configuration::init (const char *filename) // The destination is first followed by some spaces ACE_CString destination (string, dest_end - string); // And then the IOR - ACE_CString ior (ior_start + 1, ACE_OS::strlen (ior_start + 1) - 1); + ACE_CString ior (ior_start + 1, ACE_OS::strlen (ior_start + 1)); if (this->deployment_info_.bind (destination.c_str (), ior.c_str ()) != 0) { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp index 74a6177e5a8..89dd9a3179e 100644 --- a/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp +++ b/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager_Impl.cpp @@ -74,16 +74,13 @@ CIAO::DomainApplicationManager_Impl::~DomainApplicationManager_Impl () } Deployment::NodeApplication_ptr -CIAO::DomainApplicationManager_Impl:: -get_node_app (const char * node_name) - ACE_THROW_SPEC ((::CORBA::SystemException, - ::Deployment::NoSuchName)) +CIAO::DomainApplicationManager_Impl::get_node_app (const char * node_name) + ACE_THROW_SPEC ((::CORBA::SystemException, ::Deployment::NoSuchName)) { // Get the NodeApplication object reference. ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> *entry = 0; - if (this->artifact_map_.find (node_name, - entry) != 0) + if (this->artifact_map_.find (node_name, entry) != 0) { ACE_ERROR ((LM_ERROR, "DAnCE (%P|%t) DomainApplicationManager_Impl.cpp -" @@ -100,8 +97,7 @@ get_node_app (const char * node_name) } void -CIAO::DomainApplicationManager_Impl:: -init () +CIAO::DomainApplicationManager_Impl::init () ACE_THROW_SPEC ((CORBA::SystemException, Deployment::ResourceNotAvailable, Deployment::StartError, @@ -221,8 +217,7 @@ init () } bool -CIAO::DomainApplicationManager_Impl:: -get_plan_info (void) +CIAO::DomainApplicationManager_Impl::get_plan_info (void) { CIAO_TRACE("CIAO::DomainApplicationManager_Impl::get_plan_info"); @@ -317,8 +312,7 @@ get_plan_info (void) //@@ We should ask those spec writers to look at the code below, hopefully // They will realize some thing. int -CIAO::DomainApplicationManager_Impl:: -split_plan (void) +CIAO::DomainApplicationManager_Impl::split_plan (void) { CIAO_TRACE("CIAO::DomainApplicationManager_Impl::split_plan"); @@ -643,8 +637,7 @@ startLaunch (const ::Deployment::Properties & configProperty, void -CIAO::DomainApplicationManager_Impl:: -install_all_es (void) +CIAO::DomainApplicationManager_Impl::install_all_es (void) ACE_THROW_SPEC ((CORBA::SystemException, Deployment::StartError)) { @@ -738,7 +731,7 @@ finishLaunch (CORBA::Boolean start, for (CORBA::ULong i = 0; i < this->num_child_plans_; ++i) { // Get the NodeApplication object reference. - ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> * entry; + ACE_Hash_Map_Entry <ACE_CString, Chained_Artifacts> * entry = 0; if (this->artifact_map_.find (this->node_manager_names_[i], entry) != 0) diff --git a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp b/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp index 3f1caa25d71..7b357c1a882 100644 --- a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp +++ b/CIAO/ciao/Swapping_Servant_Home_Impl_Base.cpp @@ -17,8 +17,7 @@ namespace CIAO // Operations for CCMHome interface. CORBA::IRObject_ptr - Swapping_Home_Servant_Impl_Base::get_component_def ( - ) + Swapping_Home_Servant_Impl_Base::get_component_def (void) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), @@ -26,8 +25,7 @@ namespace CIAO } CORBA::IRObject_ptr - Swapping_Home_Servant_Impl_Base::get_home_def ( - ) + Swapping_Home_Servant_Impl_Base::get_home_def (void) ACE_THROW_SPEC ((CORBA::SystemException)) { ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), diff --git a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h b/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h index 8302d80d16f..d9e86e81e7d 100644 --- a/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h +++ b/CIAO/ciao/Swapping_Servant_Home_Impl_Base.h @@ -46,12 +46,10 @@ namespace CIAO virtual ~Swapping_Home_Servant_Impl_Base (void); // Operations for CCMHome interface. - virtual ::CORBA::IRObject_ptr - get_component_def () + virtual ::CORBA::IRObject_ptr get_component_def (void) ACE_THROW_SPEC ((CORBA::SystemException)); - virtual ::CORBA::IRObject_ptr - get_home_def () + virtual ::CORBA::IRObject_ptr get_home_def (void) ACE_THROW_SPEC ((CORBA::SystemException)); protected: diff --git a/CIAO/ciao/Upgradeable_Context_Impl_T.cpp b/CIAO/ciao/Upgradeable_Context_Impl_T.cpp index 9431da4c67a..33c3621dd48 100644 --- a/CIAO/ciao/Upgradeable_Context_Impl_T.cpp +++ b/CIAO/ciao/Upgradeable_Context_Impl_T.cpp @@ -36,8 +36,7 @@ namespace CIAO typename COMP_VAR> void Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>::deactivate_facet ( - const PortableServer::ObjectId &oid - ) + const PortableServer::ObjectId &oid) ACE_THROW_SPEC ((CORBA::SystemException)) { /* @@ -54,13 +53,11 @@ namespace CIAO typename COMP_VAR> void Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>:: - remove_facet ( - CORBA::Object_ptr reference) + remove_facet (CORBA::Object_ptr reference) ACE_THROW_SPEC ((CORBA::SystemException)) { PortableServer::ObjectId_var oid = - this->container_->the_facet_cons_POA ()->reference_to_id - (reference); + this->container_->the_facet_cons_POA ()->reference_to_id (reference); this->update_port_activator (oid.in ()); @@ -73,8 +70,7 @@ namespace CIAO typename COMP_VAR> void Upgradeable_Context_Impl<BASE_CTX, SVNT, COMP, COMP_VAR>:: - update_port_activator ( - const PortableServer::ObjectId &oid) + update_port_activator (const PortableServer::ObjectId &oid) ACE_THROW_SPEC ((CORBA::SystemException)) { /* diff --git a/CIAO/examples/BasicSP/README.html b/CIAO/examples/BasicSP/README.html index 00c785c7c2f..9bd740215e1 100644 --- a/CIAO/examples/BasicSP/README.html +++ b/CIAO/examples/BasicSP/README.html @@ -38,8 +38,8 @@ This document describes how to compile/run the BasicSP (HUDisplay) example with <LI> Generate the project/make files for the <em> BasicSP </em> example directory: <UL> - <LI> <em> linux: </em> <code> [in $CIAO_ROOT/DAnCE/examples/BasicSP] mwc.pl </code> </LI> - <LI> <em> windows: </em> <code> [in %CIAO_ROOT%/DAnCE/examples/BasicSP] mwc.pl -type vc71</code> </LI> + <LI> <em> linux: </em> <code> [in $CIAO_ROOT/examples/BasicSP] mwc.pl -type gnuace</code> </LI> + <LI> <em> windows: </em> <code> [in %CIAO_ROOT%/examples/BasicSP] mwc.pl -type vc71</code> </LI> </UL> </LI> @@ -51,7 +51,7 @@ This document describes how to compile/run the BasicSP (HUDisplay) example with <UL> - <LI> Change into the $CIAO_ROOT/DAnCE/examples/BasicSP/descriptors directory Start NodeManagers (NodeDameon) by running <code> basicNodeDaemon.pl </code> + <LI> Change into the $CIAO_ROOT/examples/BasicSP/descriptors directory Start NodeManagers (NodeDameon) by running <code> basicNodeDaemon.pl </code> <LI> Start the execution manager: <code>$CIAO_ROOT/DAnCE/ExecutionManager/Execution_Manager -o EM.ior -i NodeManagerMap.dat </code> @@ -60,7 +60,7 @@ This document describes how to compile/run the BasicSP (HUDisplay) example with <LI> Start the executor: <code> $CIAO_ROOT/DAnCE/Plan_Launcher/plan_launcher -p flattern_deploymentplan.cdp -k file://EM.ior </code> - <LI> After this, components should be deployed successfully. You can run the $CIAO_ROOT/DAnCE/examples/BasicSP/EC/controller to start the application. + <LI> After this, components should be deployed successfully. You can run the $CIAO_ROOT/examples/BasicSP/EC/controller to start the application. Please make sure that the component IOR file for the EC component is present when you run this client. <BR/> diff --git a/CIAO/examples/BasicSP/descriptors/run_test.pl b/CIAO/examples/BasicSP/descriptors/run_test.pl new file mode 100755 index 00000000000..898e8bca092 --- /dev/null +++ b/CIAO/examples/BasicSP/descriptors/run_test.pl @@ -0,0 +1,175 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{'ACE_ROOT'}/bin"; +use PerlACE::Run_Test; + +$CIAO_ROOT = "$ENV{'CIAO_ROOT'}"; +$TAO_ROOT = "$ENV{'TAO_ROOT'}"; +$DAnCE = "$ENV{'CIAO_ROOT'}/DAnCE"; +$daemons_running = 0; +$em_running = 0; +$ns_running = 0; +$daemons = 5; +@ports = ( 10000, 20000, 30000, 40000, 50000 ); +@iorfiles = ( "NodeApp1.ior", "NodeApp2.ior", "NodeApp3.ior", "NodeApp4.ior", "NodeApp5.ior" ); +$status = 0; +$dat_file = "NodeManagerMap.dat"; +$cdp_file = "flattern_deploymentplan.cdp"; +$controller_exec = "$CIAO_ROOT/examples/BasicSP/EC/controller"; + +$nsior = PerlACE::LocalFile ("ns.ior"); + +unlink $nsior; + +$E = 0; +$EM = 0; + +# Delete if there are any .ior files. +sub delete_ior_files { + for ($i = 0; $i < $daemons; ++$i) { + unlink $iorfiles[$i]; + } + unlink PerlACE::LocalFile ("EM.ior"); + unlink PerlACE::LocalFile ("Receiver.ior"); + unlink PerlACE::LocalFile ("Sender.ior"); + unlink PerlACE::LocalFile ("DAM.ior"); + unlink PerlACE::LocalFile ("ns.ior"); +} + +sub kill_node_daemons { + for ($i = 0; $i < $daemons; ++$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } +} + +sub kill_open_processes { + if ($daemons_running == 1) { + kill_node_daemons (); + } + + if ($em_running == 1) { + $EM->Kill (); + $EM->TimedWait (1); + } + + if ($ns_running == 1) { + $NS->Kill (); + $NS->TimedWait (1); + } + +} + +# Invoke naming service + +$NS = new PerlACE::Process ("$TAO_ROOT/orbsvcs/Naming_Service/Naming_Service", "-m 0 -ORBEndpoint iiop://localhost:60003 -o ns.ior"); + +$NS->Spawn (); + +print STDERR "Starting Naming Service\n"; + +if (PerlACE::waitforfile_timed ($nsior, 10) == -1) +{ + print STDERR "ERROR: cannot find naming service IOR file\n"; + $NS->Kill (); + exit 1; +} + +$ns_running = 1; + +# Set up NamingService environment +$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService"; + + +sub run_node_daemons { + for ($i = 0; $i < $daemons; ++$i) + { + $iorfile = $iorfiles[$i]; + $port = $ports[$i]; + + $iiop = "iiop://localhost:$port"; + $node_app = "$DAnCE/NodeApplication/NodeApplication"; + + $d_cmd = "$DAnCE/NodeManager/NodeManager"; + $d_param = "-ORBEndpoint $iiop -s $node_app -o $iorfile -d 30"; + + $Daemons[$i] = new PerlACE::Process ($d_cmd, $d_param); + $result = $Daemons[$i]->Spawn (); + push(@processes, $Daemons[$i]); + + if (PerlACE::waitforfile_timed ($iorfile, + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR + "ERROR: The ior file of node daemon $i could not be found\n"; + for (; $i >= 0; --$i) { + $Daemons[$i]->Kill (); $Daemons[$i]->TimedWait (1); + } + return -1; + } + } + return 0; +} + +delete_ior_files (); + +# Invoke node daemons. +print "Invoking node daemons\n"; +$status = run_node_daemons (); + +if ($status != 0) { + print STDERR "ERROR: Unable to execute the node daemons\n"; + kill_open_processes (); + exit 1; +} + +$daemons_running = 1; + +# Invoke execution manager. +print "Invoking execution manager\n"; +$EM = new PerlACE::Process ("$DAnCE/ExecutionManager/Execution_Manager", + "-o EM.ior -i $dat_file"); +$EM->Spawn (); + +if (PerlACE::waitforfile_timed ("EM.ior", + $PerlACE::wait_interval_for_process_creation) == -1) { + print STDERR + "ERROR: The ior file of execution manager could not be found\n"; + kill_open_processes (); + exit 1; +} + +$em_running = 1; + +sleep (10); + +# Invoke executor - start the application -. +print "Invoking executor - start the application -\n"; +$E = + new PerlACE::Process ("$DAnCE/Plan_Launcher/plan_launcher", + "-p flattened_deploymentplan.cdp -k file://EM.ior"); + +$E->SpawnWaitKill (60); + +sleep (10); + +print "Invoking the controller\n"; +$controller = new PerlACE::Process ("$controller_exec", ""); +$result = $controller->SpawnWaitKill (3000); + +if ($result != 0) { + print STDERR "ERROR: The controller returned $result\n"; + $status = 1; +} + +# Invoke executor - stop the application -. +print "Invoking executor - stop the application -\n"; +$E = + new PerlACE::Process ("$DAnCE/Plan_Launcher/plan_launcher", + "-p flattern_deploymentplan.cdp -k file://EM.ior"); +$E->SpawnWaitKill (3000); + +sleep (99999999999); |