diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-02-21 00:32:28 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-02-21 00:32:28 +0000 |
commit | 7343440a82927caf704dacc8bc3ac07871accf59 (patch) | |
tree | 15fc7dfb7606da172ed8694d0e54eb9a54fabc17 | |
parent | 61dd04da073f811127118f1ff82bd34f42d8ec2f (diff) | |
download | ATCD-7343440a82927caf704dacc8bc3ac07871accf59.tar.gz |
ChangeLogTag:Tue Feb 20 15:02:01 2001 Carlos O'Ryan <coryan@uci.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 132 | ||||
-rw-r--r-- | TAO/docs/Options.html | 110 | ||||
-rw-r--r-- | TAO/docs/ior_parsing.html | 226 |
3 files changed, 361 insertions, 107 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 7bf19001dc5..8e91e57b651 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,89 +1,99 @@ +Tue Feb 20 15:02:01 2001 Carlos O'Ryan <coryan@uci.edu> + + * docs/Options.html: + Add documentation about the secret -ORBIORParser option in the + resource factory. + + * docs/ior_parsing.html: + Document the pluggable IOR parser feature in TAO, and how you + can go about adding a new version. + Tue Feb 20 16:35:27 2001 Carlos O'Ryan <coryan@cs.wustl.edu> - * tao/RT_ORBInitializer.cpp: - We must add the RT_Protocols_Hooks service, after the - Service_Configurator is opened. This is a bit more complicated - than the usual ACE_Service_Config::static_svcs()->insert(). - After the beta we need to revisit this code and factor out some - commonalities with ACE_Service_Config::load_static_svcs(), and - probably rethink this portion of the RT-CORBA initialization. + * tao/RT_ORBInitializer.cpp: + We must add the RT_Protocols_Hooks service, after the + Service_Configurator is opened. This is a bit more complicated + than the usual ACE_Service_Config::static_svcs()->insert(). + After the beta we need to revisit this code and factor out some + commonalities with ACE_Service_Config::load_static_svcs(), and + probably rethink this portion of the RT-CORBA initialization. - This fix should solve the crashes under Sun/CC 4.2 that have - plagued TAO-1.1.12 and our nightly builds too. + This fix should solve the crashes under Sun/CC 4.2 that have + plagued TAO-1.1.12 and our nightly builds too. - This problem was identified by many members of the community, - including Scott Gunn <gunns@tvratings.com>, J. Russell - Noseworthy <rnosewor@objectsciences.com> and Keith Nicewarner - <knicewar@erg.sri.com>. + This problem was identified by many members of the community, + including Scott Gunn <gunns@tvratings.com>, J. Russell + Noseworthy <rnosewor@objectsciences.com> and Keith Nicewarner + <knicewar@erg.sri.com>. Tue Feb 20 16:13:22 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/IIOP_Connection_Handler.cpp (handle_close): Fixed a problem - with lingering handles in the cache when the server is - shutdown. We need to pro-actively purge the handles from - cache. Thanks to Christian von Mueffling <cvm@aiss.de> for - reporting this problem. - - * tao/IIOP_Transport.cpp: We were explicitly purging connections - after a handle_close () in close_connection (). That is not - required as we purge the connections from cache during - handle_close () itself. - - * tao/Strategies/UIOP_Connection_Handler.cpp: - * tao/Strategies/UIOP_Transport.cpp: - * tao/Strategies/SHMIOP_Connection_Handler.cpp: - * tao/Strategies/SHMIOP_Transport.cpp: - * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: - * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp: Replicated the - changes done for IIOP. - + * tao/IIOP_Connection_Handler.cpp (handle_close): Fixed a problem + with lingering handles in the cache when the server is + shutdown. We need to pro-actively purge the handles from + cache. Thanks to Christian von Mueffling <cvm@aiss.de> for + reporting this problem. + + * tao/IIOP_Transport.cpp: We were explicitly purging connections + after a handle_close () in close_connection (). That is not + required as we purge the connections from cache during + handle_close () itself. + + * tao/Strategies/UIOP_Connection_Handler.cpp: + * tao/Strategies/UIOP_Transport.cpp: + * tao/Strategies/SHMIOP_Connection_Handler.cpp: + * tao/Strategies/SHMIOP_Transport.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Transport.cpp: Replicated the + changes done for IIOP. + Tue Feb 20 12:02:30 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/IIOP_Connection_Handler.cpp (handle_close): - * tao/Strategies/UIOP_Connection_Handler.cpp: - * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: Fixed a - leak from open handles on the server side when the clients - exit. + * tao/IIOP_Connection_Handler.cpp (handle_close): + * tao/Strategies/UIOP_Connection_Handler.cpp: + * orbsvcs/orbsvcs/SSLIOP/SSLIOP_Connection_Handler.cpp: Fixed a + leak from open handles on the server side when the clients + exit. Tue Feb 20 10:25:37 2001 Jeff Parsons <parsons@cs.wustl.edu> * TAO_IDL/be/be_visitor_operation.operation_ss.cpp: Added missing carriage return in skeleton code generation. - Thanks to Alexandr Gavrilov <gavr@trustworks.com> for + Thanks to Alexandr Gavrilov <gavr@trustworks.com> for reporting this bug. Tue Feb 20 06:27:17 2001 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> - * tao/Makefile.bor (OBJFILES): Remove - - $(OBJDIR)\GIOP_Message_Headers.obj - - since this file no longer exists. Thanks to Johnny Willemsen - for reporting this. + * tao/Makefile.bor (OBJFILES): Remove + + $(OBJDIR)\GIOP_Message_Headers.obj + + since this file no longer exists. Thanks to Johnny Willemsen + for reporting this. Mon Feb 19 20:19:07 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/GIOP_Message_Lite.cpp: - * tao/GIOP_Message_Locate_Header.cpp: - * tao/GIOP_Message_Generator_Parser_10.cpp: Corrected the wrong - inclusions. - - * tao/Makefile: - * tao/Domain/Makefile: - * tao/DynamicAny/Makefile: - * tao/DynamicInterface/Makefile: - * tao/IFR_Client/Makefile: - * tao/IORManipulation/Makefile: - * tao/IORTable/Makefile: - * tao/PortableServer/Makefile: - * tao/SmartProxies/Makefile: - * tao/Strategies/Makefile: Updated dependencies. + * tao/GIOP_Message_Lite.cpp: + * tao/GIOP_Message_Locate_Header.cpp: + * tao/GIOP_Message_Generator_Parser_10.cpp: Corrected the wrong + inclusions. + + * tao/Makefile: + * tao/Domain/Makefile: + * tao/DynamicAny/Makefile: + * tao/DynamicInterface/Makefile: + * tao/IFR_Client/Makefile: + * tao/IORManipulation/Makefile: + * tao/IORTable/Makefile: + * tao/PortableServer/Makefile: + * tao/SmartProxies/Makefile: + * tao/Strategies/Makefile: Updated dependencies. Mon Feb 19 19:59:44 2001 Balachandran Natarajan <bala@cs.wustl.edu> - * tao/GIOP_Message_Locate_Header.h: Changed the wrong inclusion of - .i file. + * tao/GIOP_Message_Locate_Header.h: Changed the wrong inclusion of + .i file. Mon Feb 19 19:15:11 2001 Jeff Parsons <parsons@cs.wustl.edu> diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html index 8ec8f44eaf9..9e1d1f2e97b 100644 --- a/TAO/docs/Options.html +++ b/TAO/docs/Options.html @@ -155,7 +155,7 @@ merged with <a href="#-ORBCollocation"><code>-ORBCollocation</code></a>. </TR> <TR> <TD><CODE><A HREF="ORBEndpoint.html">-ORBEndpoint</A></CODE> - <EM>endpoint</EM></TD> + <EM>endpoint</EM></TD> <TD><a name="-ORBEndpoint"></a>Tells the ORB to listen for requests on the interface specified by <I><EM>endpoint</EM></I>. Endpoints are specified using a URL style format. An endpoint has the form: @@ -276,11 +276,11 @@ merged with <a href="#-ORBCollocation"><code>-ORBCollocation</code></a>. <CODE>-ORBEndpoint</CODE> option. <P> This is a client-side option. - <P> - <FONT COLOR=RED>-ORBPreconnect is <STRONG>deprecated</STRONG>. - This option will be removed in the near future. The Real-Time CORBA standard - <CODE>validate_connection()</CODE> method should be used - instead. + <P> + <FONT COLOR=RED>-ORBPreconnect is <STRONG>deprecated</STRONG>. + This option will be removed in the near future. The Real-Time CORBA standard + <CODE>validate_connection()</CODE> method should be used + instead. </TD> </TR> <TR> @@ -403,7 +403,7 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. <TABLE BORDER="1" CELLSPACING="2" CELLPADDING="0"> <TR><TH><em>which</em></TH><TH>Reactor</TH> </TR> - <TR> + <TR> <TD><CODE>select_mt</CODE></TD> <TD>Use the multi-thread select-based reactor.</TD> </TR> @@ -431,7 +431,7 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. <TR> <TD><CODE>tp</CODE></TD> <TD>Use the <CODE>ACE_TP_Reactor</CODE>, a select based - thread-pool reactor.</TD> + thread-pool reactor.</TD> </TR> </TABLE> </TD> @@ -439,10 +439,10 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. <TR> <TD><CODE>-ORBReactorMaskSignals</CODE> <EM>0/1</EM></TD> <TD>ACE select reactors mask signals during upcalls to the event - handlers. This is only useful if the application is going to + handlers. This is only useful if the application is going to trap those signals and handle them in any way. Disabling the mask can improve performance by reducing the - number of kernel level locks. + number of kernel level locks. </TD> </TR> <TR> @@ -462,6 +462,24 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. </TD> </TR> <TR> + <TD><CODE>-ORBIORParser</CODE> <EM>parser</EM></TD> + <TD><a name="-ORBIORParser"></a> + Name an IOR Parser to load. + IOR Parsers are used to interpret strings passed to + <CODE>ORB::string_to_object()</CODE>. + By default the ORB can handle multiple string formats, + including <CODE>IOR:</CODE>, + <CODE>corbaloc:</CODE>, + <CODE>corbaname:</CODE>, + and <CODE>file:</CODE>. + The application developer can + <A HREF="ior_parsing.html"> + add new IOR formats + </A> + using this option. + </TD> +</TR> +<TR> <TD><CODE>-ORBInputCDRAllocator</CODE> <EM>which</EM></TD> <TD><a name="-ORBInputCDRAllocator"></a> Specify whether the ORB uses locked @@ -546,7 +564,7 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. Select the type of reactor registry. Currently two implementations are provided: <B>single</B> uses a single reactor per ORB, this is the default - and is sufficient for most applications. + and is sufficient for most applications. Applications with stringent QoS requirements may prefer the <B>per-priority</B> strategy, in this case threads at different CORBA priorities are assigned different @@ -578,12 +596,12 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. for a purely Reactor-driven concurrency strategy or <code>thread-per-connection</code> for creating a new thread to service each connection. The default is reactive. - <P> - TAO also supports the thread-pool concurrency model - but this is implemented by the user, creating multiple - threads that call <CODE>ORB::run()</CODE> and using - the <CODE>-ORBReactorType tp</CODE> option. - </P> + <P> + TAO also supports the thread-pool concurrency model + but this is implemented by the user, creating multiple + threads that call <CODE>ORB::run()</CODE> and using + the <CODE>-ORBReactorType tp</CODE> option. + </P> </TD> </TR> <TR> @@ -591,33 +609,33 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. <TD><a name="server_timeout"><CODE>-ORBThreadPerConnectionTimeout</CODE></a> <EM>milliseconds</EM></TD> <TD>In many platforms it is impossible to interrupt the server - threads created by the - <code>thread-per-connection</code> model. - This is because these threads are blocked in - <CODE>read()</CODE> operations (and not in - <CODE>select()</CODE>). - As a workaround, the server threads - periodically poll the ORB to find out if they should - shutdown. - This option controls the period of the polling, - expressed in milliseconds. - Applications that do not shutdown, or that can otherwise - ensure that no server threads will be running at - shutdown (for example if all the clients terminate - before the server) can disable the polling using the - magic value <CODE>INFINITE</CODE>. - - <P> - If the option is not provided then the ORB uses the - compile time flag - <CODE>TAO_DEFAULT_THREAD_PER_CONNECTION_TIMEOUT</CODE>, - this flag also expresses the time in milliseconds (as - a string constant) and the magic value - <CODE>"INFINITE"</CODE> can be used to disable polling - entirely. This yields a slight performance improvement - (around 1%). - </P> - </TD> + threads created by the + <code>thread-per-connection</code> model. + This is because these threads are blocked in + <CODE>read()</CODE> operations (and not in + <CODE>select()</CODE>). + As a workaround, the server threads + periodically poll the ORB to find out if they should + shutdown. + This option controls the period of the polling, + expressed in milliseconds. + Applications that do not shutdown, or that can otherwise + ensure that no server threads will be running at + shutdown (for example if all the clients terminate + before the server) can disable the polling using the + magic value <CODE>INFINITE</CODE>. + + <P> + If the option is not provided then the ORB uses the + compile time flag + <CODE>TAO_DEFAULT_THREAD_PER_CONNECTION_TIMEOUT</CODE>, + this flag also expresses the time in milliseconds (as + a string constant) and the magic value + <CODE>"INFINITE"</CODE> can be used to disable polling + entirely. This yields a slight performance improvement + (around 1%). + </P> + </TD> </TR> <TR> <TD><CODE>-ORBActiveObjectMapSize</CODE> <EM>active object map @@ -821,8 +839,8 @@ superseded by <code><A HREF="#-ORBReactorType">-ORBReactorType</A></code>. MUXED means that Transport multiplexes more than one request at the same time on a connection. This option is often used in - conjunction with Asynchronous Method Invocation, because - multiple requests can be sent 'in bulk'. <p> + conjunction with Asynchronous Method Invocation, because + multiple requests can be sent 'in bulk'. <p> Default for this option is EXCLUSIVE. diff --git a/TAO/docs/ior_parsing.html b/TAO/docs/ior_parsing.html new file mode 100644 index 00000000000..9f51a690fe0 --- /dev/null +++ b/TAO/docs/ior_parsing.html @@ -0,0 +1,226 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> + <head> + <!-- $Id$ --> + <title>Adding new IOR Parsers to TAO</title> + </head> + + <body text="#000000" link="#0000ff" vlink="#cc0000" bgcolor="#ffffff"> + + <CENTER> + <H1>Introduction</H2> + </CENTER> + + <h4>What is an IOR Parser?</h4> + + <P>TAO supports several IOR formats, including + <CODE>IOR:</CODE>, <CODE>corbaloc:</CODE>, + <CODE>corbaname:</CODE> and <CODE>file:</CODE>. + However, some applications may benefit from other formats, for + example, <CODE>http:</CODE> could allow applications to download + an object reference from a web server. + </P> + <P>Adding new IOR formats to the ORB is a simple task, the ORB + takes advantage ACE's + <A HREF="http://www.cs.wustl.edu/~schmidt/DSEJ-94.ps.gz"> + Service Configurator + </A> + to dynamically load new <EM>IOR Parsers</EM>. + The implementation of <CODE>string_to_object()</CODE> queries + each available IOR Parser to convert an string into an object + reference. + Application developers can implement their own parsers and + dynamically (or statically) add them to the ORB, without any + need to recompile TAO. + </P> + + <H4>Why aren't the IOR parsers in TAO enough?</H4> + + <P>TAO provides a basic set of IOR parsers, + but it would be detrimental to TAO's footprint to implement a + huge collection of IOR parsers into the ORB. + Moreover, the DOC group does not have the ability to create all + possible IOR parsers: many applications will use proprietary + databases to configure the ORB. + <P> + + <H4>Why should I use an IOR parser?</H4> + + <P>Using an IOR parser is more convenient than, say, + setting up the ad-hoc configuration code in + <CODE>main()</CODE>. + It also allows for easier integration with other TAO components, + such as the <CODE>-ORBInitRef</CODE> options. + </P> + + <HR> + + <CENTER> + <H1>Implementation</H2> + </CENTER> + + <H1>How do you Implement an IOR Parser?</H1> + + <P>Implementing an IOR parser is easy, + you must implement a class derived from + <CODE>TAO_IOR_Parser</CODE>. + As an example we will develop an HTTP IOR parser, + the class declaration will probably look like this: +<PRE> +class HTTP_Parser : public TAO_IOR_Parser +{ +public: + virtual int match_prefix (const char *ior_string) const; + virtual CORBA::Object_ptr parse_string (const char *ior, + CORBA::ORB_ptr orb, + CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)); +}; +</PRE> + For maximal portability this class uses the alternative mapping + for exception handling, if you are not familiar with the + alternative mapping you can safely ignore the + <CODE>CORBA::Environment</CODE> argument. + Please read the exception handling + <A HREF="exceptions.html"> + documentation + </A> + for more details. + </P> + + <UL> + <LI><B>match_prefix</B> This method must recognize all the IOR + prefixes that this parser supports. Normally this is a single + prefix, a typical implementation will look like this: +<PRE> +int +HTTP_Parser::match_prefix (const char *ior_string) const +{ + static char http_prefix[] = "http:"; + int cmp = ACE_OS::strncmp (ior_string, http_prefix, sizeof(http_prefix)); + return (cmp == 0); +} +</PRE> + </LI> + <LI><B>parse_string</B> This method implements the real string + parsing, you can safely assume that the string has been + validated by the <CODE>match_prefix()</CODE> method. + Typically, this method will obtain the IOR string, in our + example by downloading the document from the web server, + and then uses <CODE>string_to_object()</CODE> to return the + object reference: +<PRE> +CORBA::Object_ptr +HTTP_Parser::parse_string (const char *ior, + CORBA::ORB_ptr orb, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Parse IOR as if it was an http:-URL + ACE_URL_Addr *url_addr = + ACE_URL_Addr::create_addr (ior); + + ACE_HTTP_Addr *http_addr = + ACE_dynamic_cast(ACE_HTTP_Addr*,url_addr); + + // Connect to the remote host and download the web page, store the + // contents in: + char *document_contents = ...; + + return orb->string_to_object (document_contents, ACE_TRY_ENV); +} +</PRE> + </LI> + </UL> + + <H4>How do you add an IOR Parser to the ORB?</H4> + + <P>As we mentioned above, TAO uses the ACE Service Configurator + framework to find (dynamically or statically) the IOR parsers. + You may want to read the + <A HREF="../../docs/tutorials/022/page01.html"> + ACE tutorial + </A> + on this subject, but the process is mostly mechanic, and + described here. + </P> + <P>First you must declare, in the header file, a factory method + and a description of the service, + this is easily accomplished via the following ACE macros: +<PRE> +ACE_FACTORY_DECLARE (Export_Prefix, HTTP_Parser) +ACE_STATIC_SVC_DELCARE_EXPORT (Export_Prefix, HTTP_Parser) +</PRE> + If you are only going to use Unix-like compilers and linkers, + then you can simply use <CODE>TAO</CODE> in place of + <CODE>Export_Prefix</CODE>. + However, under Microsoft Windows variants, this string must be + the prefix of the DLL export/import macros used by your library. + If you are going to statically link your IOR Parser into the + application you will also need to add + <CODE>ACE_STATIC_SVC_REQUIRE</CODE>, as follows: +<PRE> +ACE_FACTORY_DECLARE (Export_Prefix, HTTP_Parser) +ACE_STATIC_SVC_DELCARE_EXPORT (Export_Prefix, HTTP_Parser) +ACE_STATIC_SVC_REQUIRE (HTTP_Parser) +</PRE> + </P> + + <P>Next you must implement the services defined above, using some + other group of helper macros, in your source file you should + add: +<PRE> +ACE_STATIC_SVC_DEFINE (HTTP_Parser, + ACE_TEXT ("HTTP_Parser"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (HTTP_Parser), + ACE_Service_Type::DELETE_THIS | + ACE_Service_Type::DELETE_OBJ, + 0) +ACE_FACTORY_DEFINE (Export_Prefix, HTTP_Parser) +</PRE> + The second argument to <CODE>ACE_STATIC_SVC_DEFINE</CODE> is + the name of the service in ACE's Service Configurator. + It is customary, but not required, to use the name of the class. + </P> + + <P>Finally you can dynamically add your IOR parser to the ORB + using the <CODE>-ORBIORParser</CODE> option in the + Resource Factory + (see + <A HREF="Options.html"> + Options for TAO Components + </A> + for details about ORB and Resource Factory options), + for example: +<PRE> +# svc.conf file +static Resource_Factory "-ORBIORPaser HTTP_Parser" +</PRE> + would add our new parser to the ORB. + </P> +<PRE> + +</PRE> + </P> + + <H4>Are there any complete examples?</H4> + + <P>Yes, the IOR parsers in the ORB can serve as complete examples, + please check: + <CODE>FILE_Parser.h</CODE>, + <CODE>CORBALOC_Parser.h</CODE>, + <CODE>CORBANAME_Parser.h</CODE>, + or <CODE>DLL_Parser.h</CODE>. + Unfortunately there are no examples that show how to dynamically + add a new IOR parser into the ORB. + </P> + + <hr> + <address><a href="mailto:coryan@uci.edu">Carlos O'Ryan</a></address> +<!-- Created: Tue Feb 20 08:42:57 PST 2001 --> +<!-- hhmts start --> +Last modified: Tue Feb 20 16:32:13 PST 2001 +<!-- hhmts end --> + </body> +</html> |