summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLog-99c46
-rw-r--r--TAO/TAO_IDL/be/be_interface.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp10
-rw-r--r--TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp3
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp6
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp21
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp23
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h9
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h4
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i4
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp98
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h27
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i15
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp59
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h20
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp13
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h3
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp50
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/Event_Channel.h12
-rw-r--r--TAO/orbsvcs/orbsvcs/Event/Event_Channel.i12
-rw-r--r--TAO/tao/Context.cpp2
-rw-r--r--TAO/tao/Context.h40
-rw-r--r--TAO/tao/IOR_LookupTable.cpp31
-rw-r--r--TAO/tao/ORB.cpp8
28 files changed, 335 insertions, 220 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c
index b55a8ca2b48..5aaaada8d78 100644
--- a/TAO/ChangeLog-99c
+++ b/TAO/ChangeLog-99c
@@ -1,3 +1,49 @@
+Fri Apr 30 12:42:06 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * TAO_IDL/be/be_interface.cpp:
+ * TAO_IDL/be/be_visitor_interface/interface_ch.cpp:
+ * TAO_IDL/be/be_visitor_interface/interface_sh.cpp:
+ * TAO_IDL/be/be_visitor_interface/tie_sh.cpp:
+ * TAO_IDL/be/be_visitor_operation/arglist.cpp:
+ * TAO_IDL/be/be_visitor_operation/operation_sh.cpp:
+ * TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp:
+ * TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp:
+ Generate CORBA::default_environment() instead of
+ CORBA::Environment::default_environment. It is easier to
+ generate code for the TAO library that way and it is slightly
+ more efficient.
+
+ * orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp:
+ * orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h:
+ * orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp:
+ * orbsvcs/orbsvcs/Event/EC_Event_Channel.h:
+ * orbsvcs/orbsvcs/Event/EC_Event_Channel.i:
+ * orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp:
+ * orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h:
+ * orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i:
+ * orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp:
+ * orbsvcs/orbsvcs/Event/EC_ProxySupplier.h:
+ * orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp:
+ * orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h:
+ Added support for reference counting of ProxyPushConsumer and
+ ProxyPushSupplier objects.
+ Also fixed the initialization of the default_POAs for those
+ classes and the Admin interfaces.
+ Added strategized locking to the
+
+ * tao/Context.h:
+ * tao/Context.cpp:
+ Use CORBA::defaul_environment() instead of
+ CORBA::Environment::default_environment() that way we can
+ include Context.h without requiring Environment.h
+ Also reordered some includes in the .cpp file to validate the
+ Context.h file on its own.
+
+ * tao/IOR_LookupTable.cpp:
+ * tao/ORB.cpp:
+ Protected some debug messages with TAO_debug_level. Also added a
+ few more to check the iioploc support.
+
Fri Apr 30 11:58:23 1999 Nanbor Wang <nanbor@cs.wustl.edu>
* tao/Request.{h,cpp} (operator[]): Changed the return type from
diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp
index a223827de56..01fe8ebcc01 100644
--- a/TAO/TAO_IDL/be/be_interface.cpp
+++ b/TAO/TAO_IDL/be/be_interface.cpp
@@ -1770,7 +1770,7 @@ be_interface::gen_skel_helper (be_interface *derived,
<< "void *obj," << be_nl
<< "void *context," << be_nl
<< "CORBA::Environment &env =" << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt << "\n\n";
}
@@ -1821,7 +1821,7 @@ be_interface::gen_skel_helper (be_interface *derived,
<< "void *obj," << be_nl
<< "void *context," << be_nl
<< "CORBA::Environment &env =" << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt << "\n\n";
}
@@ -1868,7 +1868,7 @@ be_interface::gen_skel_helper (be_interface *derived,
<< "void *obj," << be_nl
<< "void *context," << be_nl
<< "CORBA::Environment &env = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt << "\n\n";
}
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
index ff03c2a6bab..6711f5197fa 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp
@@ -161,14 +161,14 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
<< "_narrow (" << be_idt << be_idt_nl
<< "CORBA::Object_ptr obj," << be_nl
<< "CORBA::Environment &env = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt_nl
<< "static " << node->local_name () << "_ptr "
<< "_unchecked_narrow (" << be_idt << be_idt_nl
<< "CORBA::Object_ptr obj," << be_nl
<< "CORBA::Environment &env = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt_nl
<< "static " << node->local_name () << "_ptr " << "_nil (void);\n\n";
@@ -188,7 +188,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node)
*os << "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl
<< "const CORBA::Char *type_id, " << be_nl
<< "CORBA::Environment &env = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt_nl
<< "virtual const char* "
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
index 12a3a50a992..6c5ef47158f 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp
@@ -111,7 +111,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
<< "virtual CORBA::Boolean _is_a (" << be_idt << be_idt_nl
<< "const char* logical_type_id," << be_nl
<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");\n" << be_uidt_nl;
@@ -125,7 +125,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
<< "void *obj," << be_nl
<< "void *context," << be_nl
<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");\n" << be_uidt_nl;
@@ -136,7 +136,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
<< "void *obj," << be_nl
<< "void *context," << be_nl
<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");\n" << be_uidt_nl;
@@ -145,14 +145,14 @@ be_visitor_interface_sh::visit_interface (be_interface *node)
<< "CORBA::ServerRequest &_tao_req," << be_nl
<< "void *_tao_context," << be_nl
<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");\n" << be_uidt_nl;
// Print out the _this() method.
*os << node->name () << " *_this (" << be_idt << be_idt_nl
<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");\n" << be_uidt_nl;
diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
index 78d03c9a8a4..e93e0b40e81 100644
--- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp
@@ -116,7 +116,7 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node)
<< "// overridden ServantBase operations" << be_nl
<< "PortableServer::POA_ptr _default_POA (" << be_idt << be_idt_nl
<< "CORBA::Environment &env = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt << "\n";
@@ -165,4 +165,3 @@ be_visitor_interface_tie_sh::method_helper (be_interface *,
delete visitor;
return 0;
}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
index 50c08c5f05d..969e55e2c04 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/arglist.cpp
@@ -60,7 +60,7 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
-1);
}
-
+
switch (this->ctx_->state ())
{
@@ -71,7 +71,7 @@ be_visitor_operation_arglist::visit_operation (be_operation *node)
os->indent ();
*os << "CORBA::Environment &ACE_TRY_ENV";
*os << " = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt;
break;
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
@@ -156,7 +156,7 @@ be_visitor_operation_arglist::visit_argument (be_argument *node)
ctx.state (TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH);
break;
case TAO_CodeGen::TAO_OPERATION_ARGLIST_OTHERS:
- case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
+ case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_IS:
case TAO_CodeGen::TAO_OPERATION_ARGLIST_COLLOCATED_SH:
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
index 856be64611b..0e3244afec0 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp
@@ -139,7 +139,7 @@ be_visitor_operation_sh::visit_operation (be_operation *node)
<< "void *_tao_obj, " << be_nl
<< "void *_tao_context, " << be_nl
<< "CORBA::Environment &_tao_env = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt << "\n\n";
}
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp
index f9e2ef18168..b453bbe12d2 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ch.cpp
@@ -46,7 +46,7 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node)
// generate the class name
be_type *pt; // base types
-
+
if (bt->node_type () == AST_Decl::NT_typedef)
{
// get the primitive base type of this typedef node
@@ -87,7 +87,7 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node)
// constructor
*os << class_name << " (CORBA::ULong length," << be_idt_nl;
- // the accept is here the first time used and if an
+ // the accept is here the first time used and if an
// error occurs, it will occur here. Later no check
// for errors will be done.
if (pt->accept (visitor) == -1)
@@ -118,14 +118,14 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node)
<< "// Read-write accessor." << be_nl;
// allocbuf
- *os << "static ";
- pt->accept (visitor);
+ *os << "static ";
+ pt->accept (visitor);
*os << " **allocbuf (CORBA::ULong length); "
<< "// Allocate storage for a sequence.." << be_nl;
// freebuf
- *os << "static void freebuf (";
- pt->accept (visitor);
+ *os << "static void freebuf (";
+ pt->accept (visitor);
*os << " **buffer);" << be_nl;
// allocate_buffer
@@ -136,12 +136,12 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node)
*os << "virtual void _deallocate_buffer (void);" << be_nl;
// get_buffer
- pt->accept(visitor);
+ pt->accept(visitor);
*os << "* *get_buffer (CORBA::Boolean orphan = 0);" << be_nl;
// get_buffer
- *os << "const ";
- pt->accept (visitor);
+ *os << "const ";
+ pt->accept (visitor);
*os << "* *get_buffer (void) const;" << be_nl;
// _shrink_buffer
@@ -157,7 +157,7 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node)
<< "void* target," << be_nl
<< "CORBA_Object *src," << be_nl
<< "CORBA_Environment &ACE_TRY_ENV = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt_nl;
@@ -179,4 +179,3 @@ be_visitor_sequence_ch::gen_bounded_obj_sequence (be_sequence *node)
delete visitor;
return 0;
}
-
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp
index 1f9e88780c2..3edf1668afd 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ch.cpp
@@ -47,7 +47,7 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
// generate the class name
be_type *pt; // base types
-
+
if (bt->node_type () == AST_Decl::NT_typedef)
{
// get the primitive base type of this typedef node
@@ -73,7 +73,7 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
os->gen_ifdef_macro (class_name);
os->indent ();
-
+
//forward declaration of the object manager;
*os << "class " << object_manager << ";" << be_nl << be_nl;
@@ -92,7 +92,7 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
// constructor
*os << class_name << " (CORBA::ULong maximum," << be_idt_nl
<< "CORBA::ULong length," << be_nl;
- pt->accept (visitor);
+ pt->accept (visitor);
*os <<"* *value," << be_nl
<< "CORBA::Boolean release = 0);" << be_uidt_nl;
@@ -109,8 +109,8 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
*os << object_manager << " operator[] (CORBA::ULong index) const;" << be_nl;
// allocbuf
- *os << "static ";
- pt->accept (visitor);
+ *os << "static ";
+ pt->accept (visitor);
*os << " **allocbuf (CORBA::ULong nelems);" << be_nl;
// freebuf
@@ -126,17 +126,17 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
*os << "virtual void _deallocate_buffer (void);" << be_nl;
// get_buffer
- pt->accept(visitor);
+ pt->accept(visitor);
*os << "* *get_buffer (CORBA::Boolean orphan = 0);" << be_nl;
// get_buffer
- *os << "const ";
- pt->accept (visitor);
+ *os << "const ";
+ pt->accept (visitor);
*os << "* *get_buffer (void) const;" << be_nl;
// shrink_buffer
*os << "virtual void _shrink_buffer (CORBA::ULong nl, CORBA::ULong ol);" << be_nl;
-
+
be_predefined_type *prim = be_predefined_type::narrow_from_decl (pt);
if ((pt->node_type () != AST_Decl::NT_pre_defined) ||
(prim && (prim->pt () == AST_PredefinedType::PT_pseudo) &&
@@ -147,13 +147,13 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
<< "void* target," << be_nl
<< "CORBA_Object *src," << be_nl
<< "CORBA_Environment &ACE_TRY_ENV = " << be_idt_nl
- << "CORBA::Environment::default_environment ()"
+ << "CORBA::default_environment ()"
<< be_uidt << be_uidt_nl
<< ");" << be_uidt_nl;
*os << "virtual CORBA_Object* _upcast (void *src) const;" << be_nl;
}
- *os << be_uidt_nl << "};\n";
+ *os << be_uidt_nl << "};\n";
os->gen_endif (); // endif macro
@@ -169,4 +169,3 @@ be_visitor_sequence_ch::gen_unbounded_obj_sequence (be_sequence *node)
delete visitor;
return 0;
}
-
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp
index 6e614ef54ba..09e8a3fa84b 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.cpp
@@ -22,6 +22,8 @@ TAO_EC_ConsumerAdmin::TAO_EC_ConsumerAdmin (TAO_EC_Event_Channel *ec,
this->supplier_set_ =
this->event_channel_->create_proxy_push_supplier_set ();
}
+ this->default_POA_ =
+ this->event_channel_->consumer_poa ();
}
TAO_EC_ConsumerAdmin::~TAO_EC_ConsumerAdmin (void)
@@ -31,13 +33,6 @@ TAO_EC_ConsumerAdmin::~TAO_EC_ConsumerAdmin (void)
}
void
-TAO_EC_ConsumerAdmin::set_default_POA (PortableServer::POA_ptr poa)
-{
- this->default_POA_ =
- PortableServer::POA::_duplicate (poa);
-}
-
-void
TAO_EC_ConsumerAdmin::connected (TAO_EC_ProxyPushConsumer *consumer,
CORBA::Environment &ACE_TRY_ENV)
{
@@ -99,10 +94,6 @@ TAO_EC_ConsumerAdmin::obtain_push_supplier (CORBA::Environment &ACE_TRY_ENV)
TAO_EC_ProxyPushSupplier* supplier =
this->event_channel_->create_proxy_push_supplier ();
- PortableServer::POA_var poa =
- this->event_channel_->supplier_poa (ACE_TRY_ENV);
- supplier->set_default_POA (poa.in ());
-
return supplier->_this (ACE_TRY_ENV);
}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h
index 7fdf340e443..543ed30a456 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ConsumerAdmin.h
@@ -83,12 +83,6 @@ public:
CORBA::ULong max_write_delay (void) const;
// Delegate on the EC_ProxyPushSupplier....
- void set_default_POA (PortableServer::POA_ptr poa);
- // Set this servant's default POA
-
- virtual PortableServer::POA_ptr _default_POA (CORBA::Environment& env);
- // Override the ServantBase method.
-
virtual void connected (TAO_EC_ProxyPushConsumer*,
CORBA::Environment&);
virtual void disconnected (TAO_EC_ProxyPushConsumer*,
@@ -107,6 +101,9 @@ public:
virtual RtecEventChannelAdmin::ProxyPushSupplier_ptr
obtain_push_supplier (CORBA::Environment &);
+ // = The PortableServer::ServantBase methods
+ virtual PortableServer::POA_ptr _default_POA (CORBA::Environment& env);
+
private:
TAO_EC_Event_Channel *event_channel_;
// The Event Channel we belong to
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp
index 64cc17aba2b..be3f712ea3c 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.cpp
@@ -77,20 +77,10 @@ TAO_EC_Event_Channel::~TAO_EC_Event_Channel (void)
}
void
-TAO_EC_Event_Channel::activate (CORBA::Environment& ACE_TRY_ENV)
+TAO_EC_Event_Channel::activate (CORBA::Environment&)
{
this->dispatching_->activate ();
this->timeout_generator_->activate ();
-
- PortableServer::POA_var supplier_poa =
- this->supplier_poa (ACE_TRY_ENV);
- ACE_CHECK;
- this->supplier_admin_->set_default_POA (supplier_poa.in ());
-
- PortableServer::POA_var consumer_poa =
- this->consumer_poa (ACE_TRY_ENV);
- ACE_CHECK;
- this->consumer_admin_->set_default_POA (consumer_poa.in ());
}
void
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h
index 4480b052dea..6aecda000d8 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.h
@@ -102,8 +102,8 @@ public:
void destroy_proxy_push_supplier_set (TAO_EC_ProxyPushSupplier_Set*);
// Create and destroy a ProxyPushSupplier_Set
- PortableServer::POA_ptr supplier_poa (CORBA::Environment&);
- PortableServer::POA_ptr consumer_poa (CORBA::Environment&);
+ PortableServer::POA_ptr supplier_poa (void);
+ PortableServer::POA_ptr consumer_poa (void);
// Access the supplier and consumer POAs from the factory.
ACE_Lock* create_consumer_lock (void);
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i
index 8c245cca820..5572e235c9e 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_Event_Channel.i
@@ -73,13 +73,13 @@ TAO_EC_Event_Channel::destroy_proxy_push_consumer (TAO_EC_ProxyPushConsumer* con
}
ACE_INLINE PortableServer::POA_ptr
-TAO_EC_Event_Channel::supplier_poa (CORBA::Environment&)
+TAO_EC_Event_Channel::supplier_poa (void)
{
return PortableServer::POA::_duplicate (this->supplier_poa_.in ());
}
ACE_INLINE PortableServer::POA_ptr
-TAO_EC_Event_Channel::consumer_poa (CORBA::Environment &)
+TAO_EC_Event_Channel::consumer_poa (void)
{
return PortableServer::POA::_duplicate (this->consumer_poa_.in ());
}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp
index ab408795abb..2f6bc8b9a56 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp
@@ -14,19 +14,19 @@ ACE_RCSID(Event, EC_ProxyConsumer, "$Id$")
TAO_EC_ProxyPushConsumer::
TAO_EC_ProxyPushConsumer (TAO_EC_Event_Channel* ec)
: event_channel_ (ec),
+ refcount_ (1),
filter_ (0)
{
-}
+ this->lock_ =
+ this->event_channel_->create_consumer_lock ();
-TAO_EC_ProxyPushConsumer::~TAO_EC_ProxyPushConsumer (void)
-{
+ this->default_POA_ =
+ this->event_channel_->consumer_poa ();
}
-void
-TAO_EC_ProxyPushConsumer::set_default_POA (PortableServer::POA_ptr poa)
+TAO_EC_ProxyPushConsumer::~TAO_EC_ProxyPushConsumer (void)
{
- this->default_POA_ =
- PortableServer::POA::_duplicate (poa);
+ this->event_channel_->destroy_consumer_lock (this->lock_);
}
PortableServer::POA_ptr
@@ -63,22 +63,51 @@ TAO_EC_ProxyPushConsumer::disconnected (TAO_EC_ProxyPushConsumer*,
{
}
+CORBA::ULong
+TAO_EC_ProxyPushConsumer::_incr_refcnt (void)
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ return this->refcount_++;
+}
+
+CORBA::ULong
+TAO_EC_ProxyPushConsumer::_decr_refcnt (void)
+{
+ {
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+ this->refcount_--;
+ if (this->refcount_ != 0)
+ return this->refcount_;
+ }
+
+ // Notify the event channel
+ this->event_channel_->destroy_proxy_push_consumer (this);
+ return 0;
+}
+
void
TAO_EC_ProxyPushConsumer::connect_push_supplier (
RtecEventComm::PushSupplier_ptr push_supplier,
const RtecEventChannelAdmin::SupplierQOS& qos,
CORBA::Environment &ACE_TRY_ENV)
{
- if (this->is_connected ())
- ACE_THROW (RtecEventChannelAdmin::AlreadyConnected ());
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
- this->supplier_ =
- RtecEventComm::PushSupplier::_duplicate (push_supplier);
- this->qos_ = qos;
+ if (this->is_connected_i ())
+ ACE_THROW (RtecEventChannelAdmin::AlreadyConnected ());
- this->filter_ =
- this->event_channel_->supplier_filter_builder ()->create (this->qos_);
- this->filter_->bind (this);
+ this->supplier_ =
+ RtecEventComm::PushSupplier::_duplicate (push_supplier);
+ this->qos_ = qos;
+
+ this->filter_ =
+ this->event_channel_->supplier_filter_builder ()->create (this->qos_);
+ this->filter_->bind (this);
+ }
// Notify the event channel...
this->event_channel_->connected (this, ACE_TRY_ENV);
@@ -91,6 +120,8 @@ TAO_EC_ProxyPushConsumer::push (const RtecEventComm::EventSet& event,
if (this->is_connected () == 0)
return; // @@ THROW something???
+ // No need to keep the lock, the filter_ class is supposed to be
+ // thread safe....
this->filter_->push (event, ACE_TRY_ENV);
}
@@ -98,8 +129,22 @@ void
TAO_EC_ProxyPushConsumer::disconnect_push_consumer (
CORBA::Environment &ACE_TRY_ENV)
{
- this->supplier_ =
- RtecEventComm::PushSupplier::_nil ();
+ {
+ ACE_GUARD_THROW_EX (
+ ACE_Lock, ace_mon, *this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
+ ACE_CHECK;
+
+ if (this->is_connected_i () == 0)
+ ACE_THROW (CORBA::BAD_INV_ORDER ());
+
+ this->supplier_ =
+ RtecEventComm::PushSupplier::_nil ();
+
+ this->filter_->unbind (this);
+ this->event_channel_->supplier_filter_builder ()->destroy (this->filter_);
+ this->filter_ = 0;
+ }
PortableServer::POA_var poa =
this->_default_POA (ACE_TRY_ENV);
@@ -110,12 +155,21 @@ TAO_EC_ProxyPushConsumer::disconnect_push_consumer (
poa->deactivate_object (id.in (), ACE_TRY_ENV);
ACE_CHECK;
- this->filter_->unbind (this);
- this->event_channel_->supplier_filter_builder ()->destroy (this->filter_);
- this->filter_ = 0;
-
// Notify the event channel...
this->event_channel_->disconnected (this, ACE_TRY_ENV);
- this->event_channel_->destroy_proxy_push_consumer (this);
+ this->_decr_refcnt ();
}
+
+void
+TAO_EC_ProxyPushConsumer::_add_ref (CORBA::Environment &)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_EC_ProxyPushConsumer::_remove_ref (CORBA::Environment &)
+{
+ this->_decr_refcnt ();
+}
+
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h
index 890abbfd242..1659522d65a 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h
@@ -90,12 +90,13 @@ public:
// Usually implemented as no-ops, but some configurations may
// require this methods.
- void set_default_POA (PortableServer::POA_ptr poa);
- // Set this servant's default POA
-
virtual PortableServer::POA_ptr _default_POA (CORBA::Environment& env);
// Override the ServantBase method.
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
+ // Increment and decrement the reference count.
+
// = The RtecEventChannelAdmin::ProxyPushConsumer methods...
virtual void connect_push_supplier (
RtecEventComm::PushSupplier_ptr push_supplier,
@@ -105,12 +106,25 @@ public:
CORBA::Environment &);
virtual void disconnect_push_consumer (CORBA::Environment &);
+ // = Servant reference counting methods.
+ virtual void _add_ref (CORBA_Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
+ virtual void _remove_ref (CORBA_Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
+
+private:
+ CORBA::Boolean is_connected_i (void) const;
+ // The private version (without locking) of is_connected().
+
private:
TAO_EC_Event_Channel* event_channel_;
// The supplier admin, used for activation and memory managment.
- TAO_EC_SupplierFiltering* filter_;
- // The strategy to do filtering close to the supplier
+ ACE_Lock* lock_;
+ // The locking strategy.
+
+ CORBA::ULong refcount_;
+ // The reference count.
RtecEventComm::PushSupplier_var supplier_;
// The supplier....
@@ -120,6 +134,9 @@ private:
PortableServer::POA_var default_POA_;
// Store the default POA.
+
+ TAO_EC_SupplierFiltering* filter_;
+ // The strategy to do filtering close to the supplier
};
#if defined (__ACE_INLINE__)
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i
index c692963193e..0ca9186a78d 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.i
@@ -1,19 +1,32 @@
// $Id$
ACE_INLINE CORBA::Boolean
-TAO_EC_ProxyPushConsumer::is_connected (void) const
+TAO_EC_ProxyPushConsumer::is_connected_i (void) const
{
return !CORBA::is_nil (this->supplier_.in ());
}
+ACE_INLINE CORBA::Boolean
+TAO_EC_ProxyPushConsumer::is_connected (void) const
+{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
+
+ return this->is_connected_i ();
+}
+
ACE_INLINE RtecEventComm::PushSupplier_ptr
TAO_EC_ProxyPushConsumer::supplier (void) const
{
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0);
return RtecEventComm::PushSupplier::_duplicate (this->supplier_.in ());
}
ACE_INLINE const RtecEventChannelAdmin::SupplierQOS&
TAO_EC_ProxyPushConsumer::publications (void) const
{
+ // @@ TODO There should be a better way to signal errors here.
+ static RtecEventChannelAdmin::SupplierQOS empty_qos;
+ ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, empty_qos);
+
return this->qos_;
}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp
index e45d6b291c0..49d98e4d517 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp
@@ -21,12 +21,13 @@ TAO_EC_ProxyPushSupplier::TAO_EC_ProxyPushSupplier (TAO_EC_Event_Channel* ec)
{
this->lock_ =
this->event_channel_->create_supplier_lock ();
+
+ this->default_POA_ =
+ this->event_channel_->supplier_poa ();
}
TAO_EC_ProxyPushSupplier::~TAO_EC_ProxyPushSupplier (void)
{
- delete this->child_;
- this->child_ = 0;
this->event_channel_->destroy_supplier_lock (this->lock_);
}
@@ -52,25 +53,10 @@ TAO_EC_ProxyPushSupplier::_decr_refcnt (void)
return 0;
}
-void
-TAO_EC_ProxyPushSupplier::set_default_POA (PortableServer::POA_ptr poa)
-{
- ACE_GUARD (ACE_Lock, ace_mon, *this->lock_);
- this->default_POA_ = PortableServer::POA::_duplicate (poa);
-}
-
-PortableServer::POA_ptr
-TAO_EC_ProxyPushSupplier::_default_POA_i ()
-{
- return PortableServer::POA::_duplicate (this->default_POA_.in ());
-}
-
PortableServer::POA_ptr
TAO_EC_ProxyPushSupplier::_default_POA (CORBA::Environment&)
{
- ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_,
- PortableServer::POA::_nil ());
- return this->_default_POA_i ();
+ return PortableServer::POA::_duplicate (this->default_POA_.in ());
}
void
@@ -136,19 +122,26 @@ TAO_EC_ProxyPushSupplier::disconnect_push_supplier (
RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ());
ACE_CHECK;
+ if (this->is_connected_i () == 0)
+ ACE_THROW (CORBA::BAD_INV_ORDER ());
+
this->consumer_ =
RtecEventComm::PushConsumer::_nil ();
- PortableServer::POA_var poa =
- this->_default_POA_i ();
-
- PortableServer::ObjectId_var id =
- poa->servant_to_id (this, ACE_TRY_ENV);
- ACE_CHECK;
- poa->deactivate_object (id.in (), ACE_TRY_ENV);
- ACE_CHECK;
+ // @@ Why don't we have a destroy() method in the filter_builder?
+ delete this->child_;
+ this->child_ = 0;
}
+ PortableServer::POA_var poa =
+ this->_default_POA (ACE_TRY_ENV);
+ ACE_CHECK;
+ PortableServer::ObjectId_var id =
+ poa->servant_to_id (this, ACE_TRY_ENV);
+ ACE_CHECK;
+ poa->deactivate_object (id.in (), ACE_TRY_ENV);
+ ACE_CHECK;
+
// Notify the event channel...
this->event_channel_->disconnected (this, ACE_TRY_ENV);
@@ -239,7 +232,7 @@ TAO_EC_ProxyPushSupplier::push_to_consumer (const RtecEventComm::EventSet& event
ACE_CHECK;
if (this->is_connected_i () == 0)
- return; // TAO_THROW (RtecEventComm::Disconnected ());????
+ return; // ACE_THROW (RtecEventComm::Disconnected ());????
if (this->suspended_ != 0)
return;
@@ -314,6 +307,18 @@ TAO_EC_ProxyPushSupplier::can_match (
return this->child_->can_match (header);
}
+void
+TAO_EC_ProxyPushSupplier::_add_ref (CORBA::Environment &)
+{
+ this->_incr_refcnt ();
+}
+
+void
+TAO_EC_ProxyPushSupplier::_remove_ref (CORBA::Environment &)
+{
+ this->_decr_refcnt ();
+}
+
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
template class ACE_Reverse_Lock<ACE_Lock>;
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h
index 94ae013ac54..0cbae27494f 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h
@@ -96,9 +96,6 @@ public:
// Usually implemented as no-ops, but some configurations may
// require this methods.
- void set_default_POA (PortableServer::POA_ptr poa);
- // Set this servant's default POA
-
virtual PortableServer::POA_ptr _default_POA (CORBA::Environment& env);
// Override the ServantBase method.
@@ -124,13 +121,9 @@ public:
virtual void suspend_connection (CORBA::Environment &);
virtual void resume_connection (CORBA::Environment &);
- virtual CORBA::ULong _incr_refcnt (void);
- virtual CORBA::ULong _decr_refcnt (void);
+ CORBA::ULong _incr_refcnt (void);
+ CORBA::ULong _decr_refcnt (void);
// Increment and decrement the reference count.
- // @@ TODO We use the canonical tao form, but in the future we may
- // want to add methods that follow the upcoming CORBA2.3
- // specification, which will include reference counting for
- // servants.
// = The TAO_EC_Filter methods, only push() is implemented...
virtual int filter (const RtecEventComm::EventSet& event,
@@ -149,13 +142,16 @@ public:
virtual CORBA::ULong max_event_size (void) const;
virtual int can_match (const RtecEventComm::EventHeader &header) const;
+ // = Servant reference counting methods.
+ virtual void _add_ref (CORBA_Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
+ virtual void _remove_ref (CORBA_Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
+
private:
CORBA::Boolean is_connected_i (void) const;
// The private version (without locking) of is_connected().
- PortableServer::POA_ptr _default_POA_i ();
- // The private version (without locking) of _default_POA_i ().
-
private:
TAO_EC_Event_Channel* event_channel_;
// The Event Channel that owns this object.
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
index 1325a900c63..6f7ed8f6069 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.cpp
@@ -14,19 +14,14 @@ ACE_RCSID(Event, EC_SupplierAdmin, "$Id$")
TAO_EC_SupplierAdmin::TAO_EC_SupplierAdmin (TAO_EC_Event_Channel *ec)
: event_channel_ (ec)
{
+ this->default_POA_ =
+ this->event_channel_->supplier_poa ();
}
TAO_EC_SupplierAdmin::~TAO_EC_SupplierAdmin (void)
{
}
-void
-TAO_EC_SupplierAdmin::set_default_POA (PortableServer::POA_ptr poa)
-{
- this->default_POA_ =
- PortableServer::POA::_duplicate (poa);
-}
-
PortableServer::POA_ptr
TAO_EC_SupplierAdmin::_default_POA (CORBA::Environment&)
{
@@ -87,10 +82,6 @@ TAO_EC_SupplierAdmin::obtain_push_consumer (CORBA::Environment &ACE_TRY_ENV)
TAO_EC_ProxyPushConsumer* consumer =
this->event_channel_->create_proxy_push_consumer ();
- PortableServer::POA_var poa =
- this->event_channel_->consumer_poa (ACE_TRY_ENV);
- consumer->set_default_POA (poa.in ());
-
return consumer->_this (ACE_TRY_ENV);
}
diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h
index 7394c2326e6..26499991a76 100644
--- a/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h
+++ b/TAO/orbsvcs/orbsvcs/Event/EC_SupplierAdmin.h
@@ -63,9 +63,6 @@ public:
virtual ~TAO_EC_SupplierAdmin (void);
// destructor...
- void set_default_POA (PortableServer::POA_ptr poa);
- // Set this servant's default POA
-
virtual PortableServer::POA_ptr _default_POA (CORBA::Environment& env);
// Override the ServantBase method.
diff --git a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp
index a48d66aa66a..c32a9280a30 100644
--- a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp
+++ b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp
@@ -1150,8 +1150,9 @@ ACE_ES_Consumer_Module::shutdown_request (ACE_ES_Dispatch_Request *request)
poa->deactivate_object (id.in (), TAO_TRY_ENV);
TAO_CHECK_ENV;
- // Delete the consumer proxy.
- delete sc->consumer ();
+ // Delete the consumer proxy, no need to delete it, is is owned
+ // by the POA
+ // delete sc->consumer ();
if (!dont_update)
this->channel_->update_consumer_gwys (TAO_TRY_ENV);
@@ -1229,7 +1230,8 @@ ACE_ES_Consumer_Module::shutdown (void)
ACE_ERROR ((LM_ERROR, "%p Failed to remove consumer.\n", "ACE_ES_Consumer_Module::shutdown"));
}
- delete *proxy;
+ // No need to delete it, owned by the POA
+ // delete *proxy;
}
}
@@ -1323,8 +1325,11 @@ ACE_ES_Consumer_Module::push (const ACE_ES_Dispatch_Request *request,
}
RtecEventChannelAdmin::ProxyPushSupplier_ptr
-ACE_ES_Consumer_Module::obtain_push_supplier (CORBA::Environment &TAO_IN_ENV)
+ACE_ES_Consumer_Module::obtain_push_supplier (CORBA::Environment &ACE_TRY_ENV)
{
+ RtecEventChannelAdmin::ProxyPushSupplier_ptr proxy =
+ RtecEventChannelAdmin::ProxyPushSupplier::_nil ();
+
auto_ptr<ACE_Push_Consumer_Proxy> new_consumer (new ACE_Push_Consumer_Proxy (this));
// Get a new supplier proxy object.
@@ -1332,20 +1337,25 @@ ACE_ES_Consumer_Module::obtain_push_supplier (CORBA::Environment &TAO_IN_ENV)
{
ACE_ERROR ((LM_ERROR, "ACE_EventChannel"
"::obtain_push_supplier failed.\n"));
- TAO_THROW_RETURN (CORBA::NO_MEMORY (), 0);
+ TAO_THROW_RETURN (CORBA::NO_MEMORY (), proxy);
}
{
- TAO_GUARD_THROW_RETURN (ACE_ES_MUTEX, ace_mon, this->lock_, 0, TAO_IN_ENV,
- RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_GUARD_THROW_EX (ACE_ES_MUTEX, ace_mon, this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_CHECK_RETURN (proxy);
if (all_consumers_.insert (new_consumer.get ()) == -1)
ACE_ERROR ((LM_ERROR, "ACE_ES_Consumer_Module insert failed.\n"));
}
- // Return the CORBA object reference to the new supplier proxy,
- // there is no need to hold a pointer, it is now help in the map...
- return new_consumer.release ()->get_ref (TAO_IN_ENV);
+ proxy = new_consumer->_this (ACE_TRY_ENV);
+ TAO_CHECK_RETURN (proxy);
+
+ // Give away ownership to the POA....
+ new_consumer.release ()->_remove_ref ();
+
+ return proxy;
}
void
@@ -3194,22 +3204,32 @@ ACE_ES_Supplier_Module::shutdown (void)
}
RtecEventChannelAdmin::ProxyPushConsumer_ptr
-ACE_ES_Supplier_Module::obtain_push_consumer (CORBA::Environment &TAO_IN_ENV)
+ACE_ES_Supplier_Module::obtain_push_consumer (CORBA::Environment &ACE_TRY_ENV)
{
+ RtecEventChannelAdmin::ProxyPushConsumer_ptr proxy =
+ RtecEventChannelAdmin::ProxyPushConsumer::_nil ();
+
auto_ptr<ACE_Push_Supplier_Proxy> new_supplier (new ACE_Push_Supplier_Proxy (this));
if (new_supplier.get () == 0)
- TAO_THROW_RETURN (CORBA::NO_MEMORY (), 0);
+ ACE_THROW_RETURN (CORBA::NO_MEMORY (), proxy);
{
- TAO_GUARD_THROW_RETURN (ACE_ES_MUTEX, ace_mon, this->lock_, 0, TAO_IN_ENV,
- RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_GUARD_THROW_EX (ACE_ES_MUTEX, ace_mon, this->lock_,
+ RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR());
+ ACE_CHECK_RETURN (proxy);
if (all_suppliers_.insert (new_supplier.get ()) == -1)
ACE_ERROR ((LM_ERROR, "ACE_ES_Supplier_Module insert failed.\n"));
}
- return new_supplier.release ()->get_ref (TAO_IN_ENV);
+ proxy = new_supplier->_this (ACE_TRY_ENV);
+ ACE_CHECK_RETURN (proxy);
+
+ // Give ownership to the POA
+ new_supplier.release ()->_remove_ref ();
+
+ return proxy;
}
void
diff --git a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h
index 7859e667756..7a45d3c4d33 100644
--- a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h
+++ b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h
@@ -1244,7 +1244,8 @@ class ACE_EventChannel;
// = Event Channel interfaces.
-class TAO_ORBSVCS_Export ACE_Push_Supplier_Proxy : public POA_RtecEventChannelAdmin::ProxyPushConsumer
+class TAO_ORBSVCS_Export ACE_Push_Supplier_Proxy : public POA_RtecEventChannelAdmin::ProxyPushConsumer, public PortableServer::RefCountServantBase
+//
// = TITLE
// Push Supplier Proxy.
//
@@ -1278,9 +1279,6 @@ public:
// = Operations for the Event Channel.
- RtecEventChannelAdmin::ProxyPushConsumer_ptr get_ref (CORBA::Environment &);
- // Allow transformations to RtecEventChannelAdmin::ProxyPushConsumer.
-
int connected (void);
// Returns 1 if the proxy has been connected to a "remote" client.
@@ -1323,7 +1321,8 @@ private:
// ************************************************************
-class TAO_ORBSVCS_Export ACE_Push_Consumer_Proxy : public POA_RtecEventChannelAdmin::ProxyPushSupplier
+class TAO_ORBSVCS_Export ACE_Push_Consumer_Proxy : public POA_RtecEventChannelAdmin::ProxyPushSupplier, public PortableServer::RefCountServantBase
+//
// = TITLE
// Push Consumer Proxy.
//
@@ -1369,9 +1368,6 @@ public:
void shutdown (void);
// Actively disconnect from the consumer.
- RtecEventChannelAdmin::ProxyPushSupplier_ptr get_ref (CORBA::Environment &);
- // Allow transformations to RtecEventChannelAdmin::ProxyPushSupplier.
-
ACE_ES_Consumer_Correlation &correlation (void);
// Access the consumer-specific Consumer_Correlation.
diff --git a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.i b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.i
index 2a597943068..95618c081de 100644
--- a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.i
+++ b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.i
@@ -11,12 +11,6 @@ const unsigned int ACE_INT2BIT[32] =
// **************************************************
-ACE_INLINE RtecEventChannelAdmin::ProxyPushConsumer_ptr
-ACE_Push_Supplier_Proxy::get_ref (CORBA::Environment &env)
-{
- return this->_this (env);
-}
-
ACE_INLINE int
ACE_Push_Supplier_Proxy::connected (void)
{
@@ -56,12 +50,6 @@ ACE_Push_Supplier_Proxy::qos (void) const
// **************************************************
-ACE_INLINE RtecEventChannelAdmin::ProxyPushSupplier_ptr
-ACE_Push_Consumer_Proxy::get_ref (CORBA::Environment &env)
-{
- return this->_this (env);
-}
-
ACE_INLINE RtecEventChannelAdmin::ConsumerQOS &
ACE_Push_Consumer_Proxy::qos (void)
{
diff --git a/TAO/tao/Context.cpp b/TAO/tao/Context.cpp
index 695d2054526..a0eb6176a43 100644
--- a/TAO/tao/Context.cpp
+++ b/TAO/tao/Context.cpp
@@ -1,10 +1,10 @@
// $Id$
+#include "tao/Context.h"
#include "tao/Typecode.h"
#include "tao/Environment.h"
#include "tao/NVList.h"
#include "tao/ORB.h"
-#include "tao/Context.h"
#if !defined (__ACE_INLINE__)
# include "tao/Context.i"
diff --git a/TAO/tao/Context.h b/TAO/tao/Context.h
index 316374c3b15..4647dc45ef0 100644
--- a/TAO/tao/Context.h
+++ b/TAO/tao/Context.h
@@ -52,39 +52,39 @@ public:
// a CORBA::NO_IMPLEMENT exception and do nothing else.
const char *context_name (
- CORBA::Environment &ACE_TRY_ENV =
- CORBA::Environment::default_environment ()
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::default_environment ()
) const;
CORBA_Context_ptr parent (
- CORBA::Environment &ACE_TRY_ENV =
- CORBA::Environment::default_environment ()
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::default_environment ()
) const;
- void create_child (const char *child_ctx_name,
+ void create_child (const char *child_ctx_name,
CORBA_Context_out child_ctx,
- CORBA::Environment &ACE_TRY_ENV =
- CORBA::Environment::default_environment ());
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
- void set_one_value (const char *propname,
+ void set_one_value (const char *propname,
const CORBA_Any &propvalue,
- CORBA::Environment &ACE_TRY_ENV =
- CORBA::Environment::default_environment ());
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
void set_values (CORBA::NVList_ptr values,
- CORBA::Environment &ACE_TRY_ENV =
- CORBA::Environment::default_environment ());
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
void delete_values (const char *propname,
- CORBA::Environment &ACE_TRY_ENV =
- CORBA::Environment::default_environment ());
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
void get_values (const char *start_scope,
CORBA::Flags op_flags,
const char *pattern,
CORBA::NVList_ptr &values,
- CORBA::Environment &ACE_TRY_ENV =
- CORBA::Environment::default_environment ());
+ CORBA::Environment &ACE_TRY_ENV =
+ CORBA::default_environment ());
#if !defined(__GNUC__) || __GNUC__ > 2 || __GNUC_MINOR__ >= 8
typedef CORBA_Context_ptr _ptr_type;
@@ -202,13 +202,13 @@ public:
void add_consume (char *ctx);
// add and consume a string to the list
- char *item (CORBA::ULong index,
- CORBA_Environment &ACE_TRY_ENV =
+ char *item (CORBA::ULong index,
+ CORBA_Environment &ACE_TRY_ENV =
CORBA::default_environment ());
// return the typecode at index i. Raises the "Bounds" exception
- void remove (CORBA::ULong index,
- CORBA_Environment &ACE_TRY_ENV =
+ void remove (CORBA::ULong index,
+ CORBA_Environment &ACE_TRY_ENV =
CORBA::default_environment ());
// remove the typecode at index i. Raises the "Bounds" exception
diff --git a/TAO/tao/IOR_LookupTable.cpp b/TAO/tao/IOR_LookupTable.cpp
index 728dc0cfe0f..5ed31afa4b0 100644
--- a/TAO/tao/IOR_LookupTable.cpp
+++ b/TAO/tao/IOR_LookupTable.cpp
@@ -1,6 +1,7 @@
// $Id$
-#include "IOR_LookupTable.h"
+#include "tao/IOR_LookupTable.h"
+#include "tao/debug.h"
ACE_RCSID(tao, IOR_TableLookup, "$Id$")
@@ -32,20 +33,23 @@ TAO_IOR_LookupTable::add_ior (ACE_CString &object_name,
switch (this->hash_map_.bind (object_name, ior))
{
case 1 : // object name already exists in the table.
- ACE_DEBUG ((LM_DEBUG,
- "Object Name already exists in the table\n"));
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) Object Name already exists in the IOR table\n"));
return 1;
case -1 : // Failure.
- ACE_ERROR_RETURN ((LM_ERROR,
- "Unable to bind in IOR_LookupTable::add_ior ()"),
- -1);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) Unable to bind in IOR tao\n"));
+ return -1;
}
- ACE_DEBUG ((LM_DEBUG,
- "\n%s:%s Added to the IOR table\n",
- object_name.c_str (),
- ior.c_str ()));
-
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) IOR Table: <%s> -> <%s>\n",
+ object_name.c_str (),
+ ior.c_str ()));
+
return 0;
}
@@ -57,6 +61,11 @@ TAO_IOR_LookupTable::find_ior (ACE_CString &object_name,
// returns 0 on success.
// -1 on failure.
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) IOR Table find <%s>\n",
+ object_name.c_str ()));
+
return this->hash_map_.find (object_name, ior);
}
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index 9a597148566..ad39de0bbdf 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -1478,6 +1478,10 @@ CORBA::Object_ptr
CORBA_ORB::iioploc_string_to_object (const char *string,
CORBA::Environment &env)
{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - iioploc_string_to_object <%s>\n",
+ string));
CORBA::Object_ptr obj = CORBA::Object::_nil ();
// NIL objref encodes as just "iioploc:" ... which has already been
@@ -1725,6 +1729,10 @@ int
CORBA_ORB::_tao_find_in_IOR_table (ACE_CString &object_id,
CORBA::Object_ptr &obj)
{
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "TAO (%P|%t): lookup service ID <%s>\n",
+ object_id.c_str ()));
+
ACE_CString ior;
if (this->lookup_table_.find_ior (object_id, ior) != 0)