summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspaunov <spaunov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-05-08 15:43:08 +0000
committerspaunov <spaunov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2006-05-08 15:43:08 +0000
commit10640ed9cfeec436f2f245fa43f28d21c95a555d (patch)
tree985c69290d4d3e3db3d49a7d82de0931adba6676
parentdc5a6d75402c121327b407659c26a2a7cbc073ba (diff)
downloadATCD-10640ed9cfeec436f2f245fa43f28d21c95a555d.tar.gz
Mon May 8 15:33:58 UTC 2006 Stoyan Paunov <spaunov@isis.vanderbilt.edu>
-rw-r--r--TAO/CIAO/ChangeLog56
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp76
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h41
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp3
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.h2
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/README.txt18
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp4
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h1
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp4
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp77
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManagerDaemon.idl2
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp122
-rw-r--r--TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h14
-rw-r--r--TAO/CIAO/bin/PerlCIAO/TestUtils.base3
-rw-r--r--TAO/CIAO/bin/PerlCIAO/TestUtils.pm323
-rw-r--r--TAO/CIAO/bin/PerlCIAO/TestUtils_Base.pm78
-rw-r--r--TAO/CIAO/bin/PerlCIAO/generate_container.pl126
-rw-r--r--TAO/CIAO/bin/PerlCIAO/perlciao.mpc7
-rw-r--r--TAO/CIAO/tools/Config_Handlers/IDD_Handler.cpp7
19 files changed, 810 insertions, 154 deletions
diff --git a/TAO/CIAO/ChangeLog b/TAO/CIAO/ChangeLog
index fc41cd4dda8..5ebe35d34fb 100644
--- a/TAO/CIAO/ChangeLog
+++ b/TAO/CIAO/ChangeLog
@@ -1,10 +1,56 @@
+Mon May 8 15:33:58 UTC 2006 Stoyan Paunov <spaunov@isis.vanderbilt.edu>
+
+ * DAnCE/RepositoryManager/HTTP_Client.h:
+ * DAnCE/RepositoryManager/HTTP_Client.cpp:
+ * DAnCE/RepositoryManager/HTTP_Handler.h:
+ * DAnCE/RepositoryManager/HTTP_Handler.cpp:
+ * DAnCE/RepositoryManager/Options.h:
+ * DAnCE/RepositoryManager/Options.cpp:
+ * DAnCE/RepositoryManager/PC_Updater.h:
+ * DAnCE/RepositoryManager/PC_Updater.cpp:
+ * DAnCE/RepositoryManager/PC_Updater_T.h:
+ * DAnCE/RepositoryManager/PC_Updater_T.cpp:
+ * DAnCE/RepositoryManager/README.txt:
+ * DAnCE/RepositoryManager/RM_Helper.h:
+ * DAnCE/RepositoryManager/RM_Helper.cpp:
+ * DAnCE/RepositoryManager/RMadmin.cpp:
+ * DAnCE/RepositoryManager/RepositoryManager.cpp:
+ * DAnCE/RepositoryManager/RepositoryManagerDaemon.idl:
+ * DAnCE/RepositoryManager/RepositoryManager_Impl.h:
+ * DAnCE/RepositoryManager/RepositoryManager_Impl.cpp:
+ * DAnCE/RepositoryManager/URL_Parser.h:
+ * DAnCE/RepositoryManager/URL_Parser.cpp:
+ * DAnCE/RepositoryManager/ZIP_Wrapper.h:
+ * DAnCE/RepositoryManager/ZIP_Wrapper.cpp:
+
+ Updating the RepositoryManager with the latest changes from the
+ escher repository. Adding my newest changes. Adding some new
+ minor features.
+
+ * bin/PerlCIAO/TestUtils.base:
+ * bin/PerlCIAO/TestUtils.pm:
+ * bin/PerlCIAO/TestUtils_Base.pm:
+ * bin/PerlCIAO/generate_container.pl:
+ * bin/PerlCIAO/perlciao.mpc:
+
+ This is a set of test utilities tailored towards testing CIAO components.
+ It provides a nice and quick interface provising the common functionality
+ necessary to run a CIAO test and perform clean-up on failure. This utils
+ are a wrapper around the $ACE_ROOT/bin/PerlACE/ utilities. I will check in
+ an example of how test utils are used shortly.
+
+ * tools/Config_Handlers/IDD_Handler.cpp:
+
+ Fixing a bug in the PackageConfiguration reverse handler.
+
+
Fri May 5 15:36:47 2006 Douglas C. Schmidt <schmidt@cse.wustl.edu>
- * docs/cidlc.html Added documentation for the CIDL compiler.
- Thanks to Boris for contributing this.
-
- * docs/index.html: Fixed some broken links to the tutorials and added
- a link to Ming's tutorial example that shows how to use CoSMIC.
+ * docs/cidlc.html Added documentation for the CIDL compiler.
+ Thanks to Boris for contributing this.
+
+ * docs/index.html: Fixed some broken links to the tutorials and added
+ a link to Ming's tutorial example that shows how to use CoSMIC.
Fri May 5 16:58:17 UTC 2006 Nishanth Shankaran <nshankar@dre.vanderbilt.edu>
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp
index 3d3ec89e933..9c5e3f1b12b 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.cpp
@@ -88,7 +88,7 @@ void PC_Updater::clear_list ()
// PackageConfiguration
- bool PC_Updater::update (const ::Deployment::PackageConfiguration &pc)
+ bool PC_Updater::update (::Deployment::PackageConfiguration &pc)
{
//get the list of files in the package and figure out the names of all necessary files
if (!ZIP_Wrapper::file_list_info (const_cast <char*> (this->package_.c_str ()), this->file_list_))
@@ -102,20 +102,20 @@ void PC_Updater::clear_list ()
// ComponentInterfaceDescription
- void PC_Updater::update (const ::Deployment::ComponentInterfaceDescription &cid)
+ void PC_Updater::update (::Deployment::ComponentInterfaceDescription &cid)
{
}
// Requirement
- void PC_Updater::update (const ::Deployment::Requirement &req)
+ void PC_Updater::update (::Deployment::Requirement &req)
{
}
// ComponentExternalPortEndpoint
- void PC_Updater::update (const ::Deployment::ComponentExternalPortEndpoint &cepe)
+ void PC_Updater::update (::Deployment::ComponentExternalPortEndpoint &cepe)
{
}
@@ -123,32 +123,32 @@ void PC_Updater::clear_list ()
// ImplementationDependency
- void PC_Updater::update(const Deployment::ImplementationDependency &id)
+ void PC_Updater::update (Deployment::ImplementationDependency &id)
{
}
// ComponentPackageReference
- void PC_Updater::update (const ::Deployment::ComponentPackageReference &cpr)
+ void PC_Updater::update (::Deployment::ComponentPackageReference &cpr)
{
}
// SubcomponentInstantiationDescription
- void PC_Updater::update (const ::Deployment::SubcomponentInstantiationDescription &sid)
+ void PC_Updater::update (::Deployment::SubcomponentInstantiationDescription &sid)
{
update_sequence (sid.basePackage, this);
}
// SubcomponentPortEndpoint
- void PC_Updater::update (const ::Deployment::SubcomponentPortEndpoint& spe)
+ void PC_Updater::update (::Deployment::SubcomponentPortEndpoint& spe)
{
}
// AssemblyConnectionDescription
- void PC_Updater::update (const ::Deployment::AssemblyConnectionDescription &acd)
+ void PC_Updater::update (::Deployment::AssemblyConnectionDescription &acd)
{
}
@@ -156,81 +156,80 @@ void PC_Updater::clear_list ()
// AssemblyPropertyMapping
void
- PC_Updater::update (const ::Deployment::AssemblyPropertyMapping &apm)
+ PC_Updater::update (::Deployment::AssemblyPropertyMapping &apm)
{
}
// ComponentAssemblyDescription
- void PC_Updater::update (const ::Deployment::ComponentAssemblyDescription& cad)
+ void PC_Updater::update (::Deployment::ComponentAssemblyDescription& cad)
{
update_sequence (cad.instance, this);
}
// ImplementationArtifactDescription
- void PC_Updater::update (const ::Deployment::ImplementationArtifactDescription &iad)
+ void PC_Updater::update (::Deployment::ImplementationArtifactDescription &iad)
{
- bool found = false;
-
- //cout << "label: " << iad.label << endl;
- //cout << "location: " << CORBA::string_dup (iad.location[0].in ()) << endl;
-
+ //create an interator
ACE_Double_Linked_List_Iterator<ZIP_File_Info> iter (this->file_list_);
- char str [TEMP_LEN];
+ //construct search string
+ char str [TEMP_LEN + 2];
+ str[TEMP_LEN + 1] = '\0'; //let's make this safe for printing
+ ACE_OS::strncpy (str, "implementations/", TEMP_LEN);
+ ACE_OS::strncat (str, iad.location[0],
+ TEMP_LEN - 16 ); //ACE_OS::strlen ("implementations/") = 16
+
+ //find the correct path and return
while (!iter.done ())
{
- ACE_OS::strncpy ( str, iter.next ()->name_.c_str (), TEMP_LEN);
+ const char* full_path = iter.next ()->name_.c_str ();
//weird. Need to call next to get current ?!?!
- const char* name;
-
- name = ACE_OS::strstr (str, iad.location[0]);
+ //compare them
+ const char* name = ACE_OS::strstr (full_path, str);
if (name)
{
ACE_CString loc (this->server_path_);
- loc += name;
- loc += iad.location[0];
+ loc += "/";
+ loc += full_path;
iad.location[0] = CORBA::string_dup (loc.c_str ());
- //cout << "new location: " << iad.location[0].in () << endl << endl;
-
- found = true;
- break;
+ //cout << "location: " << iad.location[0].in () << endl << endl;
+ return;
}
iter++;
}
- if (!found)
- this->success_ = false;
+ this->success_ = false;
}
// NamedImplementationArtifact
- void PC_Updater::update (const ::Deployment::NamedImplementationArtifact &nia)
+ void PC_Updater::update (::Deployment::NamedImplementationArtifact &nia)
{
update (nia.referencedArtifact);
}
// ImplementationRequirement
- void PC_Updater::update (const ::Deployment::ImplementationRequirement &ir)
+ void PC_Updater::update (::Deployment::ImplementationRequirement &ir)
{
}
// MonolithicImplementationDescription
- void PC_Updater::update (const ::Deployment::MonolithicImplementationDescription &mid)
+ void PC_Updater::update (::Deployment::MonolithicImplementationDescription &mid)
{
update_sequence (mid.primaryArtifact, this);
}
// Capability
- void PC_Updater::update (const ::Deployment::Capability &capability)
+ void PC_Updater::update (::Deployment::Capability &capability)
{
}
@@ -238,8 +237,7 @@ void PC_Updater::clear_list ()
// ComponentImplementationDescription
- void PC_Updater::update (
- const ::Deployment::ComponentImplementationDescription &cid)
+ void PC_Updater::update (::Deployment::ComponentImplementationDescription &cid)
{
update_sequence (cid.assemblyImpl, this);
update_sequence (cid.monolithicImpl, this);
@@ -247,20 +245,20 @@ void PC_Updater::clear_list ()
// PackagedComponentImplementation
- void PC_Updater::update (const ::Deployment::PackagedComponentImplementation &pci)
+ void PC_Updater::update (::Deployment::PackagedComponentImplementation &pci)
{
PC_Updater::update (pci.referencedImplementation);
}
// ComponentPackageDescription
- void PC_Updater::update (const ::Deployment::ComponentPackageDescription &comppkgdesc)
+ void PC_Updater::update (::Deployment::ComponentPackageDescription &comppkgdesc)
{
update_sequence (comppkgdesc.implementation, this);
}
// Property
- void PC_Updater::update (const Deployment::Property& property)
+ void PC_Updater::update (Deployment::Property& property)
{
}
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h
index 4396ee22621..9c6d326f54d 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater.h
@@ -1,3 +1,4 @@
+
/* -*- C++ -*- */
//========================================================================
@@ -51,45 +52,45 @@ public:
/// A whole slew of overloaded routines for different IDL
/// data types part of the PackageConfiguration.
- bool update (const ::Deployment::PackageConfiguration &pc);
+ bool update (::Deployment::PackageConfiguration &pc);
- void update (const ::Deployment::Property &property);
+ void update (::Deployment::Property &property);
- void update (const ::Deployment::AssemblyConnectionDescription &acd);
+ void update (::Deployment::AssemblyConnectionDescription &acd);
- void update (const ::Deployment::AssemblyPropertyMapping &apm);
+ void update (::Deployment::AssemblyPropertyMapping &apm);
- void update (const ::Deployment::ComponentPackageDescription &comppkgdesc);
+ void update (::Deployment::ComponentPackageDescription &comppkgdesc);
- void update (const ::Deployment::MonolithicImplementationDescription &mid);
+ void update (::Deployment::MonolithicImplementationDescription &mid);
- void update (const ::Deployment::PackagedComponentImplementation &pci);
+ void update (::Deployment::PackagedComponentImplementation &pci);
- void update (const ::Deployment::SubcomponentPortEndpoint &spe);
+ void update (::Deployment::SubcomponentPortEndpoint &spe);
- void update (const ::Deployment::Requirement &requirement);
+ void update (::Deployment::Requirement &requirement);
- void update (const ::Deployment::ComponentExternalPortEndpoint &cepe);
+ void update (::Deployment::ComponentExternalPortEndpoint &cepe);
- void update (const ::Deployment::ComponentPackageReference &cpr);
+ void update (::Deployment::ComponentPackageReference &cpr);
- void update (const ::Deployment::ComponentImplementationDescription &cid);
+ void update (::Deployment::ComponentImplementationDescription &cid);
- void update (const ::Deployment::SubcomponentInstantiationDescription &sid);
+ void update (::Deployment::SubcomponentInstantiationDescription &sid);
- void update (const ::Deployment::NamedImplementationArtifact &named_implementation);
+ void update (::Deployment::NamedImplementationArtifact &named_implementation);
- void update (const ::Deployment::ComponentInterfaceDescription &cid);
+ void update (::Deployment::ComponentInterfaceDescription &cid);
- void update (const ::Deployment::Capability &capability);
+ void update (::Deployment::Capability &capability);
- void update (const ::Deployment::ImplementationArtifactDescription &iad);
+ void update (::Deployment::ImplementationArtifactDescription &iad);
- void update (const ::Deployment::ImplementationRequirement &ir);
+ void update (::Deployment::ImplementationRequirement &ir);
- void update(const Deployment::ImplementationDependency &id);
+ void update (::Deployment::ImplementationDependency &id);
- void update (const ::Deployment::ComponentAssemblyDescription& cad);
+ void update (::Deployment::ComponentAssemblyDescription& cad);
protected:
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp
index 01fd77a797d..f1795f6ade9 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.cpp
@@ -1,5 +1,4 @@
// $Id$
-
#ifndef PC_UPDATER_T_C
#define PC_UPDATER_T_C
#include "PC_Updater.h"
@@ -9,7 +8,7 @@ namespace PC_Updater_T
{
/// Dumps a sequence
template <typename SEQUENCE>
- void update_sequence (const SEQUENCE &seq, PC_Updater* updater)
+ void update_sequence (SEQUENCE &seq, PC_Updater* updater)
{
const CORBA::ULong size = seq.length ();
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.h b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.h
index 0e3eb05b5f5..0696c685e2b 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/PC_Updater_T.h
@@ -24,7 +24,7 @@
namespace PC_Updater_T
{
template <typename SEQUENCE>
- static void update_sequence (const SEQUENCE &seq);
+ static void update_sequence (SEQUENCE &seq);
}
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/README.txt b/TAO/CIAO/DAnCE/RepositoryManager/README.txt
index ee8eb6bcdce..e4cd2fa6397 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/README.txt
+++ b/TAO/CIAO/DAnCE/RepositoryManager/README.txt
@@ -1,28 +1,28 @@
This is the README file for the Repository Manager (RM).
-In order to be able to compile the RM you need to have ZZIP lib because the Repository
+In order to be able to compile the RM you need to have ZZIP lib because the Repository
Manager (RM) uses it to read the contents of CCM packages. ZZIP itself is a C++ wrapper
around ZLIB, thus you will also need ZLIB. In order to compile the RM successfully
you will need to do the following:
-
+
1. Download ZLIB and ZZIP-LIB
2. Compile the multi-threaded versions of these libraries
-3. [on Windows] create a separate directory for each library; create an include and a lib
+3. [on Windows] create a separate directory for each library; create an include and a lib
subdirectory within them. Then copy the libraries files in the library subdirectory.
-Copy zlib.h in the zlib_path/include and copy zziplib.h, zzip-conf.h and zzip-msvc.h
+Copy zlib.h in the zlib_path/include and copy zziplib.h, zzip-conf.h and zzip-msvc.h
(for Windows platforms; Linux might have its own file!!!). This step might be easier if
you find a binary package of the libraries and just install it.
-4. Set $ZLIB_ROOT and $ZZIP_ROOT to point to the directories where you placed the
+4. Set $ZLIB_ROOT and $ZZIP_ROOT to point to the directories where you placed the
libraries and the include files.
5. Turn on zzip and zlib in default.features for MPC.
6. MPC will handle the rest.
-Things to watch out for:
-On Windows make sure that you are linking the right ZIP libraries
-together with the rest of the libraries, i.e. if you are building the debug version of ACE,
+Things to watch out for:
+On Windows make sure that you are linking the right ZIP libraries
+together with the rest of the libraries, i.e. if you are building the debug version of ACE,
TAO and CIAO, then use the debug version of the ZIP libraries. Otherwise the RM will compile
-but it will not work properly.
+but it will not work properly.
to compile the idl with the tao_idl compiler:
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp
index 9c14b6b9608..16d78d7dc51 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.cpp
@@ -135,7 +135,7 @@ bool RM_Helper::write_to_disk (
bool RM_Helper::write_pc_to_disk (
- const char* full_path,
+ const char* full_path,
ACE_Message_Block& mb,
bool replace
)
@@ -246,7 +246,7 @@ ACE_Message_Block* RM_Helper::read_pc_from_disk (
mb->length (file_info.st_size);
// Close the file handle
- ACE_OS::close (handle);
+ ACE_OS::close (handle);
length = file_info.st_size;
return mb;
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h
index 2314295ee78..fb2f8a61db0 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RM_Helper.h
@@ -1,3 +1,4 @@
+
/* -*- C++ -*- */
//=============================================================================
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp
index 60d90c29bc9..b1b7dae1386 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RMadmin.cpp
@@ -1,3 +1,4 @@
+
/* -*- C++ -*- */
/***
@@ -203,6 +204,9 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
}
ACE_ENDTRY;
+ //char a;
+ //cin >> a;
+
return 0;
}
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp
index 813ee79f1cd..60fdd644a65 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager.cpp
@@ -1,3 +1,4 @@
+
/* -*- C++ -*- */
//======================================================================
@@ -20,17 +21,24 @@
#include "ace/streams.h"
#include "ace/Auto_Ptr.h"
#include "ace/Task.h"
-using namespace std;
+#include "ace/Get_Opt.h"
+#include "ace/SString.h"
-namespace
+namespace CIAO
{
-/// Name of the file holding the IOR of the RM
-const char * rm_ior = "RepositoryManagerDeamon.ior";
+ namespace RepositoryManager
+ {
+ /// Name of the file holding the IOR of the RM
+ const char * RMior = "RepositoryManagerDeamon.ior";
-/// Default number of worker threads to run in the multi-threaded RM
-unsigned int nthreads = 3;
+ /// Default number of worker threads to run in the multi-threaded RM
+ static unsigned int nthreads = 3;
+ static ACE_CString HTTPserver = "127.0.0.1:5432";
+ }
}
+//forward declaration
+bool parse_args (int argc, char *argv[]);
/**
* @class Worker
@@ -63,6 +71,9 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
//init the ORB
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
+ if (!parse_args (argc, argv))
+ return -1;
+
//Get the root POA object
CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA");
@@ -75,10 +86,14 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
//create a servant
CIAO_RepositoryManagerDaemon_i* repo;
- ACE_NEW_RETURN (repo, CIAO_RepositoryManagerDaemon_i (orb.in ()), 1);
+ ACE_NEW_RETURN (repo,
+ CIAO_RepositoryManagerDaemon_i (
+ orb.in (),
+ CIAO::RepositoryManager::HTTPserver.c_str ()),
+ 1);
//trasfer ownership to the POA
- PortableServer::ServantBase_var distributor_owner_transfer(repo);
+ PortableServer::ServantBase_var owner_transfer(repo);
//register and implicitly activate servant
CIAO::RepositoryManagerDaemon_var RepositoryManagerDeamon = repo->_this ();
@@ -87,22 +102,20 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
CORBA::String_var ior = orb->object_to_string (RepositoryManagerDeamon.in ());
//output the IOR to a file
- FILE* ior_out = ACE_OS::fopen (rm_ior, "w");
+ FILE* ior_out = ACE_OS::fopen (CIAO::RepositoryManager::RMior, "w");
if (ior_out == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot open output file for writing IOR: %s",
- rm_ior),
- 1);
+ CIAO::RepositoryManager::RMior),
+ 1);
ACE_OS::fprintf (ior_out, "%s", ior.in ());
ACE_OS::fclose (ior_out);
- if (argc > 1)
- nthreads = ACE_OS::atoi (argv[1]);
-
Worker worker (orb.in ());
- if (worker.activate (THR_NEW_LWP | THR_JOINABLE, nthreads) != 0)
+ if (worker.activate (THR_NEW_LWP | THR_JOINABLE,
+ CIAO::RepositoryManager::nthreads) != 0)
ACE_ERROR_RETURN ((LM_ERROR,
"Cannot activate worker threads\n"),
1);
@@ -136,6 +149,40 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
}
+// ****************************************************************
+
+///Code to parse the arguments
+
+ bool
+ parse_args (int argc, char *argv[])
+ {
+ ACE_Get_Opt get_opts (argc, argv, "s:n:");
+ int c;
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 's':
+ CIAO::RepositoryManager::HTTPserver = get_opts.opt_arg ();
+ break;
+ case 'n':
+ CIAO::RepositoryManager::nthreads = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
+ case '?': // display help for use of the server.
+ ACE_DEBUG ((LM_INFO,
+ "usage: %s\n"
+ "-s <IP:PORT for HTTP server>\n"
+ "-n <number of threads>\n",
+ argv [0]));
+ return false;
+ break;
+ default:
+ ;
+ }
+
+ return true;
+ }
+
+
// ****************************************************************
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManagerDaemon.idl b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManagerDaemon.idl
index f86e14c1c8b..3cd410d2575 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManagerDaemon.idl
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManagerDaemon.idl
@@ -1,6 +1,6 @@
// $Id$
-#include "RepositoryManager.idl"
+#include "ciao/RepositoryManager.idl"
module CIAO
{
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp
index d7e953a777a..0954b8f3931 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.cpp
@@ -1,3 +1,5 @@
+// $Id$
+
//====================================================================
/**
* @file RepositoryManager_Impl.cpp
@@ -33,7 +35,6 @@
#include "ciao/Packaging_DataC.h"
#include "Config_Handlers/Utils/XML_Helper.h"
#include "Config_Handlers/Package_Handlers/PCD_Handler.h"
-//#include "xercesc/dom/DOM.hpp"
#include "RM_Helper.h" //to be able to externalize/internalize a PackageConfiguration
#include "ace/Message_Block.h" //for ACE_Message_Block
@@ -57,10 +58,13 @@ using namespace std;
CIAO_RepositoryManagerDaemon_i::CIAO_RepositoryManagerDaemon_i (CORBA::ORB_ptr the_orb, const char* server)
: the_orb_ (CORBA::ORB::_duplicate (the_orb)),
install_root_ (""),
- HTTP_server_ (server)
+ HTTP_server_ ("http://")
{
- //create directory in which the packages will be stored
+ //form the path
+ this->HTTP_server_ += server;
+ this->HTTP_server_ += "/";
+ //create directory in which the packages will be stored
ACE_OS::mkdir(INSTALL_PATH);
//if dir already exists a -1 is returned
//we ignore this, just need to make sure the directory exists
@@ -208,8 +212,14 @@ void CIAO_RepositoryManagerDaemon_i::installPackage (
//if the PackageConfiguration name cannot be found, then there is nothing to install
if (pc_name == "")
- ACE_THROW (Deployment::PackageError ());
+ {
+ //clean the extracted files
+ remove_extracted_package (package_path.c_str (), path.c_str ());
+ //remove the package
+ remove (package_path.c_str ());
+ ACE_THROW (Deployment::PackageError ());
+ }
//TODO: move exception throwing out of this func. User boolean error handling!!!
//TODO: check for errors!
@@ -218,24 +228,42 @@ void CIAO_RepositoryManagerDaemon_i::installPackage (
descriptor_dir.c_str ());
+ if (this->uuids_.find (ACE_CString (pc->UUID), entry) == 0)
+ {
+ //clean the extracted files
+ remove_extracted_package (package_path.c_str (), path.c_str ());
+ //remove the package
+ remove (package_path.c_str ());
+
+ ACE_THROW (Deployment::NameExists ());
+ }
+
//forming the server path info
ACE_CString server_path (this->HTTP_server_);
server_path += installationName;
- server_path += "/implementations/";
//NOTE: ComponentPackageReferences are currently NOT supported
if (!(pc->basePackage.length () > 0))
+ {
+ //clean the extracted files
+ remove_extracted_package (package_path.c_str (), path.c_str ());
+ //remove the package
+ remove (package_path.c_str ());
+
ACE_THROW (CORBA::NO_IMPLEMENT ());
+ }
PC_Updater updater (server_path, package_path);
if (!updater.update (pc))
- {
- ACE_DEBUG ((LM_ERROR, "[RM] problem updating the PackageConfiguration!\n"));
- remove_extracted_package (package_path.c_str (), path.c_str ());
- remove (package_path.c_str ());
- ACE_THROW (Deployment::PackageError ());
- }
+ {
+ ACE_DEBUG ((LM_ERROR, "[RM] problem updating the PackageConfiguration!\n"));
+ //clean the extracted files
+ remove_extracted_package (package_path.c_str (), path.c_str ());
+ //remove the package
+ remove (package_path.c_str ());
+ ACE_THROW (Deployment::PackageError ());
+ }
//now lets externalize the PackageConfiguration, so that we can access it later on
@@ -246,19 +274,19 @@ void CIAO_RepositoryManagerDaemon_i::installPackage (
//insert the package into the database
if (this->names_.bind (ACE_CString (installationName), path) == -1)
{
- ACE_DEBUG ((LM_ERROR,
+ ACE_DEBUG ((LM_ERROR,
"[RM] could not bind %s.\n",
installationName));
- //clean the extracted files
- remove_extracted_package (package_path.c_str (), path.c_str ());
- //remove the package
- remove (package_path.c_str ());
- //remove the PackageConfiguration externalization
- remove (pc_path.c_str ());
+ //clean the extracted files
+ remove_extracted_package (package_path.c_str (), path.c_str ());
+ //remove the package
+ remove (package_path.c_str ());
+ //remove the PackageConfiguration externalization
+ remove (pc_path.c_str ());
- //throw exception
- ACE_THROW (CORBA::INTERNAL ());
+ //throw exception
+ ACE_THROW (CORBA::INTERNAL ());
}
//ALSO NEED THE UUID here
@@ -440,14 +468,14 @@ CIAO_RepositoryManagerDaemon_i::findPackageByUUID (const char * UUID)
CIBucket_Iterator counter (this->types_, type);
CIBucket_Iterator end (this->types_,
- type,
- 1 /*tail = true*/);
+ type,
+ 1 /*tail = true*/);
//count the number of components implementing this type
CORBA::ULong num_entries = 0;
for (;
- counter != end;
- ++counter)
+ counter != end;
+ ++counter)
++num_entries;
//allocate a sequence of the right length
@@ -462,8 +490,8 @@ CIAO_RepositoryManagerDaemon_i::findPackageByUUID (const char * UUID)
CIBucket_Iterator iter (this->types_, type);
CORBA::ULong index = 0;
for (;
- iter != end && index < num_entries;
- ++iter, ++index)
+ iter != end && index < num_entries;
+ ++iter, ++index)
{
CIEntry& element = *iter;
seq[index] = CORBA::string_dup (element.int_id_.c_str ());
@@ -496,8 +524,8 @@ CIAO_RepositoryManagerDaemon_i::getAllNames ()
CORBA::ULong num_entries = 0;
for (PCMap_Iterator i = this->names_.begin ();
- i != this->names_.end ();
- ++i)
+ i != this->names_.end ();
+ ++i)
++num_entries;
CORBA::StringSeq_var seq;
@@ -549,8 +577,8 @@ CIAO_RepositoryManagerDaemon_i::getAllNames ()
CORBA::ULong num_entries = 0;
for (PCMap_Iterator i = this->names_.begin ();
- i != this->names_.end ();
- ++i)
+ i != this->names_.end ();
+ ++i)
++num_entries;
ACE_DEBUG ((LM_DEBUG, "# names: %d\n", num_entries));
@@ -634,15 +662,6 @@ void CIAO_RepositoryManagerDaemon_i::deletePackage (
internal_err = true;
}
- //if (this->uuids_.find (ACE_CString (pc->UUID), entry) != 0)
- //{
- // ACE_DEBUG ((LM_ERROR, "Could not remove UUID\n"));
- // internal_err = true;
- //}
- //else
- // //remove the UUID association
- // this->uuids_.unbind (entry->int_id_.c_str ());
-
if (this->uuids_.unbind (ACE_CString (pc->UUID)) == -1)
{
ACE_DEBUG ((LM_ERROR, "Could not remove UUID\n"));
@@ -672,7 +691,7 @@ void CIAO_RepositoryManagerDaemon_i::deletePackage (
if (internal_err)
ACE_THROW (CORBA::INTERNAL ());
else
- ACE_DEBUG ((LM_INFO, "Successfully deleting \'%s\'\n", installationName));
+ ACE_DEBUG ((LM_INFO, "Successfully deleted \'%s\'\n", installationName));
}
@@ -785,7 +804,7 @@ CIAO_RepositoryManagerDaemon_i::retrieve_PC_from_descriptors (const char* pc_nam
//change the working dir
ACE_OS::chdir (descriptor_dir);
- Deployment::PackageConfiguration_var pc;
+ Deployment::PackageConfiguration* pc = new Deployment::PackageConfiguration ();
//parse the PCD to make sure that there are no package errors
ACE_TRY
{
@@ -793,16 +812,14 @@ CIAO_RepositoryManagerDaemon_i::retrieve_PC_from_descriptors (const char* pc_nam
//pc = intf.get_PC ();
if (xercesc::DOMDocument *doc = CIAO::Config_Handlers::XML_HELPER->create_dom (pc_name))
{
- {
- //Read in the XSC type structure from the DOMDocument
+ //Read in the XSC type structure from the DOMDocument
- //Convert the XSC to an IDL datatype
- CIAO::Config_Handlers::Packaging::PCD_Handler::package_config (pc_name, pc);
- std::cout << "Instance document import succeeded. Dumping contents to file\n";
- }
+ //Convert the XSC to an IDL datatype
+ CIAO::Config_Handlers::Packaging::PCD_Handler::package_config (pc_name, *pc);
//Cleanliness is next to Godliness
- delete doc;
+ //delete doc;
+ //this causes a run-time error
}
}
ACE_CATCHALL
@@ -819,8 +836,7 @@ CIAO_RepositoryManagerDaemon_i::retrieve_PC_from_descriptors (const char* pc_nam
//change back the the old working dir
ACE_OS::chdir (this->cwd_);
-
- return pc._retn ();
+ return pc;
}
@@ -938,7 +954,7 @@ int CIAO_RepositoryManagerDaemon_i::remove_descriptor_files (char* package)
if(remove (inf->name_.c_str () + skip_len))
{
ACE_ERROR ((LM_ERROR,
- "[RM::remove_descriptor_files] Unable to write out descriptor to disk!\n"));
+ "[RM::remove_descriptor_files] Unable to remove file from disk!\n"));
return_code = 0;
}
}
@@ -957,8 +973,8 @@ int CIAO_RepositoryManagerDaemon_i::remove_descriptor_files (char* package)
// 0 on error
int CIAO_RepositoryManagerDaemon_i::remove_extracted_package
-(const char* package_path,
- const char* extraction_location)
+ (const char* package_path,
+ const char* extraction_location)
{
//change the working dir
if (ACE_OS::chdir (extraction_location) == -1)
diff --git a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h
index 4f5f2b4efd0..ba96e826a20 100644
--- a/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h
+++ b/TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager_Impl.h
@@ -1,3 +1,4 @@
+
/* -*- C++ -*- */
//======================================================================
@@ -30,6 +31,7 @@
//uncomment this line to turn on the code that relates to interface types
//#define ASSEMBLY_INTERFACE_SUPPORT 1
+
#include "RepositoryManagerDaemonS.h"
#include "ace/Hash_Map_Manager.h" //for the ACE_Hash_Map_Manager
@@ -47,7 +49,7 @@ namespace
/// Directory where the packages will be stored locally
const static char* INSTALL_PATH = "RepositoryDir";
- const static size_t TEMP_LEN = 512;
+ const static size_t TEMP_LEN = 1024;
const static char* PC_EXTENSION = ".epc";
}
@@ -58,7 +60,7 @@ class CIAO_RepositoryManagerDaemon_i :
public:
/// Constructor
CIAO_RepositoryManagerDaemon_i (CORBA::ORB_ptr the_orb,
- const char* server = "http://localhost:5432/");
+ const char* server = "localhost:5432");
/// Destructor
virtual ~CIAO_RepositoryManagerDaemon_i (void);
@@ -260,10 +262,10 @@ public:
typedef CIMap::iterator CIMap_Iterator;
typedef ACE_Hash_Map_Entry <ACE_CString,ACE_CString> CIEntry;
typedef ACE_Hash_Map_Bucket_Iterator<ACE_CString,
- ACE_CString,
- ACE_Hash<ACE_CString>,
- ACE_Equal_To<ACE_CString>,
- ACE_RW_Mutex> CIBucket_Iterator;
+ ACE_CString,
+ ACE_Hash<ACE_CString>,
+ ACE_Equal_To<ACE_CString>,
+ ACE_RW_Mutex> CIBucket_Iterator;
//a hash map that associates the names of
//PackageConfigurations with their location
diff --git a/TAO/CIAO/bin/PerlCIAO/TestUtils.base b/TAO/CIAO/bin/PerlCIAO/TestUtils.base
new file mode 100644
index 00000000000..7e68a521d2f
--- /dev/null
+++ b/TAO/CIAO/bin/PerlCIAO/TestUtils.base
@@ -0,0 +1,3 @@
+processes
+files
+wd
diff --git a/TAO/CIAO/bin/PerlCIAO/TestUtils.pm b/TAO/CIAO/bin/PerlCIAO/TestUtils.pm
new file mode 100644
index 00000000000..6cb4ca22fe7
--- /dev/null
+++ b/TAO/CIAO/bin/PerlCIAO/TestUtils.pm
@@ -0,0 +1,323 @@
+
+#------------------------------------------------------------------------
+# class: TestUtils
+# Author: Stoyan Paunov
+#
+# Description: This is a class to help us write better and more manage-
+# able test utilities. Usually when creating a test in
+# CIAO it has to do with deploying a number of managers
+# and failure to deploy any process means failure of the
+# test. This test utility class takes care of the error
+# handling and clean-up and side of testing and allows
+# the test writer to concentrate on the core logic.
+# These are the main advantages of the TestUtils class:
+# --> Semi-Automatic error handling
+# --> Automatic process shutdown and clean-up
+# --> Semi-Automatic file (IOR) deletion
+# --> Location independent tests
+# --> Clean and concise code base
+# --> Manageable test utility suites
+#------------------------------------------------------------------------
+
+# class TestUtils
+sub new;
+sub DESTROY;
+sub cleanup;
+sub goto_dir;
+sub spawn;
+sub terminate;
+sub required_file;
+sub required_files;
+sub mark_file;
+sub mark_files;
+sub remove_file;
+sub remove_files;
+sub cleanup_files;
+sub cleanup_processes;
+
+package TestUtils;
+use PerlCIAO::TestUtils_Base;
+use strict;
+our @ISA = qw(TestUtils_Base); # inherits from TestUtils_Base
+
+use lib "$ENV{'ACE_ROOT'}/bin";
+use PerlACE::Run_Test;
+use Cwd;
+
+#------------------------------------------------------------------------
+# Constructor
+#------------------------------------------------------------------------
+sub new {
+ my $class = shift;
+
+ #call the constructor of the parent class, TestUtils_Base.
+ my $self = $class->SUPER::new();
+
+ $self->{_wd} = getcwd;
+
+ bless $self, $class;
+ return $self;
+}
+
+#------------------------------------------------------------------------
+# Destructor: performs clean-up
+#------------------------------------------------------------------------
+
+sub DESTROY {
+ my $self = shift;
+
+ #$self->cleanup (); check the CLEAN-UP description for explanation
+}
+
+#------------------------------------------------------------------------
+# Cleanup: This fuction kills the spawned processes and deletes the
+# marked files. Optionally, once the cleanup is done it will
+# cause the program to exit, iff an exit code is specified.
+#
+#
+# NOTE: You need to call the cleanup () although it is called
+# in the destructor because this class is a wrapper around
+# PerlACE::Run_Test which also keep some internal state
+# and tries to do some clean-up. However its destructor
+# is called before this one, and this results in some
+# errors.
+#------------------------------------------------------------------------
+
+sub cleanup {
+ my $self = shift;
+ my $exit_code = shift;
+
+ print "Performing clean-up ...\n";
+
+ $self->cleanup_files ();
+ $self->cleanup_processes ();
+
+ print "Cleanup = DONE\n";
+
+ chdir $self->wd ();
+
+ if (defined ($exit_code)) {
+ exit ($exit_code);
+ }
+}
+
+#------------------------------------------------------------------------
+# Goto_dir: This function allows you to change the current working
+# directory. Note that the class returns to the original
+# working directory upon exit.
+#------------------------------------------------------------------------
+
+#TODO: might want to push the dir to some stack
+sub goto_dir {
+ my $self = shift;
+ my $dir = shift;
+
+ if (! (chdir $dir)) {
+ print STDERR "Failed to change directory to: $dir";
+ $self->cleanup ();
+ }
+
+}
+
+#------------------------------------------------------------------------
+# Spawn: This function is used to spawn a process. It takes a descriptive
+# name under which it stores the process, the command line and the
+# arguments needed by the command. Optionally, you could specify
+# a timeout based on which the process would be spawned and if
+# it has not terminated after timeout seconds it will be killed.
+# If a failure occurs the function will perform clean-up and
+# terminate the program.
+#------------------------------------------------------------------------
+
+sub spawn {
+ my $self = shift;
+ my $name = shift;
+ my $cmd = shift;
+ my $args = shift;
+ my $timeout = shift;
+
+ if (!defined ($self->processes ())) {
+ $self->{_processes} = {};
+ }
+
+ my $process = new PerlACE::Process ($cmd, $args);
+
+ if (defined ($timeout)) {
+ if ((my $ret = $process->SpawnWaitKill ($timeout)) == -1) {
+ print STDERR "ERROR: Process $name returned $ret.\n";
+ $self->cleanup (1);
+ }
+ }
+ else {
+ if ($process->Spawn () == -1) {
+ $process->Kill ();
+ #just in case, lets add it to the process list
+ $self->processes->{$name} = $process;
+ print STDERR "ERROR: Failure to spawn $name.\n";
+ $self->cleanup (1);
+ }
+ }
+
+ $self->processes->{$name} = $process;
+ return $process;
+}
+
+#------------------------------------------------------------------------
+# Terminate: This function takes in the descriptive process name passed
+# to Spawn, looks up the process corresponding to it and
+# kills it.
+#------------------------------------------------------------------------
+
+sub terminate {
+ my $self = shift;
+ my $pname = shift;
+
+ $self->processes ()->{$pname}->Kill ();
+ $self->processes ()->{$pname}->TimedWait (1);
+
+ print STDERR "$pname teminated!\n";
+}
+
+#------------------------------------------------------------------------
+# Required_file: This function checks if a required file is present in
+# the current working directory. If the file is missing
+# it performs cleanup and causes the program to exit.
+#------------------------------------------------------------------------
+
+sub required_file {
+ my $self = shift;
+ my $file = shift;
+
+ if (PerlACE::waitforfile_timed
+ ($file, $PerlACE::wait_interval_for_process_creation) == -1) {
+
+ print STDERR
+ "ERROR: Required file $file could not be found.\n";
+
+ $self->cleanup (1);
+ }
+ return 1;
+}
+
+#------------------------------------------------------------------------
+# Required_filez: This function does the same as required_file above
+# except that it works on a reference (REF) to a list
+# of required files.
+#------------------------------------------------------------------------
+
+sub required_files {
+ my $self = shift;
+ my $files = shift;
+ my $pname = shift;
+
+ foreach my $file (@{$files}) {
+
+ if (PerlACE::waitforfile_timed
+ ($file, $PerlACE::wait_interval_for_process_creation) == -1) {
+
+ print STDERR
+ "ERROR: Required file $file could not be found.\n";
+
+ $self->cleanup (1);
+ }
+ }
+ return 1;
+}
+
+#------------------------------------------------------------------------
+# Mark_file: This function marks a file from the current working
+# directory for deletion. Once the file is marked it will be
+# deleted upon program termination. If the file cannot be
+# found, it is ignored.
+#------------------------------------------------------------------------
+
+sub mark_file {
+ my $self = shift;
+ my $file = shift;
+
+ if (!defined $self->files ()) {
+ $self->{_files} = [];
+ }
+
+ push @{$self->files ()}, $file;
+}
+
+#------------------------------------------------------------------------
+# Mark_filez: This function does the same as mark_file above except
+# that it works on a reference (REF) to an array/list of
+# required files.
+#------------------------------------------------------------------------
+
+sub mark_files {
+ my $self = shift;
+ my $files = shift;
+
+ if (!defined $self->files ()) {
+ $self->{_files} = [];
+ }
+
+ foreach my $file (@{$files}) {
+ push @{$self->files ()}, $file;
+ }
+}
+
+#------------------------------------------------------------------------
+# Remove_file: This fuction removes a file from the current working
+# directory. If the file is not there, it is ignored.
+#------------------------------------------------------------------------
+
+sub remove_file {
+ my $self = shift;
+ my $file = shift;
+
+ my $path = PerlACE::LocalFile ($file);
+ unlink $path;
+}
+
+#------------------------------------------------------------------------
+# Remove_filez: This fuction removes a list of file from the current
+# working directory. It takes a REF of a list of files
+# and ignores files which are not found.
+#------------------------------------------------------------------------
+
+sub remove_files {
+ my $self = shift;
+ my $files = shift;
+
+ foreach my $file (@{$files}) {
+ my $path = PerlACE::LocalFile ($file);
+ unlink $path;
+ }
+}
+
+#------------------------------------------------------------------------
+# Cleanup_files: clean us the files :)
+#------------------------------------------------------------------------
+
+sub cleanup_files {
+ my $self = shift;
+
+ if (defined ($self->files ())) {
+ foreach my $file (@{$self->files ()}) {
+ $self->remove_file ($file);
+ }
+ }
+}
+
+#------------------------------------------------------------------------
+# Cleanup_processes: clean us the processes :)
+#------------------------------------------------------------------------
+
+sub cleanup_processes {
+ my $self = shift;
+
+ if (defined ($self->processes ())) {
+ foreach my $pname ( keys %{$self->processes ()}) {
+ $self->terminate ($pname);
+ delete ($self->processes ()->{$pname});
+ }
+ }
+}
+
+#return value of the class
+1; \ No newline at end of file
diff --git a/TAO/CIAO/bin/PerlCIAO/TestUtils_Base.pm b/TAO/CIAO/bin/PerlCIAO/TestUtils_Base.pm
new file mode 100644
index 00000000000..be0726946c9
--- /dev/null
+++ b/TAO/CIAO/bin/PerlCIAO/TestUtils_Base.pm
@@ -0,0 +1,78 @@
+#File generated by C:\ACE_wrappers_devel\ACE_wrappers\TAO\CIAO\bin\PerlCIAO\generate_container.pl.
+#Input file: TestUtils.base.
+#Code generator author: Stoyan Paunov
+#
+
+#class TestUtils_Base
+package TestUtils_Base;
+use strict;
+
+#Class constructor :)
+sub new {
+ my ($class) = @_;
+
+ #Create a reference to an anonymous hash
+ my $self = {
+ _processes => undef,
+ _files => undef,
+ _wd => undef
+ };
+
+ #Bless the hash.
+ bless $self, $class;
+ return $self;
+}
+
+#accessor/mutator method for processes
+sub processes {
+ my ( $self, $processes ) = @_;
+
+ $self->{_processes} = $processes
+ if defined ($processes);
+
+ return $self->{_processes};
+}
+
+#accessor/mutator method for files
+sub files {
+ my ( $self, $files ) = @_;
+
+ $self->{_files} = $files
+ if defined ($files);
+
+ return $self->{_files};
+}
+
+#accessor/mutator method for wd
+sub wd {
+ my ( $self, $wd ) = @_;
+
+ $self->{_wd} = $wd
+ if defined ($wd);
+
+ return $self->{_wd};
+}
+
+#print method for the class
+sub print {
+ my ($self) = @_;
+
+ my $f;
+
+ $f = defined ($self->{_processes})
+ ? $self->{_processes} : "not defined";
+ printf ("processes: %s\n", $f);
+
+ $f = defined ($self->{_files})
+ ? $self->{_files} : "not defined";
+ printf ("files: %s\n", $f);
+
+ $f = defined ($self->{_wd})
+ ? $self->{_wd} : "not defined";
+ printf ("wd: %s\n", $f);
+
+}
+
+#class return value
+1;
+
diff --git a/TAO/CIAO/bin/PerlCIAO/generate_container.pl b/TAO/CIAO/bin/PerlCIAO/generate_container.pl
new file mode 100644
index 00000000000..c56c03ea300
--- /dev/null
+++ b/TAO/CIAO/bin/PerlCIAO/generate_container.pl
@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+#
+# $Id$
+#
+# The above line is for compatibility /w Linux. Windows uses the .pl extension.
+# Author: Stoyan Paunov
+# Purpose: Generate a container class with mutator/accessor methods
+# The idea is to use this class as a base class in the
+# inheritance hierarchy. This way we can evolve the base
+# container independently from the rest of the code!
+#
+
+use strict;
+
+die "Usage: $0 <module name> <field description file>\n"
+ if not defined $ARGV[0];
+
+die "Usage: $0 <module name> <field description file>\n"
+ if not defined $ARGV[1];
+
+my $module_name = $ARGV[0];
+my $fields = $ARGV[1];
+
+open (FIELDS, $fields) or die "Failed opening $fields\n";
+
+my @fields = <FIELDS>;
+close FIELDS;
+
+my $field;
+
+print "\#File generated by $0.\n";
+print "\#Input file: $fields.\n";
+print "\#Code generator author: Stoyan Paunov\n\#\n\n";
+
+print "\#class $module_name\n";
+print "package $module_name;\n";
+print "use strict;\n\n";
+print "\#Class constructor :)\n";
+print "sub new {\n";
+print " my (\$class) = \@_;\n\n";
+print " \#Create a reference to an anonymous hash\n";
+print " my \$self = {\n";
+
+my $count = 0;
+my $end = $#fields;
+
+#generate initialization code
+foreach $field (@fields)
+{
+ if ($field =~ /^$/ ) # empty line
+ {
+ next;
+ }
+
+ chomp ($field);
+
+ if ($count == $end)
+ {
+ printf (" _\%-14s => undef\n", $field);
+ next;
+ }
+ printf (" _\%-14s => undef,\n", $field);
+
+
+ $count++
+}
+
+print " };\n\n";
+print " \#Bless the hash.\n";
+print " bless \$self, \$class;\n";
+print " return \$self;\n";
+print "}\n\n";
+
+#Code to generate the accessor and mutator
+
+foreach $field (@fields)
+{
+ if ($field =~ /^$/ ) # empty line
+ {
+ next;
+ }
+
+ chomp ($field);
+
+ print "\#accessor/mutator method for $field\n";
+ print "sub $field {\n";
+ print " my ( \$self, \$$field ) = \@_;\n\n";
+ print " \$self->{_$field} = \$$field\n";
+ print " if defined (\$$field);\n\n";
+ print " return \$self->{_$field};\n";
+ print "}\n\n";
+
+}
+
+
+print "\#print method for the class\n";
+print "sub print {\n";
+print " my (\$self) = \@_;\n\n";
+
+print " my \$f;\n\n";
+
+#Code to generate a print method which dumps the object state
+foreach $field (@fields)
+{
+ if ($field =~ /^$/ ) # empty line
+ {
+ next;
+ }
+
+ chomp ($field);
+ print " \$f = defined (\$self->{_$field}) \n";
+ print " ? \$self->{_$field} : \"not defined\";\n";
+ print " printf (\"$field: %s\\n\", \$f);\n\n";
+
+}
+
+
+
+print "}\n\n";
+
+print "\#class return value \n1;\n\n";
+
+
+
+
+
diff --git a/TAO/CIAO/bin/PerlCIAO/perlciao.mpc b/TAO/CIAO/bin/PerlCIAO/perlciao.mpc
new file mode 100644
index 00000000000..6de809ec87d
--- /dev/null
+++ b/TAO/CIAO/bin/PerlCIAO/perlciao.mpc
@@ -0,0 +1,7 @@
+
+project(PerlCIAO) : script {
+ Script_Files {
+ TestUtils.pm
+ TestUtils_Base.pm
+ }
+}
diff --git a/TAO/CIAO/tools/Config_Handlers/IDD_Handler.cpp b/TAO/CIAO/tools/Config_Handlers/IDD_Handler.cpp
index 4adedee7715..7c7c315f324 100644
--- a/TAO/CIAO/tools/Config_Handlers/IDD_Handler.cpp
+++ b/TAO/CIAO/tools/Config_Handlers/IDD_Handler.cpp
@@ -112,7 +112,12 @@ namespace CIAO
//Get all the string/IDREFs
XMLSchema::string < ACE_TCHAR > name ((src.name));
XMLSchema::string < ACE_TCHAR > node ((src.node));
- XMLSchema::string < ACE_TCHAR > source ((src.source[0]));
+ XMLSchema::string < ACE_TCHAR > source ("");
+ if (src.source.length () > 0)
+ {
+ XMLSchema::string < ACE_TCHAR > source_detail (src.source[0]);
+ source = source_detail;
+ }
ACE_CString temp;
MDD_Handler::IDREF.find_ref(src.implementationRef, temp);
XMLSchema::IDREF< ACE_TCHAR > implementation ((temp.c_str()));