summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp203
1 files changed, 84 insertions, 119 deletions
diff --git a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
index c7676adf1c7..c42a41a5603 100644
--- a/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
+++ b/TAO/orbsvcs/orbsvcs/AV/Endpoint_Strategy_T.cpp
@@ -28,37 +28,31 @@ template <class T_StreamEndpoint, class T_VDev, class T_MediaCtrl>
TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::~TAO_AV_Endpoint_Reactive_Strategy (void)
{
// Do not allow exceptions to escape from the destructor
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
if(this->stream_endpoint_a_servant_ )
{
- stream_endpoint_a_servant_->_remove_ref (
- ACE_ENV_SINGLE_ARG_PARAMETER);
+ stream_endpoint_a_servant_->_remove_ref ();
}
if(this->stream_endpoint_b_servant_)
{
- stream_endpoint_b_servant_->_remove_ref (
- ACE_ENV_SINGLE_ARG_PARAMETER);
+ stream_endpoint_b_servant_->_remove_ref ();
}
if(this->vdev_servant_)
{
- vdev_servant_->_remove_ref (
- ACE_ENV_SINGLE_ARG_PARAMETER);
+ vdev_servant_->_remove_ref ();
}
if(this->media_ctrl_servant_)
{
- media_ctrl_servant_->_remove_ref (
- ACE_ENV_SINGLE_ARG_PARAMETER);
+ media_ctrl_servant_->_remove_ref ();
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
}
- ACE_ENDTRY;
}
@@ -67,8 +61,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate (void)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
this->activate_stream_endpoint ();
if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated stream_endpoint\n"));
@@ -79,31 +72,28 @@ TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activ
this->activate_mediactrl ();
if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activated mediactrl\n"));
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Endpoint_Reactive_Strategy::activate");
+ ex._tao_print_exception (
+ "TAO_Endpoint_Reactive_Strategy::activate");
return -1;
}
- ACE_ENDTRY;
return 0;
}
template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
char *
-TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant ACE_ENV_ARG_DECL)
+TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant)
{
PortableServer::ObjectId_var id =
- this->poa_->activate_object (servant
- ACE_ENV_ARG_PARAMETER);
+ this->poa_->activate_object (servant);
CORBA::Object_var obj =
- this->poa_->id_to_reference (id.in ()
- ACE_ENV_ARG_PARAMETER);
+ this->poa_->id_to_reference (id.in ());
CORBA::String_var str =
- this->orb_->object_to_string (obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ this->orb_->object_to_string (obj.in ());
return str._retn ();
}
@@ -114,7 +104,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_vdev (void)
{
- ACE_TRY
+ try
{
// Bridge pattern. Allow subclasses to override this behavior
T_VDev *vdev = 0;
@@ -123,19 +113,19 @@ TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activ
// Activate the object under the root poa.
// CORBA::String_var vdev_ior = this->activate_with_poa (vdev,
-// ACE_ENV_ARG_PARAMETER);
+//);
// if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Endpoint_Reactive_Strategy::activate_vdev, vdev ior is:%s\n",
// vdev_ior. in ()));
// Save the object reference, so that create_A can return it
this->vdev_ = vdev->_this ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy::activate_vdev");
+ ex._tao_print_exception (
+ "TAO_AV_Endpoint_Reactive_Strategy::activate_vdev");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -145,7 +135,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_mediactrl (void)
{
- ACE_TRY
+ try
{
// Bridge pattern. Subclasses can override this
if (this->make_mediactrl ( media_ctrl_servant_ ) == -1)
@@ -160,16 +150,15 @@ TAO_AV_Endpoint_Reactive_Strategy <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activ
this->vdev_->define_property ("Related_MediaCtrl",
- anyval
- ACE_ENV_ARG_PARAMETER);
+ anyval);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy::activate_mediactrl");
+ ex._tao_print_exception (
+ "TAO_AV_Endpoint_Reactive_Strategy::activate_mediactrl");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -242,7 +231,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Endpoint_Reactive_Strategy_A<T_StreamEndpoint, T_VDev, T_MediaCtrl>::create_A (AVStreams::StreamEndPoint_A_ptr &stream_endpoint,
AVStreams::VDev_ptr &vdev
- ACE_ENV_ARG_DECL_NOT_USED/* ACE_ENV_SINGLE_ARG_PARAMETER */)
+/* ACE_ENV_SINGLE_ARG_PARAMETER */)
{
if (this->activate () == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -260,7 +249,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_stream_endpoint (void)
{
- ACE_TRY
+ try
{
// Use the bridge method
@@ -270,12 +259,12 @@ TAO_AV_Endpoint_Reactive_Strategy_A <T_StreamEndpoint, T_VDev, T_MediaCtrl>::act
// Save the object references, so that create_a can return them
this->stream_endpoint_a_ = this->stream_endpoint_a_servant_->_this ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy_A::activate_stream_endpoint");
+ ex._tao_print_exception (
+ "TAO_AV_Endpoint_Reactive_Strategy_A::activate_stream_endpoint");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -311,19 +300,19 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Endpoint_Reactive_Strategy_B <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_stream_endpoint (void)
{
- ACE_TRY
+ try
{
if (this->make_stream_endpoint ( this->stream_endpoint_b_servant_ ) == -1)
return -1;
this->stream_endpoint_b_ = this->stream_endpoint_b_servant_->_this ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Endpoint_Reactive_Strategy_B::activate_stream_endpoint");
+ ex._tao_print_exception (
+ "TAO_AV_Endpoint_Reactive_Strategy_B::activate_stream_endpoint");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -332,7 +321,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Endpoint_Reactive_Strategy_B<T_StreamEndpoint, T_VDev, T_MediaCtrl>::create_B (AVStreams::StreamEndPoint_B_ptr &stream_endpoint,
AVStreams::VDev_ptr &vdev
- ACE_ENV_ARG_DECL_NOT_USED/* ACE_ENV_SINGLE_ARG_PARAMETER */)
+/* ACE_ENV_SINGLE_ARG_PARAMETER */)
{
if (this->activate () == -1)
ACE_ERROR_RETURN ((LM_ERROR,
@@ -370,8 +359,7 @@ TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::init (int argc,
CORBA::ORB_ptr orb,
PortableServer::POA_ptr poa)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
this->orb_ = orb;
@@ -379,8 +367,7 @@ TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::init (int argc,
// create the objects and activate them in the poa
this->activate_objects (argc,
- argv
- ACE_ENV_ARG_PARAMETER);
+ argv);
// Get ourselves a naming_service object reference
this->bind_to_naming_service ();
@@ -391,12 +378,11 @@ TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::init (int argc,
// register the stream_endpoing with the naming_service
this->register_stream_endpoint ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Child_Process");
+ ex._tao_print_exception ("TAO_Child_Process");
return -1;
}
- ACE_ENDTRY;
// release the semaphore the parent is waiting on
if (this->release_semaphore () == -1)
@@ -409,21 +395,17 @@ TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::init (int argc,
template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
char *
-TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant
- ACE_ENV_ARG_DECL)
+TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa (PortableServer::Servant servant)
{
PortableServer::ObjectId_var id =
- this->poa_->activate_object (servant
- ACE_ENV_ARG_PARAMETER);
+ this->poa_->activate_object (servant);
CORBA::Object_var obj =
- this->poa_->id_to_reference (id.in ()
- ACE_ENV_ARG_PARAMETER);
+ this->poa_->id_to_reference (id.in ());
CORBA::String_var str =
- this->orb_->object_to_string (obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ this->orb_->object_to_string (obj.in ());
return str._retn ();
}
@@ -432,10 +414,9 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_with_poa
template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_objects (int /*argc*/,
- char ** /*argv*/
- ACE_ENV_ARG_DECL)
+ char ** /*argv*/)
{
- ACE_TRY
+ try
{
// bridge method to make a new stream endpoint
if (this->make_stream_endpoint (this->stream_endpoint_) == -1)
@@ -450,31 +431,27 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::activate_objects
return -1;
// activate the stream_endpoint
- CORBA::String_var stream_endpoint_ior = this->activate_with_poa (this->stream_endpoint_
- ACE_ENV_ARG_PARAMETER);
+ CORBA::String_var stream_endpoint_ior = this->activate_with_poa (this->stream_endpoint_);
if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
"(%P|%t)TAO_AV_Child_Process::activate_objects,stream_endpoint_ior :%s\n",
stream_endpoint_ior.in ()));
// activate the vdev
- CORBA::String_var vdev_ior = this->activate_with_poa (this->vdev_
- ACE_ENV_ARG_PARAMETER);
+ CORBA::String_var vdev_ior = this->activate_with_poa (this->vdev_);
if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,
"(%P|%t)TAO_AV_Child_Process::activate_objects, vdev ior is :%s\n",
vdev_ior.in ()));
// activate the media controller
- CORBA::String_var media_ctrl_ior = this->activate_with_poa (this->media_ctrl_
- ACE_ENV_ARG_PARAMETER);
+ CORBA::String_var media_ctrl_ior = this->activate_with_poa (this->media_ctrl_);
if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG,"(%P|%t)TAO_AV_Child_Process::activate_objects,media_ctrl_ior is: %s\n",media_ctrl_ior.in ()));
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::init ");
+ ex._tao_print_exception ("TAO_AV_Child_Process::init ");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -483,25 +460,24 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::bind_to_naming_service (void)
{
- ACE_TRY
+ try
{
CORBA::Object_var naming_obj =
- this->orb_->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER);
+ this->orb_->resolve_initial_references ("NameService");
if (CORBA::is_nil (naming_obj.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
" (%P|%t) Unable to resolve the Name Service.\n"),
-1);
// if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) %s:%d\n", __FILE__, __LINE__));
this->naming_context_ =
- CosNaming::NamingContext::_narrow (naming_obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ CosNaming::NamingContext::_narrow (naming_obj.in ());
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::bind_to_naming_service");
+ ex._tao_print_exception (
+ "TAO_AV_Child_Process::bind_to_naming_service");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -510,7 +486,7 @@ template <class T_StreamEndpoint, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (void)
{
- ACE_TRY
+ try
{
char vdev_name [BUFSIZ];
ACE_OS::sprintf (vdev_name,
@@ -530,40 +506,36 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_vdev (vo
this->media_ctrl_->_this ();
this->vdev_->define_property ("Related_MediaCtrl",
- media_ctrl_obj_.in()
- ACE_ENV_ARG_PARAMETER);
+ media_ctrl_obj_.in());
vdev_obj_ = this->vdev_->_this ();
- ACE_TRY_EX (bind)
+ try
{
// Register the vdev with the naming server.
this->naming_context_->bind (this->vdev_name_,
- vdev_obj_.in()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK_EX (bind);
+ vdev_obj_.in());
}
- ACE_CATCH (CosNaming::NamingContext::AlreadyBound,ex)
+ catch (const CosNaming::NamingContext::AlreadyBound& )
{
// If the object was already there, replace the older reference
// with this one
this->naming_context_->rebind (this->vdev_name_,
- vdev_obj_.in()
- ACE_ENV_ARG_PARAMETER);
+ vdev_obj_.in());
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::register_vdev");
+ ex._tao_print_exception (
+ "TAO_AV_Child_Process::register_vdev");
return -1;
}
- ACE_ENDTRY;
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_AV_Child_Process::register_vdev");
+ ex._tao_print_exception (
+ "TAO_AV_Child_Process::register_vdev");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -572,17 +544,15 @@ template <class T_StreamEndpoint_B, class T_VDev , class T_MediaCtrl>
int
TAO_AV_Child_Process <T_StreamEndpoint_B, T_VDev, T_MediaCtrl>::run (ACE_Time_Value *tv)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
- this->orb_->run (tv ACE_ENV_ARG_PARAMETER);
+ this->orb_->run (tv);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"orb.run ()");
+ ex._tao_print_exception ("orb.run ()");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -625,7 +595,7 @@ int
TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_stream_endpoint (void)
{
CORBA::Object_ptr stream_endpoint_obj = CORBA::Object::_nil ();
- ACE_TRY
+ try
{
stream_endpoint_obj = this->stream_endpoint_->_this ();
@@ -633,22 +603,20 @@ TAO_AV_Child_Process <T_StreamEndpoint, T_VDev, T_MediaCtrl>::register_stream_e
// subclasses can define their own name for the streamendpoint
// Register the stream endpoint object with the naming server.
this->naming_context_->bind (this->stream_endpoint_name_,
- stream_endpoint_obj
- ACE_ENV_ARG_PARAMETER);
+ stream_endpoint_obj);
}
- ACE_CATCH (CosNaming::NamingContext::AlreadyBound,ex)
+ catch (const CosNaming::NamingContext::AlreadyBound& )
{
// if the name was already there, replace the reference with the new one
this->naming_context_->rebind (this->stream_endpoint_name_,
- stream_endpoint_obj
- ACE_ENV_ARG_PARAMETER);
+ stream_endpoint_obj);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Endpoint_Reactive_Strategy::activate");
+ ex._tao_print_exception (
+ "TAO_Endpoint_Reactive_Strategy::activate");
return -1;
}
- ACE_ENDTRY;
return 0;
}
@@ -692,23 +660,20 @@ int
TAO_AV_Child_Process<T_StreamEndpoint, T_VDev, T_MediaCtrl>::unbind_names (void)
{
// Remove the names from the naming service
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
if (CORBA::is_nil (this->naming_context_.in ()) == 0)
return 0;
- this->naming_context_->unbind (this->stream_endpoint_name_
- ACE_ENV_ARG_PARAMETER);
+ this->naming_context_->unbind (this->stream_endpoint_name_);
- this->naming_context_->unbind (this->vdev_name_
- ACE_ENV_ARG_PARAMETER);
+ this->naming_context_->unbind (this->vdev_name_);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"TAO_Endpoint_Process_Strategy::activate");
+ ex._tao_print_exception (
+ "TAO_Endpoint_Process_Strategy::activate");
return -1;
}
- ACE_ENDTRY;
return 0;
}