diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/FOCUS/FOCUS.pl | 203 | ||||
-rw-r--r-- | bin/FOCUS/NEWS | 35 | ||||
-rw-r--r-- | bin/FOCUS/PROBLEM-REPORT-FORM | 45 | ||||
-rw-r--r-- | bin/FOCUS/README | 76 | ||||
-rw-r--r-- | bin/FOCUS/VERSION | 1 | ||||
-rw-r--r-- | bin/FOCUS/specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl | 211 | ||||
-rw-r--r-- | bin/FOCUS/specializations/Messaging_Strategy/GIOP.spl | 246 | ||||
-rw-r--r-- | bin/FOCUS/specializations/README | 16 | ||||
-rw-r--r-- | bin/FOCUS/specializations/Reactor_Family/Select_Reactor_MT.spl | 450 | ||||
-rw-r--r-- | bin/FOCUS/specializations/Reactor_Family/Select_Reactor_ST.spl | 466 | ||||
-rw-r--r-- | bin/FOCUS/specializations/Reactor_Family/TP_Reactor.spl | 439 | ||||
-rw-r--r-- | bin/FOCUS/specializations/Wait_Strategy/Wait_On_Read.spl | 105 |
12 files changed, 2293 insertions, 0 deletions
diff --git a/bin/FOCUS/FOCUS.pl b/bin/FOCUS/FOCUS.pl new file mode 100755 index 00000000000..e82acfe63cc --- /dev/null +++ b/bin/FOCUS/FOCUS.pl @@ -0,0 +1,203 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; +######################################################################### +# FOCUS: A Feature Oriented Customization tool for ACE+TAO. +# +# Usage: +# ====== +# --prefix-path - gives the prefix to the place where ACE+TAO is installed +# --reactor-spl - provide the component that needs to be specialized +# --protocol-spl - provide the concrete protocol to specialize +# --output-prefix-path - +# (Optional) if specified, copies all the files to the +# output prefix. The directory structure is maintained. +# That is if foo/bar.h file was specialized. Then the +# output will be <prefix_output>/foo/bar.h +# +# Adding New Specializations +# =========================== +# (1) Add a new command line option if the specialization belongs to a +# new family of components. For example, Concurrency strategy +# (1.b) If not, then enhance exisiting option with a new value +# (2) Associate a specialization file for the concrete component being +# specialized. +# (3) Update the specializations directory appropriately to add the +# specializations file. +# +# @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> +# +# $Id$ +# +######################################################################## +use Getopt::Long; + +# This script can be invoked from anywhere. We need to add this to the +# path +use lib "$ENV{ACE_ROOT}/bin"; + +use FOCUS::Parser::FOCUSParser; + +sub usage +{ + + # How to use FOCUS + # Currently FOCUS supports the specialization of reactor and protocol + # families + my $usage = "usage: \n ./FOCUS " + . " \n --prefix-path=<path to module root>" + . " [\n --reactor-spl=<select-mt, select-st, tp-reactor>" + . " \n --protocol-spl=<iiop>" + . " \n --wait-strategy-spl=<rw>" + . " \n --output-prefix=<output path>" + . " \n --messaging-spl=<giop>" + . " \n --context-specific-optimizations=<dispatch>" + . " \n ]" + . "\n"; + print "$usage \n"; +} + +# Global Table that maps the specialization name to the file +# select => "../specializations/Reactor_Family/Select_Reactor.spl +# For each component that one needs to specialize add an entry in +# this simple global table to execute the specializations. + +# Get the ACE_ROOT ENV variable. Then the specializations +# can be accessed via $ACE_ROOT/bin/FOCUS/..... +my $spl_prefix_path = ""; +if (defined $ENV{"ACE_ROOT"}) +{ + $spl_prefix_path = $ENV{"ACE_ROOT"}; + + # Check if the prefix path ends with a / or not + # if it does not then manually add the / to it + my $last = substr ($spl_prefix_path, -1); + if ($last ne "/") + { + $spl_prefix_path = $spl_prefix_path . "/"; + } + + # Add the bin/FOCUS directory to the prefix path + $spl_prefix_path = $spl_prefix_path . "bin/FOCUS/"; + +} +else +{ + print "FOCUS: ACE_ROOT environment variable not defined. Exiting... \n"; + exit 1; +} + +my %specialization_table = ( + "select-mt", $spl_prefix_path . "specializations/Reactor_Family/Select_Reactor_MT.spl", + "select-st", $spl_prefix_path . "specializations/Reactor_Family/Select_Reactor_ST.spl", + "tp-reactor",$spl_prefix_path . "specializations/Reactor_Family/TP_Reactor.spl", + "giop", $spl_prefix_path . "specializations/Messaging_Strategy/GIOP.spl", + "iiop", $spl_prefix_path . "specializations/Protocol_Family/IIOP/iiop.spl", + "rw", $spl_prefix_path . "specializations/Wait_Strategy/Wait_On_Read.spl", + "dispatch", $spl_prefix_path . "specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl"); + +# Get the command line options +my $ret = GetOptions ("prefix-path=s" => \$prefix_path, + "reactor-spl=s" => \$reactor_type, + "protocol-spl=s" => \$protocol_type, + "messaging-spl=s" => \$messaging_type, + "wait-strategy-spl=s" => \$wait_strat_type, + "output-prefix:s" => \$output_prefix, + "context-specific-optimizations=s" => \$context_opt); + +# Check if the prefix path is specified +if (!$prefix_path) +{ + usage; + exit 1; +} + +# +# Check if the optional outputpath is specified +# if it not specified then the output_prefix will +# be same as the prefix_path. +# So if the prefix is something like: +# /build/arvindk/ACE_wrappers, then the output_prefix +# will be the same. +# +# Upshot: The source files will be directly replaced. +# +if (! $output_prefix) +{ + $output_prefix = $prefix_path; +} + +# Check if the type of each component specialized is valid! +if ($reactor_type) +{ + my $spl_file = $specialization_table {$reactor_type}; + if (! length ($spl_file)) + { + print "Invalid reactor type specified \n"; + usage; + exit 1; + } + + # specialize the Reactor component + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} + +# protocol specialization +if ($protocol_type) +{ + my $spl_file = $specialization_table {$protocol_type}; + if (! spl_file) + { + print "Invalid reactor type specified \n"; + usage; + exit 1; + } + + # specialize the Protocol component + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} + +# Wait Strategy specialization +if ($wait_strat_type) +{ + my $spl_file = $specialization_table {$wait_strat_type}; + if (! spl_file) + { + print "Invalid specialization for the Wait strategy \n"; + usage; + exit 1; + } + + # specialize the wait strategy + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} + +#Messaging specialization +if ($messaging_type) +{ + my $spl_file = $specialization_table {$messaging_type}; + if (! spl_file) + { + print "Invalid specialization for Messaging strategy \n"; + usage; + exit 1; + } + + # specialize the wait strategy + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} + +# Context specific optimizations present +if ($context_opt) +{ + my $spl_file = $specialization_table {$context_opt}; + if (! spl_file) + { + print "Invalid Context specialization optimization specified\n"; + usage; + exit 1; + } + + # specialize the wait strategy + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} diff --git a/bin/FOCUS/NEWS b/bin/FOCUS/NEWS new file mode 100644 index 00000000000..29dd15e6a3d --- /dev/null +++ b/bin/FOCUS/NEWS @@ -0,0 +1,35 @@ +USER VISIBLE CHANGES AND CAPABILITIES ADDED TO FOCUS: +===================================================== + +. Support for specialization of ACE Reactor Framework + -- Specialization of ACE_Select_Reactor both st and mt + -- Specialization of ACE_TP_Reactor + +. Support for specialization of Pluggable Messaging in TAO + -- Specialization of Pluggable Messaging Interface based on GIOP + +. Support for specializing the Pluggable Protocol framework in TAO + -- Specialization for IIOP protocol implementation in TAO + +FUTURE CAPABILITIES and PLANNED CHANGES +======================================== +ACE+TAO component specialization related capabilities +----------------------------------------------------- +. Support for specialization of the Messaging Framework based on GIOP_Lite +. Support for specialization of Wait Strategy including Leader_Follower wait strategy +. Support for specialization of Flushing Strategy components + +FOCUS Specialization Language Enhancements +------------------------------------------ +. Support for multi line search and replace capabilities +. Support for ensuring source files are not corrupted when multiple + specializations are grouped together when the specializations are + added. + +FOCUS Transformation Related Enhancements +---------------------------------------- +. Support for undo feature for the transformations. This is going to be + really hard. I am not sure if this is doable +. Specifying dependencies between the different specializations. If one + is incompatible with the other, then this needs to be detected before + the specializations are executed. diff --git a/bin/FOCUS/PROBLEM-REPORT-FORM b/bin/FOCUS/PROBLEM-REPORT-FORM new file mode 100644 index 00000000000..9538e1d58df --- /dev/null +++ b/bin/FOCUS/PROBLEM-REPORT-FORM @@ -0,0 +1,45 @@ +To: arvindk@dre.vanderbilt.edu +Subject: [area]: [synopsis] + + TAO VERSION: + ACE VERSION: + + HOST MACHINE and OPERATING SYSTEM: + + + TARGET MACHINE and OPERATING SYSTEM, if different from HOST: + COMPILER NAME AND VERSION (AND PATCHLEVEL): + + FOCUS COMMAND LINE OPTION + [What command line option did you use for FOCUS?] + + AREA/CLASS/EXAMPLE AFFECTED: +[What example failed? What module failed to compile?] + + DOES THE PROBLEM AFFECT: + COMPILATION? + [ What compiler are you using? Please cut n paste the + compilation error.] + + LINKING? + [ On Unix systems, did you run make realclean first?] + EXECUTION? + OTHER (please specify)? + +[Please indicate whether ACE/TAO, your application, or both are affected.] + + SYNOPSIS: +[Brief description of the problem] + + DESCRIPTION: +[Detailed description of problem. Don't just say "<blah> +doesn't work, here's a fix," explain what your program does +to get to the <blah> state. ] + + SAMPLE FIX/WORKAROUND: +[If available ] + + ACE+TAO INSTRUMENTED FILES: + Please if possible attach the ACE+TAO instrumented files (source + files) that affected your application. (Please use a compression + utility for sending the attachments) diff --git a/bin/FOCUS/README b/bin/FOCUS/README new file mode 100644 index 00000000000..14f3c804dc9 --- /dev/null +++ b/bin/FOCUS/README @@ -0,0 +1,76 @@ + + FOCUS README + ============ + +Motivation: +---------- +Middleware is often developed as a set of frameworks that can be +extended and configured with alternative implementations of key +components, such as different types of transport protocols e.g., +TCP/IP, VME, or shared memory), event demultiplexing mechanisms +e.g., reactive-, proactive-, or thread-based), request +demultiplexing strategies (e.g., dynamic hashing, perfect +hashing, or active demuxing), and concurrency models (e.g., +thread-per-connection, thread pool, or thread-pre-request). A +particular DRE application, however, may only use a small subset +of the potential framework alternatives. As a result, general-purpose +middleware may be overly extensible, i.e., contain +unnecessary overhead for indirection and dynamic dispatching that is +not needed for use cases in a particular context. +A challenge is to develop middleware specialization +techniques that can eliminate unnecessary overhead associated with +overly extensible middleware framework implementations for certain +product variants or application-specific contexts. + +Example and Approach: +-------------------- +The reactor framework in ACE allows plug and play of different +reactors such as Select, TP, Devpoll etc. The TAO middleware +implementation and applications that run atop TAO typically use +one particular implementation of the Reactor. For example, a +single-threaded application might use select_* reactors. The +Reactor framework uses the bridge pattern to transparently +invoke operations on the right reactors. When the concrete +Reactor is known, it should be possible to specialize the +framework to use the concrete reactor directly rather than use +the bridge. + +As a part of the Feature Oriented Customizer (FOCUS) tool being +,we are trying to specialize frameworks +when the concrete implementation 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. + +To help in this transformation process, FOCUS applies markers +within the source code. These markers are added as special +comments. For example, //@@ REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK +represents a hook where forward declarations and include files are +added by the weaver. As these markers are comments therefore should not +affect normal applications in *any* manner. Additionally, applications +that use multiple reactor implementations not be affected/do not need any +change. Currently, these specializations are targeted for TAO middleware, +where applications know the target reactor a priori and want to +leverage the specialization to improve performance. + +FOCUS Installation +------------------ +. FOCUS is written using Perl and does not require any compilation. Additionally + FOCUS does not depend on any external tools. + +Requirements +------------ +. FOCUS has been tested on Perl version 5.8.0 and uses the following Perl + packages: + -- XML::DOM package --> Perl package for processing XML DTDs + +Sample Usage: +------------- +FOCUS can be invoked from the command line in the following manner: +cmd>$ACE_ROOT/bin/FOCUS/FOCUS.pl --reactor-spl=select-st + --prefix-path=/build/arvindk/ACE_wrappers + --output-prefix=/build/arvindk/spl-files + +More Information: +----------------- +More information about FOCUS should be available from the docs directory. diff --git a/bin/FOCUS/VERSION b/bin/FOCUS/VERSION new file mode 100644 index 00000000000..b41df4e4c7b --- /dev/null +++ b/bin/FOCUS/VERSION @@ -0,0 +1 @@ +This is FOCUS version 0.0.1 alpha diff --git a/bin/FOCUS/specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl b/bin/FOCUS/specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl new file mode 100644 index 00000000000..a33b90ba255 --- /dev/null +++ b/bin/FOCUS/specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl @@ -0,0 +1,211 @@ +<?xml version="1.0"?> + +<!-- Leader Follower Flushing Strategy Specializations + * ================================================= + * Details all the specialization transformations necessary + * to specialize the Flushing Strategy with the concrete + * Leader_Follower flushing strategy. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="TAO/tao"> + +<!-- Transformations to L/F Flushing Strategy --> +<file name="Leader_Follower_Flushing_Strategy.h"> + +<!-- Comment out Flushing_Strategy include --> +<remove>#include "Flushing_Strategy.h"</remove> + +<!-- Add the forward declarations --> +<add> + <hook>FLUSHING_STRATEGY_SPL_INCLUDE_ADD_HOOK</hook> + <data> +class TAO_Transport; +class TAO_Queued_Message; +class ACE_Time_Value; + +#include "TAO_Export.h" + </data> +</add> + +<!-- Remove all virtual key words --> +<remove>virtual</remove> + +<!-- Remove inheritance from Flushing strategy --> +<remove>: public TAO_Flushing_Strategy</remove> + +</file> + +<!-- Do not build other Flushing Strategies --> +<file name="tao.mpc"> + + <substitute> + <search>Flushing_Strategy.h</search> + <replace>// Flushing_Strategy.h</replace> + </substitute> + <substitute> + <search>Flushing_Strategy.cpp</search> + <replace>// Flushing_Strategy.cpp</replace> + </substitute> + + <substitute> + <search>Block_Flushing_Strategy.h</search> + <replace>// Block_Flushing_Strategy.h</replace> + </substitute> + <substitute> + <search>Block_Flushing_Strategy.cpp</search> + <replace>// Block_Flushing_Strategy.cpp</replace> + </substitute> + + <substitute> + <search>Reactive_Flushing_Strategy.h</search> + <replace>// Reactive_Flushing_Strategy.h</replace> + </substitute> + <substitute> + <search>Reactive_Flushing_Strategy.cpp</search> + <replace>// Reactive_Flushing_Strategy.cpp</replace> + </substitute> + +</file> + +<file name="default_resource.cpp"> + +<substitute match-line="yes"> + <search>#include "tao/Reactive_Flushing_Strategy.h"</search> + <replace> // #include "tao/Reactive_Flushing_Strategy.h"</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "tao/Block_Flushing_Strategy.h"</search> + <replace>// #include "tao/Block_Flushing_Strategy.h"</replace> +</substitute> + +<!-- Replace all occurences of Flushing_Strategy with + L/F Flushing Strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +<!-- Comment out region specified by comment hooks --> +<comment> + <start-hook>FLUSHING_STRATEGY_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>FLUSHING_STRATEGY_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add the L/F specialization after the hook --> +<add> + <hook>FLUSHING_STRATEGY_SPL_COMMENT_HOOK_END</end-hook> + <data>this->flushing_strategy_type_ = TAO_LEADER_FOLLOWER_FLUSHING; + </data> +</add> + +<!-- Comment out creation of all other flushing strategies --> +<comment> + <start-hook>FLUSHING_STRATEGY_CREATION_SPL_HOOK_START</start-hook> + <end-hook>FLUSHING_STRATEGY_CREATION_SPL_HOOK_END</end-hook> +</comment> + +<!-- Create the L/F flushing strategy directly --> +<add> + <hook>FLUSHING_STRATEGY_CREATION_SPL_HOOK_END</hook> + <data>ACE_NEW_RETURN (strategy, + TAO_Leader_Follower_Flushing_Strategy, + 0); + </data> +</add> + +</file> + +<file name="default_resource.h"> + +<!-- Replace all occurences of Flushing_Strategy with L/F strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="ORB_Core.h"> + +<!-- Replace all occurences of base strategy with most + derived strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="ORB_Core.cpp"> + +<!-- Replace the Flushing Strategy inclue with L/F + flushing include --> +<substitute match-line="yes"> + <search>#include "Flushing_Strategy.h"</search> + <replace>#include "Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="ORB_Core.i"> + +<!-- Replace all occurences of base strategy with most + derived strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="Transport.h"> + +<!-- Remove the friend declaration of Reactive_Flushing --> +<substitute match-line="yes"> + <search>friend class TAO_Reactive_Flushing_Strategy;</search> + <replace>// friend class TAO_Reactive_Flushing_Strategy;</replace> +</substitute> + +<!-- Remove friend declaration of Block Flushing --> +<substitute match-line="yes"> + <search>friend class TAO_Block_Flushing_Strategy;</search> + <replace>// friend class TAO_Block_Flushing_Strategy;</replace> +</substitute> + +</file> + +<file name="Transport.cpp"> + +<substitute match-line="yes"> + <search>#include "Flushing_Strategy.h"</search> + <replace>#include "Leader_Follower_Flushing_Strategy.h</replace> +</substitute> + +<!-- Replace all occurences of TAO_Flushing_Strategy with + TAO_Leader_Follower_Flushing --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_strategy</replace> +</substitute> + +</file> + +<file name="Resource_Factor.h"> + +<!-- Replace TAO_Flushing_Strategy with L/F version --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +</module> + +</transform> diff --git a/bin/FOCUS/specializations/Messaging_Strategy/GIOP.spl b/bin/FOCUS/specializations/Messaging_Strategy/GIOP.spl new file mode 100644 index 00000000000..76e27509848 --- /dev/null +++ b/bin/FOCUS/specializations/Messaging_Strategy/GIOP.spl @@ -0,0 +1,246 @@ +<?xml version="1.0"?> + +<!-- Pluggable Messaging Specializations: + * When the concrete pluggable messaging is selected, + * this specialization removes the need for the Pluggable + * messaging interface completely from within TAO. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<!-- Define the module where there are multiple files --> +<module name="TAO/tao"> + +<file name="tao.mpc"> + +<!-- Remove Pluggable messaging include altogether --> +<substitute> + <search>GIOP_Message_Lite.cpp</search> + <replace>// GIOP_Message_Lite.cpp </replace> +</substitute> +<substitute> + <search>GIOP_Message_Lite.h</search> + <replace>// GIOP_Message_Lite.h</replace> +</substitute> +<substitute> + <search>Pluggable_Messaging.h</search> + <replace>// Pluggable_Messaging.h</replace> +</substitute> +<substitute> + <search>Pluggable_Messaging.cpp</search> + <replace>// Pluggable_Messaging.cpp</replace> +</substitute> + +</file> + +<file name="GIOP_Message_Base.h"> + +<!-- Remove Pluggable Messaging include directive --> +<remove>#include "tao/Pluggable_Messaging.h"</remove> + +<!-- Remove all occurences of virtual keyword --> +<remove>virtual</remove> + +<!-- Remove inheritance from Pluggable Messaging replace with + concrete class +--> +<remove>: public TAO_Pluggable_Messaging</remove> + +<!-- Typedef the concrete type, GIOP_Message_Base as the + underlying pluggable messaging type + --> +<add> + <hook>MESSAGING_SPL_EXTERN_ADD_HOOK</hook> + <data>typedef TAO_GIOP_Message_Base TAO_Pluggable_Messaging;</data> +</add> + +<!-- The method is_ready_for_bi_directional_giop is procted, this + should be made public --> +<substitute match-line="yes"> + <!-- Operation signature --> + <search>int is_ready_for_bidirectional \(TAO_OutputCDR &msg\);</search> + <replace> + +public: + int is_ready_for_bidirectional (TAO_OutputCDR &msg); + +protected: + </replace> +</substitute> + +</file> + +<file name="IIOP_Connection_Handler.h"> + +<!-- remove forward decls --> +<remove>class TAO_Pluggable_Messaging;</remove> + +</file> + +<file name="IIOP_Transport.h"> + +<!-- remove forward decls --> +<remove>class TAO_Pluggable_Messaging;</remove> + +</file> + +<file name="TAO_Server_Request.h"> + +<!-- Remove Pluggable messaging include altogether --> +<substitute match-line="yes"> + <search>class TAO_Pluggable_Messaging;</search> + <replace>#include "tao/GIOP_Message_Base.h"</replace> +</substitute> + +</file> + +<file name="TAO_Server_Request.cpp"> + +<!-- Remove Pluggable messaging include altogether --> +<remove>#include "Pluggable_Messaging.h"</remove> + +</file> + +<file name="Transport.h"> +<!-- Remove Pluggable messaging include altogether --> +<substitute match-line="yes"> + <search>class TAO_Pluggable_Messaging;</search> + <replace>#include "tao/GIOP_Message_Base.h"</replace> +</substitute> +</file> + +<file name="Transport.cpp"> + <remove>#include "Pluggable_Messaging.h"</remove> +</file> + +</module> + +<!-- Transformations to the Messaging Directory --> +<module name="TAO/tao/Messaging"> + +<file name="AMH_Response_Handler.h"> + +<substitute match-line="yes"> + <search>class TAO_Pluggable_Messaging;</search> + <replace>#include "tao/GIOP_Message_Base.h"</replace> +</substitute> + +</file> + +<file name="AMH_Response_Handler.cpp"> + <remove>#include "tao/Pluggable_Messaging.h"</remove> +</file> + +<file name="AMH_Response_Handler.cpp"> +<substitute match-line="yes"> + <search>#include "tao/Pluggable_Messaging.h"</search> + <replace>#include "tao/GIOP_Message_Base.h"</replace> +</substitute> +</file> + +<file name="Asynch_Invocation.cpp"> + <remove>#include "tao/Pluggable_Messaging.h"</remove> +</file> + +</module> + +<module name="TAO/tao/Strategies"> + +<file name="DIOP_Connection_Handler.h"> + <remove>class TAO_Pluggable_Messaging;</remove> +</file> + +<file name="DIOP_Transport.h"> + <remove>class TAO_Pluggable_Messaging;</remove> +</file> + +<file name="DIOP_Transport.cpp"> + + <!-- Replace GIOP_Lite with GIOP --> +<comment> + <start-hook>MESSAGING_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>MESSAGING_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>MESSAGING_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (this->messaging_object_, + TAO_GIOP_Message_Base (orb_core, + ACE_MAX_DGRAM_SIZE)); + </data> +</add> + + <remove>#include "tao/GIOP_Message_Lite.h"</remove> + +</file> + +<file name="SHMIOP_Transport.h"> + <remove>class TAO_Pluggable_Messaging;</remove> +</file> + +<file name="SHMIOP_Transport.cpp"> + <remove>#include "tao/GIOP_Message_Lite.h"</remove> + + <!-- Replace GIOP_Lite with GIOP --> +<comment> + <start-hook>MESSAGING_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>MESSAGING_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>MESSAGING_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (this->messaging_object_, + TAO_GIOP_Message_Base (orb_core, + ACE_MAX_DGRAM_SIZE)); + </data> +</add> + +</file> + +<file name="UIOP_Connection_Handler.h"> + <remove>class TAO_Pluggable_Messaging;</remove> +</file> + +<file name="UIOP_Connection_Handler.cpp"> + <remove>#include "tao/GIOP_Message_Lite.h"</remove> +</file> + +<file name="UIOP_Transport.h"> + <remove>class TAO_Pluggable_Messaging;</remove> +</file> + +<file name="UIOP_Transport.cpp"> + + <!-- Replace GIOP_Lite with GIOP --> +<comment> + <start-hook>MESSAGING_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>MESSAGING_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>MESSAGING_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (this->messaging_object_, + TAO_GIOP_Message_Base (orb_core, + ACE_MAX_DGRAM_SIZE)); + </data> +</add> + <remove>#include "tao/GIOP_Message_Lite.h"</remove> +</file> +</module> + +<module name="TAO/tao/DynamicInterface"> + <file name="DII_Invocation_Adapter.cpp"> + <substitute match-line="yes"> + <search>#include "tao/Pluggable_Messaging.h"</search> + <replace>#include "tao/GIOP_Message_Base.h"</replace> + </substitute> + </file> +</module> + +</transform> diff --git a/bin/FOCUS/specializations/README b/bin/FOCUS/specializations/README new file mode 100644 index 00000000000..e2126bf6566 --- /dev/null +++ b/bin/FOCUS/specializations/README @@ -0,0 +1,16 @@ +@file README +============ + +This file describes certain common conventions regarding how the +specializations rules are integrated/added to this specialization +database. This directory will serve as a repository that will host all +the specialization rules for the different families/components. At the +moment, all the specialization transformations are specific to the +ACE+TAO middleware. + +For each component framework, the following are the rules for adding +the specializations: + +. Create a directory with the name of the component family, e.g., Reactor_Family +. Within this directory, create the <<Specific_Component>>.spl file that has the + individual transformations defined. diff --git a/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_MT.spl b/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_MT.spl new file mode 100644 index 00000000000..c7541cc6915 --- /dev/null +++ b/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_MT.spl @@ -0,0 +1,450 @@ +<?xml version="1.0"?> + +<!-- Select Reactor Specializations: + * =============================== + * Details all the specialization transformations necessary + * to specialize the Reactor framework when the target reactor + * is a select reactor. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<!-- Define the module where there are multiple files --> +<module name="ace"> + +<!-- File where the transformations happen --> +<file name="Select_Reactor_Base.h"> + +<!-- Add the following lines based on a hook --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>class ACE_Sig_Handler;</data> + <data>class ACE_Sig_Action;</data> + <data>class ACE_Sig_Set;</data> +</add> + +<add> + <hook>REACTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> +//--- How can we devirtualize these methods? +virtual ~ACE_Select_Reactor_Impl () {} + +virtual int notify (ACE_Event_Handler *event_handler = 0, + ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, + ACE_Time_Value * = 0) =0; + +virtual int remove_handler (ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + +virtual int register_handler (ACE_HANDLE handle, + ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + </data> +</add> + +<!-- Remove what ever is present in the tag from the file --> +<remove>virtual</remove> +<remove>: public ACE_Reactor_Impl</remove> +<remove>#include "ace/Reactor_Impl.h"</remove> + +<!-- Replace a with b --> +<substitute> + <search>public ACE_Reactor_Notify</search> + <replace>public ACE_Event_Handler</replace> +</substitute> + +<!-- Replace the generic versions with the Select specialized versions --> +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<!-- After the specialization, the following functions are still virtual --> +<substitute> + <search>void renew</search> + <replace>virtual void renew</replace> +</substitute> +<substitute> + <search>int is_suspended_i</search> + <replace>virtual int is_suspended_i</replace> +</substitute> +<substitute> + <search>void clear_dispatch_mask</search> + <replace>virtual void clear_dispatch_mask</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<!-- Transformations to Reactor_Token_T.h --> +<file name="Reactor_Token_T.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "ace/Reactor_Impl.h"</search> + <replace>#include "ace/Select_Reactor_Base.h"</replace> +</substitute> + +</file> + +<file name="Reactor_Token_T.cpp"> + +<!-- Search for ACE_Reactor_Impl and replace it with + ACE_Select_Reactor_Impl --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_T.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>class ACE_Sig_Handler;</data> +<data>class ACE_Sig_Action;</data> +<data>class ACE_Sig_Set;</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<remove>virtual</remove> + +</file> + +<file name="Select_Reactor_T.cpp"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/Countdown_Time.h"</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +</file> + +<file name="Select_Reactor_T.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<file name="Reactor.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>#include "ace/Select_Reactor.h"</data> +</add> + +<remove>class ACE_Reactor_Impl;</remove> +<remove>virtual</remove> + +<substitute> +<search>ACE_Reactor_Impl</search> +<replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Remove the Reactor_Timer interface include --> +<remove>: public ACE_Reactor_Timer_Interface</remove> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Event_Handler.h"> + +<!-- remove the ACE_Event_Handler forware declaration --> +<remove>class ACE_Reactor_Timer_Interface;</remove> + +<!-- substitute ACE_Reactor_Timer operations with ACE_Reactor --> +<substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> +</substitute> +</file> + +<file name="Event_Handler.cpp"> + <substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> + </substitute> +</file> + +<file name="Timer_Queue_T.cpp"> + +<!-- Remove the Reactor_Timer_Interface include --> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + + +<file name="Reactor.cpp"> + +<!-- Comment the conditional includes in the file --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_INCLUDE_START_HOOK</start-hook> + <end-hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</end-hook> +</comment> + +<!-- Comment out conditional includes files in the Reactor's + constructor +--> +<comment> + <start-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Within the constructor now create the right Reactor --> +<add> + <hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (impl, + ACE_Select_Reactor); + </data> +</add> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="Reactor.inl"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +// Check if this is necessary +#include "ace/Select_Reactor.h" + </data> +</add> + +</file> + +<!-- Do not build the other reactors than the Select Reactor! --> +<file name="ace.mpc"> + +<!-- Here is where regular expressions can come handy. Such + a capability is not currently provided + --> +<substitute> + <search>TP_Reactor.h</search> + <replace>// TP_Reactor.h </replace> +</substitute> +<substitute> + <search>TP_Reactor.cpp</search> + <replace>// TP_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Msg_WFMO_Reactor --> +<substitute> + <search>Msg_WFMO_Reactor.cpp</search> + <replace>// Msg_WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the WFMO Reactor --> +<substitute> + <search>WFMO_Reactor.cpp</search> + <replace>// WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor Impl --> +<substitute> + <search>Reactor_Impl.cpp</search> + <replace>// Reactor_Impl.cpp</replace> +</substitute> +<substitute> + <search>Reactor_Impl.h</search> + <replace>// Reactor_Impl.h</replace> +</substitute> + +<!-- Do not build the Dev Poll Reactor --> +<substitute> + <search>Dev_Poll_Reactor.cpp</search> + <replace>// Dev_Poll_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the priority Reactor --> +<substitute> + <search>Priority_Reactor.cpp</search> + <replace>// Priority_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor_Timer_Interface --> +<substitute> + <search>Reactor_Timer_Interface.h</search> + <replace>// Reactor_Timer_Interface.h</replace> +</substitute> +<substitute> + <search>Reactor_Timer_Interface.cpp</search> + <replace>// Reactor_Timer_Interface.cpp </replace> +</substitute> + +</file> + +</module> + +<!-- transformations required in TAO to work with a select reactor --> +<module name="TAO/tao"> + +<!-- Changes to default_resource.h --> +<file name="default_resource.h"> + +<!-- Remove the forward declaration of ACE_Reactor_Impl --> +<substitute match-line="yes"> +<search>class ACE_Reactor_Impl;</search> +<replace>#include "ace/Reactor.h"</replace> +</substitute> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<!-- Changes to default_resource.cpp --> +<file name="default_resource.cpp"> + +<!-- Remove the occurence of TP_Reactor --> +<remove>#include "ace/TP_Reactor.h"</remove> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Comment out the code that creates TP_Reactor --> +<comment> + <start-hook>TAO_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add hook to add code that creates the select reactor + component --> +<add> + <!-- We use the same hook that signifies where the comment code + ended to add the concrete Reactor type --> + <hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> +</file> + +<!-- changes to tao.mpc --> +<file name="tao.mpc"> + <substitute> + <search>GUIResource_Factory.cpp</search> + <replace>// GUIResource_Factory.cpp</replace> + </substitute> + <substitute> + <search>GUIResource_Factory.h</search> + <replace>// GUIResource_Factory.h</replace> + </substitute> +</file> + +</module> + +<module name="TAO/tao/Strategies"> + +<file name="advanced_resource.h"> + +<!-- Replace all occurances of ACE_Reactor_Impl with + Select_Reactor + --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="advanced_resource.cpp"> + +<!-- Comment out all other reactor includes --> +<remove>#include "ace/FlReactor.h"</remove> +<remove>#include "ace/TkReactor.h"</remove> +<remove>#include "ace/WFMO_Reactor.h"</remove> +<remove>#include "ace/TP_Reactor.h"</remove> +<remove>#include "ace/Msg_WFMO_Reactor.h"</remove> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Replace Select_Reactor.h with Reactor.h --> +<substitute> + <search>ace/Select_Reactor.h</search> + <replace>ace/Reactor.h</replace> +</substitute> + +<!-- Comment out creation code for all other reactors --> +<comment> + <start-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Use the end hook to insert code that will create right reactor --> +<add> + <hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> + +</file> + +</module> + +</transform> diff --git a/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_ST.spl b/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_ST.spl new file mode 100644 index 00000000000..13e72307183 --- /dev/null +++ b/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_ST.spl @@ -0,0 +1,466 @@ +<?xml version="1.0"?> + +<!-- Select Reactor Specializations: + * =============================== + * Details all the specialization transformations necessary + * to specialize the Reactor framework when the target reactor + * is a select reactor. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<!-- Define the module where there are multiple files --> +<module name="ace"> + +<!-- File where the transformations happen --> +<file name="Select_Reactor_Base.h"> + +<!-- Add the following lines based on a hook --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>class ACE_Sig_Handler;</data> + <data>class ACE_Sig_Action;</data> + <data>class ACE_Sig_Set;</data> +</add> + +<add> + <hook>REACTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> +//These methods needs to be virtual as they are used by +//Select_Reactor_Notify classes which use the base class +virtual ~ACE_Select_Reactor_Impl () {} + +virtual int notify (ACE_Event_Handler *event_handler = 0, + ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, + ACE_Time_Value * = 0) =0; + +virtual int remove_handler (ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + +virtual int register_handler (ACE_HANDLE handle, + ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + </data> +</add> + +<!-- Remove what ever is present in the tag from the file --> +<remove>virtual</remove> +<remove>: public ACE_Reactor_Impl</remove> +<remove>#include "ace/Reactor_Impl.h"</remove> + +<!-- Replace a with b --> +<substitute> + <search>public ACE_Reactor_Notify</search> + <replace>public ACE_Event_Handler</replace> +</substitute> + +<!-- Replace the generic versions with the Select specialized versions --> +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<!-- After the specialization, the following functions are still virtual --> +<substitute> + <search>void renew</search> + <replace>virtual void renew</replace> +</substitute> +<substitute> + <search>int is_suspended_i</search> + <replace>virtual int is_suspended_i</replace> +</substitute> +<substitute> + <search>void clear_dispatch_mask</search> + <replace>virtual void clear_dispatch_mask</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<file name="Select_Reactor_T.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>class ACE_Sig_Handler;</data> +<data>class ACE_Sig_Action;</data> +<data>class ACE_Sig_Set;</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<remove>virtual</remove> + +</file> + +<file name="Select_Reactor_T.cpp"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/Countdown_Time.h"</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +</file> + +<file name="Select_Reactor_T.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<!-- Transformations to Reactor_Token_T.h --> +<file name="Reactor_Token_T.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "ace/Reactor_Impl.h"</search> + <replace>#include "ace/Select_Reactor_Base.h"</replace> +</substitute> + +</file> + +<file name="Reactor_Token_T.cpp"> + +<!-- Search for ACE_Reactor_Impl and replace it with + ACE_Select_Reactor_Impl --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Reactor.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>#include "ace/Select_Reactor.h"</data> +</add> + +<remove>class ACE_Reactor_Impl;</remove> +<remove>virtual</remove> + +<substitute> +<search>ACE_Reactor_Impl</search> +<replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Remove the Reactor_Timer interface include --> +<remove>: public ACE_Reactor_Timer_Interface</remove> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Event_Handler.h"> + +<!-- remove the ACE_Event_Handler forware declaration --> +<remove>class ACE_Reactor_Timer_Interface;</remove> + +<!-- substitute ACE_Reactor_Timer operations with ACE_Reactor --> +<substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> +</substitute> +</file> + +<file name="Event_Handler.cpp"> + <substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> + </substitute> +</file> + +<file name="Timer_Queue_T.cpp"> + +<!-- Remove the Reactor_Timer_Interface include --> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Reactor.cpp"> + +<!-- Comment the conditional includes in the file --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_INCLUDE_START_HOOK</start-hook> + <end-hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</end-hook> +</comment> + +<!-- Comment out conditional includes files in the Reactor's + constructor +--> +<comment> + <start-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Within the constructor now create the right Reactor --> +<add> + <hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (impl, + ACE_Select_Reactor); + </data> +</add> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="Reactor.inl"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +// Check if this is necessary +#include "ace/Select_Reactor.h" + </data> +</add> + +</file> + +<file name="Select_Reactor.h"> + +<!-- comment out the lock based select reactor, which is a select_mt --> +<comment> + <start-hook>TAO_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + typedef ACE_Select_Reactor_T <ACE_Reactor_Token_T < ACE_Noop_Token > > ACE_Select_Reactor; + </data> +</add> +</file> + +<!-- Do not build the other reactors than the Select Reactor! --> +<file name="ace.mpc"> + +<!-- Here is where regular expressions can come handy. Such + a capability is not currently provided + --> +<substitute> + <search>TP_Reactor.h</search> + <replace>// TP_Reactor.h </replace> +</substitute> +<substitute> + <search>TP_Reactor.cpp</search> + <replace>// TP_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Msg_WFMO_Reactor --> +<substitute> + <search>Msg_WFMO_Reactor.cpp</search> + <replace>// Msg_WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the WFMO Reactor --> +<substitute> + <search>WFMO_Reactor.cpp</search> + <replace>// WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor Impl --> +<substitute> + <search>Reactor_Impl.cpp</search> + <replace>// Reactor_Impl.cpp</replace> +</substitute> +<substitute> + <search>Reactor_Impl.h</search> + <replace>// Reactor_Impl.h</replace> +</substitute> + +<!-- Do not build the Dev Poll Reactor --> +<substitute> + <search>Dev_Poll_Reactor.cpp</search> + <replace>// Dev_Poll_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the priority Reactor --> +<substitute> + <search>Priority_Reactor.cpp</search> + <replace>// Priority_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor_Timer_Interface --> +<substitute> + <search>Reactor_Timer_Interface.h</search> + <replace>// Reactor_Timer_Interface.h</replace> +</substitute> +<substitute> + <search>Reactor_Timer_Interface.cpp</search> + <replace>// Reactor_Timer_Interface.cpp </replace> +</substitute> + +</file> + +</module> + +<!-- transformations required in TAO to work with a select reactor --> +<module name="TAO/tao"> + +<!-- Changes to default_resource.h --> +<file name="default_resource.h"> + +<!-- Remove the forward declaration of ACE_Reactor_Impl --> +<substitute match-line="yes"> +<search>class ACE_Reactor_Impl;</search> +<replace>#include "ace/Reactor.h"</replace> +</substitute> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<!-- Changes to default_resource.cpp --> +<file name="default_resource.cpp"> + +<!-- Remove the occurence of TP_Reactor --> +<remove>#include "ace/TP_Reactor.h"</remove> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Comment out the code that creates TP_Reactor --> +<comment> + <start-hook>TAO_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add hook to add code that creates the select reactor + component --> +<add> + <!-- We use the same hook that signifies where the comment code + ended to add the concrete Reactor type --> + <hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_NULL_LOCK_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> +</file> + +<!-- changes to tao.mpc --> +<file name="tao.mpc"> + <substitute> + <search>GUIResource_Factory.cpp</search> + <replace>// GUIResource_Factory.cpp</replace> + </substitute> + <substitute> + <search>GUIResource_Factory.h</search> + <replace>// GUIResource_Factory.h</replace> + </substitute> +</file> + +</module> + +<module name="TAO/tao/Strategies"> + +<file name="advanced_resource.h"> + +<!-- Replace all occurances of ACE_Reactor_Impl with + Select_Reactor + --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="advanced_resource.cpp"> + +<!-- Comment out all other reactor includes --> +<remove>#include "ace/FlReactor.h"</remove> +<remove>#include "ace/TkReactor.h"</remove> +<remove>#include "ace/WFMO_Reactor.h"</remove> +<remove>#include "ace/TP_Reactor.h"</remove> +<remove>#include "ace/Msg_WFMO_Reactor.h"</remove> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Replace Select_Reactor.h with Reactor.h --> +<substitute> + <search>ace/Select_Reactor.h</search> + <replace>ace/Reactor.h</replace> +</substitute> + +<!-- Comment out creation code for all other reactors --> +<comment> + <start-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Use the end hook to insert code that will create right reactor --> +<add> + <hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_NULL_LOCK_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> + +</file> + +</module> + +</transform> diff --git a/bin/FOCUS/specializations/Reactor_Family/TP_Reactor.spl b/bin/FOCUS/specializations/Reactor_Family/TP_Reactor.spl new file mode 100644 index 00000000000..f25c5fe5416 --- /dev/null +++ b/bin/FOCUS/specializations/Reactor_Family/TP_Reactor.spl @@ -0,0 +1,439 @@ +<?xml version="1.0"?> + +<!-- Thread Pool Reactor Specializations: + * ====================================== + * Thread Pool reactor is a variation of the Select Reactor. + * This specialization includes all of the specializations + * that are present in Select_Reactor.spl + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="ace"> + +<!-- File where the transformations happen --> +<file name="Select_Reactor_Base.h"> + +<!-- Add the following lines based on a hook --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>class ACE_Sig_Handler;</data> + <data>class ACE_Sig_Action;</data> + <data>class ACE_Sig_Set;</data> +</add> + +<!-- Remove what ever is present in the tag from the file --> +<remove>#include "ace/Reactor_Impl.h"</remove> +<remove>virtual</remove> +<remove>: public ACE_Reactor_Impl</remove> + +<!-- Replace a with b --> +<substitute> + <search>public ACE_Reactor_Notify</search> + <replace>public ACE_Event_Handler</replace> +</substitute> + +<add> + <hook>REACTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> +//--- How can we devirtualize these methods? +virtual ~ACE_Select_Reactor_Impl () {} + +virtual int notify (ACE_Event_Handler *event_handler = 0, + ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, + ACE_Time_Value * = 0) = 0; + +virtual int remove_handler (ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) = 0; + +virtual int register_handler (ACE_HANDLE handle, + ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; +//-------------------------------------------- + </data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<!-- After the specialization, the following functions are still virtual --> +<substitute> + <search>void renew</search> + <replace>virtual void renew</replace> +</substitute> +<substitute> + <search>int is_suspended_i</search> + <replace>virtual int is_suspended_i</replace> +</substitute> +<substitute> + <search>void clear_dispatch_mask</search> + <replace>virtual void clear_dispatch_mask</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<file name="Select_Reactor_T.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>class ACE_Sig_Handler;</data> +<data>class ACE_Sig_Action;</data> +<data>class ACE_Sig_Set;</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> +</file> + +<file name="Select_Reactor_T.cpp"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/Countdown_Time.h"</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +</file> + +<!-- Transformations to Reactor_Token_T.h --> +<file name="Reactor_Token_T.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "ace/Reactor_Impl.h"</search> + <replace>#include "ace/Select_Reactor_Base.h"</replace> +</substitute> + +</file> + +<file name="Reactor_Token_T.cpp"> + +<!-- Search for ACE_Reactor_Impl and replace it with + ACE_Select_Reactor_Impl --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<!-- Starting below is the specialization for TP_Reactor --> + +<!-- Transformations to Reactor.h --> +<file name="Reactor.h"> + +<!-- Replace all occurences of ACE_Reactor_Impl with TP_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Remove all occurences of the word virtual --> +<remove>virtual</remove> + +<!-- Remove the Reactor_Timer interface include --> +<remove>: public ACE_Reactor_Timer_Interface</remove> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Event_Handler.h"> + +<!-- remove the ACE_Event_Handler forware declaration --> +<remove>class ACE_Reactor_Timer_Interface;</remove> + +<!-- substitute ACE_Reactor_Timer operations with ACE_Reactor --> +<substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> +</substitute> +</file> + +<file name="Event_Handler.cpp"> + <substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> + </substitute> +</file> + +<file name="Timer_Queue_T.cpp"> + +<!-- Remove the Reactor_Timer_Interface include --> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<!-- Transformations to Reactor.inl --> +<file name="Reactor.inl"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +// Check if this is necessary +#include "ace/Select_Reactor.h" + </data> +</add> + +</file> + +<file name="Reactor.cpp"> + +<!-- Replace ACE_Reactor_Impl with ACE_TP_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Comment the conditional includes in the file --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_INCLUDE_START_HOOK</start-hook> + <end-hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</end-hook> +</comment> + +<!-- Comment out conditional includes files in the Reactor's + constructor +--> +<comment> + <start-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add the TP_Reactor include file --> +<add> + <hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</hook> + <data>#include "ace/TP_Reactor.h"</data> +</add> + +<!-- Within the constructor now create the right Reactor --> +<add> + <hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (impl, + ACE_TP_Reactor); + </data> +</add> + +</file> + +<!-- Transformations to TP_Reactor.h --> +<file name="TP_Reactor.h"> + +<!-- Remove all occurances of virtual --> +<remove>virtual</remove> + +</file> + +<!-- Transformations to TP_Reactor.cpp --> +<file name="TP_Reactor.cpp"> + +<!-- Comment hook --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add this function to the --> +<add> + <hook>REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> +int +ACE_TP_Reactor::register_handler (int signum, + ACE_Event_Handler *new_sh, + ACE_Sig_Action *new_disp, + ACE_Event_Handler **old_sh, + ACE_Sig_Action *old_disp) +{ + return ACE_Select_Reactor::register_handler (signum, + new_sh, + new_disp, + old_sh, + old_disp); +} + </data> +</add> + +</file> + +<!-- Transformations to Asynch_Pseudo_Task.h --> +<file name="Asynch_Pseudo_Task.h"> + +<!-- Remove the Select_Reacto.h include --> +<remove>#include "ace/Select_Reactor.h"</remove> + +<substitute> + <search>ACE_Select_Reactor</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Add the TP_Reactor which is the concrete reactor --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/TP_Reactor.h"</data> +</add> + +</file> + +<file name="ace.mpc"> + +<!-- Do not build the WFMO Reactor --> +<substitute> + <search>WFMO_Reactor.cpp</search> + <replace>// WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor Impl --> +<substitute> + <search>Reactor_Impl.cpp</search> + <replace>// Reactor_Impl.cpp</replace> +</substitute> +<substitute> + <search>Reactor_Impl.h</search> + <replace>// Reactor_Impl.h</replace> +</substitute> + +<!-- Do not build the Dev Poll Reactor --> +<substitute> + <search>Dev_Poll_Reactor.cpp</search> + <replace>// Dev_Poll_Reactor.cpp</replace> +</substitute> + + +<!-- Do not build the Msg_WFMO_Reactor --> +<substitute> + <search>Msg_WFMO_Reactor.cpp</search> + <replace>// Msg_WFMO_Reactor.cpp</replace> +</substitute> + + +<!-- Do not build the priority Reactor --> +<substitute> + <search>Priority_Reactor.cpp</search> + <replace>// Priority_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor_Timer_Interface --> +<substitute> + <search>Reactor_Timer_Interface.h</search> + <replace>// Reactor_Timer_Interface.h</replace> +</substitute> +<substitute> + <search>Reactor_Timer_Interface.cpp</search> + <replace>// Reactor_Timer_Interface.cpp </replace> +</substitute> + +</file> + +</module> +<!-- end of Changes to ace --> + +<!-- Transformations to TAO module --> +<module name="TAO/tao"> + +<file name="default_resource.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +<file name="default_resource.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +</module> + +<module name="TAO/tao/Strategies"> + +<file name="advanced_resource.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +<file name="advanced_resource.cpp"> + +<!-- Comment out all other reactor includes --> + +<remove>#include "ace/FlReactor.h"</remove> +<remove>#include "ace/TkReactor.h"</remove> +<remove>#include "ace/WFMO_Reactor.h"</remove> +<!-- <remove>#include "ace/Select_Reactor.h"</remove> --> +<remove>#include "ace/Msg_WFMO_Reactor.h"</remove> + +<!-- Substitute ACE_Reactor_Impl with ACE_TP_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Comment out creation code for all other reactors --> +<comment> + <start-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Use the end hook to insert code that will create right reactor --> +<add> + <hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + ACE_TP_Reactor (ACE::max_handles (), + 1, + (ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + this->reactor_mask_signals_, + ACE_Select_Reactor_Token::LIFO), + 0); + </data> +</add> + +</file> + +</module> + +</transform> diff --git a/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Read.spl b/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Read.spl new file mode 100644 index 00000000000..ab76b9c8eef --- /dev/null +++ b/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Read.spl @@ -0,0 +1,105 @@ +<?xml version="1.0"?> + +<!-- Wait Strategy Specialization + * =============================== + * Details all the specialization transformations necessary + * to specialize the Wait_Strategy with the Wait_On_Read strategy + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="TAO/tao"> + +<file name="Wait_Strategy.cpp"> + +<!-- Copy specialized code from the Wait_On_Read strategy + to this file --> + +<copy-from-source> + + <!-- Name of the source file from which to copy. In this case, this is + the Wait_On_Read source file --> + <source>Wait_On_Read.cpp</source> + + <!-- Copy data between the following hooks defined in the aforementioned + file --> + <copy-hook-start>WAIT_STRATEGY_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>WAIT_STRATEGY_SPL_COPY_HOOK_END</copy-hook-end> + + <!-- Destination hook in the Wait_Strategy.h file where the code + should be placed --> + <dest-hook>TAO_WAIT_STRATEGY_SPL_ADD_HOOK</dest-hook> + +</copy-from-source> + +<!-- Copy include files to the hook to get the necessary include files --> +<add> + <hook>WAIT_STRATEGY_SPL_COPY_HOOK_START</hook> + <data> +#include "Wait_On_Read.h" +#include "Transport.h" +#include "Resume_Handle.h" +#include "Synch_Reply_Dispatcher.h" +#include "Client_Strategy_Factory.h" +#include "ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Countdown_Time.h" + </data> +</add> + +<!-- Once this is done, replace all occurences of TAO_Wait_On_Read with + TAO_Wait_Strategy --> +<substitute> + <search>TAO_Wait_On_Read</search> + <replace>TAO_Wait_Strategy</replace> +</substitute> + +</file> + +<file name="tao.mpc"> + +<!-- Do not build the other Wait strategy classes --> +<substitute> + <search>Wait_On_Read.h</search> + <replace>// Wait_On_Read.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Read.cpp</search> + <replace>// Wait_On_Read.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_Reactor.h</search> + <replace>// Wait_On_Reactor.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Reactor.cpp</search> + <replace>// Wait_On_Reactor.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_Leader_Follower.h</search> + <replace>// Wait_On_Leader_Follower.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Leader_Follower.cpp</search> + <replace>// Wait_On_Leader_Follower.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_LF_No_Upcall.h</search> + <replace>// Wait_On_LF_No_Upcall.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_LF_No_Upcall.cpp</search> + <replace>// Wait_On_LF_No_Upcall.cpp</replace> +</substitute> + +</file> + +</module> + +</transform> |