summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarvindk <arvindk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-09-29 21:34:37 +0000
committerarvindk <arvindk@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-09-29 21:34:37 +0000
commitc929402791968fe4a5dbfca4347895c543a18bec (patch)
tree48bce9b3e6a1c8bb4258790be7cd6d6aba999ebd
parent736d2c112a4db53f2c423172a2d49fe1cf2a55c7 (diff)
downloadATCD-c929402791968fe4a5dbfca4347895c543a18bec.tar.gz
ChangelogTag: Thu Sep 29 16:07:02 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
-rw-r--r--bin/FOCUS/ChangeLog235
-rw-r--r--bin/FOCUS/Parser/FOCUSParser.pm726
-rw-r--r--bin/FOCUS/docs/FOCUS.html165
-rw-r--r--bin/FOCUS/specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl172
-rw-r--r--bin/FOCUS/specializations/Protocol_Family/IIOP/iiop.spl996
5 files changed, 2294 insertions, 0 deletions
diff --git a/bin/FOCUS/ChangeLog b/bin/FOCUS/ChangeLog
new file mode 100644
index 00000000000..30ac9d1bef6
--- /dev/null
+++ b/bin/FOCUS/ChangeLog
@@ -0,0 +1,235 @@
+Thu Sep 29 15:57:36 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * FOCUS.pl:
+ Changed the script to use $ACE_ROOT enviornment variable to
+ compute the paths to the specialization files.
+
+ * Parser/Parser.pm:
+ Modified the parser comments and return values.
+
+ * NEWS: Added news file that discusses the current and planned
+ features.
+
+ * README: Readme file
+ * INSTALL: Removed install file and moved contents to README
+
+ * docs/FOCUS.html: Documenting the different features of FOCUS and
+ usage.
+
+Thu Sep 29 11:15:52 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * specializations/Protocol_Family/IIOP/iiop.spl:
+ * specializations/Context-Specific-Optimizations/Request-Creation-Optimizations.spl:
+ Changes required to the rules based on code level changes.
+
+Wed Sep 7 09:20:30 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * VERSION:
+ * specializations/Wait_Strategy/Wait_On_Read.spl:
+ * specializations/Protocol_Family/iiop.spl:
+ * specializations/Messaging_Strategy/GIOP.spl:
+ * Parser/Parser.pm:
+
+ Added version file for the first internal release of
+ FOCUS. Updated the specializations based on recent updates.
+
+Tue Sep 6 09:07:04 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * specializations/Protocol_Family/iiop.spl:
+
+ Added specialization rules for specializing the pluggable
+ protocols implementation in TAO with the IIOP protocol
+ implementation.
+
+Mon Aug 29 11:55:32 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * specializations/Reactor_Family/Select_Reactor_ST.spl:
+ * specializations/Reactor_Family/Select_Reactor_MT.spl:
+ * specializations/Reactor_Family/TP_Reactor.spl:
+
+ Updated the specializations rules for the Reactor specialization
+ after the commit by Steve Huston. These have been tested and
+ validated with the code in ACE+TAO.
+
+Mon Aug 22 13:28:39 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * FOCUS.pl:
+ * Parser/Parser.pm:
+ * specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimitzation.spl:
+
+ Added the specialization that resolves the request processor
+ only once and uses the cached request processor to service
+ requests on a specific connection for all other requests.
+
+Wed Aug 17 14:59:44 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * FOCUS.pl:
+
+ Added new option for specializing the wait strategy at the
+ client side in ACE+TAO
+
+ * Parser/Parser.pm:
+
+ Added support of <copy-from-source> tag that copies source code
+ from a source file and inserts it into the destination file
+ at a particular hook location.
+
+ * specializations/Reactor_Family/Select_Reactor_MT.spl:
+ * specializations/Reactor_Family/Select_Reactor_ST.spl:
+ * specializations/Wait_Strategy/Wait_On_Read.spl:
+ * specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl:
+
+ Updated the Reactor specializations, after eliminating the
+ Reactor_Timer_Interface from the Reactor implementation. Added
+ two specializations for the Wait strategy and the
+ Leader_Follower_Flushing strategies. Updated the Messaging
+ specialization based on hooks left in the source code.
+
+Mon Aug 15 14:59:28 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * Parser/Parser.pm:
+
+ Updated the parser to include the attribute match-line in a
+ substitute tag. This matches the entire line as opposed to a
+ word which substitutes default behavior is.
+
+ * specializations/Reactor_Family/Select_Reactor_MT.spl:
+ * specializations/Reactor_Family/Select_Reactor_ST.spl:
+
+ Updated the rules to include the match-line attribute to match
+ the entire line as opposed to the a single word.
+
+Mon Aug 15 09:07:54 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * specializations/Select_Reactor_ST.spl:
+ * specializations/Select_Reactor_MT.spl:
+ * specializations/TP_Reactor.spl:
+
+ Updated the specialization rules. In particular, the
+ specialization rules have been updated as two separate ST rules
+ and MT rules for select reactor ST and select reactor MT.
+
+ * FOCUS.pl:
+
+ Updated the main script to work with these two rules.
+
+Thu Aug 11 16:33:47 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * FOCUS.pl:
+ * Parser/Parser.pm:
+
+ Added option to specify the output path where the specialization
+ file should be put.
+
+ * specializations/Reactor_Family/TP_Reactor.spl:
+ Updated the thread-pool reactor specialization file tags based
+ on the generated code.
+
+Thu Aug 11 10:54:06 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * FOCUS.pl:
+
+ Updated specialization entry for Thread Pool reactor.
+
+ * Parser/Parser.pm:
+
+ Updated the Visit_Substitute method with the requirement that it
+ match whole words and not parts of a word. For example, this
+ problem manifests when one is trying to substitute
+ Msg_WFMO_Reactor and WFM_Reactor. Both the strings match for
+ WFMO_Reactor, when only the latter should be matching. Corrected
+ this issue.
+
+ * specializations/Select_Reactor.spl:
+ * specializations/TP_Reactor.spl:
+
+ Updated the tags to be consistent and corrected several typos
+ and made sure that the rules in the specializations are actually
+ executed.
+
+ * PROBLEM-REPORT-FORM:
+
+ Most important thing added :-)
+
+Wed Aug 10 15:38:17 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * FOCUS.pl:
+ Moved the perl script from the Parser module to the top level
+ directory for convenience.
+
+ * specializations/Reactor_Family/TP_Reactor.spl:
+
+ Added a specialization file for specializing TP_Reactor
+ implementation.
+
+ * specializations/Reactor_Family/Select_Reactor.spl:
+
+ Updated the specialization file to be in sync with the code
+ level comment hooks in the ACE+TAO implementation.
+
+Sun Aug 7 16:15:29 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * Parser/Parser.pm:
+
+ Added Visit_Comment visitor to parse and execute <comment>
+ tags. Each comment tag contains a start-hook and an end-hook
+ which can be used to comment blocks of region within the source
+ code.
+
+ * specializations/Protocol_Family/Pluggable_Messaging.spl:
+
+ A specialization file that completely removes the Pluggable
+ messaging interface and replaces that with the concrete type
+ used.
+
+Thu Aug 4 14:33:42 2005 Arvind Krishna <arvindkr@arvindkr.qualcomm.com>
+
+ * Parser/Parser.pm:
+
+ Added diagnostic messages and updated FOCUS perl script to use
+ Getopt command line parsing perl module.
+
+Thu Aug 4 10:57:08 2005 Arvind Krishna <arvindkr@arvindkr.qualcomm.com>
+
+ * Parser/Parser.pm:
+ * Parser/FOCUS.pl:
+ Updated the parser module to include a <module> tag, this is
+ necessary when the specializations have to work across different
+ directories such as ACE and TAO.
+
+Wed Jul 27 15:54:02 PDT 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * specializations/Reactor_Family/Select_Reactor.spl:
+ Added a couple of specialization tags for reactor specialization.
+
+ * Parser/xml-spl-parser.pm:
+ Parser now capable of executing search, replace, add and comment
+ functionality for specializations.
+
+Tue Jul 26 12:38:00 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * specializations/README:
+
+ Added a evolving README file that describes the rules for
+ integrating different specializations into FOCUS.
+
+Tue Jul 26 11:23:51 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * Parser/Parser.pm:
+ * specializations/Reactor_Family/Select_Reactor.spl:
+
+ A simple perl based parser to parse the XML specializations
+ defined within the various specialization
+ files. Select_Reactor.spl defines the specialization rules for
+ effecting the transformations for specializing the Reactor
+ framework within ACE.
+
+Tue Jul 26 11:21:44 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+
+ * FOCUS:
+ Birth of "Feature Oriented Customization of Systems" is a
+ research project that aims at customizing semi complete
+ applications or frameworks based on features (e.g., type of
+ protocol, type of reactor) used in an application. FOCUS was
+ born out of research efforts described in the following paper:
+ http://www.cs.wustl.edu/~schmidt/PDF/MW-Spl.pdf
diff --git a/bin/FOCUS/Parser/FOCUSParser.pm b/bin/FOCUS/Parser/FOCUSParser.pm
new file mode 100644
index 00000000000..b2061a660a4
--- /dev/null
+++ b/bin/FOCUS/Parser/FOCUSParser.pm
@@ -0,0 +1,726 @@
+#########################################################################
+# A Simple Parser for automating the specializations crated in FOCUS.
+#
+# @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+#
+# $Id$
+#
+# This parser, parses the specialization file given as an input argument
+# and *individually* visits the tags in a pre-determined order to weave
+# in the specializations.
+# NOTE: This parser will make N passes over the file, where N equals
+# to the number of tags defined in the specialization file. This
+# approach is intentional as it servers current needs. Future versions
+# may enhance this parser and Visit methods to be more intelligent.
+###########################################################################
+package FOCUSParser;
+
+# for MY own preferences!
+use strict;
+
+# XML related operations
+use XML::DOM;
+
+# Generic file operations
+use FileHandle;
+
+# Creating files and renaming them
+use File::Copy;
+
+# Creating directories
+use File::Path;
+
+############################################
+# GLOBAL CONSTANTS
+###########################################
+my $FOCUS_PREPEND_TAG = "\/\/@@ ";
+
+####################################################################
+# banner: A function that returns the FOCUS banner transformation
+# for just clarity purpose only.
+###################################################################
+sub FOCUS_banner_start
+{
+ my $banner_str = "// Code woven by FOCUS:\n";
+ return $banner_str;
+}
+
+sub FOCUS_banner_end
+{
+ my $banner_str = "// END Code woven by FOCUS\n";
+ return $banner_str;
+}
+
+#########################################################################
+# Visit_ADD: Visit a add element defined in the transform.
+# In particular look for the hook defined: search it in the source file
+# and add the data in the <data> tags into the file starting from the
+# hook, but not including the hook.
+##########################################################################
+sub Visit_Add
+{
+ my ($add, $copy_file_name) = @_;
+
+ # Open the copy and transform it
+ open (IN, "+<". $copy_file_name) ||
+ die "cannot open file: " . $copy_file_name;
+
+ # To update a file in place, we use the temporary
+ # file idiom. Perl says this is the best way to
+ # do this!
+ my $copy_file_tmp = $copy_file_name . "tmp";
+ open (OUT, ">". $copy_file_tmp) ||
+ die "cannot open temporary file for modying file:" . $copy_file_name;
+
+ # get the hook element defined in the add element
+ my $hook = $add->getElementsByTagName ('hook');
+
+ # ensure length of hook == 1;
+ if ($hook->getLength != 1)
+ {
+ print "Assertion Error: An <add> element can have only \
+ one <hook> definition";
+
+ # clean up
+ close (IN);
+ close (OUT);
+
+ # Diagnostic comment
+ print " [failure]... Reverting changes \n";
+
+ unlink ($copy_file_name);
+ unlink ($copy_file_name . "tmp");
+ exit (1);
+ }
+
+ # Check if the hook is present in the file at all
+ my $hook_str = $hook->item(0)->getFirstChild->getNodeValue;
+ chomp ($hook_str);
+
+ #//@@ For now, due to problem with the hook string
+ my $search_str = $hook_str;
+
+ while (<IN>)
+ {
+ if (/$search_str/)
+ {
+ # Do not remove the hook! It needs to be present
+ print OUT $_;
+
+ # FOCUS banner start
+ print OUT FOCUS_banner_start;
+
+ # parse <data> ... </data> elements for this add tag
+ my @data_list = $add->getElementsByTagName ('data');
+ foreach my $data (@data_list)
+ {
+ my $data_item = $data->getFirstChild->getNodeValue;
+ chomp ($data_item);
+
+ # Insert the item
+ print OUT "$data_item \n";
+ }
+
+ # FOCUS banner end
+ print OUT FOCUS_banner_end;
+ }
+ else
+ { print OUT $_; }
+ }
+
+ # Everything went well!
+ close (IN);
+ close (OUT);
+
+ # replace in place the old file with the new one
+ rename ($copy_file_tmp, $copy_file_name);
+}
+
+###########################################################################
+# Visit_Remove: Visit a <remove> element defined in the transform.
+# In particular look for the hook defined: search it in the source file
+# and remove the element's value from the source file being searched.
+############################################################################
+sub Visit_Remove
+{
+ my ($remove, $copy_file_name) = @_;
+
+ # obtain the data to be removed
+ my $search = $remove->getFirstChild->getNodeValue;
+ chomp ($search);
+
+ # Open the copy and transform it
+ open (IN, "+<" . $copy_file_name) ||
+ die "cannot open file: " . $copy_file_name;
+
+ # Update the file in place
+ my $copy_file_name_tmp = $copy_file_name . "tmp";
+ open (OUT, ">". $copy_file_name_tmp) ||
+ die "cannot open temporary file for modying file:" . $copy_file_name;;
+
+ # Removing something is same as search and replace. Replace with ""
+ my $replace = "";
+
+ foreach my $line (<IN>)
+ {
+ if ($line =~/$search/)
+ {
+ # We do not print the banner information
+ # as we have removed something and
+ # print the banner will be redundant!
+
+ # replace <search> with <replace>
+ $line =~ s/$search/$replace/;
+
+ print OUT $line;
+ }
+ else { print OUT $line; }
+ }
+
+ # Everything went well!
+ close (IN);
+ close (OUT);
+
+ # replace in place the old file with the new one
+ rename ($copy_file_name_tmp, $copy_file_name);
+}
+
+#########################################################################
+# Visit_Substitute: Visit a <substitute> element defined in the transform.
+# In particular look for the <search> element and replace it with the
+# <replace> element.
+#########################################################################
+sub Visit_Substitute
+{
+ my ($substitute, $copy_file_name) = @_;
+
+ # Open the copy and transform it
+ open (IN, "+<". $copy_file_name) ||
+ die "cannot open file: " . $copy_file_name;
+
+ # To update a file in place, we use the temporary
+ # file idiom. Perl says this is the best way to
+ # do this!
+ my $copy_file_name_tmp = $copy_file_name . "tmp";
+ open (OUT, ">". $copy_file_name . "tmp") ||
+ die "cannot open temporary file for modying file:" . $copy_file_name;;
+
+ # check if the match-line keyword is set or not
+ my $match_line = $substitute->getAttribute('match-line');
+
+ # <search> .... </search>
+ my $search_list = $substitute->getElementsByTagName ('search');
+
+ # ensure length of search == 1;
+ if ($search_list->getLength != 1 ||
+ $search_list->getLength == 0)
+ {
+ print "Assertion Error: A <substitute> element can have only \
+ one <search> element";
+ close (IN);
+ close (OUT);
+
+ # Dianostic comment
+ print " [failure] reverting changes \n";
+
+ unlink ($copy_file_name);
+ unlink ($copy_file_name_tmp);
+ exit (1);
+ }
+
+ # <replace> .... </replace>
+ my $replace_list = $substitute->getElementsByTagName ('replace');
+ if ($replace_list->getLength != 1 ||
+ $replace_list->getLength == 0)
+ {
+ print "Assertion Error: A <substitute> element can have only \
+ one <replace> element";
+ close (IN);
+ close (OUT);
+ unlink ($copy_file_name);
+ unlink ($copy_file_name_tmp);
+ exit (1);
+ }
+
+ # <search> and <replace> element values
+ my $search = $search_list->item(0)->getFirstChild->getNodeValue;
+ my $replace = $replace_list->item(0)->getFirstChild->getNodeValue;
+
+ # remove spaces
+ chomp ($search);
+ chomp ($replace);
+
+ # Search and replace string in the file
+ foreach my $line (<IN>)
+ {
+ # Check if the match line attribute is set. If so then
+ # ignore word boundaries. If not, honor word boundaries.
+ my $line_matched = 0;
+ if (! $match_line)
+ {
+ if ($line =~/\b$search\b/)
+ {
+ $line_matched = 1;
+ }
+ }
+ else
+ {
+ if ($line =~ /$search/)
+ {
+ $line_matched = 1;
+ }
+ }
+
+ # Check if the line matched
+ if ($line_matched)
+ {
+ # FOCUS banner start
+ print OUT FOCUS_banner_start;
+
+ # replace <search> with <replace>
+ # Caveat: What if <search> occures multiple
+ # times in the line? Here is how we handle
+ # it
+ $line =~ s/$search/$replace/g;
+
+ print OUT $line;
+
+ # FOCUS banner end
+ print OUT FOCUS_banner_end;
+ }
+ else { print OUT $line; }
+ }
+
+ # everything went well!
+ close (IN);
+ close (OUT);
+
+ # replace in place the old file with the new one
+ rename ($copy_file_name_tmp, $copy_file_name);
+}
+
+#########################################################################
+# Visit_Comment: Visit the comment-region hooks defined in the
+# source code and comment out all code between start and finish of that
+# region
+#########################################################################
+sub Visit_Comment
+{
+ my ($comment, $copy_file_name) = @_;
+
+ # check for the comment region tags and
+ # comment out the region
+ my $start_hook_tag = $comment->getElementsByTagName ('start-hook');
+ my $end_hook_tag = $comment->getElementsByTagName ('end-hook');
+
+ if ($start_hook_tag->getLength != 1 ||
+ $end_hook_tag->getLength != 1)
+ {
+ print "Assertion Error: A <comment> element can have only \
+ one pair of <start-hook> and <end-hook> tags";
+ unlink ($copy_file_name);
+ exit (1);
+ }
+
+ my $start = $start_hook_tag->item(0)->getFirstChild->getNodeValue;
+ my $end = $end_hook_tag->item(0)->getFirstChild->getNodeValue;
+
+ # What are we looking for:
+ # We need to start from "//" . FOCUS_PREPEND_TAG . $hook
+ # i.e. //[[@ <blah blah>
+ # This will be the format for both start and end
+ # //@@ Problems with the hook string
+ my $start_hook = $FOCUS_PREPEND_TAG . $start;
+ my $end_hook = $FOCUS_PREPEND_TAG . $end;
+
+ # Open the copy and transform it
+ open (IN, "+<". $copy_file_name) ||
+ die "cannot open file: " . $copy_file_name;
+
+ my $copy_file_name_tmp = $copy_file_name . "tmp";
+ open (OUT, ">". $copy_file_name_tmp) ||
+ die "cannot open temporary file for modying file:" . $copy_file_name;
+
+ my $start_commenting = 0;
+ while (<IN>)
+ {
+ if (! /$start_hook/ &&
+ ! /$end_hook/)
+ {
+ if ($start_commenting)
+ { print OUT "// " . $_; }
+ else
+ { print OUT $_; }
+ }
+ else
+ {
+ if (/$start_hook/)
+ {
+ $start_commenting = 1;
+ print OUT $_; # print start hook!
+ }
+ else
+ {
+ $start_commenting = 0;
+ print OUT $_; # print end hook!
+ }
+ }
+ }
+
+ # everything went well!
+ close (IN);
+ close (OUT);
+
+ rename ($copy_file_name_tmp, $copy_file_name);
+}
+
+###############################################################
+# Visit_Copy: visit the <copy> tags and weave the code into the
+# source file. In particular, open the source file specified
+# in the file-source tag. Search for the start hook and
+# copy until the end hook is reached.
+###############################################################
+sub Visit_Copy
+{
+ my ($copy_tag, $copy_file_name, $default_module_name, $prefix_path) = @_;
+
+ # Check if a file name has been specified
+ my $dest_file_tag = $copy_tag->getElementsByTagName ('source');
+
+ if (! $dest_file_tag)
+ {
+ print "Error: <copy-from-source> does not have the <file> tag..";
+ print "aborting \n";
+ exit 1;
+ }
+
+ if ($dest_file_tag->getLength != 1)
+ {
+ print "Assertion Error: A <copy-from-source> element can have only \
+ one <source> tag from which to copy elements";
+ exit (1);
+ }
+
+ my $dest_file_name = $dest_file_tag->item(0)->getFirstChild->getNodeValue;
+
+ #Check if the file exists and one is able to access it
+ $dest_file_name = $prefix_path . "/" . $default_module_name . "/" . $dest_file_name;
+
+ open (DEST, "<". $dest_file_name) ||
+ die "cannot open $dest_file_name \n Wrong <file> tag within <copy-from-source> exiting" ;
+
+ # check for the start and end tags within the target file where
+ # one needs to start copying from
+ my $start_tag = $copy_tag->getElementsByTagName ('copy-hook-start');
+ my $end_tag = $copy_tag->getElementsByTagName ('copy-hook-end');
+
+ if (! $start_tag || ! $end_tag)
+ {
+ print "Assertion Error: A <copy> element should have a \
+ <copy-hook-start> tag and <copy-hook-end> tag \n";
+ exit (1);
+ }
+
+ # Get the <dest-hook> tag that indicates the destination where the
+ # code between the start and end tags will be placed.
+ my $dest_hook_tag = $copy_tag->getElementsByTagName ('dest-hook');
+ if (! $dest_hook_tag)
+ {
+ print "Assertion Error: <copy-from-source> should have a <dest-hook> \
+ tag that dictates where in the source file the code should be \
+ placed. \n";
+ exit (1);
+ }
+
+ # Remove any starting and trailing white spaces
+ chomp ($dest_hook_tag);
+
+ # We have everything we need! Do the copy
+ my $start_tag_name = $start_tag->item(0)->getFirstChild->getNodeValue;
+ my $end_tag_name = $end_tag->item(0)->getFirstChild->getNodeValue;
+ my $dest_tag_name = $dest_hook_tag->item(0)->getFirstChild->getNodeValue;
+
+ # First we add the FOCUS prepend tags
+ $start_tag_name = $FOCUS_PREPEND_TAG . $start_tag_name;
+ $end_tag_name = $FOCUS_PREPEND_TAG . $end_tag_name;
+ $dest_tag_name = $FOCUS_PREPEND_TAG . $dest_tag_name;
+
+ # Step 1: Iterate over the target file till the
+ # dest-hook is found in that file
+ my $copy_file_name_tmp = $copy_file_name . "tmp";
+ open (OUT, ">". $copy_file_name_tmp) ||
+ die "cannot open temporary file for modying file:" . $copy_file_name;
+ open (IN, "<" . $copy_file_name) ||
+ die "cannot open file $copy_file_name specified in the <file> tag \n";
+
+ my $dest_tag_found = 0; #check if tag matched
+ foreach my $line (<IN>)
+ {
+ if ($line =~ /$dest_tag_name/)
+ { $dest_tag_found = 1; print OUT $line; last; }
+
+ print OUT $line;
+ }
+ close (IN);
+
+ # If we reached the end of file before finding the tag!
+ if (! $dest_tag_found)
+ {
+ print "\n Error: <dest-hook> tag missing in file .. aborting \n";
+ close (DEST);
+ close (IN);
+ close (OUT);
+ unlink ($copy_file_name_tmp);
+ exit (1);
+ }
+
+ # Step 2: Now look in the destination file and look for the hooks
+ # where one needs to copy. There could be multiple places where the
+ # hook can be present. E.g.
+ # .......
+ # //@@ COPY_START_HOOK
+ # ....
+ # ....
+ # //@@ COPY_END_HOOK
+ # ....
+ # ....
+ # //@@ COPY_START_HOOK
+ # ....
+ # ....
+ # //@@ COPY_END_HOOK
+ # Handle this case
+
+ my $line_matched = 0;
+ my $start_copying = 0; # initially do not copy
+ foreach my $line (<DEST>)
+ {
+ # Check if the line matches the start tag
+ if ($line =~/$start_tag_name/)
+ {
+ $line_matched += 1;
+ $start_copying = 1;
+ }
+ else
+ {
+ # Check if the line matches the end tag
+ if ($line =~/$end_tag_name/)
+ {
+ # check if the start tag matched!
+ if (! $line_matched)
+ {
+ print "Assertion error: <copy-hook-end> tag misplaced with \
+ the <copy-hoook-source> \n";
+ close (DEST);
+ close (IN);
+ close (OUT);
+ unlink ($copy_file_name_tmp);
+ exit (1);
+ }
+
+ # decrement the count for nested tags
+ $line_matched -= 1;
+ if (! $line_matched )
+ { $start_copying = 0; }
+ }
+ else
+ {
+ # Print out the line
+ if ($start_copying)
+ { print OUT $line; }
+ }
+ }
+ }
+
+ # At the end of this loop line_matched should be 0
+ if ($line_matched)
+ {
+ print "Error: in $dest_file_name, number of <copy-hook-source> tags \
+ did not match the number of <copy-hook-end> tags. Reverting \
+ changes. \n";
+ close (DEST);
+ close (IN);
+ close (OUT);
+ unlink ($copy_file_name_tmp);
+ exit (1);
+ }
+
+ # Step 3: Now copy data after the tag in the original file onto the destination
+ # file.
+ open (IN, "<" . $copy_file_name) ||
+ die "cannot open file $copy_file_name specified in the <file> tag \n";
+ $dest_tag_found = 0; #used as a flag
+ foreach my $line (<IN>)
+ {
+ if ($dest_tag_found)
+ { print OUT $line; }
+
+ # If the hook is found, then don't write the hook onto OUT
+ # as it would have been written earlier
+ if (! $dest_tag_found &&
+ $line =~ /$dest_tag_name/)
+ { $dest_tag_found = 1; }
+ }
+
+ # Normal exit path
+ close (IN);
+ close (OUT);
+ close (DEST);
+
+ # Rename the tmp file to the file modified
+ rename ($copy_file_name_tmp, $copy_file_name);
+}
+
+#################################################################
+# commit_files: A procedure to commit all the copy files that
+# were specialized back to the orginal files.
+#################################################################
+sub commit_files
+{
+ my ($path_name, $output_path_name, @files) = @_;
+
+ # iterate over the file_name_list
+ foreach my $file (@files)
+ {
+ # <file name="....">
+ my $file_name = $file->getAttribute('name');
+
+ # output_path == input_path then do an in place
+ # substitution.
+ if ($output_path_name eq $path_name)
+ {
+ rename ($path_name . "/" . $file_name . "copy",
+ $path_name . "/" . $file_name);
+ }
+ else
+ {
+ # Check if the path_name exists. The path name
+ # corresponds to a directory. So create it if it does
+ # not exist.
+ if (! -d $output_path_name)
+ {
+ #@@? Need to revert the *copy files?
+ mkpath ($output_path_name, 0, 0744) ||
+ die "cannot create $output_path_name: commit files failed! \n";
+ }
+
+ # move the specialized file to the output directory
+ rename ($path_name . "/" . $file_name . "copy",
+ $output_path_name . "/" . $file_name);
+ }
+ }
+}
+
+#### Main ########################################################
+# Specialize_Component
+# procedure to execute the transformations specified in the
+# specialization file
+##################################################################
+sub Specialize_Components
+{
+ # Get the command line arguments
+ my ($prefix_path, $spl_file, $output_prefix) = @_;
+
+ my $parser = XML::DOM::Parser->new();
+ my $doc = $parser->parsefile($spl_file);
+
+ # Check if the prefix path ends with a / or not
+ # if it does not then manually add the / to it
+ my $last = substr ($prefix_path, -1);
+ if ($last ne "/")
+ { $prefix_path = $prefix_path . "/"; }
+
+ # Entry Point: <transform> element
+ foreach my $transform ($doc->getElementsByTagName('transform'))
+ {
+ # <module tags>
+ foreach my $module ($transform->getElementsByTagName('module'))
+ {
+ # Complete path name to the module
+ my $module_name = $module->getAttribute('name');
+ my $path_name = $prefix_path . $module_name;
+
+ # <file tags>
+ my @files = $module->getElementsByTagName('file');
+ foreach my $file (@files)
+ {
+ # <file name="....">
+ my $file_name = $file->getAttribute('name');
+
+ # Rather than modifying the files directly, make a local
+ # copy of the files and then transform them and commit
+ # if there is a file called foo we make a file foo_copy
+ my $file_path_copy = $path_name . "/" . $file_name . "copy";
+ my $file_path_name = $path_name . "/" . $file_name;
+
+ copy ($file_path_name, $file_path_copy);
+
+ # Diagnostic comment
+ print "Instrumenting $file_name ..........";
+
+ # <comment> ... </comment>
+ my @comment_list = $file->getElementsByTagName ('comment');
+ foreach my $comment (@comment_list)
+ { Visit_Comment ($comment, $file_path_copy); }
+
+ # <copy-from-source> ... </copy-from-source>
+ my @copy_from_source_files =
+ $file->getElementsByTagName ('copy-from-source');
+ foreach my $copy_from_source (@copy_from_source_files)
+ {
+ Visit_Copy ($copy_from_source,
+ $file_path_copy,
+ $module_name,
+ $prefix_path);
+ }
+
+ # <remove> ... </remove>
+ my @remove_list = $file->getElementsByTagName ('remove');
+ foreach my $remove (@remove_list)
+ { Visit_Remove ($remove, $file_path_copy); }
+
+ # <substitute ... </substitute>
+ my @substitute_list = $file->getElementsByTagName ('substitute');
+ foreach my $substitute (@substitute_list)
+ { Visit_Substitute ($substitute, $file_path_copy); }
+
+ # <add> <hook> ...... </hook> <add>
+ my @add_list = $file->getElementsByTagName ('add');
+ foreach my $add (@add_list)
+ { Visit_Add ($add, $file_path_copy); }
+
+ # Everything went well.. Print success
+ print " [done] \n";
+ }
+ }
+
+ # At this point all the specializations in all the modules have
+ # succeeded. It is at this point that we need to commit the
+ # specializations in each of the modules. That is move the temporary
+ # file that we created to the main file that was specialized.
+ # This also means that we need another loop and do the same thing
+ # as above....
+ # <module tags>
+ foreach my $module ($transform->getElementsByTagName('module'))
+ {
+ # Complete path name to the module
+ my $module_name = $module->getAttribute('name');
+ my $path_name = $prefix_path . $module_name;
+
+ # Output path name: append output_prefix to the
+ # current module name. Append "/" to create a
+ # directory like /foo/bar/baz/
+ my $output_path = $output_prefix . "/" . $module_name;
+
+ # <file tags>
+ my @files = $module->getElementsByTagName('file');
+
+ # commit the files
+ commit_files ($path_name, $output_path, @files);
+ }
+ }
+}
+
+####
+# Requiured for a module
+####
+1;
diff --git a/bin/FOCUS/docs/FOCUS.html b/bin/FOCUS/docs/FOCUS.html
new file mode 100644
index 00000000000..6b00dfb020d
--- /dev/null
+++ b/bin/FOCUS/docs/FOCUS.html
@@ -0,0 +1,165 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<!-- $Id$ -->
+ <title>FOCUS</title>
+</head>
+<body bgcolor="#ffffff" link="#000fff" vlink="#ff0f0f" text="#000000">
+<hr>
+<p></p>
+<h2 align="center">Feature Oriented Customizer for Middleware (FOCUS)</h2>
+<h3>Table of Contents</h3>
+<ul>
+ <li><a href="#MOT">Introduction</a> </li>
+ <li><a href="#FCS-OVR">FOCUS Options overview</a> </li>
+ <li><a href="#FCS-USAGE">FOCUS Sample Usage</a> </li>
+ <li><a href="#FCS-ORG">FOCUS Structure & Organization</a> </li>
+ <li><a href="#FCS-ORG">Extending FOCUS</a> </li>
+</ul>
+
+<hr>
+<h3><b><a name="MOT">Introduction</a></b></h3>
+TAO is a highly flexible ORB that contains a wide range of ORB
+configuration options. One or more of these options can be combined
+to meet various application requirements, such as low-latency,
+predictable real-time behavior, or small memory footprint. TAO's ORB
+configuration options are managed by an object-oriented framework
+within the ORB Core. TAO ORB internally uses several objects called
+<b>Resources</b>, such
+as a <em>reactor</em> framework that demultiplexes new connection and
+data requests from a client or <em>pluggable protocol</em> framework
+to seamlessly work across different protocols. <b>Strategies</b>, are
+objects that use the <b>Resource</b> entities to perform various ORB tasks,
+such as connection management, concurrency, and demultiplexing.
+The <b>Service Configurator</b> is a framework that can be used
+to statically and dynamically configure components into middleware and
+applications.
+
+Most often, applications that run on top of TAO use only one concrete type
+of each resource. For example, predominantly TAO applications use the IIOP
+protocol for communication. In this case, the underlying framework that
+realizes the feature can be specialized to remove dynamic dispatching
+overheads. The Feature Oriented Customizer (FOCUS) tool provides a
+generic approach to enable middleware developers to specialize middleware
+Frameworks when the concrete resource type is known a priori.
+FOCUS provides an XML based transformation engine, where the
+specialization transformations are captured in XML file and a
+weaver specializes the code. Some important points to note about FOCUS
+and specialization:
+<ul>
+ <li>It does not modify an interface. So no application level changes are
+ necessary.
+ </li>
+ <li>Once a framework has been customized using FOCUS for a concrete component,
+ other components do not work. For example, specializing the protocol
+ framework with IIOP, precludes the ability to plug-in other protocol
+ implementations.
+ </li>
+ <li>It provides a source-to-source transformations that require re-compiling
+ the source.
+ </li>
+</ul>
+
+<hr>
+<h3><b><a name="FCS-OVR">FOCUS Options Usage</a></b></h3>
+<table border="2" cellpadding="0" cellspacing="2">
+ <tbody>
+ <tr>
+ <th>Option</th>
+ <th>Description</th>
+ </tr>
+ <tr>
+ <td>--prefix-path</td>
+ <td>prefix-path to the ACE+TAO source distribution location. For example,
+ in most situations this path is same as the ACE_ROOT environment
+ variable.
+ </td>
+ </tr>
+ <tr>
+ <td>--reactor-spl <em>select-st</em>, <em>select-mt</em>, <em>tp</em></td>
+ <td>Option to specialize the reactor framework with the
+ concrete reactor type.
+ <p>select-st: select reactor which no locking. Single threaded case.</p>
+ <p>select-mt: select reactor with locking enabled, multi-threaded case.
+ </p>
+ <p>tp-reactor: Thread-pool reactor</p>
+ </td>
+ </tr>
+ <tr>
+ <td>--protocol-spl <em>iiop</em></td>
+ <td>Option to specialize the pluggable protocol framework in TAO for the
+ IIOP protocol.
+ </tr>
+ <tr>
+ <td>--messaging-spl <em>giop</em></td>
+ <td>Option to specialize the messaging strategy in TAO with GIOP
+ messaging protocol.
+ </td>
+ </tr>
+ <tr>
+ <td>--wait-strategy <em>rw</em></td>
+ <td>Specialize the Wait Strategy with the concrete Wait Strategy in TAO.
+ This specialization corresponds to the <em>-ORBWaitStrategy</em>
+ option in TAO.
+ </td>
+ </tr>
+ <td>--output-prefix</td>
+ <td>Option to copy over the specialized files to an output directory. This
+ option works only when a single specialization is chose. If multiple
+ specializations are chosen, then this copies the files corresponding
+ to the last specialization.
+ </td>
+ </tbody>
+</table>
+
+<hr>
+<h3><b><a name="FCS-USAGE">FOCUS Sample Usage</a></b></h3>
+cmd>$ACE_ROOT/bin/FOCUS/FOCUS.pl --reactor-spl=select-st \
+ --prefix-path=/build/arvindk/ACE_wrappers
+ --output-prefix=/build/arvindk/spl-files
+
+<hr>
+<h3><b><a name="FCS-ORG">FOCUS Tool Organization</a></b></h3>
+FOCUS tool structure is organized as follows:
+<ul>
+ <li>Parser directory has all parser related modules</li>
+ <li>specializations: Rules data base that has the XML files required for
+ performing the individual specialization transformations. For each
+ specialization we have the following sub directories:
+ <ul>
+ <li>Reactor_Family: Specializations for ACE_Reactor family</li>
+ <li>Protocol_Family: Specializations for TAO's protocol family</li>
+ <li>Messaging_Strategy: Specializations for TAO's Messaging Strategy</li>
+ <li>Wait_Strategy: Specializations for TAO's Wait strategies</li>
+ </ul>
+ </li>
+</ul>
+
+A detailed overview of the FOCUS specialization language, that specifies the
+different types for specialization transformations supported in FOCUS is
+discussed here: {To be updated shortly!}
+
+<hr>
+<h3><b><a name="FCS-ORG">Extending FOCUS</a></b></h3>
+To add a new specializations, to FOCUS, one needs to do the following:
+<ol>
+ <li>Use the FOCUS specification language to model the different specialization
+ Transformations required. Add this to the repository under
+ FOCUS/specializations. Current convention is to use a directory for each
+ family or specific type of specialization and add specialization files
+ for each type in the family.
+ </li>
+ <li>Annotate the middleware source code where ever applicable to perform the
+ transformations.
+ </li>
+ <li>Modify the FOCUS.pl script to add a specific option similar to --reactor-spl
+ option for executing the specializations. Also update the specialization
+ table that maps the command-line option to the appropriate specialization
+ file within the repository.
+ </li>
+</ol>
+
+<hr>
+
+</body>
+</html>
diff --git a/bin/FOCUS/specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl b/bin/FOCUS/specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl
new file mode 100644
index 00000000000..c56543cf54f
--- /dev/null
+++ b/bin/FOCUS/specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl
@@ -0,0 +1,172 @@
+<?xml version="1.0"?>
+
+<!-- Dispatch Resolution Optimization
+ * ================================
+ * This optimization should be applied with the requests
+ * from a client are delivered to the same operation in
+ * an IDL interface. In general this optimization applies
+ * to IDL interfaces that have a single operation defined
+ * on them
+ *
+ * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+ * $Id$
+-->
+
+<transform>
+
+<module name="TAO/tao">
+
+<file name="Connection_Handler.h">
+
+<!-- Include file to be added for this specialization -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+ class TAO_Servant_Base;
+ #include "tao/Abstract_Servant_Base.h"
+ </data>
+</add>
+
+<!-- Add get and set operations to hold operation signature -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_PRIVATE_DATA_ADD_HOOK</hook>
+ <data>
+TAO_Skeleton op_signature_;
+TAO_Servant_Base *servant_;
+ </data>
+</add>
+
+<!-- Add get and set public operations for the data -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_PUBLIC_METHODS_ADD_HOOK</hook>
+ <data>
+void set_op_signature (TAO_Skeleton &amp;skeleton,
+ TAO_Servant_Base *&amp;servant);
+void get_op_signature (TAO_Skeleton &amp;operation_ptr,
+ TAO_Servant_Base *&amp;servant);
+ </data>
+</add>
+
+</file>
+
+<file name="Connection_Handler.inl">
+
+<!-- Add operations to get and set the operation signature -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_METHODS_ADD_HOOK</hook>
+ <data>
+ ACE_INLINE void
+ TAO_Connection_Handler::set_op_signature (TAO_Skeleton &amp;skeleton,
+ TAO_Servant_Base *&amp;servant)
+{
+ this->op_signature_ = skeleton;
+ this->servant_ = servant;
+}
+
+ACE_INLINE void
+TAO_Connection_Handler::get_op_signature (TAO_Skeleton &amp;operation_ptr,
+ TAO_Servant_Base *&amp;servant)
+{
+ operation_ptr = this->op_signature_;
+ servant = this->servant_;
+}
+
+ </data>
+</add>
+</file>
+
+<file name="GIOP_Message_Base.h">
+
+<add>
+<hook>GIOP_MESSAGE_BASE_DATA_MEMBER_ADD_HOOK</hook>
+<data>bool once__;</data>
+</add>
+</file>
+
+<file name="GIOP_Message_Base.cpp">
+
+<add>
+ <hook>GIOP_MESSAGE_BASE_INCLUDE_ADD_HOOK</hook>
+ <data>#include "tao/Connection_Handler.h"</data>
+</add>
+
+<!-- Add a once__ data member to the class that will
+ only resolve the dispatch once -->
+<substitute match-line="yes">
+ <search>TAO_DEF_GIOP_MINOR\)</search>
+ <replace>TAO_DEF_GIOP_MINOR)
+ , once__ (1)
+ </replace>
+</substitute>
+
+<!-- Comment code that resolves dispatch normally -->
+<comment>
+ <start-hook>TAO_DISPATCH_RESOLUTION_OPT_COMMENT_HOOK_START</start-hook>
+ <end-hook>TAO_DISPATCH_RESOLUTION_OPT_COMMENT_HOOK_END</end-hook>
+</comment>
+
+<!-- Add the optimized path code -->
+<add>
+ <hook>TAO_DISPATCH_RESOLUTION_OPT_COMMENT_HOOK_END</hook>
+ <data>
+ if (once__)
+ {
+ once__ = false;
+
+ // Normal path the first time
+ this->orb_core_->request_dispatcher ()->dispatch (
+ this->orb_core_,
+ request,
+ forward_to
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ // Dispatch directly to the skeleton
+ TAO_Connection_Handler *handler =
+ transport->connection_handler ();
+ TAO_Skeleton skel;
+ TAO_Servant_Base *skeleton_ptr;
+ handler->get_op_signature (skel, skeleton_ptr);
+
+ // Convert references to void *
+ void *upcall_ptr = 0;
+ skel (request,
+ upcall_ptr,
+ (void *)skeleton_ptr
+ ACE_ENV_ARG_PARAMETER);
+ if (response_required)
+ request.tao_send_reply ();
+ }
+ </data>
+</add>
+</file>
+</module>
+
+<module name="TAO/tao/PortableServer">
+<file name="Servant_Base.cpp">
+
+<!-- Add necessary include files -->
+<add>
+ <hook>TAO_SERVANT_BASE_INCLUDE_ADD_HOOK</hook>
+ <data>#include "tao/Transport.h"</data>
+ <data>#include "tao/Connection_Handler.h"</data>
+</add>
+
+<!-- After processing the first request, set the operation signature on
+ the connection handler for subsequent request processing -->
+<add>
+ <hook>TAO_DISPATCH_RESOLUTION_OPT_ADD_HOOK</hook>
+ <data>
+ TAO_Connection_Handler *handler =
+ req.transport ()->connection_handler ();
+ handler->set_op_signature (skel,
+ static_cast&lt;TAO_Servant_Base *&gt; (derived_this));
+ </data>
+</add>
+</file>
+
+</module>
+
+</transform>
diff --git a/bin/FOCUS/specializations/Protocol_Family/IIOP/iiop.spl b/bin/FOCUS/specializations/Protocol_Family/IIOP/iiop.spl
new file mode 100644
index 00000000000..c209dc90f6c
--- /dev/null
+++ b/bin/FOCUS/specializations/Protocol_Family/IIOP/iiop.spl
@@ -0,0 +1,996 @@
+<?xml version="1.0"?>
+
+<!-- IIOP Pluggable Protocol specialization
+ * ======================================
+ * This specializes the pluggable protocol framework within
+ * TAO for the IIOP concrete protocol implementation. This
+ * specialization encompasses specializations, such as
+ * specializations for the Transport, Profile, end-point,
+ * Acceptor and Connector implementations within ACE+TAO.
+ *
+ * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu>
+ * $Id$
+-->
+<transform>
+
+<module name="TAO/tao">
+
+<!-- Transformations to Transport implementation in TAO -->
+<file name="Transport.h">
+
+<!-- Search for TAO_Connection_Handler -->
+<substitute match-line="yes">
+ <search>class TAO_Connection_Handler;</search>
+ <replace>#include "tao/Connection_Handler.h"</replace>
+</substitute>
+
+<!-- Add forward declarations and includes specific to
+ IIOP -->
+<add>
+ <hook>TAO_TRANSPORT_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+namespace IIOP
+{
+ class ListenPointList;
+}
+
+class TAO_Acceptor;
+class TAO_Adapter;
+ </data>
+</add>
+
+<!-- Remove all virtual and pure virtual methods in this
+ class -->
+<remove>virtual</remove>
+
+<substitute match-line="yes">
+ <search>= 0;</search>
+ <replace>;</replace>
+</substitute>
+
+<!-- Replace the base class constructor with the derive
+ classes's constructor -->
+<substitute match-line="yes">
+ <search>TAO_Transport \(CORBA::ULong tag,</search>
+ <replace>TAO_Transport (TAO_IIOP_Connection_Handler *, CORBA::ULong tag,
+ </replace>
+</substitute>
+
+<!-- Add public methods defined in IIOP_Transport -->
+<add>
+ <hook>TAO_TRANSPORT_SPL_PUBLIC_METHODS_ADD_HOOK</hook>
+ <data>
+
+ /// Bridge method to call a similar method on the connection handler
+ void update_protocol_properties (int send_buffer_size,
+ int recv_buffer_size,
+ int no_delay,
+ int enable_network_priority);
+
+ /// Generate the request header
+ int generate_request_header (TAO_Operation_Details &amp;opd,
+ TAO_Target_Specification &amp;spec,
+ TAO_OutputCDR &amp;msg);
+ </data>
+</add>
+
+<!-- Add private methods from IIOP_Transport -->
+<add>
+ <hook>TAO_TRANSPORT_SPL_PRIVATE_METHODS_ADD_HOOK</hook>
+ <data>
+ void set_bidir_context_info (TAO_Operation_Details &amp;opdetails);
+ int get_listen_point (IIOP::ListenPointList &amp;listen_point_list,
+ TAO_Acceptor *acceptor);
+ </data>
+</add>
+
+<!-- Add private data from IIOP_Transport -->
+<add>
+ <hook>TAO_TRANSPORT_SPL_DATA_MEMBERS_ADD_HOOK</hook>
+ <data>
+ /// The connection service handler used for accessing lower layer
+ /// communication protocols.
+ TAO_IIOP_Connection_Handler *connection_handler_;
+
+ /// Our messaging object.
+ TAO_Pluggable_Messaging *messaging_object_;
+ </data>
+</add>
+
+<!-- Typedef the TAO_Transport as IIOP_Transport -->
+<add>
+ <hook>TAO_TRANSPORT_SPL_EXTERN_ADD_HOOK</hook>
+ <data>typedef TAO_Transport TAO_IIOP_Transport;</data>
+</add>
+
+<!-- This method is overridden in the derived class -->
+<substitute>
+ <search>generate_request_header</search>
+ <replace>generate_request_header_base__</replace>
+</substitute>
+
+</file>
+
+<file name="Transport.cpp">
+
+<!-- Add necessary includes -->
+<add>
+ <hook>TAO_TRANSPORT_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+#include "Transport_Acceptor.h"
+#include "IIOPC.h"
+#include "Acceptor_Registry.h"
+#include "operation_details.h"
+#include "GIOP_Message_Base.h"
+#include "Protocols_Hooks.h"
+ </data>
+</add>
+
+<!-- Modify the TAO constructor adding the IIOP Transport's data -->
+<substitute match-line="yes">
+ <search>TAO_Transport::TAO_Transport \(CORBA::ULong tag,</search>
+ <replace>TAO_Transport::TAO_Transport (TAO_IIOP_Connection_Handler *handler,
+ CORBA::ULong tag,
+ </replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>, partial_message_ \(0\)</search>
+ <replace> , partial_message_ (0)
+ , connection_handler_ (handler)
+ , messaging_object_ (0)
+ </replace>
+</substitute>
+
+<!-- Within the constructor create/initialize the messaging object -->
+<add>
+ <hook>TAO_TRANSPORT_SPL_CONSTRUCTOR_ADD_HOOK</hook>
+ <data>
+ // Use the normal GIOP object
+ ACE_NEW (this->messaging_object_,
+ TAO_GIOP_Message_Base (orb_core));
+ </data>
+</add>
+
+<add>
+ <hook>TAO_TRANSPORT_SPL_DESTRUCTOR_ADD_HOOK</hook>
+ <data>delete this->messaging_object_;</data>
+</add>
+
+<!-- comment out unimplemented base class methods -->
+<comment>
+ <start-hook>TAO_TRANSPORT_SPL_COMMENT_HOOK_START</start-hook>
+ <end-hook>TAO_TRANSPORT_SPL_COMMENT_HOOK_END</end-hook>
+</comment>
+
+<!-- Add the concrete methods from IIOP_Transport implementation -->
+<copy-from-source>
+ <source>IIOP_Transport.cpp</source>
+
+ <copy-hook-start>TAO_TRANSPORT_SPL_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_TRANSPORT_SPL_COPY_HOOK_END</copy-hook-end>
+
+ <dest-hook>TAO_TRANSPORT_SPL_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- The derived class calls this method. Override this -->
+<substitute>
+ <search>TAO_Transport::generate_request_header</search>
+ <replace>TAO_Transport::generate_request_header_base__</replace>
+</substitute>
+
+</file>
+
+<!-- Transformations to specialize Connection_Handler class -->
+<file name="Connection_Handler.h">
+
+<!-- Remove the default constructor, NOTE: we use regular expressions
+ to match the constructor but not the destructor -->
+<remove>\s+TAO_Connection_Handler\s*\(void\);</remove>
+
+<!-- Make sure that Connection_Handler inherits from SVC_HANDLER -->
+<substitute match-line="yes">
+ <search>: public TAO_LF_CH_Event</search>
+ <replace>: public TAO_IIOP_SVC_HANDLER,
+ public TAO_LF_CH_Event
+ </replace>
+</substitute>
+
+<!-- Forward declarations -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+#include "ace/Svc_Handler.h"
+#include "ace/SOCK_Stream.h"
+
+typedef ACE_Svc_Handler &lt; ACE_SOCK_STREAM, ACE_NULL_SYNCH &gt;
+ TAO_IIOP_SVC_HANDLER;
+
+namespace IIOP
+{
+ class ListenPointList;
+}
+ </data>
+</add>
+
+<!-- Public methods from IIOP_Connection_Handler class -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_PUBLIC_METHODS_ADD_HOOK</hook>
+ <data>
+ int open (void *);
+ int close (u_long = 0);
+
+ int resume_handler (void);
+ int handle_output (ACE_HANDLE);
+ int handle_close (ACE_HANDLE, ACE_Reactor_Mask);
+ int handle_timeout (const ACE_Time_Value &amp;current_time,
+ const void *act = 0);
+
+ /// Add ourselves to Cache.
+ int add_transport_to_cache (void);
+
+ /// Process the @a listen_list
+ int process_listen_point_list (IIOP::ListenPointList &amp;listen_list);
+
+ /// Check if network priority needs to be enabled
+ int enable_network_priority (void);
+
+ TAO_Connection_Handler (ACE_Thread_Manager * = 0);
+
+ /// Constructor.
+ TAO_Connection_Handler (TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag);
+ </data>
+</add>
+
+<!-- Private data members -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_PRIVATE_DATA_ADD_HOOK</hook>
+ <data>int dscp_codepoint_;</data>
+</add>
+
+<!-- Typedef the class -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_EXTERN_ADD_HOOK</hook>
+ <data>typedef TAO_Connection_Handler TAO_IIOP_Connection_Handler;</data>
+</add>
+
+<!-- Remove all virtuals and =0; from the code -->
+<remove>virtual</remove>
+
+<substitute match-line="yes">
+ <search>= 0;</search>
+ <replace>;</replace>
+</substitute>
+
+</file>
+
+<file name="Connection_Handler.cpp">
+
+<!-- Add the include hook -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+#include "IIOPC.h"
+#include "Thread_Lane_Resources.h"
+#include "Base_Transport_Property.h"
+#include "Protocols_Hooks.h"
+#include "Wait_Strategy.h"
+
+#include "ace/os_include/netinet/os_tcp.h"
+#include "ace/os_include/os_netdb.h"
+ </data>
+</add>
+
+<!-- IIOP_Connection_Handler constructors added -->
+<add>
+ <hook>CONNECTION_HANDLER_SPL_METHODS_ADD_HOOK</hook>
+ <data>
+TAO_Connection_Handler::TAO_Connection_Handler (ACE_Thread_Manager *t)
+ : TAO_IIOP_SVC_HANDLER (t, 0 , 0),
+ orb_core_ (0),
+ dscp_codepoint_ (IPDSFIELD_DSCP_DEFAULT &lt;&lt; 2)
+{
+ ACE_ASSERT (0);
+}
+
+TAO_Connection_Handler::TAO_Connection_Handler (
+ TAO_ORB_Core *orb_core,
+ CORBA::Boolean flag)
+ : TAO_IIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0),
+ orb_core_ (orb_core),
+ transport_ (0),
+ dscp_codepoint_ (IPDSFIELD_DSCP_DEFAULT &lt;&lt; 2)
+{
+ TAO_IIOP_Transport* specific_transport = 0;
+ ACE_NEW (specific_transport,
+ TAO_IIOP_Transport (this, IOP::TAG_INTERNET_IOP, orb_core));
+
+ // store this pointer (indirectly increment ref count)
+ this->transport (specific_transport);
+
+ // @@todo: We need to have a distinct option/ method in the resource
+ // factory for this and TAO_Transport.
+ this->lock_ =
+ this->orb_core_->resource_factory ()->create_cached_connection_lock ();
+
+ // Put ourselves in the connection wait state as soon as we get
+ // created
+ this->state_changed (TAO_LF_Event::LFS_CONNECTION_WAIT);
+}
+ </data>
+</add>
+
+<!-- Replace all occurances of IIOP_Connection_Handler with that
+ of TAO_Connection_Handler -->
+<substitute>
+ <search>TAO_IIOP_Connection_Handler</search>
+ <replace>TAO_Connection_Handler</replace>
+</substitute>
+
+<!-- Comment out base class methods that are over-ridden in the
+ derived class -->
+<comment>
+ <start-hook>CONNECTION_HANDLER_SPL_COMMENT_HOOK_START</start-hook>
+ <end-hook>CONNECTION_HANDLER_SPL_COMMENT_HOOK_END</end-hook>
+</comment>
+
+<!-- Copy operations from IIOP_Connection_Handler class and put them
+ in the Connection_Handler class -->
+
+<copy-from-source>
+
+ <source>IIOP_Connection_Handler.cpp</source>
+ <copy-hook-start>CONNECTION_HANDLER_SPL_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>CONNECTION_HANDLER_SPL_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>CONNECTION_HANDLER_SPL_METHODS_ADD_HOOK</dest-hook>
+
+</copy-from-source>
+
+<add>
+ <hook>CONNECTION_HANDLER_DESTRUCTOR_ADD_HOOK</hook>
+ <data>delete this->transport ();</data>
+</add>
+
+</file>
+
+<!-- Modifications to Acceptor and Connector Components in TAO -->
+<file name="Transport_Acceptor.h">
+
+<!-- Forward declaration -->
+<add>
+ <hook>TAO_ACCEPTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+#include "tao/Connection_Handler.h"
+#include "tao/Acceptor_Impl.h"
+#include "tao/GIOP_Message_Version.h"
+#include "ace/Acceptor.h"
+#include "ace/SOCK_Acceptor.h"
+ </data>
+</add>
+
+<!-- Methods from IIOP_Acceptor components -->
+<copy-from-source>
+ <source>IIOP_Acceptor.h</source>
+ <copy-hook-start>TAO_ACCEPTOR_SPL_CONCRETE_METHODS_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_ACCEPTOR_SPL_CONCRETE_METHODS_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_ACCEPTOR_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Typedef hook -->
+<add>
+ <hook>TAO_ACCEPTOR_SPL_EXTERN_ADD_HOOK</hook>
+ <data>typedef TAO_Acceptor TAO_IIOP_Acceptor;
+ #if defined(__ACE_INLINE__)
+ #include "tao/IIOP_Acceptor.i"
+ #endif /* __ACE_INLINE__ */
+ </data>
+</add>
+
+<!-- Private data memeber -->
+<copy-from-source>
+ <source>IIOP_Acceptor.h</source>
+
+ <copy-hook-start>TAO_ACCEPTOR_SPL_DATA_MEMBERS_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_ACCEPTOR_SPL_DATA_MEMBERS_COPY_HOOK_END</copy-hook-end>
+
+ <dest-hook>TAO_ACCEPTOR_SPL_DATA_MEMBERS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Eliminate the virtual functions -->
+<remove>virtual</remove>
+<substitute match-line="yes">
+ <search>= 0;</search>
+ <replace>;</replace>
+</substitute>
+
+<!-- Remove destructor -->
+<remove>~TAO_IIOP_Acceptor \(void\);</remove>
+
+<substitute>
+ <search>TAO_IIOP_Acceptor</search>
+ <replace>TAO_Acceptor</replace>
+</substitute>
+
+</file>
+
+<!-- Transformations to Transport_Acceptor.cpp -->
+<file name="Transport_Acceptor.cpp">
+
+<copy-from-source>
+ <source>IIOP_Acceptor.cpp</source>
+
+ <copy-hook-start>TAO_ACCEPTOR_SPL_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_ACCEPTOR_SPL_COPY_HOOK_END</copy-hook-end>
+
+ <dest-hook>TAO_ACCEPTOR_SPL_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Modify the constructor -->
+<substitute match-line="yes">
+ <search>: TAO_Acceptor \(IOP::TAG_INTERNET_IOP\),</search>
+ <replace>: tag_ (IOP::TAG_INTERNET_IOP),
+ lite_flag_ (0)
+ </replace>
+</substitute>
+
+<!-- Add mthods to the destructor -->
+<add>
+ <hook>TAO_ACCEPTOR_DESTRUCTOR_ADD_HOOK</hook>
+ <data>
+ this->close ();
+ delete this->creation_strategy_;
+ delete this->concurrency_strategy_;
+ delete this->accept_strategy_;
+
+ delete [] this->addrs_;
+
+ for (CORBA::ULong i = 0; i &lt; this->endpoint_count_; ++i)
+ CORBA::string_free (this->hosts_[i]);
+
+ delete [] this->hosts_;
+ </data>
+</add>
+
+<!-- Trasnform IIOP_Acceptor to TAO_Acceptor -->
+<substitute match-line="yes">
+ <search>#include "tao/IIOP_Acceptor.h"</search>
+ <replace> </replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>#include "tao/IIOP_Profile.h"</search>
+ <replace>#include "tao/Profile.h"</replace>
+</substitute>
+
+<substitute>
+ <search>TAO_IIOP_Acceptor::TAO_IIOP_Acceptor</search>
+ <replace>TAO_Acceptor::TAO_Acceptor</replace>
+</substitute>
+
+</file>
+
+<file name="tao.mpc">
+
+<!-- Do not build all IIOP_* files as the specializations
+ are moved to the base classes -->
+
+<substitute>
+ <search>IIOP_Transport.cpp</search>
+ <replace>// IIOP_Transport.cpp </replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Transport.h</search>
+ <replace>// IIOP_Transport.h</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Connection_Handler.cpp</search>
+ <replace>// IIOP_Connection_Handler.cpp</replace>
+</substitute>
+<substitute>
+ <search>IIOP_Connection_Handler.h</search>
+ <replace>// IIOP_Connection_Handler.h</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Acceptor.cpp</search>
+ <replace>// IIOP_Acceptor.cpp</replace>
+</substitute>
+<substitute>
+ <search>IIOP_Acceptor.h</search>
+ <replace>// IIOP_Acceptor.h</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Connector.cpp</search>
+ <replace>// IIOP_Connector.cpp</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Endpoint.cpp</search>
+ <replace>// IIOP_Endpoint.cpp</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Connector.h</search>
+ <replace>// IIOP_Connector.h</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Endpoint.h</search>
+ <replace>// IIOP_Endpoint.h</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Profile.cpp</search>
+ <replace>// IIOP_Profile.cpp</replace>
+</substitute>
+<substitute>
+ <search>IIOP_Profile.h</search>
+ <replace>// IIOP_Profile.h</replace>
+</substitute>
+
+</file>
+
+<file name="Endpoint.h">
+
+<!-- Include and forward declation add hook -->
+<add>
+ <hook>TAO_ENDPOINT_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+#include "tao/IIOP_EndpointsC.h"
+#include "ace/INET_Addr.h"
+ </data>
+</add>
+
+<!-- Copy the private member declarations from IIOP_Endpoint
+ implementation -->
+
+<copy-from-source>
+ <source>IIOP_Endpoint.h</source>
+
+ <copy-hook-start>TAO_ENDPOINT_SPL_PRIVATE_DATA_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_ENDPOINT_SPL_PRIVATE_DATA_COPY_HOOK_END</copy-hook-end>
+
+ <dest-hook>TAO_ENDPOINT_SPL_PRIVATE_DATA_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<copy-from-source>
+ <source>IIOP_Endpoint.h</source>
+ <copy-hook-start>TAO_ENDPOINT_SPL_PUBLIC_METHODS_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_ENDPOINT_SPL_PUBLIC_METHODS_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_ENDPOINT_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Remove the unimplemented copy constructor of the base class -->
+<remove>ACE_UNIMPLEMENTED_FUNC \(TAO_Endpoint \(const TAO_Endpoint&amp;\)\)</remove>
+
+<substitute>
+ <search>TAO_IIOP_Endpoint</search>
+ <replace>TAO_Endpoint</replace>
+</substitute>
+
+<substitute>
+ <search>TAO_IIOP_Profile</search>
+ <replace>TAO_Profile</replace>
+</substitute>
+
+<add>
+ <hook>TAO_ENDPOINT_SPL_EXTERN_ADD_HOOK</hook>
+ <data>typedef TAO_Endpoint TAO_IIOP_Endpoint;
+ #if defined (__ACE_INLINE__)
+ # include "tao/IIOP_Endpoint.i"
+ #endif /* __ACE_INLINE__ */
+ </data>
+</add>
+
+<!-- Eliminate the virtual functions -->
+<remove>virtual</remove>
+<substitute match-line="yes">
+ <search>= 0;</search>
+ <replace>;</replace>
+</substitute>
+
+</file>
+
+<file name="Endpoint.cpp">
+
+ <copy-from-source>
+ <source>IIOP_Endpoint.cpp</source>
+ <copy-hook-start>TAO_ENDPOINT_SPL_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_ENDPOINT_SPL_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_ENDPOINT_SPL_METHODS_ADD_HOOK</dest-hook>
+ </copy-from-source>
+
+ <!-- In the constructors copied from the derived class, there is a
+ invocation of the base class constructor. Expand it -->
+ <substitute match-line="yes">
+ <search>: TAO_Endpoint \(IOP::TAG_INTERNET_IOP\)</search>
+ <replace>: addr_lookup_lock_ ()
+ , hash_val_ (0)
+ , tag_ (IOP::TAG_INTERNET_IOP)
+ , priority_ (TAO_INVALID_PRIORITY)
+ </replace>
+ </substitute>
+
+ <substitute match-line="yes">
+ <search>: TAO_Endpoint \(IOP::TAG_INTERNET_IOP, priority\)</search>
+ <replace>: addr_lookup_lock_ ()
+ , hash_val_ (0)
+ , tag_ (IOP::TAG_INTERNET_IOP)
+ , priority_ (priority)
+ </replace>
+ </substitute>
+
+ <substitute match-line="yes">
+ <search>: TAO_Endpoint \(rhs.tag_, rhs.priority_\)</search>
+ <replace>: addr_lookup_lock_ ()
+ , hash_val_ (0)
+ , tag_ (rhs.tag_)
+ , priority_ (rhs.priority_)
+ </replace>
+ </substitute>
+
+<substitute>
+ <search>TAO_IIOP_Endpoint</search>
+ <replace>TAO_Endpoint</replace>
+</substitute>
+
+<remove>#include "IIOP_Endpoint.h"</remove>
+
+</file>
+
+<file name="Transport_Connector.h">
+
+<add>
+ <hook>TAO_CONNECTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook>
+ <data>
+#include "ace/SOCK_Connector.h"
+#include "ace/Connector.h"
+#include "tao/Connector_Impl.h"
+#include "tao/Connection_Handler.h"
+ </data>
+</add>
+
+<copy-from-source>
+ <source>IIOP_Connector.h</source>
+ <copy-hook-start>TAO_CONNECTOR_SPL_PUBLIC_METHODS_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_CONNECTOR_SPL_PUBLIC_METHODS_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_CONNECTOR_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- IIOP_Connector's constructor -->
+<add>
+ <hook>TAO_CONNECTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook>
+ <data> TAO_Connector (CORBA::Boolean flag = 0);</data>
+</add>
+
+<copy-from-source>
+ <source>IIOP_Connector.h</source>
+ <copy-hook-start>TAO_CONNECTOR_SPL_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_CONNECTOR_SPL_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_CONNECTOR_SPL_PRIVATE_DATA_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<add>
+ <hook>TAO_CONNECTOR_SPL_EXTERN_ADD_HOOK</hook>
+ <data>typedef TAO_Connector TAO_IIOP_Connector;</data>
+</add>
+
+<!-- eliminate all virtual methods -->
+<remove>virtual</remove>
+
+<substitute match-line="yes">
+ <search>= 0;</search>
+ <replace>;</replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>class TAO_Endpoint;</search>
+ <replace>#include "tao/Endpoint.h"</replace>
+</substitute>
+
+</file>
+
+<file name="Transport_Connector.cpp">
+
+<add>
+ <hook>TAO_CONNECTOR_SPL_INCLUDE_ADD_HOOK</hook>
+ <data>
+#include "ace/OS_NS_strings.h"
+ </data>
+</add>
+
+<!-- Instrument the constructor -->
+<substitute match-line="yes">
+ <search>: TAO_Connector \(IOP::TAG_INTERNET_IOP\)</search>
+ <replace>: active_connect_strategy_ (0)
+ , tag_ (IOP::TAG_INTERNET_IOP)
+ , lite_flag_ (0)
+ , orb_core_ (0)
+ </replace>
+</substitute>
+
+<copy-from-source>
+ <source>IIOP_Connector.cpp</source>
+
+ <copy-hook-start>TAO_CONNECTOR_SPL_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_CONNECTOR_SPL_COPY_HOOK_END</copy-hook-end>
+
+ <dest-hook>TAO_CONNECTOR_SPL_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- replace all IIOP_Connector with TAO_Connector -->
+<substitute>
+ <search>TAO_IIOP_Connector</search>
+ <replace>TAO_Connector</replace>
+</substitute>
+
+</file>
+
+<file name="IIOP_Factory.cpp">
+
+<substitute match-line="yes">
+ <search>#include "IIOP_Acceptor.h"</search>
+ <replace>#include "Transport_Acceptor.h"</replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>#include "IIOP_Connector.h"</search>
+ <replace>#include "Transport_Connector.h"</replace>
+</substitute>
+</file>
+
+<file name="IIOP_Lite_Factory.cpp">
+
+<substitute match-line="yes">
+ <search>#include "IIOP_Acceptor.h"</search>
+ <replace>#include "Transport_Acceptor.h"</replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>#include "IIOP_Connector.h"</search>
+ <replace>#include "Transport_Connector.h"</replace>
+</substitute>
+</file>
+
+<!-- Transformations to Profile class to make it tailored for IIOP
+ Profile -->
+<file name="Profile.h">
+
+<!-- include and forward declarations -->
+<substitute match-line="yes">
+ <search>class TAO_Endpoint;</search>
+ <replace>#include "tao/Endpoint.h"</replace>
+</substitute>
+
+<!-- Remove all virtual methods -->
+<remove>virtual</remove>
+<substitute match-line="yes">
+ <search>= 0;</search>
+ <replace>;</replace>
+</substitute>
+
+<!-- Copy all public methods from IIOP_Profile.h -->
+<copy-from-source>
+ <source>IIOP_Profile.h</source>
+ <copy-hook-start>TAO_PROFILE_SPL_PUBLIC_METHODS_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_PROFILE_SPL_PUBLIC_METHODS_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_PROFILE_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Add proteccted data from IIOP_Profile class -->
+<copy-from-source>
+ <source>IIOP_Profile.h</source>
+ <copy-hook-start>TAO_PROFILE_SPL_PROTECTED_METHODS_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_PROFILE_SPL_PROTECTED_METHODS_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_PROFILE_SPL_PROTECTED_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Add all the private data methods -->
+<copy-from-source>
+ <source>IIOP_Profile.h</source>
+ <copy-hook-start>TAO_PROFILE_SPL_PRIVATE_DATA_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_PROFILE_SPL_PRIVATE_DATA_COPY_HOOK_END</copy-hook-end>
+ <dest-hook>TAO_PROFILE_SPL_PRIVATE_DATA_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Typedef the Profile class as IIOP_Profile -->
+<add>
+ <hook>TAO_PROFILE_SPL_EXTERN_ADD_HOOK</hook>
+ <data>
+typedef TAO_Profile TAO_IIOP_Profile;
+ </data>
+</add>
+
+<substitute>
+ <search>TAO_IIOP_Profile</search>
+ <replace>TAO_Profile</replace>
+</substitute>
+
+
+</file>
+
+<!-- Transformations to Profile.cpp file specialized with the
+ IIOP_Profile implementation -->
+<file name="Profile.cpp">
+
+<!-- comment out virtual methods in the base class that do nothing
+ but have implementations due to compiler issues -->
+<comment>
+ <start-hook>TAO_PROFILE_SPL_COMMENT_HOOK_START</start-hook>
+ <end-hook>TAO_PROFILE_SPL_COMMENT_HOOK_END</end-hook>
+</comment>
+
+<copy-from-source>
+ <source>IIOP_Profile.cpp</source>
+
+ <copy-hook-start>TAO_PROFILE_SPL_COPY_HOOK_START</copy-hook-start>
+ <copy-hook-end>TAO_PROFILE_SPL_COPY_HOOK_END</copy-hook-end>
+
+ <dest-hook>TAO_PROFILE_SPL_METHODS_ADD_HOOK</dest-hook>
+</copy-from-source>
+
+<!-- Add methods to the constructor of the Profile -->
+<!-- Constructors are the exceptional case, we need to add
+ them specifically -->
+
+<add>
+ <hook>TAO_PROFILE_SPL_METHODS_ADD_HOOK</hook>
+ <data>
+TAO_Profile::TAO_Profile (const ACE_INET_Addr &amp;addr,
+ const TAO::ObjectKey &amp;object_key,
+ const TAO_GIOP_Message_Version &amp;version,
+ TAO_ORB_Core *orb_core)
+ : version_ (version)
+ , are_policies_parsed_ (false)
+ , addressing_mode_ (0)
+ , tagged_profile_ (0)
+ , ref_object_key_ (0)
+ , tag_ (IOP::TAG_INTERNET_IOP)
+ , orb_core_ (orb_core)
+ , forward_to_ (0)
+ , refcount_lock_ (0)
+ , refcount_ (1)
+ , endpoint_ (addr,
+ orb_core->orb_params ()->use_dotted_decimal_addresses ())
+ , count_ (1)
+{
+ // @@ NOTE: Need to probably use a different type of lock.
+ this->refcount_lock_ =
+ this->orb_core_->client_factory ()->create_profile_lock ();
+
+ (void) this->orb_core_->object_key_table ().bind (object_key,
+ this->ref_object_key_);
+}
+
+TAO_Profile::TAO_Profile (const char* host,
+ CORBA::UShort port,
+ const TAO::ObjectKey &amp;object_key,
+ const ACE_INET_Addr &amp;addr,
+ const TAO_GIOP_Message_Version &amp;version,
+ TAO_ORB_Core *orb_core)
+ : version_ (version)
+ , are_policies_parsed_ (false)
+ , addressing_mode_ (0)
+ , tagged_profile_ (0)
+ , ref_object_key_ (0)
+ , tag_ (IOP::TAG_INTERNET_IOP)
+ , orb_core_ (orb_core)
+ , forward_to_ (0)
+ , refcount_lock_ (0)
+ , refcount_ (1)
+ , endpoint_ (host, port, addr)
+ , count_ (1)
+{
+ // @@ NOTE: Need to probably use a different type of lock.
+ this->refcount_lock_ =
+ this->orb_core_->client_factory ()->create_profile_lock ();
+ (void) this->orb_core_->object_key_table ().bind (object_key,
+ this->ref_object_key_);
+}
+
+TAO_Profile::TAO_Profile (TAO_ORB_Core *orb_core)
+ : version_ (TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR,
+ TAO_DEF_GIOP_MINOR))
+ , are_policies_parsed_ (false)
+ , addressing_mode_ (0)
+ , tagged_profile_ (0)
+ , ref_object_key_ (0)
+ , tag_ (IOP::TAG_INTERNET_IOP)
+ , orb_core_ (orb_core)
+ , forward_to_ (0)
+ , refcount_lock_ (0)
+ , refcount_ (1)
+ , endpoint_ ()
+ , count_ (1)
+{
+ this->refcount_lock_ =
+ this->orb_core_->client_factory ()->create_profile_lock ();
+}
+</data>
+</add>
+
+<add>
+ <hook>TAO_PROFILE_SPL_DESTRUCTOR_ADD_HOOK</hook>
+ <data>
+TAO_Endpoint *tmp = 0;
+for (TAO_Endpoint *next = this->endpoint ()->next ();
+ next != 0;
+ next = tmp)
+{
+ tmp = next->next ();
+ delete next;
+}
+ </data>
+</add>
+
+<!-- Replace all occurances of IIOP_Profile
+ with TAO_Profile -->
+<substitute>
+ <search>TAO_IIOP_Profile</search>
+ <replace>TAO_Profile</replace>
+</substitute>
+
+<!-- remove the dynamic casts, as now there is no
+ inheritance hiearchy -->
+<substitute>
+ <search>dynamic_cast</search>
+ <replace>static_cast</replace>
+</substitute>
+
+</file>
+
+<file name="Invocation_Endpoint_Selectors.cpp">
+
+<substitute match-line="yes">
+ <search>#include "tao/IIOP_Endpoint.h"</search>
+ <replace>#include "tao/Endpoint.h"</replace>
+</substitute>
+</file>
+
+<file name="orbconf.h">
+
+<substitute match-line="yes">
+ <search>TAO_HAS_UIOP 1</search>
+ <replace>TAO_HAS_UIOP 0</replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>TAO_HAS_SHMIOP 1</search>
+ <replace>TAO_HAS_SHMIOP 0</replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>TAO_HAS_MIOP 1</search>
+ <replace>TAO_HAS_MIOP 0</replace>
+</substitute>
+
+<substitute match-line="yes">
+ <search>TAO_HAS_DIOP 1</search>
+ <replace>TAO_HAS_DIOP 0</replace>
+</substitute>
+</file>
+</module>
+
+<module name="/TAO/tao/RTPortableServer">
+
+<file name="RT_Servant_Dispatcher.cpp">
+
+<substitute>
+ <search>IIOP_Transport.h</search>
+ <replace>Transport.h</replace>
+</substitute>
+
+<substitute>
+ <search>IIOP_Connection_Handler.h</search>
+ <replace>Connection_Handler.h</replace>
+</substitute>
+
+</file>
+
+</module>
+
+</transform>