summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-04-10 20:25:10 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-04-10 20:25:10 +0000
commit1e3d7a38d447defbf69f7206b3293bc7b50392a5 (patch)
tree539ee16d6ae7dd8c83949057bc07af997c374bf1 /TAO/tao
parentf42e086076b6aa0b2814214c0101291f286c7ee1 (diff)
downloadATCD-1e3d7a38d447defbf69f7206b3293bc7b50392a5.tar.gz
ChangeLogTag:Mon Apr 10 13:17:41 2000 Carlos O'Ryan <coryan@uci.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/Makefile3
-rw-r--r--TAO/tao/ORB.cpp34
-rw-r--r--TAO/tao/ORB.h5
-rw-r--r--TAO/tao/Object_Loader.cpp13
-rw-r--r--TAO/tao/Object_Loader.h56
-rw-r--r--TAO/tao/Object_Loader.i1
-rw-r--r--TAO/tao/TAO.dsp70
-rw-r--r--TAO/tao/TAO_Static.dsp24
8 files changed, 166 insertions, 40 deletions
diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile
index 82a48616704..d07d6c8531b 100644
--- a/TAO/tao/Makefile
+++ b/TAO/tao/Makefile
@@ -190,7 +190,8 @@ ORB_CORE_FILES = \
GIOPC \
BoundsC \
TAOC \
- TAOS
+ TAOS \
+ Object_Loader
DYNAMIC_ANY_FILES =
diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp
index f5bfbee44c9..41d4c2ff66c 100644
--- a/TAO/tao/ORB.cpp
+++ b/TAO/tao/ORB.cpp
@@ -31,6 +31,7 @@
#include "tao/POA.h"
#include "tao/Request.h"
#include "tao/MProfile.h"
+#include "tao/Object_Loader.h"
#if (TAO_HAS_INTERFACE_REPOSITORY == 1)
# include "tao/InterfaceC.h"
@@ -68,6 +69,7 @@ ACE_RCSID(tao, ORB, "$Id$")
static const char ior_prefix [] = "IOR:";
static const char file_prefix[] = "file://";
+static const char dll_prefix[] = "DLL:";
// = Static initialization.
@@ -1686,7 +1688,7 @@ CORBA_ORB::string_to_object (const char *str,
CORBA::COMPLETED_NO),
CORBA::Object::_nil ());
-
+
if (ACE_OS::strncmp (str,
file_prefix,
sizeof file_prefix - 1) == 0)
@@ -1697,6 +1699,11 @@ CORBA_ORB::string_to_object (const char *str,
sizeof ior_prefix - 1) == 0)
return this->ior_string_to_object (str + sizeof ior_prefix - 1,
ACE_TRY_ENV);
+ else if (ACE_OS::strncmp (str,
+ dll_prefix,
+ sizeof dll_prefix - 1) == 0)
+ return this->dll_string_to_object (str + sizeof dll_prefix - 1,
+ ACE_TRY_ENV);
else
return this->url_ior_string_to_object (str, ACE_TRY_ENV);
}
@@ -1823,7 +1830,7 @@ CORBA_ORB::ior_string_to_object (const char *str,
// Create deencapsulation stream ... then unmarshal objref from that
// stream.
-
+
int byte_order = *(mb.rd_ptr ());
mb.rd_ptr (1);
mb.wr_ptr (len);
@@ -1868,6 +1875,29 @@ CORBA_ORB::file_string_to_object (const char* filename,
return object;
}
+// ****************************************************************
+
+CORBA::Object_ptr
+CORBA_ORB::dll_string_to_object (const char *str,
+ CORBA::Environment &ACE_TRY_ENV)
+{
+ TAO_Object_Loader *loader =
+ ACE_Dynamic_Service<TAO_Object_Loader>::instance (str);
+ if (loader == 0)
+ {
+ ACE_THROW_RETURN
+ (CORBA::INV_OBJREF
+ (CORBA_SystemException::_tao_minor_code
+ (TAO_NULL_POINTER_MINOR_CODE, 0),
+ CORBA::COMPLETED_NO),
+ CORBA::Object::_nil ());
+ }
+
+ return loader->create_object (this, ACE_TRY_ENV);
+}
+
+// ****************************************************************
+
// Convert an URL style IOR in an object
CORBA::Object_ptr
diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h
index 0b86fd31c0a..7a8c1d98666 100644
--- a/TAO/tao/ORB.h
+++ b/TAO/tao/ORB.h
@@ -772,6 +772,11 @@ private:
// Read an IOR from a file and then parse it, returning the object
// reference.
+ CORBA::Object_ptr dll_string_to_object (const char* service_name,
+ CORBA::Environment &ACE_TRY_ENV);
+ // Uses the service configurator to dynamically load an
+ // implementation of an object, and create that object.
+
CORBA::Object_ptr ior_string_to_object (const char* ior,
CORBA::Environment &ACE_TRY_ENV);
// Convert an OMG IOR into an object reference.
diff --git a/TAO/tao/Object_Loader.cpp b/TAO/tao/Object_Loader.cpp
new file mode 100644
index 00000000000..0d574ce8023
--- /dev/null
+++ b/TAO/tao/Object_Loader.cpp
@@ -0,0 +1,13 @@
+// $Id$
+
+#include "tao/Object_Loader.h"
+
+#if !defined(__ACE_INLINE__)
+#include "tao/Object_Loader.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(tao, Object_Loader, "$Id$")
+
+TAO_Object_Loader::~TAO_Object_Loader (void)
+{
+}
diff --git a/TAO/tao/Object_Loader.h b/TAO/tao/Object_Loader.h
new file mode 100644
index 00000000000..04ccc6ad115
--- /dev/null
+++ b/TAO/tao/Object_Loader.h
@@ -0,0 +1,56 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO
+//
+// = FILENAME
+// Object_Loader.h
+//
+// = AUTHOR
+// Carlos O'Ryan (coryan@cs.wustl.edu)
+//
+// ============================================================================
+
+#ifndef TAO_OBJECT_LOADER_H
+#define TAO_OBJECT_LOADER_H
+#include "ace/pre.h"
+
+#include "tao/corbafwd.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Service_Object.h"
+
+class TAO_Export TAO_Object_Loader : public ACE_Service_Object
+{
+ // = TITLE
+ // A class to dynamically load object implementations into an
+ // ORB.
+ //
+ // = DESCRIPTION
+ // Many services and components of the ORB can be dynamically
+ // loaded, this is the class used to implement ....
+ // @@ TODO
+ //
+public:
+ virtual ~TAO_Object_Loader (void);
+ // The destructor
+
+ virtual CORBA::Object_ptr create_object (CORBA::ORB_ptr orb,
+ CORBA::Environment &)
+ ACE_THROW_SPEC (()) = 0;
+ // Create and activate a new object into the orb.
+ // This method cannot throw any exception, but it can return a nil
+ // object to indicate an error condition.
+};
+
+#if defined (__ACE_INLINE__)
+# include "tao/Object_Loader.i"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
+#endif /* TAO_OBJECT_LOADER_H */
diff --git a/TAO/tao/Object_Loader.i b/TAO/tao/Object_Loader.i
new file mode 100644
index 00000000000..cfa1da318d3
--- /dev/null
+++ b/TAO/tao/Object_Loader.i
@@ -0,0 +1 @@
+// $Id$
diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp
index 767e8c1658e..dc85af4710d 100644
--- a/TAO/tao/TAO.dsp
+++ b/TAO/tao/TAO.dsp
@@ -18,20 +18,16 @@ CFG=TAO DLL - Win32 Debug
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
-!MESSAGE "TAO DLL - Win32 Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "TAO DLL - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "TAO DLL - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "TAO DLL - Win32 Alpha Release" (based on\
- "Win32 (ALPHA) Dynamic-Link Library")
-!MESSAGE "TAO DLL - Win32 Alpha Debug" (based on\
- "Win32 (ALPHA) Dynamic-Link Library")
-!MESSAGE "TAO DLL - Win32 MFC Debug" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "TAO DLL - Win32 MFC Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "TAO DLL - Win32 Alpha Release" (based on "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "TAO DLL - Win32 Alpha Debug" (based on "Win32 (ALPHA) Dynamic-Link Library")
+!MESSAGE "TAO DLL - Win32 MFC Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "TAO DLL - Win32 MFC Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
+# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath "Desktop"
@@ -110,12 +106,12 @@ LINK32=link.exe
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
CPP=cl.exe
# ADD BASE CPP /Gt0 /I "../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "TAO_BUILD_DLL" /FD nologo MT Gt0 W3 GX O2 I "../../" /c
# ADD CPP /nologo /MD /Gt0 /W3 /GX /O2 /I "../../" /I "../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "TAO_BUILD_DLL" /FD /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL"
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
@@ -140,12 +136,12 @@ LINK32=link.exe
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
-MTL=midl.exe
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
CPP=cl.exe
# ADD BASE CPP /Gt0 /I "../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "TAO_BUILD_DLL" /FD /MTd nologo Gt0 W3 GX Zi Od Gy I "../../" /c
# ADD CPP /nologo /Gt0 /W3 /GX /Zi /Od /Gy /I "../../" /I "../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "TAO_BUILD_DLL" /FD /MDd /c
+MTL=midl.exe
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL"
RSC=rc.exe
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
@@ -1795,6 +1791,25 @@ SOURCE=.\Object_KeyC.cpp
# End Source File
# Begin Source File
+SOURCE=.\Object_Loader.cpp
+
+!IF "$(CFG)" == "TAO DLL - Win32 Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Debug"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Debug"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Release"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\ObjectIDList.cpp
!IF "$(CFG)" == "TAO DLL - Win32 Release"
@@ -3421,6 +3436,10 @@ SOURCE=.\Object_KeyC.h
# End Source File
# Begin Source File
+SOURCE=.\Object_Loader.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ObjectIDList.h
# End Source File
# Begin Source File
@@ -3897,6 +3916,10 @@ SOURCE=.\Object_KeyC.i
# End Source File
# Begin Source File
+SOURCE=.\Object_Loader.i
+# End Source File
+# Begin Source File
+
SOURCE=.\ObjectIDList.i
# End Source File
# Begin Source File
@@ -4066,21 +4089,6 @@ SOURCE=.\ValueFactory_Map.i
# Begin Source File
SOURCE=.\tao.rc
-
-!IF "$(CFG)" == "TAO DLL - Win32 Release"
-
-!ELSEIF "$(CFG)" == "TAO DLL - Win32 Debug"
-
-!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Release"
-
-!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Debug"
-
-!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Debug"
-
-!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Release"
-
-!ENDIF
-
# End Source File
# End Group
# End Target
diff --git a/TAO/tao/TAO_Static.dsp b/TAO/tao/TAO_Static.dsp
index 4384fe82cab..3a7c54eba37 100644
--- a/TAO/tao/TAO_Static.dsp
+++ b/TAO/tao/TAO_Static.dsp
@@ -22,9 +22,11 @@ CFG=TAO LIB - Win32 Debug
!MESSAGE
# Begin Project
+# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath "Desktop"
CPP=cl.exe
+RSC=rc.exe
!IF "$(CFG)" == "TAO LIB - Win32 Release"
@@ -38,12 +40,11 @@ CPP=cl.exe
# PROP Output_Dir ""
# PROP Intermediate_Dir "LIB\Release"
# PROP Target_Dir ""
-RSC=rc.exe
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /I "../" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /D TAO_HAS_DLL=0 /D "ACE_NO_INLINE" /FD /c
# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
@@ -63,11 +64,10 @@ LIB32=link.exe -lib
# PROP Output_Dir ""
# PROP Intermediate_Dir "LIB\Debug"
# PROP Target_Dir ""
-RSC=rc.exe
-# ADD BASE RSC /l 0x409
-# ADD RSC /l 0x409
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /Z7 /Od /I "../../" /I "../" /D TAO_HAS_DLL=0 /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D ACE_HAS_DLL=0 /YX /FD /c
+# ADD BASE RSC /l 0x409
+# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
@@ -414,6 +414,10 @@ SOURCE=.\Object_KeyC.cpp
# End Source File
# Begin Source File
+SOURCE=.\Object_Loader.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\ObjectIDList.cpp
# End Source File
# Begin Source File
@@ -994,6 +998,10 @@ SOURCE=.\Object_KeyC.h
# End Source File
# Begin Source File
+SOURCE=.\Object_Loader.h
+# End Source File
+# Begin Source File
+
SOURCE=.\ObjectIDList.h
# End Source File
# Begin Source File
@@ -1462,6 +1470,10 @@ SOURCE=.\Object_KeyC.i
# End Source File
# Begin Source File
+SOURCE=.\Object_Loader.i
+# End Source File
+# Begin Source File
+
SOURCE=.\ObjectIDList.i
# End Source File
# Begin Source File