summaryrefslogtreecommitdiff
path: root/ACE/ace/Parse_Node.cpp
diff options
context:
space:
mode:
authoriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-04-04 22:28:48 +0000
committeriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-04-04 22:28:48 +0000
commitb2a641dbe426a09df50ede495d19834238d3539c (patch)
tree72de94ddc6d6d8a1ba0d5e508f526ef2029e9082 /ACE/ace/Parse_Node.cpp
parent64f732c904b2724a297e77b951f2593d308b24a0 (diff)
downloadATCD-b2a641dbe426a09df50ede495d19834238d3539c.tar.gz
ChangeLogTag: Fri Apr 4 21:43:35 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
Diffstat (limited to 'ACE/ace/Parse_Node.cpp')
-rw-r--r--ACE/ace/Parse_Node.cpp58
1 files changed, 53 insertions, 5 deletions
diff --git a/ACE/ace/Parse_Node.cpp b/ACE/ace/Parse_Node.cpp
index 376866af7fb..e70e1bff34b 100644
--- a/ACE/ace/Parse_Node.cpp
+++ b/ACE/ace/Parse_Node.cpp
@@ -30,14 +30,55 @@ ACE_Stream_Node::dump (void) const
#endif /* ACE_HAS_DUMP */
}
+#include "ace/ARGV.h"
+
void
ACE_Stream_Node::apply (ACE_Service_Gestalt *config, int &yyerrno)
{
ACE_TRACE ("ACE_Stream_Node::apply");
- if (config->initialize (this->node_->record (config),
- this->node_->parameters ()) == -1)
+ const ACE_Service_Type *sst = this->node_->record (config);
+ if (sst == 0)
+ const_cast<ACE_Static_Node *> (this->node_)->apply (config, yyerrno);
+
+ if (yyerrno != 0) return;
+
+ sst = this->node_->record (config);
+ ACE_Stream_Type *st =
+ dynamic_cast<ACE_Stream_Type *> (const_cast<ACE_Service_Type_Impl *> (sst->type ()));
+
+ for (const ACE_Static_Node *module = dynamic_cast<const ACE_Static_Node*> (this->mods_);
+ module != 0;
+ module = dynamic_cast<ACE_Static_Node*> (module->link()))
+ {
+ ACE_ARGV args (module->parameters ());
+
+ const ACE_Service_Type *mst = module->record (config);
+ if (mst == 0)
+ const_cast<ACE_Static_Node *> (module)->apply (config, yyerrno);
+
+ if (yyerrno != 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("dynamic initialization failed for Module %s\n"),
+ module->name ()));
++yyerrno;
+ }
+
+ ACE_Module_Type const * const mt1 =
+ static_cast <ACE_Module_Type const *> (module->record (config)->type());
+
+ ACE_Module_Type *mt = const_cast<ACE_Module_Type *>(mt1);
+
+ if (st->push (mt) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_LIB_TEXT ("dynamic initialization failed for Stream %s\n"),
+ this->node_->name ()));
+ ++yyerrno;
+ }
+
+ }
#ifndef ACE_NLOGGING
if (ACE::debug ())
@@ -76,7 +117,14 @@ void
ACE_Parse_Node::link (ACE_Parse_Node *n)
{
ACE_TRACE ("ACE_Parse_Node::link");
- this->next_ = n;
+
+ // Find the last list entry (if any) ...
+ ACE_Parse_Node *t = this;
+ while (t->next_ != 0)
+ t = t->next_;
+
+ // ... and insert n there.
+ t->next_ = n;
}
ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node *str_ops,
@@ -718,7 +766,7 @@ ACE_Static_Function_Node::symbol (ACE_Service_Gestalt *config,
ACE_Static_Svc_Descriptor *ssd = 0;
if (config->find_static_svc_descriptor (this->function_name_, &ssd) == -1)
{
- yyerrno++;
+ ++yyerrno;
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) No static service ")
ACE_TEXT ("registered for function %s\n"),
@@ -728,7 +776,7 @@ ACE_Static_Function_Node::symbol (ACE_Service_Gestalt *config,
if (ssd->alloc_ == 0)
{
- yyerrno++;
+ ++yyerrno;
if (this->symbol_ == 0)
{