diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-23 10:06:22 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-23 10:06:22 +0000 |
commit | ccdb5780e845c0aca49ff0451da05625610b5797 (patch) | |
tree | bde5f7592a3d68242b2adb7cba88c84863b95782 | |
parent | 7d0e686fd1e2ab18781ae7faa2fbcb55c24f36ad (diff) | |
download | ATCD-ccdb5780e845c0aca49ff0451da05625610b5797.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tests/POA/Explicit_Activation/Explicit_Activation.dsw (renamed from TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsw) | 0 | ||||
-rw-r--r-- | TAO/tests/POA/Explicit_Activation/server.cpp (renamed from TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp) | 13 | ||||
-rw-r--r-- | TAO/tests/POA/Explicit_Activation/server.dsp (renamed from TAO/tests/POA/Explicit_Activation_POA_Ids/server.dsp) | 0 | ||||
-rw-r--r-- | TAO/tests/POA/Explicit_Activation/svc.conf | 49 | ||||
-rw-r--r-- | TAO/tests/POA/On_Demand_Activation/On_Demand_Activation.dsw | 29 | ||||
-rw-r--r-- | TAO/tests/POA/On_Demand_Activation/Servant_Activator.cpp | 33 | ||||
-rw-r--r-- | TAO/tests/POA/On_Demand_Activation/Servant_Activator.h | 17 |
7 files changed, 141 insertions, 0 deletions
diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsw b/TAO/tests/POA/Explicit_Activation/Explicit_Activation.dsw index 293f7320fc8..293f7320fc8 100644 --- a/TAO/tests/POA/Explicit_Activation_POA_Ids/Explicit_Activation_POA_Ids.dsw +++ b/TAO/tests/POA/Explicit_Activation/Explicit_Activation.dsw diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp b/TAO/tests/POA/Explicit_Activation/server.cpp index 0bc51d2689c..6dec3921a4a 100644 --- a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.cpp +++ b/TAO/tests/POA/Explicit_Activation/server.cpp @@ -46,6 +46,19 @@ main (int argc, char **argv) return -1; } + for (CORBA::ULong i = 0; + i < policies.length () && env.exception () == 0; + ++i) + { + PortableServer::Policy_ptr policy = policies[i]; + policy->destroy (env); + } + if (env.exception () != 0) + { + env.print_exception ("PortableServer::POA::create_POA"); + return -1; + } + MyFooServant first_foo_impl (root_poa, 27); MyFooServant second_foo_impl (first_poa, 28); diff --git a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.dsp b/TAO/tests/POA/Explicit_Activation/server.dsp index 0421abf651e..0421abf651e 100644 --- a/TAO/tests/POA/Explicit_Activation_POA_Ids/server.dsp +++ b/TAO/tests/POA/Explicit_Activation/server.dsp diff --git a/TAO/tests/POA/Explicit_Activation/svc.conf b/TAO/tests/POA/Explicit_Activation/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/tests/POA/Explicit_Activation/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/tests/POA/On_Demand_Activation/On_Demand_Activation.dsw b/TAO/tests/POA/On_Demand_Activation/On_Demand_Activation.dsw new file mode 100644 index 00000000000..293f7320fc8 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/On_Demand_Activation.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 5.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "server"=.\server.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/On_Demand_Activation/Servant_Activator.cpp b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.cpp new file mode 100644 index 00000000000..ddecaad4177 --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.cpp @@ -0,0 +1,33 @@ +#include "Servant_Activator.h" +#include "MyFooServant.h" + +PortableServer::Servant +MyFooServantActivator::incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + CORBA::Environment &env) +{ + CORBA::String_var s = PortableServer::ObjectId_to_string (oid); + if (ACE_OS::strstr (s.in (), "Foo") != 0) + { + return new MyFooServant (poa, 27); + } + else + { + CORBA::Exception *exception = new CORBA::OBJECT_NOT_EXIST (CORBA::COMPLETED_NO); + env.exception (exception); + return 0; + } +} + +void +MyFooServantActivator::etherealize (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + PortableServer::Servant servant, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations, + CORBA::Environment &env) +{ + if (remaining_activations == CORBA::B_FALSE) + delete servant; +} + diff --git a/TAO/tests/POA/On_Demand_Activation/Servant_Activator.h b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.h new file mode 100644 index 00000000000..1792284649b --- /dev/null +++ b/TAO/tests/POA/On_Demand_Activation/Servant_Activator.h @@ -0,0 +1,17 @@ +#include "tao/corba.h" + +class MyFooServantActivator : public POA_PortableServer::ServantActivator +{ +public: + virtual PortableServer::Servant incarnate (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr poa, + CORBA::Environment &env); + + virtual void etherealize (const PortableServer::ObjectId &oid, + PortableServer::POA_ptr adapter, + PortableServer::Servant servant, + CORBA::Boolean cleanup_in_progress, + CORBA::Boolean remaining_activations, + CORBA::Environment &env); +}; + |