summaryrefslogtreecommitdiff
path: root/TAO/examples/Content_Server/AMI_Observer/Callback_Handler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/Content_Server/AMI_Observer/Callback_Handler.cpp')
-rw-r--r--TAO/examples/Content_Server/AMI_Observer/Callback_Handler.cpp61
1 files changed, 23 insertions, 38 deletions
diff --git a/TAO/examples/Content_Server/AMI_Observer/Callback_Handler.cpp b/TAO/examples/Content_Server/AMI_Observer/Callback_Handler.cpp
index 832e96b6732..1fd4ed054b7 100644
--- a/TAO/examples/Content_Server/AMI_Observer/Callback_Handler.cpp
+++ b/TAO/examples/Content_Server/AMI_Observer/Callback_Handler.cpp
@@ -28,13 +28,12 @@ Callback_Handler::~Callback_Handler (void)
}
void
-Callback_Handler::next_chunk (ACE_ENV_SINGLE_ARG_DECL)
+Callback_Handler::next_chunk (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (this->last_chunk_ == 1)
{
- this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ this->deactivate ();
return;
}
@@ -44,7 +43,7 @@ Callback_Handler::next_chunk (ACE_ENV_SINGLE_ARG_DECL)
Web_Server::Chunk_Type::allocbuf (BUFSIZ);
if (buf == 0)
- ACE_THROW (CORBA::NO_MEMORY ());
+ throw CORBA::NO_MEMORY ();
ssize_t bytes_read = this->file_io_.recv (buf,
BUFSIZ);
@@ -52,7 +51,7 @@ Callback_Handler::next_chunk (ACE_ENV_SINGLE_ARG_DECL)
{
Web_Server::Chunk_Type::freebuf (buf);
- ACE_THROW (CORBA::INTERNAL ());
+ throw CORBA::INTERNAL ();
}
else if (bytes_read == 0)
{
@@ -79,59 +78,49 @@ Callback_Handler::next_chunk (ACE_ENV_SINGLE_ARG_DECL)
this->callback_->sendc_next_chunk (this->ami_handler_.in (),
this->chunk_.in (),
- this->last_chunk_
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ this->last_chunk_);
}
void
Callback_Handler::next_chunk_excep
- (::Messaging::ExceptionHolder *excep_holder
- ACE_ENV_ARG_DECL_NOT_USED)
+ (::Messaging::ExceptionHolder *excep_holder)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->last_chunk_ = 1;
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
- this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->deactivate ();
- excep_holder->raise_exception (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ excep_holder->raise_exception ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("Exception occured during ")
- ACE_TEXT ("sendc_next_chunk() call:"));
+ ex._tao_print_exception (
+ ACE_TEXT ("Exception occured during ")
+ ACE_TEXT ("sendc_next_chunk() call:"));
}
- ACE_ENDTRY;
}
void
-Callback_Handler::run (ACE_ENV_SINGLE_ARG_DECL)
+Callback_Handler::run (void)
ACE_THROW_SPEC ((CORBA::SystemException,
Web_Server::Error_Result))
{
// Open the file to be downloaded
- this->open_file (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ this->open_file ();
// Activate this Reply Handler.
- this->ami_handler_ = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ this->ami_handler_ = this->_this ();
// Begin the asynchronous invocation. Note that the AMI
// "sendc_next_chunk()" call is done within the following call,
// since data must first be read into the Chunk.
- this->next_chunk (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ this->next_chunk ();
}
void
-Callback_Handler::open_file (ACE_ENV_SINGLE_ARG_DECL)
+Callback_Handler::open_file (void)
ACE_THROW_SPEC ((CORBA::SystemException,
Web_Server::Error_Result))
{
@@ -145,27 +134,23 @@ Callback_Handler::open_file (ACE_ENV_SINGLE_ARG_DECL)
0,
O_RDONLY) == -1)
// HTTP 1.1 "Not Found"
- ACE_THROW (Web_Server::Error_Result (404));
+ throw Web_Server::Error_Result (404);
}
void
-Callback_Handler::deactivate (ACE_ENV_SINGLE_ARG_DECL)
+Callback_Handler::deactivate (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
// Close the file that was sent to the client.
(void) this->file_io_.close ();
// Get the POA used when activating the Reply Handler object.
- PortableServer::POA_var poa = this->_default_POA (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ PortableServer::POA_var poa = this->_default_POA ();
// Get the object ID associated with this servant.
PortableServer::ObjectId_var oid =
- poa->servant_to_id (this
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ poa->servant_to_id (this);
// Now deactivate the AMI_CallbackHandler object.
- poa->deactivate_object (oid.in () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ poa->deactivate_object (oid.in ());
}