summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-08-27 19:55:43 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-08-27 19:55:43 +0000
commit3ea0a310ed3645403e8c23df7fddf0e07fe492ea (patch)
tree2e99b703c2f89cc84bcc2dab750e9a5b684deb23
parent044b6ab71725da4606ec7754155c3d00a59cb40c (diff)
downloadATCD-3ea0a310ed3645403e8c23df7fddf0e07fe492ea.tar.gz
ChangeLogTag: Tue Aug 27 15:48:17 2002 Irfan Pyarali <irfan@oomworks.com>
-rw-r--r--TAO/ChangeLog53
-rw-r--r--TAO/tao/PortableServer/Makefile2
-rw-r--r--TAO/tao/PortableServer/Makefile.bor2
-rw-r--r--TAO/tao/PortableServer/POA_Policies.cpp133
-rw-r--r--TAO/tao/PortableServer/POA_Policies.h63
-rw-r--r--TAO/tao/PortableServer/PortableServer.cpp35
-rw-r--r--TAO/tao/PortableServer/PortableServer_ORBInitializer.cpp95
-rw-r--r--TAO/tao/PortableServer/PortableServer_ORBInitializer.h65
-rw-r--r--TAO/tao/PortableServer/PortableServer_PolicyFactory.cpp54
-rw-r--r--TAO/tao/PortableServer/PortableServer_PolicyFactory.h43
-rw-r--r--TAO/tao/PortableServer/TAO_PortableServer.dsp16
-rw-r--r--TAO/tao/PortableServer/TAO_PortableServer_Static.dsp16
-rw-r--r--TAO/tests/POA/Makefile1
-rw-r--r--TAO/tests/POA/Makefile.bor1
-rw-r--r--TAO/tests/POA/Policies/Makefile41
-rw-r--r--TAO/tests/POA/Policies/Policies.cpp237
-rw-r--r--TAO/tests/POA/Policies/Policies.dsp100
-rw-r--r--TAO/tests/POA/Policies/Policies.dsw29
-rw-r--r--TAO/tests/POA/Policies/Policies.mpc3
-rw-r--r--TAO/tests/POA/Policies/makefile.bor14
-rwxr-xr-xTAO/tests/POA/Policies/run_test.pl20
-rw-r--r--TAO/tests/POA/README5
-rw-r--r--TAO/tests/TAO_Tests.dsw12
-rw-r--r--bin/auto_run_tests.lst1
24 files changed, 1026 insertions, 15 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index a1f7cec05ed..288e81a8be4 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,56 @@
+Tue Aug 27 15:48:17 2002 Irfan Pyarali <irfan@oomworks.com>
+
+ * tao\PortableServer\PortableServer_PolicyFactory.cpp: New class
+ for creating POA Policies.
+
+ * tao\PortableServer\PortableServer_ORBInitializer.cpp: New
+ initialization class that adds TAO_PortableServer_PolicyFactory
+ as a factory for POA Policies.
+
+ * tao\PortableServer\PortableServer.cpp (init): Registered
+ TAO_PortableServer_ORBInitializer with the PortableInterceptor.
+
+ * tao\PortableServer\POA_Policies.cpp (create): Added create
+ methods to the policy classes so that they can be created from
+ Any values.
+
+ * tests\POA\Policies: This program tests the construction of POA
+ policies, both through the generic ORB::create_policy interface
+ and the PortableServer specific interfaces.
+
+ The following files were added:
+
+ - tests/POA/Policies/Makefile
+ - tests/POA/Policies/Policies.cpp
+ - tests/POA/Policies/Policies.dsp
+ - tests/POA/Policies/Policies.dsw
+ - tests/POA/Policies/Policies.mpc
+ - tests/POA/Policies/makefile.bor
+ - tests/POA/Policies/run_test.pl
+
+ The following files were updated:
+
+ - tests/TAO_Tests.dsw
+ - tests/POA/Makefile
+ - tests/POA/Makefile.bor
+ - tests/POA/README
+ - $ACE_ROOT/bin/auto_run_tests.lst
+
+ * tao\PortableServer: Added new files
+ PortableServer_PolicyFactory.{cpp,h} and
+ PortableServer_ORBInitializer.{cpp,h} to:
+
+ - TAO_PortableServer_Static.dsp
+ - TAO_PortableServer.dsp
+ - Makefile
+ - Makefile.bor
+
+Tue Aug 27 12:42:58 2002 Irfan Pyarali <irfan@oomworks.com>
+
+ * tests\POA\Default_Servant\Makefile (BIN_UNCHECKED): Changed
+ Makefile such that the test program is not compiled with minimum
+ CORBA. Thanks to Ossama for pointing this out.
+
Tue Aug 27 12:40:12 2002 Balachandran Natarajan <bala@isis-server.vuse.vanderbilt.edu>
Fix for [BUG 1265].
diff --git a/TAO/tao/PortableServer/Makefile b/TAO/tao/PortableServer/Makefile
index 8c3a9bea585..73715288701 100644
--- a/TAO/tao/PortableServer/Makefile
+++ b/TAO/tao/PortableServer/Makefile
@@ -45,6 +45,8 @@ CPP_SRCS += \
Servant_Dispatcher \
POA_Cached_Policies \
POA_Policies \
+ PortableServer_ORBInitializer \
+ PortableServer_PolicyFactory \
POA_Policy_Set \
Default_Policy_Validator \
IORInfo \
diff --git a/TAO/tao/PortableServer/Makefile.bor b/TAO/tao/PortableServer/Makefile.bor
index 7504ace2f2c..7f483b2091c 100644
--- a/TAO/tao/PortableServer/Makefile.bor
+++ b/TAO/tao/PortableServer/Makefile.bor
@@ -31,6 +31,8 @@ OBJFILES = \
$(OBJDIR)\PortableGroup_Hooks.obj \
$(OBJDIR)\PortableServer.obj \
$(OBJDIR)\PortableServerC.obj \
+ $(OBJDIR)\PortableServer_PolicyFactory.obj \
+ $(OBJDIR)\PortableServer_ORBInitializer.obj \
$(OBJDIR)\Servant_Base.obj \
$(OBJDIR)\Servant_Dispatcher.obj \
$(OBJDIR)\ServerInterceptorAdapter.obj \
diff --git a/TAO/tao/PortableServer/POA_Policies.cpp b/TAO/tao/PortableServer/POA_Policies.cpp
index 09078bacb3f..4fc67176d07 100644
--- a/TAO/tao/PortableServer/POA_Policies.cpp
+++ b/TAO/tao/PortableServer/POA_Policies.cpp
@@ -61,6 +61,25 @@ TAO_Thread_Policy::_tao_scope (void) const
return TAO_POLICY_POA_SCOPE;
}
+CORBA::Policy_ptr
+TAO_Thread_Policy::create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::ThreadPolicyValue value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_Thread_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_Thread_Policy (value),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
#endif /* TAO_HAS_MINIMUM_POA == 0 */
/////////////////////////////////////////////////////////////////////////////
@@ -115,6 +134,25 @@ TAO_Lifespan_Policy::_tao_scope (void) const
return TAO_POLICY_POA_SCOPE;
}
+CORBA::Policy_ptr
+TAO_Lifespan_Policy::create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::LifespanPolicyValue value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_Lifespan_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_Lifespan_Policy (value),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
/////////////////////////////////////////////////////////////////////////////
TAO_Id_Uniqueness_Policy::TAO_Id_Uniqueness_Policy (PortableServer::IdUniquenessPolicyValue value)
@@ -167,6 +205,25 @@ TAO_Id_Uniqueness_Policy::_tao_scope (void) const
return TAO_POLICY_POA_SCOPE;
}
+CORBA::Policy_ptr
+TAO_Id_Uniqueness_Policy::create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::IdUniquenessPolicyValue value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_Id_Uniqueness_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_Id_Uniqueness_Policy (value),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
/////////////////////////////////////////////////////////////////////////////
TAO_Id_Assignment_Policy::TAO_Id_Assignment_Policy (PortableServer::IdAssignmentPolicyValue value)
@@ -219,6 +276,25 @@ TAO_Id_Assignment_Policy::_tao_scope (void) const
return TAO_POLICY_POA_SCOPE;
}
+CORBA::Policy_ptr
+TAO_Id_Assignment_Policy::create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::IdAssignmentPolicyValue value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_Id_Assignment_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_Id_Assignment_Policy (value),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
/////////////////////////////////////////////////////////////////////////////
#if (TAO_HAS_MINIMUM_POA == 0)
@@ -273,6 +349,25 @@ TAO_Implicit_Activation_Policy::_tao_scope (void) const
return TAO_POLICY_POA_SCOPE;
}
+CORBA::Policy_ptr
+TAO_Implicit_Activation_Policy::create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::ImplicitActivationPolicyValue value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_Implicit_Activation_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_Implicit_Activation_Policy (value),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
/////////////////////////////////////////////////////////////////////////////
TAO_Servant_Retention_Policy::TAO_Servant_Retention_Policy (PortableServer::ServantRetentionPolicyValue value)
@@ -325,6 +420,25 @@ TAO_Servant_Retention_Policy::_tao_scope (void) const
return TAO_POLICY_POA_SCOPE;
}
+CORBA::Policy_ptr
+TAO_Servant_Retention_Policy::create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::ServantRetentionPolicyValue value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_Servant_Retention_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_Servant_Retention_Policy (value),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
/////////////////////////////////////////////////////////////////////////////
TAO_Request_Processing_Policy::TAO_Request_Processing_Policy (PortableServer::RequestProcessingPolicyValue value)
@@ -377,6 +491,25 @@ TAO_Request_Processing_Policy::_tao_scope (void) const
return TAO_POLICY_POA_SCOPE;
}
+CORBA::Policy_ptr
+TAO_Request_Processing_Policy::create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL)
+{
+ PortableServer::RequestProcessingPolicyValue value;
+ if ((val >>= value) == 0)
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+
+ TAO_Request_Processing_Policy *tmp = 0;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_Request_Processing_Policy (value),
+ CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (CORBA::Policy::_nil ());
+
+ return tmp;
+}
+
#endif /* TAO_HAS_MINIMUM_POA == 0 */
#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)
diff --git a/TAO/tao/PortableServer/POA_Policies.h b/TAO/tao/PortableServer/POA_Policies.h
index ba779a0906b..b3f125b2cd2 100644
--- a/TAO/tao/PortableServer/POA_Policies.h
+++ b/TAO/tao/PortableServer/POA_Policies.h
@@ -57,10 +57,15 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the cached policy type for this policy.
- virtual TAO_Cached_Policy_Type _tao_cached_type (void) const;
+ TAO_Cached_Policy_Type _tao_cached_type (void) const;
/// Returns the scope at which this policy can be applied. See orbconf.h.
- virtual TAO_Policy_Scope _tao_scope (void) const;
+ TAO_Policy_Scope _tao_scope (void) const;
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL);
protected:
PortableServer::ThreadPolicyValue value_;
@@ -88,10 +93,15 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the cached policy type for this policy.
- virtual TAO_Cached_Policy_Type _tao_cached_type (void) const;
+ TAO_Cached_Policy_Type _tao_cached_type (void) const;
/// Returns the scope at which this policy can be applied. See orbconf.h.
- virtual TAO_Policy_Scope _tao_scope (void) const;
+ TAO_Policy_Scope _tao_scope (void) const;
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL);
protected:
PortableServer::LifespanPolicyValue value_;
@@ -117,10 +127,15 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the cached policy type for this policy.
- virtual TAO_Cached_Policy_Type _tao_cached_type (void) const;
+ TAO_Cached_Policy_Type _tao_cached_type (void) const;
/// Returns the scope at which this policy can be applied. See orbconf.h.
- virtual TAO_Policy_Scope _tao_scope (void) const;
+ TAO_Policy_Scope _tao_scope (void) const;
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL);
protected:
PortableServer::IdUniquenessPolicyValue value_;
@@ -146,10 +161,15 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the cached policy type for this policy.
- virtual TAO_Cached_Policy_Type _tao_cached_type (void) const;
+ TAO_Cached_Policy_Type _tao_cached_type (void) const;
/// Returns the scope at which this policy can be applied. See orbconf.h.
- virtual TAO_Policy_Scope _tao_scope (void) const;
+ TAO_Policy_Scope _tao_scope (void) const;
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL);
protected:
PortableServer::IdAssignmentPolicyValue value_;
@@ -177,10 +197,15 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the cached policy type for this policy.
- virtual TAO_Cached_Policy_Type _tao_cached_type (void) const;
+ TAO_Cached_Policy_Type _tao_cached_type (void) const;
/// Returns the scope at which this policy can be applied. See orbconf.h.
- virtual TAO_Policy_Scope _tao_scope (void) const;
+ TAO_Policy_Scope _tao_scope (void) const;
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL);
protected:
PortableServer::ImplicitActivationPolicyValue value_;
@@ -206,10 +231,15 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the cached policy type for this policy.
- virtual TAO_Cached_Policy_Type _tao_cached_type (void) const;
+ TAO_Cached_Policy_Type _tao_cached_type (void) const;
/// Returns the scope at which this policy can be applied. See orbconf.h.
- virtual TAO_Policy_Scope _tao_scope (void) const;
+ TAO_Policy_Scope _tao_scope (void) const;
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL);
protected:
PortableServer::ServantRetentionPolicyValue value_;
@@ -235,10 +265,15 @@ public:
ACE_THROW_SPEC ((CORBA::SystemException));
/// Return the cached policy type for this policy.
- virtual TAO_Cached_Policy_Type _tao_cached_type (void) const;
+ TAO_Cached_Policy_Type _tao_cached_type (void) const;
/// Returns the scope at which this policy can be applied. See orbconf.h.
- virtual TAO_Policy_Scope _tao_scope (void) const;
+ TAO_Policy_Scope _tao_scope (void) const;
+
+ /// Helper method for the implementation of
+ /// CORBA::ORB::create_policy.
+ static CORBA::Policy_ptr create (const CORBA::Any &val
+ ACE_ENV_ARG_DECL);
protected:
PortableServer::RequestProcessingPolicyValue value_;
diff --git a/TAO/tao/PortableServer/PortableServer.cpp b/TAO/tao/PortableServer/PortableServer.cpp
index fabc25a9630..f27b58c558d 100644
--- a/TAO/tao/PortableServer/PortableServer.cpp
+++ b/TAO/tao/PortableServer/PortableServer.cpp
@@ -13,11 +13,44 @@
#include "PortableServer.h"
#include "Object_Adapter.h"
+#include "PortableServer_ORBInitializer.h"
ACE_RCSID (PortableServer, PortableServer, "$Id$")
int
TAO_POA_Initializer::init (void)
{
- return ACE_Service_Config::process_directive (ace_svc_desc_TAO_Object_Adapter_Factory);
+ ACE_DECLARE_NEW_CORBA_ENV;
+ ACE_TRY
+ {
+ /// Register the Messaging ORBInitializer.
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ ACE_NEW_THROW_EX (temp_orb_initializer,
+ TAO_PortableServer_ORBInitializer,
+ CORBA::NO_MEMORY (
+ CORBA_SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_TRY_CHECK;
+
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "(%P | %t) Caught exception:");
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return
+ ACE_Service_Config::process_directive (ace_svc_desc_TAO_Object_Adapter_Factory);
}
diff --git a/TAO/tao/PortableServer/PortableServer_ORBInitializer.cpp b/TAO/tao/PortableServer/PortableServer_ORBInitializer.cpp
new file mode 100644
index 00000000000..f142a7758be
--- /dev/null
+++ b/TAO/tao/PortableServer/PortableServer_ORBInitializer.cpp
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+
+#include "PortableServer_ORBInitializer.h"
+#include "PortableServer_PolicyFactory.h"
+#include "PortableServerC.h"
+
+ACE_RCSID (PortableServer,
+ PortableServer_ORBInitializer,
+ "$Id$")
+
+void
+TAO_PortableServer_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_PortableServer_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_policy_factories (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_PortableServer_ORBInitializer::register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+{
+ // Register the PortableServer policy factories.
+ PortableInterceptor::PolicyFactory_ptr tmp;
+ ACE_NEW_THROW_EX (tmp,
+ TAO_PortableServer_PolicyFactory,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableInterceptor::PolicyFactory_var policy_factory = tmp;
+
+ // Bind the same policy factory to all PortableServer related policy
+ // types since a single policy factory is used to create each of the
+ // different types of PortableServer policies.
+ CORBA::PolicyType type[] = {
+#if (TAO_HAS_MINIMUM_POA == 0)
+ PortableServer::THREAD_POLICY_ID,
+ PortableServer::IMPLICIT_ACTIVATION_POLICY_ID,
+ PortableServer::SERVANT_RETENTION_POLICY_ID,
+ PortableServer::REQUEST_PROCESSING_POLICY_ID,
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+ PortableServer::LIFESPAN_POLICY_ID,
+ PortableServer::ID_UNIQUENESS_POLICY_ID,
+ PortableServer::ID_ASSIGNMENT_POLICY_ID
+ };
+
+ const CORBA::PolicyType *end =
+ type + sizeof (type) / sizeof (type[0]);
+
+ for (CORBA::PolicyType *i = type;
+ i != end;
+ ++i)
+ {
+ ACE_TRY
+ {
+ info->register_policy_factory (*i,
+ policy_factory.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCH (CORBA::BAD_INV_ORDER, ex)
+ {
+ if (ex.minor () == (TAO_OMG_VMCID | 16))
+ {
+ // The factory is already there, it happens because the
+ // magic initializer in PortableServer.cpp registers
+ // with the ORB multiple times. This is an indication
+ // that we should do no more work in this
+ // ORBInitializer.
+ return;
+ }
+ ACE_RE_THROW;
+ }
+ ACE_CATCHANY
+ {
+ // Rethrow any other exceptions...
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+ }
+}
diff --git a/TAO/tao/PortableServer/PortableServer_ORBInitializer.h b/TAO/tao/PortableServer/PortableServer_ORBInitializer.h
new file mode 100644
index 00000000000..5aefd0303de
--- /dev/null
+++ b/TAO/tao/PortableServer/PortableServer_ORBInitializer.h
@@ -0,0 +1,65 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PortableServer_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Irfan Pyarali <irfan@oomworks.com>
+ */
+//=============================================================================
+
+
+#ifndef TAO_PORTABLESERVER_ORB_INITIALIZER_H
+#define TAO_PORTABLESERVER_ORB_INITIALIZER_H
+
+#include "ace/pre.h"
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "portableserver_export.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+
+/// Forward Declarations
+class TAO_PortableServer_PolicyFactory;
+
+/// PortableServer ORB initializer.
+class TAO_PortableServer_Export TAO_PortableServer_ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /**
+ * @name PortableInterceptor::ORBInitializer methods
+ *
+ * The following methods are required by the
+ * PortableInterceptor::ORBInitializer interface.
+ */
+ //@{
+
+ void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+private:
+
+ /// Register PortableServer policy factories.
+ void register_policy_factories (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL);
+};
+
+#include "ace/post.h"
+
+#endif /* TAO_PORTABLESERVER_ORB_INITIALIZER_H */
diff --git a/TAO/tao/PortableServer/PortableServer_PolicyFactory.cpp b/TAO/tao/PortableServer/PortableServer_PolicyFactory.cpp
new file mode 100644
index 00000000000..97d70992797
--- /dev/null
+++ b/TAO/tao/PortableServer/PortableServer_PolicyFactory.cpp
@@ -0,0 +1,54 @@
+#include "PortableServer_PolicyFactory.h"
+#include "POA_Policies.h"
+
+ACE_RCSID (PortableServer,
+ PortableServer_PolicyFactory,
+ "$Id$")
+
+CORBA::Policy_ptr
+TAO_PortableServer_PolicyFactory::create_policy (
+ CORBA::PolicyType type,
+ const CORBA::Any &value
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError))
+{
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+ if (type == PortableServer::THREAD_POLICY_ID)
+ return TAO_Thread_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+ if (type == PortableServer::LIFESPAN_POLICY_ID)
+ return TAO_Lifespan_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
+
+ if (type == PortableServer::ID_UNIQUENESS_POLICY_ID)
+ return TAO_Id_Uniqueness_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
+
+ if (type == PortableServer::ID_ASSIGNMENT_POLICY_ID)
+ return TAO_Id_Assignment_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+ if (type == PortableServer::IMPLICIT_ACTIVATION_POLICY_ID)
+ return TAO_Implicit_Activation_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
+
+ if (type == PortableServer::SERVANT_RETENTION_POLICY_ID)
+ return TAO_Servant_Retention_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
+
+ if (type == PortableServer::REQUEST_PROCESSING_POLICY_ID)
+ return TAO_Request_Processing_Policy::create (value
+ ACE_ENV_ARG_PARAMETER);
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+ ACE_THROW_RETURN (CORBA::PolicyError (CORBA::BAD_POLICY_TYPE),
+ CORBA::Policy::_nil ());
+}
diff --git a/TAO/tao/PortableServer/PortableServer_PolicyFactory.h b/TAO/tao/PortableServer/PortableServer_PolicyFactory.h
new file mode 100644
index 00000000000..e41f9b088fa
--- /dev/null
+++ b/TAO/tao/PortableServer/PortableServer_PolicyFactory.h
@@ -0,0 +1,43 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file PortableServer_PolicyFactory.h
+ *
+ * $Id$
+ *
+ * @author Irfan Pyarali <irfan@oomworks.com>
+ */
+//=============================================================================
+
+#ifndef TAO_PORTABLESERVER_POLICY_FACTORY_H
+#define TAO_PORTABLESERVER_POLICY_FACTORY_H
+
+#include "ace/pre.h"
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "portableserver_export.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.h"
+
+/// Policy factory for all PortableServer related policies.
+class TAO_PortableServer_Export TAO_PortableServer_PolicyFactory
+ : public virtual PortableInterceptor::PolicyFactory,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ CORBA::Policy_ptr create_policy (CORBA::PolicyType type,
+ const CORBA::Any & value
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ CORBA::PolicyError));
+};
+
+#include "ace/post.h"
+
+#endif /* TAO_PORTABLESERVER_POLICY_FACTORY_H */
diff --git a/TAO/tao/PortableServer/TAO_PortableServer.dsp b/TAO/tao/PortableServer/TAO_PortableServer.dsp
index fec710db1a8..d879c6bb1b6 100644
--- a/TAO/tao/PortableServer/TAO_PortableServer.dsp
+++ b/TAO/tao/PortableServer/TAO_PortableServer.dsp
@@ -256,6 +256,14 @@ SOURCE=.\PortableServer.cpp
# End Source File
# Begin Source File
+SOURCE=.\PortableServer_ORBInitializer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\PortableServer_PolicyFactory.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\PortableServerC.cpp
# End Source File
# Begin Source File
@@ -400,6 +408,14 @@ SOURCE=.\portableserver_export.h
# End Source File
# Begin Source File
+SOURCE=.\PortableServer_ORBInitializer.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\PortableServer_PolicyFactory.h
+# End Source File
+# Begin Source File
+
SOURCE=.\PortableServerC.h
# End Source File
# Begin Source File
diff --git a/TAO/tao/PortableServer/TAO_PortableServer_Static.dsp b/TAO/tao/PortableServer/TAO_PortableServer_Static.dsp
index ec2fedc8bd3..b95c6d9bc5d 100644
--- a/TAO/tao/PortableServer/TAO_PortableServer_Static.dsp
+++ b/TAO/tao/PortableServer/TAO_PortableServer_Static.dsp
@@ -260,6 +260,14 @@ SOURCE=.\POAManager.h
# End Source File
# Begin Source File
+SOURCE=.\PortableServer_PolicyFactory.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\PortableServer_ORBInitializer.h
+# End Source File
+# Begin Source File
+
SOURCE=.\PortableServer.h
# End Source File
# Begin Source File
@@ -392,6 +400,14 @@ SOURCE=.\PolicyS.cpp
# End Source File
# Begin Source File
+SOURCE=.\PortableServer_PolicyFactory.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\PortableServer_ORBInitializer.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\PortableServer.cpp
# End Source File
# Begin Source File
diff --git a/TAO/tests/POA/Makefile b/TAO/tests/POA/Makefile
index ffb0253e12d..790ebfd1e2a 100644
--- a/TAO/tests/POA/Makefile
+++ b/TAO/tests/POA/Makefile
@@ -19,6 +19,7 @@ DIRS = POA_Destruction \
Non_Servant_Upcalls \
Single_Threaded_POA \
Persistent_ID \
+ Policies \
Identity
# The following test hasn't been updated yet
diff --git a/TAO/tests/POA/Makefile.bor b/TAO/tests/POA/Makefile.bor
index 6edbbdbd940..ae9e004009f 100644
--- a/TAO/tests/POA/Makefile.bor
+++ b/TAO/tests/POA/Makefile.bor
@@ -12,6 +12,7 @@ DIRS = \
Non_Servant_Upcalls \
Single_Threaded_POA \
Persistent_ID \
+ Policies \
wait_for_completion
!include <$(ACE_ROOT)\include\makeinclude\recurse.bor>
diff --git a/TAO/tests/POA/Policies/Makefile b/TAO/tests/POA/Policies/Makefile
new file mode 100644
index 00000000000..6e779c23bca
--- /dev/null
+++ b/TAO/tests/POA/Policies/Makefile
@@ -0,0 +1,41 @@
+#----------------------------------------------------------------------------
+#
+# $Id$
+#
+#----------------------------------------------------------------------------
+
+#----------------------------------------------------------------------------
+# Local macros
+#----------------------------------------------------------------------------
+
+ifndef TAO_ROOT
+ TAO_ROOT = $(ACE_ROOT)/TAO
+endif # ! TAO_ROOT
+
+PROG_SRCS = Policies.cpp
+
+PROG_OBJS = Policies.o
+
+BIN = Policies
+
+#----------------------------------------------------------------------------
+# Include macros and targets
+#----------------------------------------------------------------------------
+
+include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
+include $(ACE_ROOT)/include/makeinclude/macros.GNU
+include $(TAO_ROOT)/rules.tao.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
+#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
+include $(TAO_ROOT)/taoconfig.mk
+
+Policies: $(addprefix $(VDIR),$(PROG_OBJS))
+ $(LINK.cc) $(LDFLAGS) -o $@ $^ $(TAO_SRVR_LIBS) $(POSTLINK)
+
+realclean: clean
+
+# DO NOT DELETE THIS LINE -- g++dep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
diff --git a/TAO/tests/POA/Policies/Policies.cpp b/TAO/tests/POA/Policies/Policies.cpp
new file mode 100644
index 00000000000..ab8f710ea37
--- /dev/null
+++ b/TAO/tests/POA/Policies/Policies.cpp
@@ -0,0 +1,237 @@
+// $Id$
+
+//========================================================================
+//
+// = LIBRARY
+// TAO/tests/POA/Policies
+//
+// = FILENAME
+// Policies.cpp
+//
+// = DESCRIPTION
+// This program tests the construction of POA policies, both
+// through the generic ORB::create_policy interface and the
+// PortableServer specific interfaces.
+//
+// = AUTHOR
+// Irfan Pyarali
+//
+//=========================================================================
+
+#include "tao/corba.h"
+#include "tao/PortableServer/PortableServer.h"
+
+int
+main (int argc, char **argv)
+{
+ ACE_DECLARE_NEW_CORBA_ENV;
+
+ ACE_TRY
+ {
+ // Initialize the ORB first.
+ CORBA::ORB_var orb = CORBA::ORB_init (argc,
+ argv,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Obtain the RootPOA.
+ CORBA::Object_var obj =
+ orb->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow to POA.
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Get the POAManager of the POA.
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+ {
+ PortableServer::ThreadPolicy_var policy1 =
+ root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any policy_value;
+ policy_value <<= PortableServer::ORB_CTRL_MODEL;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (PortableServer::THREAD_POLICY_ID,
+ policy_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ThreadPolicy_var policy2 =
+ PortableServer::ThreadPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (policy1->value () == policy2->value ());
+ }
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+ {
+ PortableServer::LifespanPolicy_var policy1 =
+ root_poa->create_lifespan_policy (PortableServer::TRANSIENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any policy_value;
+ policy_value <<= PortableServer::TRANSIENT;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (PortableServer::LIFESPAN_POLICY_ID,
+ policy_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::LifespanPolicy_var policy2 =
+ PortableServer::LifespanPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (policy1->value () == policy2->value ());
+ }
+
+ {
+ PortableServer::IdUniquenessPolicy_var policy1 =
+ root_poa->create_id_uniqueness_policy (PortableServer::UNIQUE_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any policy_value;
+ policy_value <<= PortableServer::UNIQUE_ID;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (PortableServer::ID_UNIQUENESS_POLICY_ID,
+ policy_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::IdUniquenessPolicy_var policy2 =
+ PortableServer::IdUniquenessPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (policy1->value () == policy2->value ());
+ }
+
+ {
+ PortableServer::IdAssignmentPolicy_var policy1 =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any policy_value;
+ policy_value <<= PortableServer::USER_ID;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (PortableServer::ID_ASSIGNMENT_POLICY_ID,
+ policy_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::IdAssignmentPolicy_var policy2 =
+ PortableServer::IdAssignmentPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (policy1->value () == policy2->value ());
+ }
+
+#if (TAO_HAS_MINIMUM_POA == 0)
+
+ {
+ PortableServer::ImplicitActivationPolicy_var policy1 =
+ root_poa->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any policy_value;
+ policy_value <<= PortableServer::IMPLICIT_ACTIVATION;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (PortableServer::IMPLICIT_ACTIVATION_POLICY_ID,
+ policy_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ImplicitActivationPolicy_var policy2 =
+ PortableServer::ImplicitActivationPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (policy1->value () == policy2->value ());
+ }
+
+ {
+ PortableServer::ServantRetentionPolicy_var policy1 =
+ root_poa->create_servant_retention_policy (PortableServer::RETAIN
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any policy_value;
+ policy_value <<= PortableServer::RETAIN;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (PortableServer::SERVANT_RETENTION_POLICY_ID,
+ policy_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::ServantRetentionPolicy_var policy2 =
+ PortableServer::ServantRetentionPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (policy1->value () == policy2->value ());
+ }
+
+ {
+ PortableServer::RequestProcessingPolicy_var policy1 =
+ root_poa->create_request_processing_policy (PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Any policy_value;
+ policy_value <<= PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY;
+
+ CORBA::Policy_var policy =
+ orb->create_policy (PortableServer::REQUEST_PROCESSING_POLICY_ID,
+ policy_value
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::RequestProcessingPolicy_var policy2 =
+ PortableServer::RequestProcessingPolicy::_narrow (policy.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_ASSERT (policy1->value () == policy2->value ());
+ }
+
+#endif /* TAO_HAS_MINIMUM_POA == 0 */
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Exception caught");
+ return -1;
+ }
+ ACE_ENDTRY;
+ ACE_CHECK_RETURN (-1);
+
+ return 0;
+}
diff --git a/TAO/tests/POA/Policies/Policies.dsp b/TAO/tests/POA/Policies/Policies.dsp
new file mode 100644
index 00000000000..5b53a78a198
--- /dev/null
+++ b/TAO/tests/POA/Policies/Policies.dsp
@@ -0,0 +1,100 @@
+# Microsoft Developer Studio Project File - Name="POA Policies" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=POA Policies - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Policies.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Policies.mak" CFG="POA Policies - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "POA Policies - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "POA Policies - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "POA Policies - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\..\.." /I "..\..\.." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ace.lib TAO.lib TAO_PortableServer.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+
+!ELSEIF "$(CFG)" == "POA Policies - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\..\.." /I "..\..\.." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 aced.lib TAOd.lib TAO_PortableServerd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\tao\PortableServer" /libpath:"..\..\..\tao" /libpath:"..\..\..\..\ace"
+
+!ENDIF
+
+# Begin Target
+
+# Name "POA Policies - Win32 Release"
+# Name "POA Policies - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Policies.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# End Target
+# End Project
diff --git a/TAO/tests/POA/Policies/Policies.dsw b/TAO/tests/POA/Policies/Policies.dsw
new file mode 100644
index 00000000000..7b285e093c8
--- /dev/null
+++ b/TAO/tests/POA/Policies/Policies.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Policies"=.\Policies.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/TAO/tests/POA/Policies/Policies.mpc b/TAO/tests/POA/Policies/Policies.mpc
new file mode 100644
index 00000000000..cacefcf62e9
--- /dev/null
+++ b/TAO/tests/POA/Policies/Policies.mpc
@@ -0,0 +1,3 @@
+project(Policies): server {
+ exename = Policies
+}
diff --git a/TAO/tests/POA/Policies/makefile.bor b/TAO/tests/POA/Policies/makefile.bor
new file mode 100644
index 00000000000..d48a7d318d1
--- /dev/null
+++ b/TAO/tests/POA/Policies/makefile.bor
@@ -0,0 +1,14 @@
+
+#
+# Makefile for building the Policies test
+#
+
+NAME = Policies
+
+OBJFILES = \
+ $(OBJDIR)\Policies.obj
+
+CPPDIR = .;..
+
+!include <$(ACE_ROOT)\include\makeinclude\build_example.bor>
+
diff --git a/TAO/tests/POA/Policies/run_test.pl b/TAO/tests/POA/Policies/run_test.pl
new file mode 100755
index 00000000000..23ab04cd393
--- /dev/null
+++ b/TAO/tests/POA/Policies/run_test.pl
@@ -0,0 +1,20 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id$
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$T = new PerlACE::Process ("Policies");
+
+$test = $T->SpawnWaitKill (60);
+
+if ($test != 0) {
+ print STDERR "ERROR: test returned $test\n";
+ exit 1;
+}
+
+exit 0;
diff --git a/TAO/tests/POA/README b/TAO/tests/POA/README
index 7560abe5e0b..efd49e5b943 100644
--- a/TAO/tests/POA/README
+++ b/TAO/tests/POA/README
@@ -65,3 +65,8 @@ Object Adapter (POA) interfaces and their usage scenarios.
This test checks the combination of PERSISTENT &
SYSTEM_ID POA policies.
+ . Policies
+
+ This program tests the construction of POA policies,
+ both through the generic ORB::create_policy interface
+ and the PortableServer specific interfaces.
diff --git a/TAO/tests/TAO_Tests.dsw b/TAO/tests/TAO_Tests.dsw
index 8fcbe013886..7609035cd8b 100644
--- a/TAO/tests/TAO_Tests.dsw
+++ b/TAO/tests/TAO_Tests.dsw
@@ -1323,6 +1323,18 @@ Package=<4>
###############################################################################
+Project: "POA Policies"=".\POA\Policies\Policies.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
Project: "POA Excessive_Object_Deactivations"=".\POA\Excessive_Object_Deactivations\Excessive_Object_Deactivations.dsp" - Package Owner=<4>
Package=<5>
diff --git a/bin/auto_run_tests.lst b/bin/auto_run_tests.lst
index 8e3822b0271..4087082b4b1 100644
--- a/bin/auto_run_tests.lst
+++ b/bin/auto_run_tests.lst
@@ -82,6 +82,7 @@ TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl: !ST
TAO/tests/NestedUpcall/Triangle_Test/run_test.pl
TAO/tests/Nested_Event_Loop/run_test.pl
TAO/tests/POA/Identity/run_test.pl
+TAO/tests/POA/Policies/run_test.pl
TAO/tests/POA/Excessive_Object_Deactivations/run_test.pl
TAO/tests/POA/Persistent_ID/run_test.pl
TAO/tests/POA/Etherealization/run_test.pl: !MINIMUM