summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McQueen <simon.mcqueen@gmail.com>2006-08-02 15:37:15 +0000
committerSimon McQueen <simon.mcqueen@gmail.com>2006-08-02 15:37:15 +0000
commit633af9a1e72dadb88e9b4e2976930df9b97b6849 (patch)
treee3666b4efe8d5e31007822c8636d24c6242c8511
parenta322e7dfede1be13684ffe8937ba4aa947dd4678 (diff)
downloadATCD-633af9a1e72dadb88e9b4e2976930df9b97b6849.tar.gz
ChangeLogTag: Wed Aug 2 15:11:08 UTC 2006 Simon McQueen <sm@prismtech.com>
-rw-r--r--TAO/ChangeLog23
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp25
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h3
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/Bug_2615_Regression.mpc37
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/Hello.cpp34
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/Hello.h45
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/README25
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.cpp52
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.h51
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.cpp120
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.h92
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/Test.idl23
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/client.cpp139
-rwxr-xr-xTAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl55
-rw-r--r--TAO/orbsvcs/tests/Bug_2615_Regression/server.cpp254
15 files changed, 970 insertions, 8 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index bbf2d27f4d6..636ba3deed5 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,26 @@
+Wed Aug 2 15:11:08 UTC 2006 Simon McQueen <sm@prismtech.com>
+
+ * orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h:
+ * orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp:
+
+ Do not transmit a FT_REQUEST service context if the destination is
+ not an IOGR (i.e. does not contain a IOP::TAG_FT_GROUP component).
+
+ * orbsvcs/tests/Bug_2615_Regression/Bug_2615_Regression.mpc:
+ * orbsvcs/tests/Bug_2615_Regression/Hello.h:
+ * orbsvcs/tests/Bug_2615_Regression/Hello.cpp:
+ * orbsvcs/tests/Bug_2615_Regression/README:
+ * orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.h:
+ * orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.cpp:
+ * orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.h:
+ * orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.cpp:
+ * orbsvcs/tests/Bug_2615_Regression/Test.idl:
+ * orbsvcs/tests/Bug_2615_Regression/client.cpp:
+ * orbsvcs/tests/Bug_2615_Regression/run_test.pl:
+ * orbsvcs/tests/Bug_2615_Regression/server.cpp:
+
+ Regression test for the above.
+
Wed Aug 2 13:03:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl>
* tao/DynamicInterface/DII_Invocation_Adapter.{h,cpp}:
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp
index ad331580af6..1da0a14348d 100644
--- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.cpp
@@ -88,7 +88,22 @@ namespace TAO
op.in ()));
}
- this->group_version_context (ri
+ IOP::TaggedComponent_var tp;
+ ACE_TRY
+ {
+ tp =
+ ri->get_effective_component (IOP::TAG_FT_GROUP
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ return;
+ }
+ ACE_ENDTRY;
+
+ this->group_version_context (ri,
+ tp
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
@@ -239,17 +254,13 @@ namespace TAO
void
FT_ClientRequest_Interceptor::group_version_context (
- PortableInterceptor::ClientRequestInfo_ptr ri
+ PortableInterceptor::ClientRequestInfo_ptr ri,
+ IOP::TaggedComponent* tp
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_TRY
{
- IOP::TaggedComponent_var tp =
- ri->get_effective_component (IOP::TAG_FT_GROUP
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
// Grab the object group version
// @@ NOTE: This involves an allocation and a dellocation. This is
// really bad.
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h
index c4115555085..51f92c674d9 100644
--- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_ClientRequest_Interceptor.h
@@ -112,7 +112,8 @@ namespace TAO
private:
- void group_version_context (PortableInterceptor::ClientRequestInfo_ptr ri
+ void group_version_context (PortableInterceptor::ClientRequestInfo_ptr ri,
+ IOP::TaggedComponent* tp
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/Bug_2615_Regression.mpc b/TAO/orbsvcs/tests/Bug_2615_Regression/Bug_2615_Regression.mpc
new file mode 100644
index 00000000000..1503a7c0a49
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/Bug_2615_Regression.mpc
@@ -0,0 +1,37 @@
+// -*- MPC -*-
+// $Id: tao397_regression.mpc,v 1.1 2006/07/26 12:54:06 sm Exp $
+
+project(*IDL): taoidldefaults {
+ IDL_Files {
+ Test.idl
+ }
+ custom_only = 1
+}
+
+project(*Client): taoserver, ftclientorb {
+ after += *IDL
+
+ exename = client
+ Source_Files {
+ client.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
+
+project (*Server) : taoserver, ftclientorb, pi_server {
+ after += *IDL
+
+ exename = server
+ Source_Files {
+ server.cpp
+ Hello.cpp
+ ServerORBInitializer2.cpp
+ ServerRequest_Interceptor2.cpp
+ TestS.cpp
+ TestC.cpp
+ }
+ IDL_Files {
+ }
+}
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/Hello.cpp b/TAO/orbsvcs/tests/Bug_2615_Regression/Hello.cpp
new file mode 100644
index 00000000000..805e10d5d49
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/Hello.cpp
@@ -0,0 +1,34 @@
+//
+// $Id: Hello.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $
+//
+
+#include "ServerRequest_Interceptor2.h"
+#include "Hello.h"
+
+ACE_RCSID(Hello, Hello, "$Id: Hello.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $")
+
+Hello::Hello (CORBA::ORB_ptr orb, Test::Hello_ptr, CORBA::ULong)
+ : orb_ (CORBA::ORB::_duplicate (orb))
+{
+}
+
+void
+Hello::shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+}
+
+void
+Hello::ping (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return;
+}
+
+CORBA::Boolean
+Hello::has_ft_request_service_context (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return ServerRequest_Interceptor2::has_ft_request_sc_;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/Hello.h b/TAO/orbsvcs/tests/Bug_2615_Regression/Hello.h
new file mode 100644
index 00000000000..ceca3785f1b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/Hello.h
@@ -0,0 +1,45 @@
+//
+// $Id: Hello.h,v 1.1 2006/07/26 12:54:06 sm Exp $
+//
+
+#ifndef HELLO_H
+#define HELLO_H
+#include /**/ "ace/pre.h"
+
+#include "TestS.h"
+
+#if defined (_MSC_VER)
+# pragma warning(push)
+# pragma warning (disable:4250)
+#endif /* _MSC_VER */
+
+/// Implement the Test::Hello interface
+class Hello
+ : public virtual POA_Test::Hello
+{
+public:
+ /// Constructor
+ Hello (CORBA::ORB_ptr orb, Test::Hello_ptr server, CORBA::ULong server_id = 0);
+
+ // = The skeleton methods
+ virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void ping (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual CORBA::Boolean has_ft_request_service_context (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+ /// Use an ORB reference to conver strings to objects and shutdown
+ /// the application.
+ CORBA::ORB_var orb_;
+};
+
+#if defined(_MSC_VER)
+# pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+#endif /* HELLO_H */
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/README b/TAO/orbsvcs/tests/Bug_2615_Regression/README
new file mode 100644
index 00000000000..50ca7c7c285
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/README
@@ -0,0 +1,25 @@
+// $Id: README,v 1.1 2006/07/26 12:54:06 sm Exp $
+
+This test provides regression coverage for bug tao397.
+
+The server installs a server request interceptor and persistent servant and writes out a vanilla IOR and an IOGR for itself.
+The client installs client side FT support and invokes the method "has_ft_request_service_context" on the IOR and then the IOGR.
+The server request interceptor indicates back to the client via the return value of the method if a FT request service context was transmitted.
+The client expects a context to have been sent *iff* the request was made on the IOGR.
+
+__Regression Output__
+
+[sm@beatrice tao397_regression]$ ./run_test.pl
+ERROR - REGRESSION - Request made on a plain IOR has a FT_REQUEST service context.
+Request made on an IOGR has a FT_REQUEST service context. This is OK.
+(9595|3074492096) server - event loop finished
+Error: REGRESSION identified!!!
+ERROR: client returned 1
+
+__Successful Output__
+
+[sm@beatrice tao397_regression]$ ./run_test.pl
+Request made on a plain IOR has no FT_REQUEST service context. This is OK.
+Request made on an IOGR has a FT_REQUEST service context. This is OK.
+(9496|3074320064) server - event loop finished
+Test passed !!!
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.cpp b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.cpp
new file mode 100644
index 00000000000..a3f6ad8ae7b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.cpp
@@ -0,0 +1,52 @@
+// -*- C++ -*-
+//
+// $Id: ServerORBInitializer2.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $
+
+#include "ServerORBInitializer2.h"
+#include "ServerRequest_Interceptor2.h"
+#include "tao/ORB_Constants.h"
+#include "tao/Exception.h"
+
+
+void
+Server_ORBInitializer2::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+
+}
+
+void
+Server_ORBInitializer2::post_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->register_server_request_interceptors (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+Server_ORBInitializer2::register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ PortableInterceptor::ServerRequestInterceptor_ptr sri =
+ PortableInterceptor::ServerRequestInterceptor::_nil ();
+
+ ACE_NEW_THROW_EX (sri,
+ ServerRequest_Interceptor2,
+ CORBA::NO_MEMORY ());
+
+ PortableInterceptor::ServerRequestInterceptor_var
+ server_interceptor = sri;
+
+ info->add_server_request_interceptor (server_interceptor.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.h b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.h
new file mode 100644
index 00000000000..1b99e5ed81b
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerORBInitializer2.h
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id: ServerORBInitializer2.h,v 1.1 2006/07/26 12:54:06 sm Exp $
+ */
+//=============================================================================
+#ifndef TAO249_SERVER_ORBINITIALIZER2_H
+#define TAO249_SERVER_ORBINITIALIZER2_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/PI_Server/PI_Server_includeC.h"
+#include "tao/PI/PI.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+/// RTCORBA ORB initializer.
+class Server_ORBInitializer2 :
+ public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+private:
+
+ /// Register the necessary interceptors.
+ void register_server_request_interceptors (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+};
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO249_SERVER_ORBINITIALIZER2_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.cpp b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.cpp
new file mode 100644
index 00000000000..fa4b35acb0e
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.cpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+
+#include "ServerRequest_Interceptor2.h"
+#include "orbsvcs/FT_CORBA_ORBC.h"
+#include "tao/IOP_IORC.h"
+#include "tao/ORB_Constants.h"
+#include "tao/AnyTypeCode/DynamicC.h"
+#include "tao/AnyTypeCode/TypeCode.h"
+#include "tao/CDR.h"
+#include "ace/Log_Msg.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "Hello.h"
+#include "ace/OS_NS_sys_time.h"
+#include "tao/PI/PIForwardRequestC.h"
+
+ACE_RCSID (FaultTolerance,
+ ServerRequest_Interceptor2,
+ "$Id: ServerRequest_Interceptor2.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $")
+
+CORBA::Boolean
+ServerRequest_Interceptor2::has_ft_request_sc_ = false;
+
+ServerRequest_Interceptor2::ServerRequest_Interceptor2 (void)
+: orb_ (0)
+{
+}
+
+ServerRequest_Interceptor2::~ServerRequest_Interceptor2 (void)
+{
+}
+
+char *
+ServerRequest_Interceptor2::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("ServerRequest_Interceptor2");
+}
+
+void
+ServerRequest_Interceptor2::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerRequest_Interceptor2::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ServerRequest_Interceptor2::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ CORBA::String_var op = ri->operation (ACE_ENV_SINGLE_ARG_PARAMETER);
+
+ if (ACE_OS::strcmp (op.in (), "has_ft_request_service_context"))
+ {
+ // bail if not the op we are interested in -
+ // avoid excess spurious error clutter when client calls ::shutdown; ::ping etc..
+ return;
+ }
+
+ ACE_TRY
+ {
+ IOP::ServiceContext_var sc =
+ ri->get_request_service_context (IOP::FT_REQUEST
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // No exception therefore there was a context
+ has_ft_request_sc_ = true;
+ }
+ ACE_CATCH (CORBA::BAD_PARAM, ex)
+ {
+ ACE_UNUSED_ARG (ex);
+ // No group version context
+ has_ft_request_sc_ = false;
+ }
+ ACE_CATCHANY
+ {
+ ACE_RE_THROW;
+ }
+ ACE_ENDTRY;
+}
+
+void
+ServerRequest_Interceptor2::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+ServerRequest_Interceptor2::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+ServerRequest_Interceptor2::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.h b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.h
new file mode 100644
index 00000000000..c0b4071a063
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/ServerRequest_Interceptor2.h
@@ -0,0 +1,92 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * $Id: ServerRequest_Interceptor2.h,v 1.1 2006/07/26 12:54:06 sm Exp $
+ */
+//=============================================================================
+
+#ifndef TAO249_SERVER_REQUEST_INTERCEPTOR2_H
+#define TAO249_SERVER_REQUEST_INTERCEPTOR2_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+#include "tao/ORB.h"
+#include "tao/PI/PI.h"
+#include "tao/PI_Server/PI_Server.h"
+
+/**
+* $Id: ServerRequest_Interceptor2.h,v 1.1 2006/07/26 12:54:06 sm Exp $
+*/
+class ServerRequest_Interceptor2
+: public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+/// Constructor.
+ServerRequest_Interceptor2 (void);
+
+/// Destructor.
+~ServerRequest_Interceptor2 (void);
+
+/**
+ * @name Methods Required by the Server Request Interceptor
+ * Interface
+ *
+ * These are methods that must be implemented since they are pure
+ * virtual in the abstract base class. They are the canonical
+ * methods required for all server request interceptors.
+ */
+//@{
+/// Return the name of this ServerRequestinterceptor.
+virtual char * name (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void destroy (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+//@}
+
+static CORBA::Boolean has_ft_request_sc_;
+
+private:
+
+CORBA::ORB_var orb_;
+};
+
+#endif /* TAO249_SERVER_REQUEST_INTERCEPTOR2_H */
+
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/Test.idl b/TAO/orbsvcs/tests/Bug_2615_Regression/Test.idl
new file mode 100644
index 00000000000..349a85259b6
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/Test.idl
@@ -0,0 +1,23 @@
+//
+// $Id: Test.idl,v 1.1 2006/07/26 12:54:06 sm Exp $
+//
+
+/// Put the interfaces in a module, to avoid global namespace pollution
+module Test
+{
+ interface Hello
+ {
+ /// A method to shutdown the ORB
+ /**
+ * This method is used to simplify the test shutdown process
+ */
+ oneway void shutdown ();
+
+ // Lets make sure things are working
+ void ping ();
+
+ // Calling this method returns true iff a FT request
+ // service context was received in the server
+ boolean has_ft_request_service_context ();
+ };
+};
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/client.cpp b/TAO/orbsvcs/tests/Bug_2615_Regression/client.cpp
new file mode 100644
index 00000000000..ff096ab02e2
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/client.cpp
@@ -0,0 +1,139 @@
+// $Id: client.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $
+
+#include "TestS.h"
+#include "ace/Get_Opt.h"
+#include "orbsvcs/FaultTolerance/FT_ClientService_Activate.h"
+#include "Hello.h"
+
+ACE_RCSID(Hello, client, "$Id: client.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $")
+
+const char *ior = "file://ior.ior";
+const char *iogr = "file://iogr.ior";
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "k:l:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'k':
+ ior = get_opts.opt_arg ();
+ break;
+ case 'l':
+ iogr = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-k <ior> "
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+ CORBA::Boolean result = 0;
+ ACE_TRY_NEW_ENV
+ {
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ // First perform the test with an IOR
+ CORBA::Object_var tmp =
+ orb->string_to_object(ior ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ Test::Hello_var hello =
+ Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
+ ior),
+ 1);
+ }
+
+ // Check this isn't generating exceptions for any other reason
+ hello->ping (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (hello->has_ft_request_service_context (ACE_ENV_SINGLE_ARG_PARAMETER))
+ {
+ ACE_DEBUG ((LM_ERROR, "ERROR - REGRESSION - Request made on a plain IOR has a FT_REQUEST service context.\n" ));
+ result = 1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Request made on a plain IOR has no FT_REQUEST service context. This is OK.\n" ));
+ }
+
+ // Now repeat the test (for the converse result) with an IOGR
+ tmp =
+ orb->string_to_object(iogr ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ hello =
+ Test::Hello::_narrow(tmp.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (hello.in ()))
+ {
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ "Test failed - Not regression - Unexpected Nil Test::Hello reference <%s>\n",
+ iogr),
+ 1);
+ }
+
+ // Check this isn't generating transients for any other reason
+ hello->ping (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (! hello->has_ft_request_service_context (ACE_ENV_SINGLE_ARG_PARAMETER))
+ {
+ ACE_DEBUG ((LM_ERROR, "ERROR - REGRESSION - Request made on an IOGR has no FT_REQUEST service context.\n" ));
+ result = 1;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Request made on an IOGR has a FT_REQUEST service context. This is OK.\n" ));
+ }
+
+ hello->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Test failed (Not regression) because unexpected exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ if (result)
+ {
+ ACE_DEBUG ((LM_ERROR, "Error: REGRESSION identified!!!\n"));
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Test passed !!!\n"));
+ }
+ return result;
+}
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl b/TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl
new file mode 100755
index 00000000000..b4e205ee32c
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl
@@ -0,0 +1,55 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# $Id: run_test.pl,v 1.1 2006/07/26 12:54:06 sm Exp $
+# -*- perl -*-
+
+use lib '../../../../bin';
+use PerlACE::Run_Test;
+
+$status = 0;
+
+$iorfile = PerlACE::LocalFile ("ior.ior");
+$iogrfile = PerlACE::LocalFile ("iogr.ior");
+unlink $iorfile;
+unlink $iogrfile;
+
+if (PerlACE::is_vxworks_test()) {
+ $CL = new PerlACE::ProcessVX ("client");
+}
+else {
+ $CL = new PerlACE::Process ("client");
+}
+
+$SV = new PerlACE::Process ("server");
+
+$SV->Spawn ();
+
+if (PerlACE::waitforfile_timed ($iorfile,
+ $PerlACE::wait_interval_for_process_creation) == -1
+ || PerlACE::waitforfile_timed ($iogrfile,
+ $PerlACE::wait_interval_for_process_creation) == -1) {
+ print STDERR "ERROR: cannot find file <$iorfile>\n";
+ $SV->Kill (); $SV->TimedWait (1);
+ exit 1;
+}
+
+$client = $CL->SpawnWaitKill (300);
+
+if ($client != 0) {
+ print STDERR "ERROR: client returned $client\n";
+ $status = 1;
+}
+
+$server = $SV->WaitKill (10);
+
+if ($server != 0) {
+ print STDERR "ERROR: server returned $server\n";
+ $status = 1;
+}
+
+unlink $iorfile;
+unlink $iogrfile;
+
+exit $status;
diff --git a/TAO/orbsvcs/tests/Bug_2615_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_2615_Regression/server.cpp
new file mode 100644
index 00000000000..aed95427025
--- /dev/null
+++ b/TAO/orbsvcs/tests/Bug_2615_Regression/server.cpp
@@ -0,0 +1,254 @@
+// $Id: server.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $
+
+#include "ace/Get_Opt.h"
+#include "ace/OS_NS_stdio.h"
+#include "tao/IORManipulation/IORManip_Loader.h"
+#include "tao/PortableServer/PortableServer.h"
+#include "orbsvcs/FaultTolerance/FT_IOGR_Property.h"
+#include "ServerORBInitializer2.h"
+#include "ServerRequest_Interceptor2.h"
+#include "tao/PI/PI.h"
+#include "tao/ORBInitializer_Registry.h"
+#include "Hello.h"
+
+ACE_RCSID (Hello,
+ server,
+ "$Id: server.cpp,v 1.1 2006/07/26 12:54:06 sm Exp $")
+
+const char *ior_output_file = "ior.ior";
+const char *iogr_output_file = "iogr.ior";
+TAO_IOP::TAO_IOR_Manipulation_var iorm = 0;
+
+int
+parse_args (int argc, char *argv[])
+{
+ ACE_Get_Opt get_opts (argc, argv, "o:p:");
+ int c;
+
+ while ((c = get_opts ()) != -1)
+ switch (c)
+ {
+ case 'o':
+ ior_output_file = get_opts.opt_arg ();
+ break;
+ case 'p':
+ iogr_output_file = get_opts.opt_arg ();
+ break;
+ case '?':
+ default:
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "usage: %s "
+ "-o <iorfile>"
+ "\n",
+ argv [0]),
+ -1);
+ }
+ // Indicates sucessful parsing of the command line
+ return 0;
+}
+
+CORBA::Object_ptr
+make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_version, CORBA::Object_ptr ref ACE_ENV_ARG_DECL)
+{
+ FT::TagFTGroupTaggedComponent ft_tag_component;
+ // Create the list
+ TAO_IOP::TAO_IOR_Manipulation::IORList iors (1);
+ iors.length(1);
+ iors [0] = CORBA::Object::_duplicate (ref);
+
+ CORBA::Object_var new_ref =
+ iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Property values
+
+ // Major and Minor revision numbers
+ ft_tag_component.component_version.major = (CORBA::Octet) 1;
+ ft_tag_component.component_version.minor = (CORBA::Octet) 0;
+
+ // Domain id
+ //const char *id = "iogr_testing";
+ ft_tag_component.group_domain_id = domain_id;
+
+ // Object group id
+ ft_tag_component.object_group_id = group_id;
+
+ // Version
+ ft_tag_component.object_group_ref_version = group_version;
+
+ // Construct the IOGR Property class
+ TAO_FT_IOGR_Property iogr_prop (ft_tag_component);
+
+ // Set the property
+ CORBA::Boolean retval = iorm->set_property (&iogr_prop,
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+
+ // Set the primary
+ // See we are setting the second ior as the primary
+ if (retval != 0)
+ {
+ retval = iorm->set_primary (&iogr_prop,
+ new_ref.in (),
+ new_ref.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (0);
+ }
+
+ return new_ref._retn ();
+}
+
+int
+main (int argc, char *argv[])
+{
+ ACE_TRY_NEW_ENV
+ {
+ Server_ORBInitializer2 *temp_initializer = 0;
+ ACE_NEW_RETURN (temp_initializer,
+ Server_ORBInitializer2,
+ -1); // No exceptions yet!
+ PortableInterceptor::ORBInitializer_var orb_initializer =
+ temp_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::ORB_var orb =
+ CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var poa_object =
+ orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (CORBA::is_nil (root_poa.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%P|%t) Panic: nil RootPOA\n"),
+ 1);
+
+ PortableServer::POAManager_var poa_manager =
+ root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::PolicyList policies (2);
+ policies.length (2);
+
+ policies[0] =
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK
+
+ policies[1] =
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ PortableServer::POA_var my_poa =
+ root_poa->create_POA ("my_poa",
+ poa_manager.in (),
+ policies
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Creation of the new POA is over, so destroy the Policy_ptr's.
+ for (CORBA::ULong i = 0; i < policies.length (); ++i)
+ {
+ CORBA::Policy_ptr policy = policies[i];
+ policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+
+
+ if (parse_args (argc, argv) != 0)
+ return 1;
+
+ Hello *hello_impl;
+ ACE_NEW_RETURN (hello_impl,
+ Hello (orb.in (), Test::Hello::_nil ()),
+ 1);
+
+ PortableServer::ObjectId_var server_id =
+ PortableServer::string_to_ObjectId ("server_id");
+
+ my_poa->activate_object_with_id (server_id.in (),
+ hello_impl
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var hello =
+ my_poa->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var ior =
+ orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ FILE *output_file = ACE_OS::fopen (ior_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ ior_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", ior.in ());
+ ACE_OS::fclose (output_file);
+
+
+ // Get a ref to the IORManipulation object
+ CORBA::Object_var IORM =
+ orb->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
+ 0
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Narrow
+ iorm =
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::Object_var iogr = make_iogr ("Domain_1", 1, 1, orb->string_to_object (ior.in ()) ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ CORBA::String_var iorgr_string =
+ orb->object_to_string (iogr.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ // Output the IOR to the <iogr_output_file>
+ output_file = ACE_OS::fopen (iogr_output_file, "w");
+ if (output_file == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s",
+ iogr_output_file),
+ 1);
+ ACE_OS::fprintf (output_file, "%s", iorgr_string.in ());
+ ACE_OS::fclose (output_file);
+
+ poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
+
+ root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Exception caught:");
+ return 1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}