summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog14
-rw-r--r--TAO/tao/Makefile.am3
-rw-r--r--TAO/tao/PortableServer/Local_Servant_Base.cpp20
-rw-r--r--TAO/tao/PortableServer/Local_Servant_Base.h58
-rw-r--r--TAO/tao/PortableServer/Local_Servant_Base.inl31
-rw-r--r--TAO/tao/PortableServer/Servant_Base.cpp24
-rw-r--r--TAO/tao/PortableServer/Servant_Base.h68
-rw-r--r--TAO/tao/PortableServer/Servant_Base.i32
8 files changed, 149 insertions, 101 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index a741cd2b417..f04666ce5d1 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,17 @@
+Sun Jan 9 10:30:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tao/PortableServer/Servant_Base.{h,cpp,i}:
+ * tao/PortableServer/Local_Servant_Base.{h,cpp,inl}:
+ Moved TAO_Local_ServantBase to its own file. Also changed
+ TAO_RefCountServantBase::_ref_count to
+ TAO_RefCountServantBase::_refcount_value, the first was TAO
+ specific, the second is defined by the corba spec. This fixes
+ bugzilla [1951]. Thanks to Frank Pilhofer <fp at mc dot com>
+ for reporting this
+
+ * tao/Makefile.am:
+ Updated for change above
+
Sat Jan 8 14:49:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
* performance-tests/Sequence_Latency/Thread_Per_Connection/Thread_Per_Conn.mpc:
diff --git a/TAO/tao/Makefile.am b/TAO/tao/Makefile.am
index 4683a855548..869cad7773f 100644
--- a/TAO/tao/Makefile.am
+++ b/TAO/tao/Makefile.am
@@ -1037,6 +1037,7 @@ libTAO_PortableServer_la_SOURCES = \
PortableServer/PortableServerC.cpp \
PortableServer/PortableServer_ORBInitializer.cpp \
PortableServer/PortableServer_PolicyFactory.cpp \
+ PortableServer/Local_Servant_Base.cpp \
PortableServer/Servant_Base.cpp \
PortableServer/Servant_Dispatcher.cpp \
PortableServer/ServerInterceptorAdapter.cpp \
@@ -1083,6 +1084,7 @@ nobase_include_HEADERS += \
PortableServer/PortableServer_ORBInitializer.h \
PortableServer/PortableServer_PolicyFactory.h \
PortableServer/Servant_Base.h \
+ PortableServer/Local_Servant_Base.h \
PortableServer/Servant_Dispatcher.h \
PortableServer/ServerInterceptorAdapter.h \
PortableServer/ServerRequestInfo.h \
@@ -1103,6 +1105,7 @@ nobase_include_HEADERS += \
PortableServer/PolicyS_T.inl \
PortableServer/PortableServerC.inl \
PortableServer/Servant_Base.i \
+ PortableServer/Local_Servant_Base.inl \
PortableServer/ServerInterceptorAdapter.inl \
PortableServer/ServerRequestInfo.inl \
PortableServer/PolicyS_T.cpp \
diff --git a/TAO/tao/PortableServer/Local_Servant_Base.cpp b/TAO/tao/PortableServer/Local_Servant_Base.cpp
new file mode 100644
index 00000000000..319d5d22acf
--- /dev/null
+++ b/TAO/tao/PortableServer/Local_Servant_Base.cpp
@@ -0,0 +1,20 @@
+// $Id$
+
+#include "tao/PortableServer/Local_Servant_Base.h"
+#include "tao/SystemException.h"
+
+ACE_RCSID (PortableServer,
+ Local_Servant_Base,
+ "$Id$")
+
+#if !defined (__ACE_INLINE__)
+# include "Local_Servant_Base.inl"
+#endif /* ! __ACE_INLINE__ */
+
+void
+TAO_Local_ServantBase::_dispatch (TAO_ServerRequest &,
+ void *
+ ACE_ENV_ARG_DECL)
+{
+ ACE_THROW (CORBA::BAD_OPERATION ());
+}
diff --git a/TAO/tao/PortableServer/Local_Servant_Base.h b/TAO/tao/PortableServer/Local_Servant_Base.h
new file mode 100644
index 00000000000..6c624d77d01
--- /dev/null
+++ b/TAO/tao/PortableServer/Local_Servant_Base.h
@@ -0,0 +1,58 @@
+// This may look like C, but it's really -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Local_Servant_Base.h
+ *
+ * $Id$
+ *
+ * @author Irfan Pyarali <irfan@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_LOCAL_SERVANT_BASE_H
+#define TAO_LOCAL_SERVANT_BASE_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/PortableServer/portableserver_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableServer/Servant_Base.h"
+
+/**
+ * @class TAO_Local_ServantBase
+ *
+ * @brief Base class for local servants.
+ *
+ * This servant does not register with the POA and does not
+ * produce a valid stub, i.e., object references of this servant
+ * cannot be exported. The (collocated) stubs of these servants
+ * will always be direct, i.e., call directly to the servant and
+ * don't call through the POA since this servant is not
+ * registered with the POA.
+ */
+class TAO_PortableServer_Export TAO_Local_ServantBase
+ : public virtual TAO_ServantBase
+{
+protected:
+ /// This is an auxiliar method for _this(). Make sure *not* to
+ /// register with the default POA.
+ TAO_Stub *_create_stub (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
+
+ /// Throws CORBA::BAD_OPERATION exception.
+ void _dispatch (TAO_ServerRequest &request,
+ void *servant_upcall
+ ACE_ENV_ARG_DECL);
+};
+
+#if defined (__ACE_INLINE__)
+# include "Local_Servant_Base.inl"
+#endif /* __ACE_INLINE__ */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_LOCAL_SERVANT_BASE_H */
diff --git a/TAO/tao/PortableServer/Local_Servant_Base.inl b/TAO/tao/PortableServer/Local_Servant_Base.inl
new file mode 100644
index 00000000000..e6ac4e794a4
--- /dev/null
+++ b/TAO/tao/PortableServer/Local_Servant_Base.inl
@@ -0,0 +1,31 @@
+// $Id$
+
+ACE_INLINE TAO_Stub *
+TAO_Local_ServantBase::_create_stub (ACE_ENV_SINGLE_ARG_DECL)
+{
+#if 0
+ PortableServer::ObjectId_var invalid_oid =
+ PortableServer::string_to_ObjectId ("invalid");
+
+ TAO::ObjectKey tmp_key (invalid_oid->length (),
+ invalid_oid->length (),
+ invalid_oid->get_buffer (),
+ 0);
+
+ // It is ok to use TAO_ORB_Core_instance here since the locality
+ // constrained servant does not really register with a POA or get
+ // exported remotely.
+ //
+ // The correct thing to do is to probably use ORB of the default
+ // POA. The unfortunate part is that calling default_POA() requires
+ // the creation of a local stub, hence causing a infinite loop.
+ return TAO_ORB_Core_instance ()->orb ()->create_stub_object (tmp_key,
+ this->_interface_repository_id ()
+ ACE_ENV_ARG_PARAMETER);
+#else
+# if !defined (ACE_HAS_EXCEPTIONS)
+ ACE_UNUSED_ARG (ACE_ENV_SINGLE_ARG_PARAMETER);
+#endif
+ return 0;
+#endif
+}
diff --git a/TAO/tao/PortableServer/Servant_Base.cpp b/TAO/tao/PortableServer/Servant_Base.cpp
index 4e6f1ed2dd0..ddb5aad1963 100644
--- a/TAO/tao/PortableServer/Servant_Base.cpp
+++ b/TAO/tao/PortableServer/Servant_Base.cpp
@@ -1,8 +1,8 @@
// $Id$
-#include "Servant_Base.h"
-#include "POA.h"
-#include "Operation_Table.h"
+#include "tao/PortableServer/Servant_Base.h"
+#include "tao/PortableServer/POA.h"
+#include "tao/PortableServer/Operation_Table.h"
#include "tao/Timeprobe.h"
#include "tao/ORB_Core.h"
@@ -139,13 +139,6 @@ TAO_ServantBase::_find (const char *opname,
return optable_->find (opname, skelfunc, st, length);
}
-/*int
-TAO_ServantBase::_bind (const char *opname,
- const TAO_Skeleton skel_ptr)
-{
- return optable_->bind (opname, skel_ptr);
-}
-*/
TAO_Stub *
TAO_ServantBase::_create_stub (ACE_ENV_SINGLE_ARG_DECL)
{
@@ -337,8 +330,8 @@ TAO_RefCountServantBase::_remove_ref (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
delete this;
}
-long
-TAO_RefCountServantBase::_ref_count (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
+CORBA::ULong
+TAO_RefCountServantBase::_refcount_value (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) const
{
return this->ref_count_.value ();
}
@@ -512,10 +505,3 @@ TAO_ServantBase_var::_retn (void)
return retval;
}
-void
-TAO_Local_ServantBase::_dispatch (TAO_ServerRequest &,
- void *
- ACE_ENV_ARG_DECL)
-{
- ACE_THROW (CORBA::BAD_OPERATION ());
-}
diff --git a/TAO/tao/PortableServer/Servant_Base.h b/TAO/tao/PortableServer/Servant_Base.h
index 7b411e477a2..88a7ed0f428 100644
--- a/TAO/tao/PortableServer/Servant_Base.h
+++ b/TAO/tao/PortableServer/Servant_Base.h
@@ -55,7 +55,7 @@ public:
virtual CORBA::Boolean _is_a (const char *logical_type_id
ACE_ENV_ARG_DECL_WITH_DEFAULTS);
- /// Default <_non_existent>: always returns false.
+ /// Default _non_existent: always returns false.
virtual CORBA::Boolean _non_existent (
ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
);
@@ -65,7 +65,7 @@ public:
ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
);
- /// Default <_get_component>: always returns CORBA::Object::_nil().
+ /// Default _get_component: always returns CORBA::Object::_nil().
virtual CORBA::Object_ptr _get_component (
ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS
);
@@ -81,7 +81,7 @@ public:
* type to the most derived type, demarshall all the parameters from
* the request and finally invokes the operation, storing the
* results and out parameters (if any) or the exceptions thrown into
- * <request>.
+ * @a request.
*/
virtual void _dispatch (TAO_ServerRequest &request,
void *servant_upcall
@@ -97,8 +97,12 @@ public:
TAO_Collocated_Skeleton &skelfunc,
TAO::Collocation_Strategy st,
const unsigned int length = 0);
+
protected:
+ /// Get this interface's repository id (TAO specific).
+ virtual const char *_interface_repository_id (void) const = 0;
+
/// Default constructor, only derived classes can be created.
TAO_ServantBase (void);
@@ -108,7 +112,6 @@ protected:
/// Assignment operator.
TAO_ServantBase &operator= (const TAO_ServantBase &);
-
virtual void synchronous_upcall_dispatch (TAO_ServerRequest &req,
void *servant_upcall,
void *derived_this
@@ -118,15 +121,6 @@ protected:
void *servant_upcall,
void *derived_this
ACE_ENV_ARG_DECL);
-
-
- /// Register a CORBA IDL operation name.
- /*virtual int _bind (const char *opname,
- const TAO_Skeleton skel_ptr);
- */
- /// Get this interface's repository id (TAO specific).
- virtual const char *_interface_repository_id (void) const = 0;
-
protected:
/// The operation table for this servant, it is initialized by the
/// most derived class.
@@ -179,10 +173,9 @@ public:
virtual void _remove_ref (ACE_ENV_SINGLE_ARG_DECL);
/**
- * Returns the current reference count value. This method is
- * non-standard and is only here to simplify debugging.
+ * Returns the current reference count value.
*/
- virtual long _ref_count (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) const;
+ virtual CORBA::ULong _refcount_value (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) const;
protected:
@@ -200,7 +193,14 @@ protected:
private:
/// Reference counter.
- ACE_Atomic_Op<TAO_SYNCH_MUTEX, long> ref_count_;
+ ACE_Atomic_Op<TAO_SYNCH_MUTEX, CORBA::ULong> ref_count_;
+};
+
+class TAO_PortableServer_Export TAO_Servant_Hash
+{
+public:
+ /// Returns hash value.
+ u_long operator () (PortableServer::Servant servant) const;
};
/**
@@ -215,7 +215,6 @@ private:
*/
class TAO_PortableServer_Export TAO_ServantBase_var
{
-
public:
TAO_ServantBase_var (void);
@@ -244,39 +243,6 @@ private:
TAO_ServantBase *ptr_;
};
-class TAO_PortableServer_Export TAO_Servant_Hash
-{
-public:
- /// Returns hash value.
- u_long operator () (PortableServer::Servant servant) const;
-};
-
-/**
- * @class TAO_Local_ServantBase
- *
- * @brief Base class for local servants.
- *
- * This servant does not register with the POA and does not
- * produce a valid stub, i.e., object references of this servant
- * cannot be exported. The (collocated) stubs of these servants
- * will always be direct, i.e., call directly to the servant and
- * don't call through the POA since this servant is not
- * registered with the POA.
- */
-class TAO_PortableServer_Export TAO_Local_ServantBase
- : public virtual TAO_ServantBase
-{
-protected:
- /// This is an auxiliar method for _this(). Make sure *not* to
- /// register with the default POA.
- TAO_Stub *_create_stub (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS);
-
- /// Throws CORBA::BAD_OPERATION exception.
- void _dispatch (TAO_ServerRequest &request,
- void *servant_upcall
- ACE_ENV_ARG_DECL);
-};
-
#if defined (__ACE_INLINE__)
# include "Servant_Base.i"
#endif /* __ACE_INLINE__ */
diff --git a/TAO/tao/PortableServer/Servant_Base.i b/TAO/tao/PortableServer/Servant_Base.i
index 20151e72852..9821c56e03e 100644
--- a/TAO/tao/PortableServer/Servant_Base.i
+++ b/TAO/tao/PortableServer/Servant_Base.i
@@ -3,36 +3,6 @@
ACE_INLINE u_long
TAO_Servant_Hash::operator () (PortableServer::Servant servant) const
{
- return ACE_static_cast (u_long,
- ACE_reinterpret_cast (ptrdiff_t, servant));
+ return static_cast <u_long>(reinterpret_cast <ptrdiff_t> (servant));
}
-ACE_INLINE TAO_Stub *
-TAO_Local_ServantBase::_create_stub (ACE_ENV_SINGLE_ARG_DECL)
-{
-#if 0
- PortableServer::ObjectId_var invalid_oid =
- PortableServer::string_to_ObjectId ("invalid");
-
- TAO::ObjectKey tmp_key (invalid_oid->length (),
- invalid_oid->length (),
- invalid_oid->get_buffer (),
- 0);
-
- // It is ok to use TAO_ORB_Core_instance here since the locality
- // constrained servant does not really register with a POA or get
- // exported remotely.
- //
- // The correct thing to do is to probably use ORB of the default
- // POA. The unfortunate part is that calling default_POA() requires
- // the creation of a local stub, hence causing a infinite loop.
- return TAO_ORB_Core_instance ()->orb ()->create_stub_object (tmp_key,
- this->_interface_repository_id ()
- ACE_ENV_ARG_PARAMETER);
-#else
-# if !defined (ACE_HAS_EXCEPTIONS)
- ACE_UNUSED_ARG (ACE_ENV_SINGLE_ARG_PARAMETER);
-#endif
- return 0;
-#endif
-}