DLL_Parser.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file   DLL_Parser.h
00006  *
00007  *  DLL_Parser.h,v 1.11 2006/05/30 18:33:59 schmidt Exp
00008  *
00009  *  @author Carlos O'Ryan (coryan@cs.wustl.edu)
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_DLL_PARSER_H
00014 #define TAO_DLL_PARSER_H
00015 
00016 #include /**/ "ace/pre.h"
00017 #include "ace/Service_Config.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #include "tao/IOR_Parser.h"
00024 
00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00026 
00027 /**
00028  * @class TAO_DLL_Parser
00029  *
00030  * @brief Implment the parser for the DLL-style IORs.
00031  *
00032  * The DLL-style IORs allows applications to transparently load object
00033  * implementations. The ORB can parse an IOR in the format:
00034  *
00035  * DLL:Service_Name
00036  *
00037  * the string_to_object() function will use ACE's Service Configurator
00038  * framework to dynamically load the service named 'Service_Name'
00039  * using all the normal platform-independent naming conventions and
00040  * environment variable lookup rules that are normally used by @c
00041  * ACE_DLL::open().  The ORB assumes that this service implements the
00042  * TAO_Object_Loader interface, and uses that interface to create a
00043  * new object implementation locally. The object reference for this
00044  * local object is returned to the application.
00045  *
00046  * This can be used in applications that sometimes require local
00047  * object while other times they may use a remote implementation.
00048  * For example, the application could be configured to use a remote
00049  * Event Service or to dynamically load an Event Service
00050  * implementation and use the local copy instead.  The local Event
00051  * Service would federate to its remote peers to work as-if a single
00052  * Event Service was in place.
00053  *
00054  * Such an application could be written as follows:
00055  *
00056  * int main (int argc, char* argv)
00057  * {
00058  *   CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
00059  *
00060  *   CORBA::Object_var object =
00061  *     orb->resolve_initial_references("EventService");
00062  *   // Use <object> here...
00063  * }
00064  *
00065  * if the application is invoked using:
00066  *
00067  * $ program -ORBInitRef EventService=IOR:....
00068  *
00069  * then a remote event service is used, but the application could also
00070  * be invoked using:
00071  *
00072  * $ program -ORBInitRef EventService=DLL:Event_Service_Loader
00073  *
00074  * In this case the Event_Service implementation will be dynamically
00075  * loaded without any modifications to the application code.
00076  *
00077  */
00078 class TAO_DLL_Parser : public TAO_IOR_Parser
00079 {
00080 public:
00081 
00082   /// The destructor
00083   virtual ~TAO_DLL_Parser (void);
00084 
00085   // = The IOR_Parser methods, please read the documentation in
00086   //   IOR_Parser.h
00087   virtual int match_prefix (const char *ior_string) const;
00088   virtual CORBA::Object_ptr parse_string (const char *ior,
00089                                           CORBA::ORB_ptr orb
00090                                           ACE_ENV_ARG_DECL_NOT_USED)
00091     ACE_THROW_SPEC ((CORBA::SystemException));
00092 };
00093 
00094 TAO_END_VERSIONED_NAMESPACE_DECL
00095 
00096 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_DLL_Parser)
00097 ACE_FACTORY_DECLARE (TAO, TAO_DLL_Parser)
00098 
00099 #include /**/ "ace/post.h"
00100 #endif /* TAO_DLL_PARSER_H */

Generated on Thu Nov 9 11:54:10 2006 for TAO by doxygen 1.3.6