summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-08 00:31:25 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-07-08 00:31:25 +0000
commit858405cd45d4824c2288f2e53eb2c6860504ccfd (patch)
tree1e1b841af7a4d63109e2a80f92418b216988ca48
parentc39f02e150db62146cbe64df0d61e1fb9984edd4 (diff)
downloadATCD-858405cd45d4824c2288f2e53eb2c6860504ccfd.tar.gz
ChangeLogTag:Wed Jul 7 19:24:00 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r--TAO/ChangeLog-99c15
-rw-r--r--TAO/docs/Options.html4
-rw-r--r--TAO/tao/Makefile3
-rw-r--r--TAO/tao/default_resource.cpp16
-rw-r--r--TAO/tao/default_resource.h3
-rw-r--r--TAO/tao/xt_resource.cpp42
-rw-r--r--TAO/tao/xt_resource.h68
-rw-r--r--TAO/tao/xt_resource.i6
-rw-r--r--TAO/tests/FL_Cube/svc.conf2
-rw-r--r--TAO/tests/Xt_Stopwatch/client.cpp15
-rw-r--r--TAO/tests/Xt_Stopwatch/server.cpp11
-rw-r--r--TAO/tests/Xt_Stopwatch/svc.conf2
12 files changed, 152 insertions, 35 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c
index d298dd40b9c..d8d844a77eb 100644
--- a/TAO/ChangeLog-99c
+++ b/TAO/ChangeLog-99c
@@ -1,3 +1,18 @@
+Wed Jul 7 19:24:00 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
+
+ * docs/Options.html:
+ * tao/Makefile:
+ * tao/default_resource.h:
+ * tao/default_resource.cpp:
+ * tao/xt_resource.h:
+ * tao/xt_resource.i:
+ * tao/xt_resource.cpp:
+ Removed the <xt> ReactorType from the default resource factory,
+ it simply did not work because the context was not properly
+ initialized.
+ Added a new Resource_Factory that can create XtReactors, but
+ only after the context has been properly set.
+
Wed Jul 07 18:26:58 1999 Irfan Pyarali <irfan@cs.wustl.edu>
* tao: Fixed determination of collocation. It is not necessary to
diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html
index 90f991215b4..a16efbf6ec8 100644
--- a/TAO/docs/Options.html
+++ b/TAO/docs/Options.html
@@ -386,10 +386,6 @@ merged with <a href="#-ORBCollocation"><code>-ORBCollocation</code></a>.
was compiled with support for the FL toolkit
</TD>
</TR>
- <TR><TD><CODE>xt<CODE></TD><TD>Use the
- <CODE>ACE_XtReactor</CODE> only available if ACE
- was compiled with support for the XWindows Toolkit
- </TD>
</TR>
<TR><TD><CODE>wfmo<CODE></TD>
<TD>Use the
diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile
index ee7177cb8e3..db7bf753b64 100644
--- a/TAO/tao/Makefile
+++ b/TAO/tao/Makefile
@@ -75,7 +75,8 @@ PLUGGABLE_PROTOCOLS_FILES = \
DEFAULT_RESOURCES_FILES = \
default_client \
default_server \
- default_resource
+ default_resource \
+ xt_resource
INTERPRETIVE_MARSHALING_FILES = \
append \
diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp
index adf7a67e1ae..433ac742f64 100644
--- a/TAO/tao/default_resource.cpp
+++ b/TAO/tao/default_resource.cpp
@@ -11,7 +11,6 @@
#include "tao/Connector_Registry.h"
#include "ace/Select_Reactor.h"
-#include "ace/XtReactor.h"
#include "ace/FlReactor.h"
#include "ace/WFMO_Reactor.h"
#include "ace/Msg_WFMO_Reactor.h"
@@ -111,15 +110,6 @@ TAO_Default_Resource_Factory::init (int argc, char **argv)
" not supported on this platform\n"));
#endif /* ACE_HAS_FL */
else if (ACE_OS::strcasecmp (name,
- "xt") == 0)
-#if defined(ACE_HAS_XT)
- reactor_type_ = TAO_REACTOR_XT;
-#else
- ACE_DEBUG ((LM_DEBUG,
- "TAO_Default_Factory - XtReactor"
- " not supported on this platform\n"));
-#endif /* ACE_HAS_XT */
- else if (ACE_OS::strcasecmp (name,
"wfmo") == 0)
#if defined(ACE_WIN32)
reactor_type_ = TAO_REACTOR_WFMO;
@@ -358,12 +348,6 @@ TAO_Default_Resource_Factory::allocate_reactor_impl (void) const
#endif /* ACE_HAS_FL */
break;
- case TAO_REACTOR_XT:
-#if defined(ACE_HAS_XT)
- ACE_NEW_RETURN (impl, ACE_XtReactor, 0);
-#endif /* ACE_HAS_FL */
- break;
-
case TAO_REACTOR_WFMO:
#if defined(ACE_WIN32) && !defined (ACE_HAS_WINCE)
ACE_NEW_RETURN (impl, ACE_WFMO_Reactor, 0);
diff --git a/TAO/tao/default_resource.h b/TAO/tao/default_resource.h
index 1f732a22131..551311386e1 100644
--- a/TAO/tao/default_resource.h
+++ b/TAO/tao/default_resource.h
@@ -70,7 +70,6 @@ public:
TAO_REACTOR_SELECT_MT, // Use ACE_Token
TAO_REACTOR_SELECT_ST, // Use ACE_Noop_Token
TAO_REACTOR_FL,
- TAO_REACTOR_XT,
TAO_REACTOR_WFMO,
TAO_REACTOR_MSGWFMO,
TAO_REACTOR_TP
@@ -93,7 +92,7 @@ public:
virtual int init_protocol_factories (void);
protected:
- ACE_Reactor_Impl *allocate_reactor_impl (void) const;
+ virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const;
// Obtain the reactor implementation
protected:
diff --git a/TAO/tao/xt_resource.cpp b/TAO/tao/xt_resource.cpp
new file mode 100644
index 00000000000..f6204af62d2
--- /dev/null
+++ b/TAO/tao/xt_resource.cpp
@@ -0,0 +1,42 @@
+// $Id$
+
+#include "tao/xt_resource.h"
+
+#if defined(ACE_HAS_XT)
+
+#if !defined (__ACE_INLINE__)
+# include "tao/xt_resource.i"
+#endif /* ! __ACE_INLINE__ */
+
+ACE_RCSID(tao, xt_resource, "$Id$")
+
+XtAppContext
+TAO_XT_Resource_Factory::context_ = 0;
+
+ACE_Reactor_Impl*
+TAO_XT_Resource_Factory::allocate_reactor_impl (void) const
+{
+ if (TAO_XT_Resource_Factory::context_ == 0)
+ return 0;
+
+ ACE_Reactor_Impl *impl = 0;
+
+ ACE_NEW_RETURN (impl, ACE_XtReactor (TAO_XT_Resource_Factory::context_), 0);
+ return impl;
+}
+
+void
+TAO_XT_Resource_Factory::set_context (XtAppContext context)
+{
+ TAO_XT_Resource_Factory::context_ = context;
+}
+
+ACE_STATIC_SVC_DEFINE (TAO_XT_Resource_Factory,
+ ASYS_TEXT ("XT_Resource_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (TAO_XT_Resource_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+ACE_FACTORY_DEFINE (TAO, TAO_XT_Resource_Factory)
+
+#endif /* ACE_HAS_XT */
diff --git a/TAO/tao/xt_resource.h b/TAO/tao/xt_resource.h
new file mode 100644
index 00000000000..f65ebb2c8cf
--- /dev/null
+++ b/TAO/tao/xt_resource.h
@@ -0,0 +1,68 @@
+// -*- C++ -*-
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO
+//
+// = FILENAME
+// xt_resource.h
+//
+// = AUTHOR
+// Carlos O'Ryan
+//
+// ============================================================================
+
+#ifndef TAO_XT_RESOURCE_H
+#define TAO_XT_RESOURCE_H
+
+#include "tao/default_resource.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined (ACE_HAS_XT)
+
+#include "ace/XtReactor.h"
+
+// ****************************************************************
+
+class TAO_XT_Resource_Factory : public TAO_Default_Resource_Factory
+{
+ // = TITLE
+ // TAO's default resource factory
+ //
+ // = DESCRIPTION
+ // Using a <{resource source specifier}> as a discriminator, the
+ // factory can return resource instances which are, e.g., global,
+ // stored in thread-specific storage, stored in shared memory,
+ // etc.
+ //
+public:
+ // = Initialization and termination methods.
+ TAO_XT_Resource_Factory (void);
+ // Constructor.
+
+ static void set_context (XtAppContext context);
+ // Set the context used to create the XtReactor
+
+protected:
+ virtual ACE_Reactor_Impl *allocate_reactor_impl (void) const;
+ // Obtain the reactor implementation
+
+private:
+ static XtAppContext context_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "tao/xt_resource.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_STATIC_SVC_DECLARE (TAO_XT_Resource_Factory)
+ACE_FACTORY_DECLARE (TAO, TAO_XT_Resource_Factory)
+
+#endif /* ACE_HAS_XT */
+
+#endif /* TAO_DEFAULT_CLIENT_H */
diff --git a/TAO/tao/xt_resource.i b/TAO/tao/xt_resource.i
new file mode 100644
index 00000000000..0b14c74dcf9
--- /dev/null
+++ b/TAO/tao/xt_resource.i
@@ -0,0 +1,6 @@
+// $Id$
+
+ACE_INLINE
+TAO_XT_Resource_Factory::TAO_XT_Resource_Factory (void)
+{
+}
diff --git a/TAO/tests/FL_Cube/svc.conf b/TAO/tests/FL_Cube/svc.conf
index 37133810cc8..be6fb27be83 100644
--- a/TAO/tests/FL_Cube/svc.conf
+++ b/TAO/tests/FL_Cube/svc.conf
@@ -1,3 +1,3 @@
# $Id$
#
-static Resource_Factory "-ORBReactorType fl_reactor"
+static Resource_Factory "-ORBReactorType fl"
diff --git a/TAO/tests/Xt_Stopwatch/client.cpp b/TAO/tests/Xt_Stopwatch/client.cpp
index d7eca00515c..999f288ab15 100644
--- a/TAO/tests/Xt_Stopwatch/client.cpp
+++ b/TAO/tests/Xt_Stopwatch/client.cpp
@@ -3,7 +3,7 @@
#include "testC.h"
#include "ace/Get_Opt.h"
-ACE_RCSID(FL_Cube, client, "$Id$")
+ACE_RCSID(Xt_Stopwatch, client, "$Id$")
#if !defined (ACE_HAS_XT)
@@ -18,15 +18,18 @@ int main (int, char *[])
#include "Control.h"
#include "Client.h"
+#include "tao/xt_resource.h"
-int
-main (int argc,
+int
+main (int argc,
char* argv[])
{
XtAppContext app;
Widget toplevel = XtAppInitialize ( &app, "Start & Stop", NULL, 0,
&argc, argv, NULL, NULL, 0 );
+ TAO_XT_Resource_Factory::set_context (app);
+
Control control (toplevel);
ACE_DECLARE_NEW_CORBA_ENV;
@@ -41,7 +44,7 @@ main (int argc,
client.parse_args (argc, argv, ACE_TRY_ENV);
ACE_TRY_CHECK;
-
+
client.add_callback (control);
// Manage the widgets
@@ -97,7 +100,7 @@ Client::parse_args (int argc, char *argv[],
this->server_ =
Stopwatch::_narrow (object.in (), ACE_TRY_ENV);
ACE_CHECK;
-
+
if (CORBA::is_nil(this->server_.in ()))
{
ACE_DEBUG ((LM_DEBUG,
@@ -115,7 +118,7 @@ Client::add_callback (Control &ctrl)
XmNactivateCallback,
&Client::start_callback,
client_data);
-
+
XtAddCallback ( ctrl.stopwidget (),
XmNactivateCallback,
&Client::stop_callback,
diff --git a/TAO/tests/Xt_Stopwatch/server.cpp b/TAO/tests/Xt_Stopwatch/server.cpp
index e82c4416a6a..49248c80b47 100644
--- a/TAO/tests/Xt_Stopwatch/server.cpp
+++ b/TAO/tests/Xt_Stopwatch/server.cpp
@@ -3,7 +3,7 @@
#include "test_i.h"
#include "ace/Get_Opt.h"
-ACE_RCSID(FL_Cube, server, "$Id$")
+ACE_RCSID(Xt_Stopwatch, server, "$Id$")
#if !defined (ACE_HAS_XT)
@@ -18,6 +18,7 @@ int main (int, char *[])
#include <Xm/Xm.h>
#include "Stopwatch_display.h"
+#include "tao/xt_resource.h"
const char *ior_output_file = 0;
@@ -50,7 +51,7 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- // We do the command line parsing first
+ // We do the command line parsing first
if (parse_args (argc, argv) != 0)
return 1;
@@ -58,6 +59,8 @@ main (int argc, char *argv[])
Widget toplevel = XtAppInitialize ( &app, "Stopwatch", NULL, 0,
&argc, argv, NULL, NULL, 0 );
+ TAO_XT_Resource_Factory::set_context (app);
+
Stopwatch_display stopwatch (toplevel);
ACE_DECLARE_NEW_CORBA_ENV;
@@ -72,7 +75,7 @@ main (int argc, char *argv[])
CORBA::Object_var poa_object =
orb->resolve_initial_references("RootPOA");
-
+
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
" (%P|%t) Unable to initialize the POA.\n"),
@@ -113,7 +116,7 @@ main (int argc, char *argv[])
poa_manager->activate (ACE_TRY_ENV);
ACE_TRY_CHECK;
-
+
XtRealizeWidget (toplevel );
XtAppMainLoop ( app );
}
diff --git a/TAO/tests/Xt_Stopwatch/svc.conf b/TAO/tests/Xt_Stopwatch/svc.conf
index 1b435a29df8..9d6894193c4 100644
--- a/TAO/tests/Xt_Stopwatch/svc.conf
+++ b/TAO/tests/Xt_Stopwatch/svc.conf
@@ -1,3 +1,3 @@
# $Id$
#
-static Resource_Factory "-ORBReactorType xt"
+dynamic Resource_Factory Service_Object * TAO:_make_TAO_XT_Resource_Factory() ""