summaryrefslogtreecommitdiff
path: root/TAO/examples/POA/Default_Servant
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/POA/Default_Servant')
-rw-r--r--TAO/examples/POA/Default_Servant/File_i.cpp46
-rw-r--r--TAO/examples/POA/Default_Servant/File_i.h16
-rw-r--r--TAO/examples/POA/Default_Servant/client.cpp18
-rw-r--r--TAO/examples/POA/Default_Servant/server.cpp34
4 files changed, 57 insertions, 57 deletions
diff --git a/TAO/examples/POA/Default_Servant/File_i.cpp b/TAO/examples/POA/Default_Servant/File_i.cpp
index a80188bd406..4cda27db3ba 100644
--- a/TAO/examples/POA/Default_Servant/File_i.cpp
+++ b/TAO/examples/POA/Default_Servant/File_i.cpp
@@ -24,9 +24,9 @@ FileImpl::System::System (PortableServer::POA_ptr poa)
// Create the Default Descriptor Servant
fd_servant_ (poa)
{
- TAO_ENV_DECLARE_NEW_ENV;
+ ACE_DECLARE_NEW_CORBA_ENV;
// set the default servant of the POA
- poa->set_servant (&this->fd_servant_ TAO_ENV_ARG_PARAMETER);
+ poa->set_servant (&this->fd_servant_ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
@@ -35,7 +35,7 @@ FileImpl::System::~System (void)
}
PortableServer::POA_ptr
-FileImpl::System::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
+FileImpl::System::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
{
return PortableServer::POA::_duplicate (this->poa_.in ());
}
@@ -43,7 +43,7 @@ FileImpl::System::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
File::Descriptor_ptr
FileImpl::System::open (const char *file_name,
CORBA::Long flags
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
File::IOError))
{
@@ -73,12 +73,12 @@ FileImpl::System::open (const char *file_name,
CORBA::Object_var obj =
this->poa_->create_reference_with_id (oid.in (),
"IDL:File/Descriptor:1.0"
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (File::Descriptor::_nil ());
// Narrow the object reference to a File Descriptor
File::Descriptor_var fd =
- File::Descriptor::_narrow (obj.in () TAO_ENV_ARG_PARAMETER);
+ File::Descriptor::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (File::Descriptor::_nil ());
@@ -96,26 +96,26 @@ FileImpl::Descriptor::~Descriptor (void)
}
PortableServer::POA_ptr
-FileImpl::Descriptor::_default_POA (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
+FileImpl::Descriptor::_default_POA (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
{
return PortableServer::POA::_duplicate (this->poa_.in ());
}
//Extracts the ACE_HANDLE from the passed object reference
ACE_HANDLE
-FileImpl::Descriptor::fd (TAO_ENV_SINGLE_ARG_DECL)
+FileImpl::Descriptor::fd (ACE_ENV_SINGLE_ARG_DECL)
{
//
// One way of getting our id.
//
// Get a reference to myself
- File::Descriptor_var me = this->_this (TAO_ENV_SINGLE_ARG_PARAMETER);
+ File::Descriptor_var me = this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (ACE_INVALID_HANDLE);
// Get the ObjectId from the reference
PortableServer::ObjectId_var oid1 =
- this->poa_->reference_to_id (me.in () TAO_ENV_ARG_PARAMETER);
+ this->poa_->reference_to_id (me.in () ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (ACE_INVALID_HANDLE);
//
@@ -123,7 +123,7 @@ FileImpl::Descriptor::fd (TAO_ENV_SINGLE_ARG_DECL)
//
PortableServer::ObjectId_var oid2 =
- this->poa_->servant_to_id (this TAO_ENV_ARG_PARAMETER);
+ this->poa_->servant_to_id (this ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (ACE_INVALID_HANDLE);
//
@@ -131,23 +131,23 @@ FileImpl::Descriptor::fd (TAO_ENV_SINGLE_ARG_DECL)
//
int argc = 0;
- CORBA::ORB_var orb = CORBA::ORB_init (argc, 0, 0 TAO_ENV_ARG_PARAMETER);
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, 0, 0 ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (ACE_INVALID_HANDLE);
// Get the POA Current object reference
CORBA::Object_var obj =
orb->resolve_initial_references ("POACurrent"
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (ACE_INVALID_HANDLE);
// Narrow the object reference to a POA Current reference
PortableServer::Current_var poa_current =
PortableServer::Current::_narrow (obj.in ()
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (ACE_INVALID_HANDLE);
PortableServer::ObjectId_var oid3 =
- poa_current->get_object_id (TAO_ENV_SINGLE_ARG_PARAMETER);
+ poa_current->get_object_id (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (ACE_INVALID_HANDLE);
ACE_ASSERT (oid1.in () == oid2.in ());
@@ -163,11 +163,11 @@ FileImpl::Descriptor::fd (TAO_ENV_SINGLE_ARG_DECL)
CORBA::Long
FileImpl::Descriptor::write (const File::Descriptor::DataBuffer &buffer
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
File::IOError))
{
- ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER);
+ ACE_HANDLE file_descriptor = this->fd (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
const CORBA::Octet *data = &buffer[0];
@@ -183,11 +183,11 @@ FileImpl::Descriptor::write (const File::Descriptor::DataBuffer &buffer
File::Descriptor::DataBuffer *
FileImpl::Descriptor::read (CORBA::Long num_bytes
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
File::IOError))
{
- ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER);
+ ACE_HANDLE file_descriptor = this->fd (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
CORBA::Octet *buffer = File::Descriptor::DataBuffer::allocbuf (num_bytes);
@@ -206,11 +206,11 @@ FileImpl::Descriptor::read (CORBA::Long num_bytes
CORBA::ULong
FileImpl::Descriptor::lseek (CORBA::ULong offset,
CORBA::Long whence
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
File::IOError))
{
- ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER);
+ ACE_HANDLE file_descriptor = this->fd (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (0);
CORBA::Long result = (CORBA::Long) ACE_OS::lseek (file_descriptor,
@@ -223,11 +223,11 @@ FileImpl::Descriptor::lseek (CORBA::ULong offset,
}
void
-FileImpl::Descriptor::destroy (TAO_ENV_SINGLE_ARG_DECL)
+FileImpl::Descriptor::destroy (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
// Get the ACE_HANDLE for this object reference
- ACE_HANDLE file_descriptor = this->fd (TAO_ENV_SINGLE_ARG_PARAMETER);
+ ACE_HANDLE file_descriptor = this->fd (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
// Close the file corresponding to this object reference.
diff --git a/TAO/examples/POA/Default_Servant/File_i.h b/TAO/examples/POA/Default_Servant/File_i.h
index 30c6c6f5e5b..ebe06fce403 100644
--- a/TAO/examples/POA/Default_Servant/File_i.h
+++ b/TAO/examples/POA/Default_Servant/File_i.h
@@ -34,35 +34,35 @@ public:
~Descriptor (void);
// Destructor
- PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL);
+ PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
// Returns the default POA of this object
virtual CORBA::Long write (const File::Descriptor::DataBuffer &buffer
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
File::IOError));
// write buffer to File corresponding to this Descriptor
virtual File::Descriptor::DataBuffer *read (CORBA::Long num_bytes
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
// Reads num_bytes from the file and returns it
File::IOError));
virtual CORBA::ULong lseek (CORBA::ULong offset,
CORBA::Long whence
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
File::IOError));
// seek to the offset in file from whence
- virtual void destroy (TAO_ENV_SINGLE_ARG_DECL)
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
// closes the file corresponding to the requested ObjectID
private:
- ACE_HANDLE fd (TAO_ENV_SINGLE_ARG_DECL);
+ ACE_HANDLE fd (ACE_ENV_SINGLE_ARG_DECL);
// Extracts the ACE_HANDLE from the objectID
PortableServer::POA_var poa_;
@@ -80,12 +80,12 @@ public:
~System (void);
//Destructor
- PortableServer::POA_ptr _default_POA (TAO_ENV_SINGLE_ARG_DECL);
+ PortableServer::POA_ptr _default_POA (ACE_ENV_SINGLE_ARG_DECL);
//Returns the default POA of this object
File::Descriptor_ptr open (const char *file_name,
CORBA::Long flags
- TAO_ENV_ARG_DECL)
+ ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
File::IOError));
// Opens a file ,creates a Descriptor reference with the
diff --git a/TAO/examples/POA/Default_Servant/client.cpp b/TAO/examples/POA/Default_Servant/client.cpp
index b40fb6b4f5e..9782d810a77 100644
--- a/TAO/examples/POA/Default_Servant/client.cpp
+++ b/TAO/examples/POA/Default_Servant/client.cpp
@@ -72,12 +72,12 @@ parse_args (int argc, char **argv)
int
main (int argc, char **argv)
{
- TAO_ENV_DECLARE_NEW_ENV;
+ ACE_DECLARE_NEW_CORBA_ENV;
ACE_TRY
{
// Initialize the ORB
- CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER);
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Parse the command-line arguments to get the IOR
@@ -106,18 +106,18 @@ main (int argc, char **argv)
ACE_OS::close (input_file);
CORBA::Object_var object = orb->string_to_object (ior.c_str ()
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Narrow the object reference to a File::System
File::System_var file_system = File::System::_narrow (object.in ()
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Creat the file filename i.e "test"
File::Descriptor_var fd = file_system->open (filename,
O_CREAT | O_RDWR
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
int message_length = ACE_OS::strlen (message) + 1;
@@ -126,16 +126,16 @@ main (int argc, char **argv)
File::Descriptor::DataBuffer data_sent (message_length, message_length, buffer, 1);
// write the message to the file
- fd->write (data_sent TAO_ENV_ARG_PARAMETER);
+ fd->write (data_sent ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
//seek to the beginning of the file
- fd->lseek (0, SEEK_SET TAO_ENV_ARG_PARAMETER);
+ fd->lseek (0, SEEK_SET ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Read back the written message
File::Descriptor::DataBuffer_var data_received = fd->read (message_length
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
char *result = (char *) &data_received[0];
@@ -145,7 +145,7 @@ main (int argc, char **argv)
result));
// close the file
- fd->destroy (TAO_ENV_SINGLE_ARG_PARAMETER);
+ fd->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}
ACE_CATCHANY
diff --git a/TAO/examples/POA/Default_Servant/server.cpp b/TAO/examples/POA/Default_Servant/server.cpp
index 5ff1c36ce5c..75f729016cb 100644
--- a/TAO/examples/POA/Default_Servant/server.cpp
+++ b/TAO/examples/POA/Default_Servant/server.cpp
@@ -58,12 +58,12 @@ parse_args (int argc, char **argv)
int
main (int argc, char **argv)
{
- TAO_ENV_DECLARE_NEW_ENV;
+ ACE_DECLARE_NEW_CORBA_ENV;
ACE_TRY
{
// Initialize the ORB
- CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 TAO_ENV_ARG_PARAMETER);
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
int result = parse_args (argc, argv);
@@ -73,14 +73,14 @@ main (int argc, char **argv)
// Obtain the RootPOA.
CORBA::Object_var obj =
orb->resolve_initial_references ("RootPOA"
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Narrow the object reference to a POA reference
- PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in () TAO_ENV_ARG_PARAMETER);
+ PortableServer::POA_var root_poa = PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (TAO_ENV_SINGLE_ARG_PARAMETER);
+ PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
CORBA::PolicyList policies (5);
@@ -88,34 +88,34 @@ main (int argc, char **argv)
// ID Assignment Policy
policies[0] =
- root_poa->create_id_assignment_policy (PortableServer::USER_ID TAO_ENV_ARG_PARAMETER);
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Lifespan Policy
policies[1] =
- root_poa->create_lifespan_policy (PortableServer::PERSISTENT TAO_ENV_ARG_PARAMETER);
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Request Processing Policy
policies[2] =
- root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT TAO_ENV_ARG_PARAMETER);
+ root_poa->create_request_processing_policy (PortableServer::USE_DEFAULT_SERVANT ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Servant Retention Policy
policies[3] =
- root_poa->create_servant_retention_policy (PortableServer::RETAIN TAO_ENV_ARG_PARAMETER);
+ root_poa->create_servant_retention_policy (PortableServer::RETAIN ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Id Uniqueness Policy
policies[4] =
- root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID TAO_ENV_ARG_PARAMETER);
+ root_poa->create_id_uniqueness_policy (PortableServer::MULTIPLE_ID ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_CString name = "firstPOA";
PortableServer::POA_var first_poa = root_poa->create_POA (name.c_str (),
poa_manager.in (),
policies
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
for (CORBA::ULong i = 0;
@@ -123,7 +123,7 @@ main (int argc, char **argv)
++i)
{
CORBA::Policy_ptr policy = policies[i];
- policy->destroy (TAO_ENV_SINGLE_ARG_PARAMETER);
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}
@@ -135,16 +135,16 @@ main (int argc, char **argv)
first_poa->activate_object_with_id (file_system_oid.in (),
&file_system_impl
- TAO_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
CORBA::Object_var file_system =
- first_poa->id_to_reference (file_system_oid.in () TAO_ENV_ARG_PARAMETER);
+ first_poa->id_to_reference (file_system_oid.in () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Get the IOR for the "FileSystem" object
CORBA::String_var file_system_ior =
- orb->object_to_string (file_system.in () TAO_ENV_ARG_PARAMETER);
+ orb->object_to_string (file_system.in () ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_DEBUG ((LM_DEBUG,"%s\n",
@@ -160,11 +160,11 @@ main (int argc, char **argv)
ACE_OS::fclose (output_file);
// set the state of the poa_manager to active i.e ready to process requests
- poa_manager->activate (TAO_ENV_SINGLE_ARG_PARAMETER);
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
// Run the ORB
- orb->run (TAO_ENV_SINGLE_ARG_PARAMETER);
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}