3 //=============================================================================
7 * @author Carlos O'Ryan (coryan@cs.wustl.edu)
9 //=============================================================================
11 #ifndef TAO_DLL_PARSER_H
12 #define TAO_DLL_PARSER_H
14 #include /**/ "ace/pre.h"
15 #include "ace/Service_Config.h"
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "tao/IOR_Parser.h"
23 #if (TAO_HAS_DDL_PARSER == 1)
25 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
28 * @class TAO_DLL_Parser
30 * @brief Implment the parser for the DLL-style IORs.
32 * The DLL-style IORs allows applications to transparently load object
33 * implementations. The ORB can parse an IOR in the format:
37 * the string_to_object() function will use ACE's Service Configurator
38 * framework to dynamically load the service named 'Service_Name'
39 * using all the normal platform-independent naming conventions and
40 * environment variable lookup rules that are normally used by @c
41 * ACE_DLL::open(). The ORB assumes that this service implements the
42 * TAO_Object_Loader interface, and uses that interface to create a
43 * new object implementation locally. The object reference for this
44 * local object is returned to the application.
46 * This can be used in applications that sometimes require local
47 * object while other times they may use a remote implementation.
48 * For example, the application could be configured to use a remote
49 * Event Service or to dynamically load an Event Service
50 * implementation and use the local copy instead. The local Event
51 * Service would federate to its remote peers to work as-if a single
52 * Event Service was in place.
54 * Such an application could be written as follows:
56 * int main (int argc, char* argv)
58 * CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
60 * CORBA::Object_var object =
61 * orb->resolve_initial_references("EventService");
62 * // Use <object> here...
65 * if the application is invoked using:
67 * $ program -ORBInitRef EventService=IOR:....
69 * then a remote event service is used, but the application could also
72 * $ program -ORBInitRef EventService=DLL:Event_Service_Loader
74 * In this case the Event_Service implementation will be dynamically
75 * loaded without any modifications to the application code.
77 class TAO_DLL_Parser
: public TAO_IOR_Parser
80 TAO_DLL_Parser () = default;
81 ~TAO_DLL_Parser () override
= default;
83 // = The IOR_Parser methods, please read the documentation in
85 bool match_prefix (const char *ior_string
) const override
;
86 CORBA::Object_ptr
parse_string (const char *ior
,
87 CORBA::ORB_ptr orb
) override
;
90 ACE_STATIC_SVC_DECLARE_EXPORT (TAO
, TAO_DLL_Parser
)
91 ACE_FACTORY_DECLARE (TAO
, TAO_DLL_Parser
)
93 TAO_END_VERSIONED_NAMESPACE_DECL
95 #endif /* TAO_HAS_DDL_PARSER == 1 */
97 #include /**/ "ace/post.h"
98 #endif /* TAO_DLL_PARSER_H */