summaryrefslogtreecommitdiff
path: root/TAO/examples/Quoter
diff options
context:
space:
mode:
authormk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-13 15:08:10 +0000
committermk1 <mk1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-10-13 15:08:10 +0000
commit857357b1aff2c692691db42a8f1717e0982a2ab6 (patch)
tree0b8baf704c41b2909df5571c822093cde45c4455 /TAO/examples/Quoter
parent2e53eba0b754c3bb280fc15528cabcb35e833605 (diff)
downloadATCD-857357b1aff2c692691db42a8f1717e0982a2ab6.tar.gz
ChangeLogTag: Fri 13 10:07:16 2000 Michael Kircher <Michael.Kircher@mchp.siemens.de>
Diffstat (limited to 'TAO/examples/Quoter')
-rw-r--r--TAO/examples/Quoter/Quoter_i.cpp72
-rw-r--r--TAO/examples/Quoter/README11
-rw-r--r--TAO/examples/Quoter/client.cpp19
3 files changed, 10 insertions, 92 deletions
diff --git a/TAO/examples/Quoter/Quoter_i.cpp b/TAO/examples/Quoter/Quoter_i.cpp
index 1d44d808a19..18d0d690154 100644
--- a/TAO/examples/Quoter/Quoter_i.cpp
+++ b/TAO/examples/Quoter/Quoter_i.cpp
@@ -277,76 +277,14 @@ Quoter_i::move (CosLifeCycle::FactoryFinder_ptr there,
CosLifeCycle::InvalidCriteria,
CosLifeCycle::CannotMeetCriteria))
{
- const char *exception_message = "Null message";
-
- if (TAO_debug_level > 0)
- ACE_DEBUG ((LM_DEBUG,"Quoter_i::move: being called\n"));
-
- ACE_TRY
- {
- // We need to have a Factory Finder
- if (CORBA::is_nil (there))
- {
- ACE_ERROR ((LM_ERROR,
- "Quoter_i::move: No Factory Finder, don't know how to go on.\n"));
-
- ACE_THROW (CosLifeCycle::NoFactory ());
- }
-
- // We need to have access to the POA
- if (CORBA::is_nil (this->poa_var_.in()))
- {
- ACE_ERROR ((LM_ERROR,
- "Quoter_i::move: No access to the POA. Cannot move.\n"));
- ACE_THROW (CosLifeCycle::NotMovable ());
- }
-
- // Create a new Quoter over there
- exception_message = "While creating a new Quoter";
- CosLifeCycle::LifeCycleObject_var lifeCycleObject_var =
- this->copy (there, the_criteria, ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- if (CORBA::is_nil (lifeCycleObject_var.in ()))
- {
- ACE_ERROR ((LM_ERROR,
- "Quoter_i::move: Created Quoter is not valid.\n"));
- ACE_THROW (CosLifeCycle::NoFactory ());
- }
-
- // Set the POA, so that the requests will be forwarded to the new location
+ ACE_UNUSED_ARG (there);
+ ACE_UNUSED_ARG (the_criteria);
- // new location
- CORBA::Object_var forward_to_var =
- CORBA::Object::_duplicate ((CORBA::Object_ptr) lifeCycleObject_var.in());
-
- if (!CORBA::is_nil (forward_to_var.in ()))
- {
- exception_message = "While servant_to_id";
- PortableServer::ObjectId_var oid = this->poa_var_->servant_to_id (this, ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ ACE_ERROR ((LM_ERROR,
+ "Quoter_i::move: The Quoter object is not movable!"));
- TAO_POA *tao_poa = ACE_dynamic_cast (TAO_POA *, this->poa_var_.in ());
+ ACE_THROW (new CosLifeCycle::NotMovable);
- exception_message = "While forwarding object";
- tao_poa->forward_object (oid.in (),
- forward_to_var.in (),
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
- }
- else
- {
- ACE_ERROR ((LM_ERROR,"Quoter_i::move: forward_to refenence is nil.\n"));
- ACE_THROW (CosLifeCycle::NotMovable());
- }
- }
- ACE_CATCHANY
- {
- ACE_ERROR ((LM_ERROR,"Quoter_i::move: %s\n", exception_message));
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception");
- return;
- }
- ACE_ENDTRY;
}
diff --git a/TAO/examples/Quoter/README b/TAO/examples/Quoter/README
index c4206b99ec8..f183f8d809d 100644
--- a/TAO/examples/Quoter/README
+++ b/TAO/examples/Quoter/README
@@ -14,6 +14,11 @@ working on other platforms as soon as it is completed.
DOCUMENTATION FOR THE EXAMPLE
=============================
+Note: Moving the Quoter object is no longer available!
+ The code was relying on ORB internal mechanisms. One way to
+ implement the move operation in a standard way would be
+ to use a servant locator on the POA managing the Quoter object.
+
Context: The Quoter example serves several tests, the first is the test
of several multithreading policies and the second is showing the
use of the Life Cycle Service as it is defined in the
@@ -73,12 +78,6 @@ client: Creates one Quoter through using the Quoter_Factory_Finder. After that
->Quoter_Generic_Factory->Quoter_Factory
-
-!!!!Note:
-To make use of the move operation you need to use the -sm switch on
-the perl script. This activates in the server multiple objects, which is needed for
-moving.
-
RUNNING THE EXAMPLE
===================
diff --git a/TAO/examples/Quoter/client.cpp b/TAO/examples/Quoter/client.cpp
index 017b2ac341a..d5656a51bb1 100644
--- a/TAO/examples/Quoter/client.cpp
+++ b/TAO/examples/Quoter/client.cpp
@@ -132,25 +132,6 @@ Quoter_Client::run (void)
if (this->debug_level_ >= 1)
ACE_DEBUG ((LM_DEBUG, "Quoter Client: Copied object: ACE Hardware = %i\n", q));
- // Move the Quoter
-
- exception_message = "While moving the quoter";
- this->quoter_var_->move (factory_Finder_var_.in (),
- criteria,
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- // Caution, the object reference stays the same
-
- if (this->debug_level_ >= 2)
- ACE_DEBUG ((LM_DEBUG, "Quoter Client: Moved object\n"));
-
- exception_message = "While using get_quote () on moved object";
- q = this->quoter_var_->get_quote ("ACE Hardware", ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- if (this->debug_level_ >= 1)
- ACE_DEBUG ((LM_DEBUG, "Quoter Client: Moved object: ACE Hardware = %i\n", q));
}
ACE_CATCHANY
{