Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

DLL_Parser.h

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

Generated on Mon Jun 16 13:48:14 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002