diff --git a/CVSROOT/checkoutlist b/CVSROOT/checkoutlist deleted file mode 100644 index b04b3501f5efd94313942eb7439457bc82f5a2f5..0000000000000000000000000000000000000000 --- a/CVSROOT/checkoutlist +++ /dev/null @@ -1,13 +0,0 @@ -# The "checkoutlist" file is used to support additional version controlled -# administrative files in $CVSROOT/CVSROOT, such as template files. -# -# The first entry on a line is a filename which will be checked out from -# the corresponding RCS file in the $CVSROOT/CVSROOT directory. -# The remainder of the line is an error message to use if the file cannot -# be checked out. -# -# File format: -# -# [] -# -# comment lines begin with '#' diff --git a/CVSROOT/commitinfo b/CVSROOT/commitinfo deleted file mode 100644 index b19e7b7a63e8e90cdb49c43f02035646c4a76e0a..0000000000000000000000000000000000000000 --- a/CVSROOT/commitinfo +++ /dev/null @@ -1,15 +0,0 @@ -# The "commitinfo" file is used to control pre-commit checks. -# The filter on the right is invoked with the repository and a list -# of files to check. A non-zero exit of the filter program will -# cause the commit to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff --git a/CVSROOT/config b/CVSROOT/config deleted file mode 100644 index ff43ec005ab332bc2aa7e1378754180e75a4b049..0000000000000000000000000000000000000000 --- a/CVSROOT/config +++ /dev/null @@ -1,14 +0,0 @@ -# Set this to "no" if pserver shouldn't check system users/passwords -#SystemAuth=no - -# Put CVS lock files in this directory rather than directly in the repository. -#LockDir=/var/lock/cvs - -# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top -# level of the new working directory when using the `cvs checkout' -# command. -#TopLevelAdmin=no - -# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the -# history file, or a subset as needed (ie `TMAR' logs all write operations) -#LogHistory=TOFEWGCMAR diff --git a/CVSROOT/cvswrappers b/CVSROOT/cvswrappers deleted file mode 100644 index 0accaf1b1532448d633d8a183cd8e3a5dd3b4a75..0000000000000000000000000000000000000000 --- a/CVSROOT/cvswrappers +++ /dev/null @@ -1,23 +0,0 @@ -# This file affects handling of files based on their names. -# -# The -t/-f options allow one to treat directories of files -# as a single file, or to transform a file in other ways on -# its way in and out of CVS. -# -# The -m option specifies whether CVS attempts to merge files. -# -# The -k option specifies keyword expansion (e.g. -kb for binary). -# -# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers) -# -# wildcard [option value][option value]... -# -# where option is one of -# -f from cvs filter value: path to filter -# -t to cvs filter value: path to filter -# -m update methodology value: MERGE or COPY -# -k expansion mode value: b, o, kkv, &c -# -# and value is a single-quote delimited value. -# For example: -#*.gif -k 'b' diff --git a/CVSROOT/editinfo b/CVSROOT/editinfo deleted file mode 100644 index d78886c1522b6eae3470c13da218c3d8e197cf71..0000000000000000000000000000000000000000 --- a/CVSROOT/editinfo +++ /dev/null @@ -1,21 +0,0 @@ -# The "editinfo" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. diff --git a/CVSROOT/loginfo b/CVSROOT/loginfo deleted file mode 100644 index 5a59f0a5440dbfb31dec7af3fbaced68fbf50a8f..0000000000000000000000000000000000000000 --- a/CVSROOT/loginfo +++ /dev/null @@ -1,26 +0,0 @@ -# The "loginfo" file controls where "cvs commit" log information -# is sent. The first entry on a line is a regular expression which must match -# the directory that the change is being made to, relative to the -# $CVSROOT. If a match is found, then the remainder of the line is a filter -# program that should expect log information on its standard input. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name ALL appears as a regular expression it is always used -# in addition to the first matching regex or DEFAULT. -# -# You may specify a format string as part of the -# filter. The string is composed of a `%' followed -# by a single format character, or followed by a set of format -# characters surrounded by `{' and `}' as separators. The format -# characters are: -# -# s = file name -# V = old version number (pre-checkin) -# v = new version number (post-checkin) -# -# For example: -#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog -# or -#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog diff --git a/CVSROOT/modules b/CVSROOT/modules deleted file mode 100644 index cb9e9efc94b342879a5fff24b425473fc11edd01..0000000000000000000000000000000000000000 --- a/CVSROOT/modules +++ /dev/null @@ -1,26 +0,0 @@ -# Three different line formats are valid: -# key -a aliases... -# key [options] directory -# key [options] directory files... -# -# Where "options" are composed of: -# -i prog Run "prog" on "cvs commit" from top-level of module. -# -o prog Run "prog" on "cvs checkout" of module. -# -e prog Run "prog" on "cvs export" of module. -# -t prog Run "prog" on "cvs rtag" of module. -# -u prog Run "prog" on "cvs update" of module. -# -d dir Place module in directory "dir" instead of module name. -# -l Top-level directory only -- do not recurse. -# -# NOTE: If you change any of the "Run" options above, you'll have to -# release and re-checkout any working directories of these modules. -# -# And "directory" is a path to a directory relative to $CVSROOT. -# -# The "-a" option specifies an alias. An alias is interpreted as if -# everything on the right of the "-a" had been typed on the command line. -# -# You can encode a module within a module by using the special '&' -# character to interpose another module into the current module. This -# can be useful for creating a module that consists of many directories -# spread out over the entire source repository. diff --git a/CVSROOT/notify b/CVSROOT/notify deleted file mode 100644 index 34f0bc288808e56e499d0852a9bfc9a3214b02d9..0000000000000000000000000000000000000000 --- a/CVSROOT/notify +++ /dev/null @@ -1,12 +0,0 @@ -# The "notify" file controls where notifications from watches set by -# "cvs watch add" or "cvs edit" are sent. The first entry on a line is -# a regular expression which is tested against the directory that the -# change is being made to, relative to the $CVSROOT. If it matches, -# then the remainder of the line is a filter program that should contain -# one occurrence of %s for the user to notify, and information on its -# standard input. -# -# "ALL" or "DEFAULT" can be used in place of the regular expression. -# -# For example: -#ALL mail %s -s "CVS notification" diff --git a/CVSROOT/rcsinfo b/CVSROOT/rcsinfo deleted file mode 100644 index 49e59f4d0df9b432c5b99c0b806378a77c9cd870..0000000000000000000000000000000000000000 --- a/CVSROOT/rcsinfo +++ /dev/null @@ -1,13 +0,0 @@ -# The "rcsinfo" file is used to control templates with which the editor -# is invoked on commit and import. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being made to, relative to the -# $CVSROOT. For the first match that is found, then the remainder of the -# line is the name of the file that contains the template. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff --git a/CVSROOT/taginfo b/CVSROOT/taginfo deleted file mode 100644 index 274a46dd5b61069f1cea62395178b09aa3120248..0000000000000000000000000000000000000000 --- a/CVSROOT/taginfo +++ /dev/null @@ -1,20 +0,0 @@ -# The "taginfo" file is used to control pre-tag checks. -# The filter on the right is invoked with the following arguments: -# -# $1 -- tagname -# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d -# $3 -- repository -# $4-> file revision [file revision ...] -# -# A non-zero exit of the filter program will cause the tag to be aborted. -# -# The first entry on a line is a regular expression which is tested -# against the directory that the change is being committed to, relative -# to the $CVSROOT. For the first match that is found, then the remainder -# of the line is the name of the filter to run. -# -# If the repository name does not match any of the regular expressions in this -# file, the "DEFAULT" line is used, if it is specified. -# -# If the name "ALL" appears as a regular expression it is always used -# in addition to the first matching regex or "DEFAULT". diff --git a/CVSROOT/verifymsg b/CVSROOT/verifymsg deleted file mode 100644 index 86f747ce222390e6aa7a488074e372030d57a479..0000000000000000000000000000000000000000 --- a/CVSROOT/verifymsg +++ /dev/null @@ -1,21 +0,0 @@ -# The "verifymsg" file is used to allow verification of logging -# information. It works best when a template (as specified in the -# rcsinfo file) is provided for the logging procedure. Given a -# template with locations for, a bug-id number, a list of people who -# reviewed the code before it can be checked in, and an external -# process to catalog the differences that were code reviewed, the -# following test can be applied to the code: -# -# Making sure that the entered bug-id number is correct. -# Validating that the code that was reviewed is indeed the code being -# checked in (using the bug-id number or a seperate review -# number to identify this particular code set.). -# -# If any of the above test failed, then the commit would be aborted. -# -# Actions such as mailing a copy of the report to each reviewer are -# better handled by an entry in the loginfo file. -# -# One thing that should be noted is the the ALL keyword is not -# supported. There can be only one entry that matches a given -# repository. diff --git a/examples/build.properties b/examples/build.properties deleted file mode 100644 index e061432dfe83fa57b74c71ff1c2d43a4a75765c8..0000000000000000000000000000000000000000 --- a/examples/build.properties +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################### -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################### - -# Some information about the product - -product.name fractalexamples -product.version 2.0 - -# Wich compiler do you want to use ? - -# build.compiler jikes diff --git a/examples/build.xml b/examples/build.xml deleted file mode 100644 index 9eb21b87cc41d4eea93b94702bcfbd4db0997077..0000000000000000000000000000000000000000 --- a/examples/build.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/comanche/build.xml b/examples/comanche/build.xml deleted file mode 100644 index ff1b9346d9e9dda67d735361c1cb075176ced391..0000000000000000000000000000000000000000 --- a/examples/comanche/build.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/comanche/etc/build.properties b/examples/comanche/etc/build.properties deleted file mode 100644 index 4d8c9c6862d5e97c967a59e916eaea8b81bc6e4b..0000000000000000000000000000000000000000 --- a/examples/comanche/etc/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Wich compiler do you want use ? - -build.compiler jikes - -# Class path for the ASM library (ASM_1_4_2) -# See http://asm.objectweb.org - -asm.path lib/asm.jar - -# Class path for the Fractal API (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -fractal.path lib/fractal.jar - -# Class path of Julia (JULIA_2_0) -# See http://fractal.objectweb.org - -julia.path lib/julia-asm.jar:lib/julia-mixins.jar:lib/julia-runtime.jar - -# Class path for the FractalADL parser (FRACTAL_ADL_2_0) -# See http://fractal.objectweb.org - -fractaladl.path lib/fractal-adl.jar:lib/ow_deployment_scheduling.jar:lib/dtdparser.jar diff --git a/examples/comanche/etc/execute.properties b/examples/comanche/etc/execute.properties deleted file mode 100644 index bbbef46bd48ac6527eae8a247a537a5479148333..0000000000000000000000000000000000000000 --- a/examples/comanche/etc/execute.properties +++ /dev/null @@ -1,16 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -run.jvm.parameters \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -# Java class to be launched - -run.classname org.objectweb.fractal.adl.Launcher - -# Application arguments - -run.parameters -fractal comanche.Comanche r diff --git a/examples/comanche/etc/julia.cfg b/examples/comanche/etc/julia.cfg deleted file mode 100644 index 8c35125c35c6ea2c2e8f3f007fbdf08dc8850a92..0000000000000000000000000000000000000000 --- a/examples/comanche/etc/julia.cfg +++ /dev/null @@ -1,614 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -# no custom definitions diff --git a/examples/comanche/index.html b/examples/comanche/index.html deleted file mode 100644 index ce78834a5608fc796b4836531aebd9ba3ed8024f..0000000000000000000000000000000000000000 --- a/examples/comanche/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Welcome in Comanche! -
-This is a test page to test the Comanche server. - \ No newline at end of file diff --git a/examples/comanche/lib/asm.jar b/examples/comanche/lib/asm.jar deleted file mode 100644 index 41e00315ffb0dbd0a386c5a7d39f3bea178804ee..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/asm.jar and /dev/null differ diff --git a/examples/comanche/lib/dtdparser.jar b/examples/comanche/lib/dtdparser.jar deleted file mode 100644 index ddb33dc33e512b1394953e10a83d1fdad438dffc..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/dtdparser.jar and /dev/null differ diff --git a/examples/comanche/lib/fractal-adl.jar b/examples/comanche/lib/fractal-adl.jar deleted file mode 100644 index 2df7d57c362e43a33cecfce8a011cbd2f4575293..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/fractal-adl.jar and /dev/null differ diff --git a/examples/comanche/lib/fractal.jar b/examples/comanche/lib/fractal.jar deleted file mode 100644 index 6bf74c05aaf416490008ba43dce643df09adbbd5..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/fractal.jar and /dev/null differ diff --git a/examples/comanche/lib/julia-asm.jar b/examples/comanche/lib/julia-asm.jar deleted file mode 100644 index 6a8a7de3de4e80f6315aae586593b3bd0bc57b72..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/julia-asm.jar and /dev/null differ diff --git a/examples/comanche/lib/julia-mixins.jar b/examples/comanche/lib/julia-mixins.jar deleted file mode 100644 index 44af2f6006db94f97907c525be68dd9433cb6e1e..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/julia-mixins.jar and /dev/null differ diff --git a/examples/comanche/lib/julia-runtime.jar b/examples/comanche/lib/julia-runtime.jar deleted file mode 100644 index b416b02e98d6e6c2433916f0be1c025a9bb1ac2b..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/julia-runtime.jar and /dev/null differ diff --git a/examples/comanche/lib/ow_deployment_scheduling.jar b/examples/comanche/lib/ow_deployment_scheduling.jar deleted file mode 100644 index 0f20b080a8d0979254b548c52dd40437060386ea..0000000000000000000000000000000000000000 Binary files a/examples/comanche/lib/ow_deployment_scheduling.jar and /dev/null differ diff --git a/examples/comanche/src/comanche/Analyzer.fractal b/examples/comanche/src/comanche/Analyzer.fractal deleted file mode 100644 index 3e7d7093e9f361c2170e4cddf4e4c32e77f985a3..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Analyzer.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/AnalyzerType.fractal b/examples/comanche/src/comanche/AnalyzerType.fractal deleted file mode 100644 index c3f241f977965a0499f4628bcdaab44d299cfff2..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/AnalyzerType.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/examples/comanche/src/comanche/Backend.fractal b/examples/comanche/src/comanche/Backend.fractal deleted file mode 100644 index 69457768d572b53813cea65898d004c93af0c8e9..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Backend.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/examples/comanche/src/comanche/BackendType.fractal b/examples/comanche/src/comanche/BackendType.fractal deleted file mode 100644 index 92a8b09da155a8e95d3953fc604e0417f0bfc15b..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/BackendType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/BasicLogger.java b/examples/comanche/src/comanche/BasicLogger.java deleted file mode 100644 index 260d42ddd441b6f25447940cfecfa1b50403484d..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/BasicLogger.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public class BasicLogger implements Logger { - public void log (String msg) { System.out.println(msg); } -} diff --git a/examples/comanche/src/comanche/Comanche.fractal b/examples/comanche/src/comanche/Comanche.fractal deleted file mode 100644 index ca67ce597d430af5ee716d501136b69f9092ab34..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Comanche.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/examples/comanche/src/comanche/ComancheType.fractal b/examples/comanche/src/comanche/ComancheType.fractal deleted file mode 100644 index 0e42e0ee86d4d753b08dc3a6123d8c075ce487bb..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/ComancheType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/Dispatcher.fractal b/examples/comanche/src/comanche/Dispatcher.fractal deleted file mode 100644 index ec115f1da4cdebed5ae2b9dd923988404eef09e9..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Dispatcher.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/DispatcherType.fractal b/examples/comanche/src/comanche/DispatcherType.fractal deleted file mode 100644 index 2682937b3d606ee68f06fd0b58666306efb0675f..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/DispatcherType.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/examples/comanche/src/comanche/ErrorHandler.fractal b/examples/comanche/src/comanche/ErrorHandler.fractal deleted file mode 100644 index 636c109f542f3d6d43bd323cf462c4289f0f1431..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/ErrorHandler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/ErrorRequestHandler.java b/examples/comanche/src/comanche/ErrorRequestHandler.java deleted file mode 100644 index 735a5f69c1a0d9443af4a72cb114d22f2e15bd17..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/ErrorRequestHandler.java +++ /dev/null @@ -1,9 +0,0 @@ -package comanche; -import java.io.*; - -public class ErrorRequestHandler implements RequestHandler { - public void handleRequest (Request r) throws IOException { - r.out.print("HTTP/1.0 404 Not Found\n\n"); - r.out.print("Document not found."); - } -} diff --git a/examples/comanche/src/comanche/FileHandler.fractal b/examples/comanche/src/comanche/FileHandler.fractal deleted file mode 100644 index 47b91c181a19a7f0147e93715dbf3510f71e3a14..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/FileHandler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/FileRequestHandler.java b/examples/comanche/src/comanche/FileRequestHandler.java deleted file mode 100644 index e4bdbe3903fc14850acc7ceeeadaebfad144469e..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/FileRequestHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package comanche; -import java.io.*; - -public class FileRequestHandler implements RequestHandler { - public void handleRequest (Request r) throws IOException { - File f = new File(r.url); - if (f.exists() && !f.isDirectory()) { - InputStream is = new FileInputStream(f); - byte[] data = new byte[is.available()]; - is.read(data); - is.close(); - r.out.print("HTTP/1.0 200 OK\n\n"); - r.out.write(data); - } else { - throw new IOException("File not found"); - } - } -} diff --git a/examples/comanche/src/comanche/Frontend.fractal b/examples/comanche/src/comanche/Frontend.fractal deleted file mode 100644 index de64b1c066167e8a1100576c8b72ebcd05b9f04f..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Frontend.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/examples/comanche/src/comanche/FrontendType.fractal b/examples/comanche/src/comanche/FrontendType.fractal deleted file mode 100644 index d7a8d67c859c8a62b695a81d0a97d7fceda9ef3b..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/FrontendType.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/examples/comanche/src/comanche/Handler.fractal b/examples/comanche/src/comanche/Handler.fractal deleted file mode 100644 index a0b17d20d8f740e87ec9c52be8b450d1fd246040..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Handler.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/examples/comanche/src/comanche/Logger.fractal b/examples/comanche/src/comanche/Logger.fractal deleted file mode 100644 index 410c5d0180a5bbfef5af7b648e1b758f25454398..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Logger.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/Logger.java b/examples/comanche/src/comanche/Logger.java deleted file mode 100644 index 241561a53c89351530e333ec75f7c271c4a7480e..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Logger.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public interface Logger { - void log (String msg); -} diff --git a/examples/comanche/src/comanche/LoggerType.fractal b/examples/comanche/src/comanche/LoggerType.fractal deleted file mode 100644 index 6b6cdbcbebd0184ff27aaa8ebe9f4b08abf887bc..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/LoggerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/MultiThreadScheduler.fractal b/examples/comanche/src/comanche/MultiThreadScheduler.fractal deleted file mode 100644 index c345848d11351cb1d53104585d47603ad2b8ef27..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/MultiThreadScheduler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/MultiThreadScheduler.java b/examples/comanche/src/comanche/MultiThreadScheduler.java deleted file mode 100644 index adf8bb4d91c15fd014f7bae585c59212aba73612..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/MultiThreadScheduler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public class MultiThreadScheduler implements Scheduler { - public void schedule (Runnable task) { new Thread(task).start(); } -} diff --git a/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal b/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal deleted file mode 100644 index 9566c389686b9daa422ed738fde3742d86390f0a..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/Receiver.fractal b/examples/comanche/src/comanche/Receiver.fractal deleted file mode 100644 index 74363878f74b875479710eed95b617a03d796117..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Receiver.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/examples/comanche/src/comanche/ReceiverType.fractal b/examples/comanche/src/comanche/ReceiverType.fractal deleted file mode 100644 index 6ff55d785bc4dc50af11e625810c78d19eb43aaa..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/ReceiverType.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/examples/comanche/src/comanche/Request.java b/examples/comanche/src/comanche/Request.java deleted file mode 100644 index 200c4b658f35cb079fdc1ccaa89d403672046e19..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Request.java +++ /dev/null @@ -1,11 +0,0 @@ -package comanche; -import java.io.*; -import java.net.*; - -public class Request { - public Socket s; - public Reader in; - public PrintStream out; - public String url; - public Request (Socket s) { this.s = s; } -} diff --git a/examples/comanche/src/comanche/RequestAnalyzer.java b/examples/comanche/src/comanche/RequestAnalyzer.java deleted file mode 100644 index 945c0df259109e6d9b3b0222fb64681dd88b5da6..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/RequestAnalyzer.java +++ /dev/null @@ -1,36 +0,0 @@ -package comanche; -import java.io.*; -import org.objectweb.fractal.api.control.BindingController; - -public class RequestAnalyzer implements RequestHandler, BindingController { - private RequestHandler rh; - private Logger l; - // configuration aspect - public String[] listFc () { return new String[] { "l", "rh" }; } - public Object lookupFc (String itfName) { - if (itfName.equals("l")) { return l; } - else if (itfName.equals("rh")) { return rh; } - else return null; - } - public void bindFc (String itfName, Object itfValue) { - if (itfName.equals("l")) { l = (Logger)itfValue; } - else if (itfName.equals("rh")) { rh = (RequestHandler)itfValue; } - } - public void unbindFc (String itfName) { - if (itfName.equals("l")) { l = null; } - else if (itfName.equals("rh")) { rh = null; } - } - // functional aspect - public void handleRequest (Request r) throws IOException { - r.in = new InputStreamReader(r.s.getInputStream()); - r.out = new PrintStream(r.s.getOutputStream()); - String rq = new LineNumberReader(r.in).readLine(); - l.log(rq); - if (rq.startsWith("GET ")) { - r.url = rq.substring(5, rq.indexOf(' ', 4)); - rh.handleRequest(r); - } - r.out.close(); - r.s.close(); - } -} diff --git a/examples/comanche/src/comanche/RequestDispatcher.java b/examples/comanche/src/comanche/RequestDispatcher.java deleted file mode 100644 index 2e851ce2519c1a703e07745f0ebb6e6e5e70a241..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/RequestDispatcher.java +++ /dev/null @@ -1,31 +0,0 @@ -package comanche; -import java.io.*; -import java.util.*; -import org.objectweb.fractal.api.control.BindingController; - -public class RequestDispatcher implements RequestHandler, BindingController { - private Map handlers = new TreeMap(); - // configuration aspect - public String[] listFc () { - return (String[])handlers.keySet().toArray(new String[handlers.size()]); - } - public Object lookupFc (String itfName) { - if (itfName.startsWith("h")) { return handlers.get(itfName); } - else return null; - } - public void bindFc (String itfName, Object itfValue) { - if (itfName.startsWith("h")) { handlers.put(itfName, itfValue); } - } - public void unbindFc (String itfName) { - if (itfName.startsWith("h")) { handlers.remove(itfName); } - } - // functional aspect - public void handleRequest (Request r) throws IOException { - Iterator i = handlers.values().iterator(); - while (i.hasNext()) { - try { - ((RequestHandler)i.next()).handleRequest(r); return; - } catch (IOException _) { } - } - } -} diff --git a/examples/comanche/src/comanche/RequestHandler.java b/examples/comanche/src/comanche/RequestHandler.java deleted file mode 100644 index 0e8d749b9ed86faa47a9ec2019f9dab2e9dddd1c..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/RequestHandler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public interface RequestHandler { - void handleRequest (Request r) throws java.io.IOException; -} diff --git a/examples/comanche/src/comanche/RequestReceiver.java b/examples/comanche/src/comanche/RequestReceiver.java deleted file mode 100644 index d5067d4eacfd6a4dc74e65862be7d9b90122e0e0..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/RequestReceiver.java +++ /dev/null @@ -1,41 +0,0 @@ -package comanche; -import java.io.*; -import java.net.*; -import org.objectweb.fractal.api.control.BindingController; - -public class RequestReceiver implements Runnable, BindingController { - private Scheduler s; - private RequestHandler rh; - // configuration aspect - public String[] listFc () { return new String[] { "s", "rh" }; } - public Object lookupFc (String itfName) { - if (itfName.equals("s")) { return s; } - else if (itfName.equals("rh")) { return rh; } - else return null; - } - public void bindFc (String itfName, Object itfValue) { - if (itfName.equals("s")) { s = (Scheduler)itfValue; } - else if (itfName.equals("rh")) { rh = (RequestHandler)itfValue; } - } - public void unbindFc (String itfName) { - if (itfName.equals("s")) { s = null; } - else if (itfName.equals("rh")) { rh = null; } - } - // functional aspect - public void run () { - try { - ServerSocket ss = new ServerSocket(8080); - System.out.println("Comanche HTTP Server ready on port 8080."); - while (true) { - final Socket socket = ss.accept(); - s.schedule(new Runnable () { - public void run () { - try { - rh.handleRequest(new Request(socket)); - } catch (IOException _) { } - } - }); - } - } catch (IOException e) { e.printStackTrace(); } - } -} diff --git a/examples/comanche/src/comanche/Scheduler.java b/examples/comanche/src/comanche/Scheduler.java deleted file mode 100644 index d3a047de430b0b568d9106c8411686b42ad349e4..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Scheduler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public interface Scheduler { - void schedule (Runnable task); -} diff --git a/examples/comanche/src/comanche/SequentialScheduler.java b/examples/comanche/src/comanche/SequentialScheduler.java deleted file mode 100644 index e49d07e3532e7b0f97b1e98f73a765b9a7a156d0..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/SequentialScheduler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public class SequentialScheduler implements Scheduler { - public void schedule (Runnable task) { task.run(); } -} diff --git a/examples/comanche/src/comanche/Server.java b/examples/comanche/src/comanche/Server.java deleted file mode 100644 index fbb5db157dd222ffa57eaf073979c40377d596db..0000000000000000000000000000000000000000 --- a/examples/comanche/src/comanche/Server.java +++ /dev/null @@ -1,20 +0,0 @@ -package comanche; - -public class Server { - public static void main (String[] args) { - RequestReceiver rr = new RequestReceiver(); - RequestAnalyzer ra = new RequestAnalyzer(); - RequestDispatcher rd = new RequestDispatcher(); - FileRequestHandler frh = new FileRequestHandler(); - ErrorRequestHandler erh = new ErrorRequestHandler(); - Scheduler s = new MultiThreadScheduler(); - Logger l = new BasicLogger(); - rr.bindFc("rh", ra); - rr.bindFc("s", s); - ra.bindFc("rh", rd); - ra.bindFc("l", l); - rd.bindFc("h0", frh); - rd.bindFc("h1", erh); - rr.run(); - } -} \ No newline at end of file diff --git a/fractal/README.txt b/fractal/README.txt deleted file mode 100644 index e2338b0f6f242af515583694eb101ee2ff749c44..0000000000000000000000000000000000000000 --- a/fractal/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -This directory is the base directory of the product. -It contains(*) the following items: - -- archive: ant files to build the jar(s) of the product, -- build.properties: properties to configure the build process, -- build.xml: main ant file to build the product, -- config: external libraries required only for building the product, -- doc: documentation of the product, -- etc: scripts to run the product, -- examples: examples of use of the product, -- externals: external libraires required for running the product, -- jdoc: ant files to build the javadoc documentation(s) of the product, -- sr': sources of the product, -- test: tests of the product, -- web: source of the web site of the product. - -(*) some items may not be present, depending on the product. diff --git a/fractal/archive/README.txt b/fractal/archive/README.txt deleted file mode 100644 index e0d72a77eeab2c75774e256e42b338274737fa5d..0000000000000000000000000000000000000000 --- a/fractal/archive/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory contains ant files to build the jars of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one jar file. - -- The name of the ant file must be the name of the jar it builds: - org-foo-bar.xml must build org-foo-bar.jar. - -- Among the elements which are included into a jar, you must specify - a manifest. It is adviced to store the manifest file in this directory. - The manifest file can be shared by several jars. The name of the manifest - file must be similar to the name of the jar file. - -- Only the default task is called on each ant file. - -- The jar file must be produced into the ${dist.lib} directory. - -Sample ant file: - - - - - - ... - - - - diff --git a/fractal/archive/fractal.mf b/fractal/archive/fractal.mf deleted file mode 100644 index 64850e0c5019dd1718c01ec39b1dc9c71f3d0235..0000000000000000000000000000000000000000 --- a/fractal/archive/fractal.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Specification-Title: "Fractal" -Specification-Version: "2.0" -Specification-Vendor: "France Telecom R&D, INRIA" diff --git a/fractal/archive/fractal.xml b/fractal/archive/fractal.xml deleted file mode 100644 index 0c717d9979f8d63d0b0755f13e0c9b234e7dba40..0000000000000000000000000000000000000000 --- a/fractal/archive/fractal.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractal/archive/naming.mf b/fractal/archive/naming.mf deleted file mode 100644 index 48de95f85f6ea3a6c57e00f542fb03afa9d428a8..0000000000000000000000000000000000000000 --- a/fractal/archive/naming.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Objectweb naming framework" -Implementation-Version: "1.0" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractal/archive/naming.xml b/fractal/archive/naming.xml deleted file mode 100644 index a0a9e9118bcd1a2c4c0fb64098e1c9506943027c..0000000000000000000000000000000000000000 --- a/fractal/archive/naming.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractal/build.config b/fractal/build.config deleted file mode 100644 index 3b639dd796249cd69bf2e1945523ecf0b96d9c81..0000000000000000000000000000000000000000 --- a/fractal/build.config +++ /dev/null @@ -1,4 +0,0 @@ -# Defines values for the 'build.properties' build properties -# This file is used to build the project in the case of bundled external jars - -objectweb.ant.tasks.path config/ow_util_ant_tasks.jar diff --git a/fractal/build.properties b/fractal/build.properties deleted file mode 100644 index acc20d3f2e4cfddfdc54e84bead3e093d4597cb7..0000000000000000000000000000000000000000 --- a/fractal/build.properties +++ /dev/null @@ -1,43 +0,0 @@ -############################################################################### -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################### - -# Some information about the product - -product.name fractal -product.version 2.0 - -############################################################################### -# BUILD -############################################################################### - -# Wich compiler do you want to use ? - -# build.compiler jikes - -# Build class path (classes needed to build the project) -# Class path for the ObjectWeb utility Ant tasks (OWANTTASK_1_1) -# See http://forge.objectweb.org/projects/monolog - -# objectweb.ant.tasks.path ow_util_ant_tasks.jar - -############################################################################### -# DOCUMENTATION -############################################################################### - -# URLs of external Javadocs - -fractal.url http://www.objectweb.org/fractal/current/doc/javadoc/fractal -jdk.url http://java.sun.com/j2se/1.3/docs/api diff --git a/fractal/build.xml b/fractal/build.xml deleted file mode 100644 index 54f744fcf204de0efb441edfde256f13951857bc..0000000000000000000000000000000000000000 --- a/fractal/build.xml +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractal/config/README.txt b/fractal/config/README.txt deleted file mode 100644 index 4978babb44fb4f93c7d819e50bedad09c7086b79..0000000000000000000000000000000000000000 --- a/fractal/config/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains the external libraries required for building the -product, but which are not necessary to use it. diff --git a/fractal/config/ow_util_ant_tasks.jar b/fractal/config/ow_util_ant_tasks.jar deleted file mode 100644 index 0c88b30e8609d170690d64f075e9b56600e01c5b..0000000000000000000000000000000000000000 Binary files a/fractal/config/ow_util_ant_tasks.jar and /dev/null differ diff --git a/fractal/doc/README.txt b/fractal/doc/README.txt deleted file mode 100644 index 84303fee616679f69995c94e1dd7d4198b338d64..0000000000000000000000000000000000000000 --- a/fractal/doc/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the documentation of the product. diff --git a/fractal/doc/javadoc/figures/type-system.fig b/fractal/doc/javadoc/figures/type-system.fig deleted file mode 100644 index f22b720ffd76cb60df75ebbd886534db21e22b15..0000000000000000000000000000000000000000 --- a/fractal/doc/javadoc/figures/type-system.fig +++ /dev/null @@ -1,138 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #bab7ba -6 2205 6750 6075 7110 -6 2205 6750 2385 7110 -2 1 0 3 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2250 6930 2340 6930 -2 1 0 3 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2250 6795 2250 7065 --6 -6 4725 6795 4815 7065 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4725 6930 4815 6930 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4725 6795 4725 7065 --6 -4 0 0 50 0 0 12 0.0000 4 120 1080 2430 6975 server interface\001 -4 0 0 50 0 0 12 0.0000 4 120 1020 4905 6975 client interface\001 --6 -6 990 3375 1755 3645 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 3420 1755 3600 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 3510 1710 3510 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 3420 1305 3600 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 3510 1350 3510 -4 0 0 50 0 0 12 0.0000 4 120 150 990 3600 I1\001 -4 1 0 50 0 0 12 0.0000 4 120 165 1530 3555 s1\001 --6 -2 2 0 1 0 32 53 0 20 0.000 0 0 -1 0 0 5 - 1350 2430 6660 2430 6660 6390 1350 6390 1350 2430 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 1710 2790 6300 2790 6300 6030 1710 6030 1710 2790 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4005 2385 4005 2430 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 2385 3915 2385 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 3420 6705 3600 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 3510 6660 3510 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 3420 6255 3600 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 3510 6300 3510 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 4905 6255 5085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 4995 6300 4995 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 4905 6705 5085 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 4995 6660 4995 -2 1 1 1 0 7 50 0 -1 2.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1800 4995 2250 4995 -2 1 1 1 0 7 50 0 -1 2.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1800 5265 2250 5265 -2 1 1 1 0 7 50 0 -1 2.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6750 4995 7200 4995 -2 1 1 1 0 7 50 0 -1 2.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6750 3510 7200 3510 -2 1 1 1 0 7 50 0 -1 2.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1800 3510 2250 3510 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 5175 6255 5355 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 5265 6300 5265 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 5175 6705 5355 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 5265 6660 5265 -2 1 1 1 0 7 50 0 -1 2.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6750 5265 7200 5265 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 5445 6255 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 5535 6300 5535 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 5445 6705 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 5535 6660 5535 -2 1 1 1 0 7 50 0 -1 2.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6750 5535 7200 5535 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 4905 1305 5085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 4995 1350 4995 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 4905 1755 5085 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 4995 1710 4995 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 5175 1305 5355 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 5265 1350 5265 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 5175 1755 5355 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 5265 1710 5265 -4 1 0 50 0 0 12 0.0000 4 120 900 4005 2655 s3-controller\001 -4 1 0 50 0 0 12 0.0000 4 120 165 6480 3555 c1\001 -4 1 0 50 0 0 12 0.0000 4 120 240 6480 5040 c2a\001 -4 0 0 50 0 0 12 0.0000 4 15 135 2295 5040 ...\001 -4 0 0 50 0 0 12 0.0000 4 15 135 2295 5310 ...\001 -4 0 0 50 0 0 12 0.0000 4 15 135 7245 5040 ...\001 -4 0 0 50 0 0 12 0.0000 4 15 135 2295 3555 ...\001 -4 0 0 50 0 0 12 0.0000 4 15 135 7245 3555 ...\001 -4 1 0 50 0 0 12 0.0000 4 120 255 6480 5310 c2b\001 -4 0 0 50 0 0 12 0.0000 4 15 135 7245 5310 ...\001 -4 1 0 50 0 0 12 0.0000 4 120 240 6480 5580 c2c\001 -4 0 0 50 0 0 12 0.0000 4 15 135 7245 5580 ...\001 -4 1 0 50 0 0 12 0.0000 4 120 150 4005 2295 I3\001 -4 0 0 50 0 0 12 0.0000 4 120 165 5940 3600 J1\001 -4 0 0 50 0 0 12 0.0000 4 120 165 5940 5085 J2\001 -4 0 0 50 0 0 12 0.0000 4 120 165 5940 5355 J2\001 -4 0 0 50 0 0 12 0.0000 4 120 165 5940 5625 J2\001 -4 1 0 50 0 0 12 0.0000 4 165 1440 4005 4500 component's content\001 -4 1 0 50 0 0 12 0.0000 4 165 1605 4005 6300 component's controller\001 -4 1 0 50 0 0 12 0.0000 4 120 240 1530 5040 s2a\001 -4 1 0 50 0 0 12 0.0000 4 120 255 1530 5310 s2b\001 -4 0 0 50 0 0 12 0.0000 4 120 150 990 5355 I2\001 -4 0 0 50 0 0 12 0.0000 4 120 150 990 5085 I2\001 diff --git a/fractal/doc/javadoc/figures/type-system.gif b/fractal/doc/javadoc/figures/type-system.gif deleted file mode 100644 index ef186ec4d10697be52b2336b5fca38cbc3e24c04..0000000000000000000000000000000000000000 Binary files a/fractal/doc/javadoc/figures/type-system.gif and /dev/null differ diff --git a/fractal/jdoc/README.txt b/fractal/jdoc/README.txt deleted file mode 100644 index a78cb67fa8d1679fe5fd3fe8efc3aab86e5b6db8..0000000000000000000000000000000000000000 --- a/fractal/jdoc/README.txt +++ /dev/null @@ -1,39 +0,0 @@ -This directory contains ant files to build the javadocs of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one javadoc. - -- As there may exist several javadocs, all javadocs must be produced - in a sub dir of ${out.dist.jdoc}. For example the user javadoc could be - produced into the ${out.dist.jdoc}/user directory - -- The name of the ant file must be the name of the destination directory of the - javadoc it builds. - -- Only the default task is called on an xml file. - -Sample ant file: - - - - - - - - - - - - - - - - - - ... - - - - diff --git a/fractal/jdoc/fractal-list/package-list b/fractal/jdoc/fractal-list/package-list deleted file mode 100644 index 0c7ce27ea081eefb65b09e2cd0f5866cd084660f..0000000000000000000000000000000000000000 --- a/fractal/jdoc/fractal-list/package-list +++ /dev/null @@ -1,4 +0,0 @@ -org.objectweb.fractal.api -org.objectweb.fractal.api.control -org.objectweb.fractal.api.factory -org.objectweb.fractal.api.type diff --git a/fractal/jdoc/fractal-util.xml b/fractal/jdoc/fractal-util.xml deleted file mode 100644 index 766c1727b8d8d01e94c94b9bb1085710c31ce448..0000000000000000000000000000000000000000 --- a/fractal/jdoc/fractal-util.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractal/jdoc/fractal.xml b/fractal/jdoc/fractal.xml deleted file mode 100644 index e79df9ae9c1d28ae69a2a7763232743bbb2e175e..0000000000000000000000000000000000000000 --- a/fractal/jdoc/fractal.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractal/jdoc/jdk-list/package-list b/fractal/jdoc/jdk-list/package-list deleted file mode 100644 index 7f582f053dd0c03fe4df1013b086217010da00f1..0000000000000000000000000000000000000000 --- a/fractal/jdoc/jdk-list/package-list +++ /dev/null @@ -1,76 +0,0 @@ -java.applet -java.awt -java.awt.color -java.awt.datatransfer -java.awt.dnd -java.awt.event -java.awt.font -java.awt.geom -java.awt.im -java.awt.im.spi -java.awt.image -java.awt.image.renderable -java.awt.print -java.beans -java.beans.beancontext -java.io -java.lang -java.lang.ref -java.lang.reflect -java.math -java.net -java.rmi -java.rmi.activation -java.rmi.dgc -java.rmi.registry -java.rmi.server -java.security -java.security.acl -java.security.cert -java.security.interfaces -java.security.spec -java.sql -java.text -java.util -java.util.jar -java.util.zip -javax.accessibility -javax.naming -javax.naming.directory -javax.naming.event -javax.naming.ldap -javax.naming.spi -javax.rmi -javax.rmi.CORBA -javax.sound.midi -javax.sound.midi.spi -javax.sound.sampled -javax.sound.sampled.spi -javax.swing -javax.swing.border -javax.swing.colorchooser -javax.swing.event -javax.swing.filechooser -javax.swing.plaf -javax.swing.plaf.basic -javax.swing.plaf.metal -javax.swing.plaf.multi -javax.swing.table -javax.swing.text -javax.swing.text.html -javax.swing.text.html.parser -javax.swing.text.rtf -javax.swing.tree -javax.swing.undo -javax.transaction -org.omg.CORBA -org.omg.CORBA_2_3 -org.omg.CORBA_2_3.portable -org.omg.CORBA.DynAnyPackage -org.omg.CORBA.ORBPackage -org.omg.CORBA.portable -org.omg.CORBA.TypeCodePackage -org.omg.CosNaming -org.omg.CosNaming.NamingContextPackage -org.omg.SendingContext -org.omg.stub.java.rmi diff --git a/fractal/jdoc/naming.xml b/fractal/jdoc/naming.xml deleted file mode 100644 index 42c3b66b7d5053a291916a2a3f018549ad83c8fe..0000000000000000000000000000000000000000 --- a/fractal/jdoc/naming.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractal/src/org/objectweb/fractal/api/Component.java b/fractal/src/org/objectweb/fractal/api/Component.java deleted file mode 100644 index 269de3b0faa352579e8f025fcd2413c107dd7269..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/Component.java +++ /dev/null @@ -1,68 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api; - -/** - * A component interface to introspect the external interfaces of the component - * to which it belongs. - */ - -public interface Component { - - /** - * Returns the type of the component to which this interface belongs. The type - * system is not specified here, in order to allow many type systems to be - * used. The basic type system specified in the {@link - * org.objectweb.fractal.api.type} package should be sufficient in most cases, - * but another one can be used if necessary. - * - * @return the type of the component to which this interface belongs. - */ - - Type getFcType (); - - /** - * Returns the external interfaces of the component to which this interface - * belongs. - * - * @return the external interfaces of the component to which this interface - * belongs, including this interface. - */ - - Object[] getFcInterfaces (); - - /** - * Returns an external interface of the component to which this interface - * belongs. - * - * @param interfaceName the name of the external interface that must be - * returned. - * @return the external interface of the component to which this interface - * belongs, whose name is equal to the given name. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - Object getFcInterface (String interfaceName) throws NoSuchInterfaceException; -} diff --git a/fractal/src/org/objectweb/fractal/api/Fractal.java b/fractal/src/org/objectweb/fractal/api/Fractal.java deleted file mode 100644 index 3eb9d116829bc1752bd0cf40738ee1f9db12ca8a..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/Fractal.java +++ /dev/null @@ -1,84 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api; - -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.factory.Factory; - -/** - * Provides a static method to get a bootstrap component. This class is only - * required for Java implementations of the Fractal model (level 3.2 at least). - * In other languages the "well known name" used to get the bootstrap component - * may take a different form than a static method. - */ - -public class Fractal { - - /** - * Private constructor (uninstantiable class). - */ - - private Fractal () { - } - - /** - * Returns a bootstrap component to create other components. This method - * creates an instance of the class whose name is specified in the - * fractal.provider system property, which much implement the {@link - * Factory} interface, and returns the component instantiated by this factory. - * - * @return a bootstrap component to create other components. This component - * provides at least two interfaces named type-factory and - * generic-factory to create component types and components. - * The type of the generic-factory interface is {@link - * org.objectweb.fractal.api.factory.GenericFactory}, or a - * sub type of this type, but the type of the type-factory - * interface is not necessarily {@link - * org.objectweb.fractal.api.type.TypeFactory} (or a sub type of this - * type). - * @throws InstantiationException if the bootstrap component cannot be - * created. - */ - - public static Component getBootstrapComponent () - throws InstantiationException - { - String bootTmplClassName = System.getProperty("fractal.provider"); - if (bootTmplClassName == null) { - throw new InstantiationException( - "The fractal.provider system property is not defined"); - } - Factory bootTmpl; - try { - Class bootTmplClass = Class.forName(bootTmplClassName); - bootTmpl = (Factory)bootTmplClass.newInstance(); - } catch (Exception e) { - throw new InstantiationException( - "Cannot find or instantiate the '" + bootTmplClassName + - "' class specified in the fractal.provider system property"); - } - return bootTmpl.newFcInstance(); - } -} diff --git a/fractal/src/org/objectweb/fractal/api/Interface.java b/fractal/src/org/objectweb/fractal/api/Interface.java deleted file mode 100644 index 1133f9576039913e5a4646107ef341a209ebb0bb..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/Interface.java +++ /dev/null @@ -1,77 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api; - -/** - * An interface to introspect component interfaces. If a Fractal component - * supports interface introspection, then the interfaces returned by the - * {@link Component#getFcInterfaces getFcInterfaces} and {@link - * Component#getFcInterfaces getFcInterfaces} methods can be cast into this - * Java interface, in order to get their name or their type. - */ - -public interface Interface { - - /** - * Returns the component to which this interface belongs. - * - * @return the {@link Component} interface of the component to which this - * interface belongs. - */ - - Component getFcItfOwner (); - - /** - * Returns the name of this interface inside its component. This name is - * "unique" inside the component: more precisely, all the external - * interfaces of the component have distinct names, as well as all its - * internal interfaces. However an internal interface can have the same name - * as an external interface. Of course, two interfaces in two distinct - * components can also have the same name. - * - * @return the name of this interface inside its component. - */ - - String getFcItfName (); - - /** - * Returns the type of this interface. The type system is not specified here, - * in order to allow many type systems to be used. The basic type system - * specified in the {@link org.objectweb.fractal.api.type} package should be - * sufficient in most cases, but another one can be used if necessary. - * - * @return the type of this interface. - */ - - Type getFcItfType (); - - /** - * Returns true if this interface is an internal interface. - * - * @return true if this interface is an internal interface. - */ - - boolean isFcInternalItf (); -} diff --git a/fractal/src/org/objectweb/fractal/api/NoSuchInterfaceException.java b/fractal/src/org/objectweb/fractal/api/NoSuchInterfaceException.java deleted file mode 100644 index 87a2691436dd0219f2d5de65a1352276cb9f888f..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/NoSuchInterfaceException.java +++ /dev/null @@ -1,44 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api; - -/** - * Thrown when trying to use or inspect an interface or interface type that does - * not exist. - */ - -public class NoSuchInterfaceException extends Exception { - - /** - * Constructs a {@link NoSuchInterfaceException} with the specified detail - * message. - * - * @param itfName the name of the interface that was not found. - */ - - public NoSuchInterfaceException (String itfName) { - super(itfName); - } -} diff --git a/fractal/src/org/objectweb/fractal/api/Type.java b/fractal/src/org/objectweb/fractal/api/Type.java deleted file mode 100644 index ac04eb88b34ad8b67f59e75865405e196ac2ae41..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/Type.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api; - -/** - * Specifies the minimal interface that all type systems must implement. This - * interface defines only one method to test if a type is a sub-type of another - * one. - */ - -public interface Type { - - /** - * Returns true if the given type is a sub-type of this type. The - * relation defined by this method should be: - *
    - *
  • reflexive: if t is {@link Object#equals equals} to u - * then t.isFcSubTypeOf(u) should return true
  • - * - *
  • transitive: if t.isFcSubTypeOf(u) and - * u.isFcSubTypeOf(v) are true then - * t.isFcSubTypeOf(v) must be true
  • - *
- * - * - * @param type the type to be compared to this type. - * @return true if the given type is a sub-type of this type. - */ - - boolean isFcSubTypeOf (Type type); -} diff --git a/fractal/src/org/objectweb/fractal/api/control/AttributeController.java b/fractal/src/org/objectweb/fractal/api/control/AttributeController.java deleted file mode 100644 index 71f88fbec3729cb3316dfc47807022999e490e65..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/AttributeController.java +++ /dev/null @@ -1,44 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -/** - * A component interface to control the attributes of the component to which it - * belongs. More precisely this interface denotes the component interfaces that - * can control component attributes: a component interface whose Java type - * is a Java interface that extends this Java interface is indeed considered as - * an interface to control the attributes of the component to which it belongs. - * Such interfaces must only contain getter and setter methods, such - * as int getX (); void setX (int x), double getSize (); void - * setSize (double x), and so on. These methods should only be used to - * configure "primitive" values such as integers or strings: they must not be - * used to configure bindings (this is the role of the {@link BindingController} - * interface). For example, they can be used to configure the size of a cache - * component, the load factor of a hashtable component, the label or color of a - * button component... - */ - -public interface AttributeController { -} diff --git a/fractal/src/org/objectweb/fractal/api/control/BindingController.java b/fractal/src/org/objectweb/fractal/api/control/BindingController.java deleted file mode 100644 index ee1d9362fc8caec762eee1c4d1e4348b1476c805..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/BindingController.java +++ /dev/null @@ -1,104 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -import org.objectweb.fractal.api.NoSuchInterfaceException; - -/** - * A component interface to control the bindings of the component to which it - * belongs. It is implicitely assumed here that the component's type system - * makes a distinction between "client" and "server" interfaces. - */ - -public interface BindingController { - - /** - * Returns the names of the client interfaces of the component to which this - * interface belongs. - * - * @return the names of the client interfaces of the component to which this - * interface belongs. - */ - - String[] listFc (); - - /** - * Returns the interface to which the given client interface is bound. More - * precisely, returns the server interface to which the client interface whose - * name is given is bound. This server interface is necessarily in the same - * address space as the client interface (see {@link #bindFc bindFc}). - * - * @param clientItfName the name of a client interface of the component to - * which this interface belongs. - * @return the server interface to which the given interface is bound, or - * null if it is not bound. - * @throws NoSuchInterfaceException if the component to which this interface - * belongs does not have a client interface whose name is equal to the - * given name. - */ - - Object lookupFc (String clientItfName) throws NoSuchInterfaceException; - - /** - * Binds the client interface whose name is given to a server interface. More - * precisely, binds the client interface of the component to which this - * interface belongs, and whose name is equal to the given name, to the given - * server interface. The given server interface must be in the same address - * space as the client interface. - * - * @param clientItfName the name of a client interface of the component to - * which this interface belongs. - * @param serverItf a server interface. - * @throws NoSuchInterfaceException if there is no such client interface. - * @throws IllegalBindingException if the binding cannot be created. - * @throws IllegalLifeCycleException if this component has a {@link - * LifeCycleController} interface, but it is not in an appropriate state - * to perform this operation. - */ - - void bindFc (String clientItfName, Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * Unbinds the given client interface. More precisely, unbinds the client - * interface of the component to which this interface belongs, and whose name - * is equal to the given name. - * - * @param clientItfName the name of a client interface of the component to - * which this interface belongs. - * @throws NoSuchInterfaceException if there is no such client interface. - * @throws IllegalBindingException if the binding cannot be removed. - * @throws IllegalLifeCycleException if this component has a {@link - * LifeCycleController} interface, but it is not in an appropriate state - * to perform this operation. - */ - - void unbindFc (String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/fractal/src/org/objectweb/fractal/api/control/ContentController.java b/fractal/src/org/objectweb/fractal/api/control/ContentController.java deleted file mode 100644 index fa0ef6f4db57c3f1be02a3f6669f380226069649..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/ContentController.java +++ /dev/null @@ -1,113 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; - -/** - * A component interface to control the content of the component to which it - * belongs. This content is supposed to be made of an unordered, unstructured - * set of components. - */ - -public interface ContentController { - - /** - * Returns the internal interfaces of the component to which this interface - * belongs. - * - * @return the internal interfaces of the component to which this interface - * belongs. - */ - - Object[] getFcInternalInterfaces (); - - /** - * Returns an internal interface of the component to which this interface - * belongs. - * - * @param interfaceName the name of the internal interface that must be - * returned. - * @return the internal interface of the component to which this interface - * belongs, whose name is equal to the given name. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - Object getFcInternalInterface (String interfaceName) - throws NoSuchInterfaceException; - - /** - * Returns the sub-components of this component. - * - * @return the {@link Component} interfaces of the sub-components of the - * component to which this interface belongs. - */ - - Component[] getFcSubComponents (); - - /** - * Adds a sub-component to this component. More precisely adds the component - * whose reference is given as a sub-component of the component to which this - * interface belongs. If C is the sub-component set returned by {@link - * #getFcSubComponents getFcSubComponents} just before a call to this - * method, and C' is the sub-component set just after this call, then - * subComponent is guaranteed to be in C', but C' is - * not guaranted to be the union of C and {subComponent}, - * nor to contain all the elements of C. - * - * @param subComponent the component to be added inside this component. - * @throws IllegalContentException if the given component cannot be added - * inside this component. - * @throws IllegalLifeCycleException if this component has a {@link - * LifeCycleController} interface, but it is not in an appropriate state - * to perform this operation. - */ - - void addFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; - - /** - * Removes a sub-component from this component. More precisely removes the - * sub-component whose reference is given from the component to which this - * interface belongs. If C is the sub-component set returned by {@link - * #getFcSubComponents getFcSubComponents} just before a call to this - * method, and C' is the sub-component set just after this call, then - * subComponent is guaranteed not to be in C', but C' - * is not guaranted to be the difference of C and - * {subComponent}, nor to contain all the elements of C distinct - * from subComponent. - * - * @param subComponent the component to be removed from this component. - * @throws IllegalContentException if the given component cannot be removed - * from this component. - * @throws IllegalLifeCycleException if this component has a {@link - * LifeCycleController} interface, but it is not in an appropriate state - * to perform this operation. - */ - - void removeFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; -} diff --git a/fractal/src/org/objectweb/fractal/api/control/IllegalBindingException.java b/fractal/src/org/objectweb/fractal/api/control/IllegalBindingException.java deleted file mode 100644 index a9ea171f1386efd7f19f30aa5cc8d57221af06a3..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/IllegalBindingException.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -/** - * Thrown when an error related to bindings occurs. - */ - -public class IllegalBindingException extends Exception { - - /** - * Constructs an {@link IllegalBindingException} with the specified detail - * message. - * - * @param msg the detail message. - */ - - public IllegalBindingException (final String msg) { - super(msg); - } -} diff --git a/fractal/src/org/objectweb/fractal/api/control/IllegalContentException.java b/fractal/src/org/objectweb/fractal/api/control/IllegalContentException.java deleted file mode 100644 index 578536a1d77999273b43495622b4551ff6d6753f..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/IllegalContentException.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -/** - * Thrown when an error related to the management of sub components occurs. - */ - -public class IllegalContentException extends Exception { - - /** - * Constructs an {@link IllegalContentException} with the specified detail - * message. - * - * @param msg the detail message. - */ - - public IllegalContentException (final String msg) { - super(msg); - } -} diff --git a/fractal/src/org/objectweb/fractal/api/control/IllegalLifeCycleException.java b/fractal/src/org/objectweb/fractal/api/control/IllegalLifeCycleException.java deleted file mode 100644 index 59bdad2ade39ea098fa3cc3023a48d52040db056..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/IllegalLifeCycleException.java +++ /dev/null @@ -1,44 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -/** - * Thrown when a component is not in a valid life cycle state to use some - * method. - */ - -public class IllegalLifeCycleException extends Exception { - - /** - * Constructs an {@link IllegalLifeCycleException} with the specified detail - * message. - * - * @param msg the detail message. - */ - - public IllegalLifeCycleException (final String msg) { - super(msg); - } -} diff --git a/fractal/src/org/objectweb/fractal/api/control/LifeCycleController.java b/fractal/src/org/objectweb/fractal/api/control/LifeCycleController.java deleted file mode 100644 index 23e02ce8d32b9a3efa8e15b90a660d93e5a09f89..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/LifeCycleController.java +++ /dev/null @@ -1,95 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -/** - * A component interface to control the lifecycle of the component to which it - * belongs. The lifecycle of a component is supposed to be an automaton, whose - * states represent execution states of the component. This interface - * corresponds to an automaton with two states called {@link #STARTED - * STARTED} and {@link #STOPPED STOPPED}, where all the 4 four - * possible transitions are allowed. It is however possible to define completely - * different lifecycle controller Java interfaces to use completely different - * automatons, or to define sub interfaces of this interface to define - * automatons based on this one, but with more states and more transitions.

- * - * Note: the sub-interfaces of this interface should use the conventions - * used in this interface, which are the following. The interface contains one - * method per state in the lifecycle automaton. Each of these methods changes - * the current state to the state corresponding to its name, if there is a - * transition from the current state to this state. The interface also contains - * one field per state. The names and values of these fields correspond to the - * names of the methods. - */ - -public interface LifeCycleController { - - /** - * The state of a component just after {@link #startFc startFc} has been - * executed. - */ - - String STARTED = "STARTED"; - - /** - * The state of a component just after {@link #stopFc stopFc} has been - * executed. This state is also the initial state of a component, i.e., the - * state of a component just after it has been created. - */ - - String STOPPED = "STOPPED"; - - /** - * Returns the execution state of the component to which this interface - * belongs. - * - * @return the execution state of the component to which this interface - * belongs. - */ - - String getFcState (); - - /** - * Starts the component to which this interface belongs. - * - * @throws IllegalLifeCycleException if the transition from the current state - * to the {@link #STARTED STARTED} state is not a valid transition of the - * life cycle automaton. - */ - - void startFc () throws IllegalLifeCycleException; - - /** - * Stops the component to which this interface belongs. The result of a method - * call on a stopped component is undefined, except on its control interfaces - * (these calls are executed normally). - * - * @throws IllegalLifeCycleException if the transition from the current state - * to the {@link #STOPPED STOPPED} state is not a valid transition of the - * life cycle automaton. - */ - - void stopFc () throws IllegalLifeCycleException; -} diff --git a/fractal/src/org/objectweb/fractal/api/control/NameController.java b/fractal/src/org/objectweb/fractal/api/control/NameController.java deleted file mode 100644 index c020792ff54274bf5d160e082e7fbc53cecc153a..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/NameController.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -/** - * A component interface to control the name of the component to which it - * belongs. - */ - -public interface NameController { - - /** - * Returns the name of the component to which this interface belongs. - * - * @return the name of the component to which this interface belongs. - * @see #setFcName - */ - - String getFcName (); - - /** - * Sets the name of the component to which this interface belongs. - * - * @param name a component name. - * @see #getFcName - */ - - void setFcName (String name); -} diff --git a/fractal/src/org/objectweb/fractal/api/control/SuperController.java b/fractal/src/org/objectweb/fractal/api/control/SuperController.java deleted file mode 100644 index 36aa23d5ad975acc16e34c1cf75274e9f8ed6337..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/SuperController.java +++ /dev/null @@ -1,45 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.control; - -import org.objectweb.fractal.api.Component; - -/** - * A component interface to control the super components of the component to - * which it belongs. - */ - -public interface SuperController { - - /** - * Returns the components that contain the component to which this interface - * belongs. - * - * @return the {@link Component} interfaces of the components that contain the - * component to which this interface belongs. - */ - - Component[] getFcSuperComponents (); -} diff --git a/fractal/src/org/objectweb/fractal/api/control/package.html b/fractal/src/org/objectweb/fractal/api/control/package.html deleted file mode 100644 index 5bf28038cf69cd07dd45252d706011c24e7c4435..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/control/package.html +++ /dev/null @@ -1,35 +0,0 @@ - - - -Specifies some basic component interfaces to control components. These control -interfaces can be provided by components that are able to control the -corresponding "aspects". For example, a component which can start and stop -itself can provide the {@link org.objectweb.fractal.api.control.LifeCycleController -LifeCycleController} interface, a component that can control its bindings can -provide the {@link org.objectweb.fractal.api.control.BindingController -BindingController} interface, and so on. -@since Fractal 0.8.0 - - diff --git a/fractal/src/org/objectweb/fractal/api/factory/Factory.java b/fractal/src/org/objectweb/fractal/api/factory/Factory.java deleted file mode 100644 index 6060f7d8eeacb4911f49c008dca6f55fcdf8e7d0..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/factory/Factory.java +++ /dev/null @@ -1,77 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Type; - -/** - * A component interface to create components of the same type. - */ - -public interface Factory { - - /** - * Returns the functional type of the components instantiated by this factory. - * - * @return the functional type of the components instantiated by this factory. - */ - - Type getFcInstanceType (); - - /** - * Returns a description of the controller part of the components instantiated - * by this factory. - * - * @return a description of the controller part of the components instantiated - * by this factory. This description is implementation specific. If it - * is null then a "default" controller part will be used. - */ - - Object getFcControllerDesc (); - - /** - * Returns a description of the content part of the components instantiated - * by this factory. - * - * @return a description of the content part of the components instantiated by - * this factory. This description is implementation specific. It may be - * null to create component with an empty initial content. It - * may also be, in Java, the fully qualified name of a Java class, to - * creat primitive components. - */ - - Object getFcContentDesc (); - - /** - * Instantiates a component from this factory. - * - * @return the {@link Component} interface of the component instantiated from - * this factory. - * @throws InstantiationException if the component cannot be created. - */ - - Component newFcInstance () throws InstantiationException; -} diff --git a/fractal/src/org/objectweb/fractal/api/factory/GenericFactory.java b/fractal/src/org/objectweb/fractal/api/factory/GenericFactory.java deleted file mode 100644 index b2ae7352ea9c60c71e20eb7dee9ce93b6fdb029a..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/factory/GenericFactory.java +++ /dev/null @@ -1,54 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Type; - -/** - * A component interface to create arbitrary components. - */ - -public interface GenericFactory { - - /** - * Creates a component. - * - * @param type an arbitrary component type. - * @param controllerDesc a description of the controller part of the - * component to be created. This description is implementation specific. - * If it is null then a "default" controller part will be used. - * @param contentDesc a description of the content part of the - * component to be created. This description is implementation specific. - * It may be null to create component with an empty initial - * content. It may also be, in Java, the fully qualified name of a Java - * class, to create primitive components. - * @return the {@link Component} interface of the created component. - * @throws InstantiationException if the component cannot be created. - */ - - Component newFcInstance (Type type, Object controllerDesc, Object contentDesc) - throws InstantiationException; -} diff --git a/fractal/src/org/objectweb/fractal/api/factory/InstantiationException.java b/fractal/src/org/objectweb/fractal/api/factory/InstantiationException.java deleted file mode 100644 index 139aed69959200937091124c6ef3a87236e334a9..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/factory/InstantiationException.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.factory; - -/** - * Thrown when a component cannot be instantiated. - */ - -public class InstantiationException extends Exception { - - /** - * Constructs an {@link InstantiationException} with the specified detail - * message. - * - * @param msg the detail message. - */ - - public InstantiationException (final String msg) { - super(msg); - } -} diff --git a/fractal/src/org/objectweb/fractal/api/factory/package.html b/fractal/src/org/objectweb/fractal/api/factory/package.html deleted file mode 100644 index f0a4c0a304b6faaa2da704891b55bf59a53924ef..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/factory/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -Specifies some basic component interfaces to instantiate components. -@since Fractal 0.8.0 - - diff --git a/fractal/src/org/objectweb/fractal/api/overview.html b/fractal/src/org/objectweb/fractal/api/overview.html deleted file mode 100644 index f232ef635dccbd2b61b9849a68da23f2a5058cc9..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/overview.html +++ /dev/null @@ -1,31 +0,0 @@ - - - -DO NOT REMOVE THIS LINE (will be automatically removed). - -See the Fractal Web Site for more -general documentation about Fractal. - - \ No newline at end of file diff --git a/fractal/src/org/objectweb/fractal/api/package.html b/fractal/src/org/objectweb/fractal/api/package.html deleted file mode 100644 index dd65d8e00da0f85d9dd2bcbdc88ce7c1d759becf..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -Specifies the component and component interface concepts. -@since Fractal 0.8.0 - - diff --git a/fractal/src/org/objectweb/fractal/api/type/ComponentType.java b/fractal/src/org/objectweb/fractal/api/type/ComponentType.java deleted file mode 100644 index ec427dd1ab370525a64a4ab5f0d88e1893dcfd5d..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/type/ComponentType.java +++ /dev/null @@ -1,64 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.type; - -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.NoSuchInterfaceException; - -/** - * A component type. A component type is just a collection of component - * interface types, which describes the interfaces that components of this type - * must or may have at runtime. - */ - -public interface ComponentType extends Type { - - /** - * Returns the types of the interfaces of components of this type. - * - * @return the types of the interfaces that components of this type must or - * may have at runtime. - */ - - InterfaceType[] getFcInterfaceTypes (); - - /** - * Returns an interface type of this component type from its name. This method - * is not strictly necessary, as it can be implemented by using the {@link - * #getFcInterfaceTypes getFcInterfaceTypes} method. But it is convenient and - * can be implemented more efficiently than with the previous method. This is - * why it is specified here. - * - * @param name the name of one of the interface types returned by {@link - * #getFcInterfaceTypes getFcInterfaceTypes} (see {@link - * InterfaceType#getFcItfName getFcItfName}). - * @return the interface type of this component type whose name is equal to - * the given name (see {@link InterfaceType#getFcItfName getFcItfName}). - * @throws NoSuchInterfaceException if there is no such interface type. - */ - - InterfaceType getFcInterfaceType (String name) - throws NoSuchInterfaceException; -} diff --git a/fractal/src/org/objectweb/fractal/api/type/InterfaceType.java b/fractal/src/org/objectweb/fractal/api/type/InterfaceType.java deleted file mode 100644 index 01e22186ae945a59f55eb13556cc047a0cdc6813..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/type/InterfaceType.java +++ /dev/null @@ -1,98 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.type; - -import org.objectweb.fractal.api.Type; - -/** - * A component interface type. Such a type is made of a name, which is the name - * of the interface described by this type inside its component (see {@link - * org.objectweb.fractal.api.Interface#getFcItfName getFcItfName}), a list of - * method signatures, which describes the methods provided or required by this - * interface, and various flags that indicates if this interface is provided or - * required, mandatory or not... - */ - -public interface InterfaceType extends Type { - - /** - * Returns the name of component interfaces of this type. More precisely, - * because some interfaces can be created dynamically (see {@link - * #isFcCollectionItf isFcCollectionItf}), this name is in fact a - * prefix of the real names of interfaces of this type. - * - * @return the name of component interfaces of this type inside their - * components (see {@link - * org.objectweb.fractal.api.Interface#getFcItfName getFcItfName}). - */ - - String getFcItfName (); - - /** - * Returns the signatures of the methods of interfaces of this type. In Java - * this method returns the fully qualified name of a Java interface - * corresponding to these method signatures. - * - * @return the signatures of the methods of interfaces of this type. - */ - - String getFcItfSignature (); - - /** - * Returns true if component interfaces of this type are client - * interfaces. - * - * @return true if component interfaces of this type are client - * interfaces, i.e., interfaces that are required, or false if - * they are server interfaces, i.e., interfaces that are provided. - */ - - boolean isFcClientItf (); - - /** - * Returns true if component interfaces of this type are optional. A - * mandatory interface is guaranteed to be "available" when the component - * is started. For a client interface, this means that the interface is bound, - * and that it is bound to a mandatory interface. An optional interface may - * not be available when the component is started (for a client interface, it - * means that the interface may not be bound). - * - * @return true if component interfaces of this type are optional. - */ - - boolean isFcOptionalItf (); - - /** - * Indicates how many interfaces of this type a component may have. A - * singleton interface type means that a component must have exactly one - * interface of this type. A collection interface type means that a component - * may have an arbitrary number of interfaces of this type (whose names must - * all begin with the name specified in this interface type). - * - * @return false if this type is a singleton interface type. - */ - - boolean isFcCollectionItf (); -} diff --git a/fractal/src/org/objectweb/fractal/api/type/TypeFactory.java b/fractal/src/org/objectweb/fractal/api/type/TypeFactory.java deleted file mode 100644 index 40b0aef22eb23f29beb1b7fdc70df49673e5401f..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/type/TypeFactory.java +++ /dev/null @@ -1,115 +0,0 @@ -/*** - * Fractal API - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton, Thierry Coupaye, Pascal Dechamboux, Romain Lenglet, - * Philippe Merle, Jean-Bernard Stefani. - */ - -package org.objectweb.fractal.api.type; - -import org.objectweb.fractal.api.factory.InstantiationException; - -/** - * A component interface to create component and interface type objects. - */ - -public interface TypeFactory { - - /** - * The isClient value to be used in {@link - * #createFcItfType createFcItfType} to create a server interface type. - */ - - boolean SERVER = false; - - /** - * The isClient value to be used in {@link - * #createFcItfType createFcItfType} to create a client interface type. - */ - - boolean CLIENT = true; - - /** - * The isOptional value to be used in {@link - * #createFcItfType createFcItfType} to create a mandatory interface type. - */ - - boolean MANDATORY = false; - - /** - * The isOptional value to be used in {@link - * #createFcItfType createFcItfType} to create an optional interface type. - */ - - boolean OPTIONAL = true; - - /** - * The isCollection value to be used in {@link - * #createFcItfType createFcItfType} to create a singleton interface type. - */ - - boolean SINGLE = false; - - /** - * The isCollection value to be used in {@link - * #createFcItfType createFcItfType} to create a collection interface type. - */ - - boolean COLLECTION = true; - - /** - * Creates an interface type. - * - * @param name the name of interfaces of this type (see {@link - * InterfaceType#getFcItfName getFcItfName}). - * @param signature signatures of the methods of interfaces of this type. In - * Java this "signature" is the fully qualified name of a Java interface - * corresponding to these method signatures. - * @param isClient true if component interfaces of this type are - * client interfaces. - * @param isOptional true if component interfaces of this type are - * optional interfaces. - * @param isCollection true if a component may have several - * interfaces of this type. - * @return an interface type initialized with the given values. - * @throws InstantiationException if the interface type cannot be created. - */ - - InterfaceType createFcItfType ( - String name, - String signature, - boolean isClient, - boolean isOptional, - boolean isCollection) throws InstantiationException; - - /** - * Creates a component type. - * - * @param interfaceTypes the interface types of the component type to be - * created. - * @return a component type whose {@link ComponentType#getFcInterfaceTypes - * getFcInterfaceTypes} method returns an array equal to - * interfaceTypes. - * @throws InstantiationException if the component type cannot be created. - */ - - ComponentType createFcType (InterfaceType[] interfaceTypes) - throws InstantiationException; -} diff --git a/fractal/src/org/objectweb/fractal/api/type/package.html b/fractal/src/org/objectweb/fractal/api/type/package.html deleted file mode 100644 index e52fab0a1649ae95d99947561ac5b82c5a0bcdf0..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/api/type/package.html +++ /dev/null @@ -1,81 +0,0 @@ - - - -Specifies a basic type system for components and component interfaces. -According to this type system, a component type is just a collection of -component interface types, which describes the interfaces that components of -this type must or may have at runtime. A component type describes explicitely -the external interfaces of a component and, implicitely, its internal -interfaces. Indeed, if the type of a component c is of the following -form: -

    -
  • s1 , I1 , server, mandatory, singleton,
  • -
  • s2 , I2 , server, optional, collection,
  • -
  • s3-controller , I3 , server, mandatory, singleton,
  • -
  • ...,
  • -
  • c1 , J1 , client, mandatory, singleton,
  • -
  • c2 , J2 , client, optional, collection,
  • -
  • ...
  • -
-Then this component: -
    -
  • must provide a server interface s1 of type I1,
  • -
  • may provide several server interfaces s2XYZ of type I2 (but - no server interface of name s2 exactly),
  • -
  • must provide a server interface s3-controller of type - I3,
  • -
  • ...,
  • -
  • must have a client interface c1 of type J1,
  • -
  • may have several client interfaces c2XYZ of type J2 (but - no client interface of name c2 exactly),
  • -
  • ...
  • -
-Futhermore, if this component provides access to its content, then it: -
    -
  • must have an internal client interface s1 of type I1, -
  • -
  • may have several internal client interfaces s2XYZ of type - I2 (but no internal client interface of name s2 - exactly),
  • -
  • ...,
  • -
  • must provide an internal server interface c1 of type - J1,
  • -
  • may provide several internal server interfaces c2XYZ of type - J2 (but no internal server interface of name c2 - exactly),
  • -
  • ...
  • -
-Moreover, each internal interface must have a corresponding external interface -of the same name (but the converse is not necessarily true). The figure below -illustrates these definitions. -

-

- -

-Figure: a sample "instance" of the above type. -

-@since Fractal 0.8.0 - - diff --git a/fractal/src/org/objectweb/fractal/util/Fractal.java b/fractal/src/org/objectweb/fractal/util/Fractal.java deleted file mode 100644 index c84fcc8c1f2e80db28245d789e0905da3a5b038f..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/util/Fractal.java +++ /dev/null @@ -1,193 +0,0 @@ -/*** - * Fractal Util: utilities for the Fractal API - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.util; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.AttributeController; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.api.factory.Factory; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.TypeFactory; - -/** - * Provides static methods to access standard interfaces of Fractal components. - */ - -public class Fractal { - - /** - * Private constructor (uninstantiable class). - */ - - private Fractal () { - } - - /** - * Returns a bootstrap component to create other components. This method - * just calls the corresponding method of the - * org.objectweb.fractal.api.Fractal class. - * - * @return a bootstrap component to create other components. - * @throws InstantiationException if the bootstrap component cannot be - * created. - */ - - public static Component getBootstrapComponent () - throws InstantiationException - { - return org.objectweb.fractal.api.Fractal.getBootstrapComponent(); - } - - /** - * Returns the {@link AttributeController} interface of the given component. - * - * @param component a component. - * @return the {@link AttributeController} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static AttributeController getAttributeController ( - final Component component) throws NoSuchInterfaceException - { - return (AttributeController)component.getFcInterface("attribute-controller"); - } - - /** - * Returns the {@link BindingController} interface of the given component. - * - * @param component a component. - * @return the {@link BindingController} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static BindingController getBindingController ( - final Component component) throws NoSuchInterfaceException - { - return (BindingController)component.getFcInterface("binding-controller"); - } - - /** - * Returns the {@link ContentController} interface of the given component. - * - * @param component a component. - * @return the {@link ContentController} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static ContentController getContentController ( - final Component component) throws NoSuchInterfaceException - { - return (ContentController)component.getFcInterface("content-controller"); - } - - /** - * Returns the {@link SuperController} interface of the given component. - * - * @param component a component. - * @return the {@link SuperController} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static SuperController getSuperController (final Component component) - throws NoSuchInterfaceException - { - return (SuperController)component.getFcInterface("super-controller"); - } - - /** - * Returns the {@link NameController} interface of the given component. - * - * @param component a component. - * @return the {@link NameController} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static NameController getNameController (final Component component) - throws NoSuchInterfaceException - { - return (NameController)component.getFcInterface("name-controller"); - } - - /** - * Returns the {@link LifeCycleController} interface of the given component. - * - * @param component a component. - * @return the {@link LifeCycleController} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static LifeCycleController getLifeCycleController ( - final Component component) throws NoSuchInterfaceException - { - return (LifeCycleController)component.getFcInterface("lifecycle-controller"); - } - - /** - * Returns the {@link Factory} interface of the given component. - * - * @param component a component. - * @return the {@link Factory} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static Factory getFactory (final Component component) - throws NoSuchInterfaceException - { - return (Factory)component.getFcInterface("factory"); - } - - /** - * Returns the {@link GenericFactory} interface of the given component. - * - * @param component a component. - * @return the {@link GenericFactory} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static GenericFactory getGenericFactory (final Component component) - throws NoSuchInterfaceException - { - return (GenericFactory)component.getFcInterface("generic-factory"); - } - - /** - * Returns the {@link TypeFactory} interface of the given component. - * - * @param component a component. - * @return the {@link TypeFactory} interface of the given component. - * @throws NoSuchInterfaceException if there is no such interface. - */ - - public static TypeFactory getTypeFactory (final Component component) - throws NoSuchInterfaceException - { - return (TypeFactory)component.getFcInterface("type-factory"); - } -} diff --git a/fractal/src/org/objectweb/fractal/util/overview.html b/fractal/src/org/objectweb/fractal/util/overview.html deleted file mode 100644 index 068b01248fb3157a0db43b5484bfe2a9010a42aa..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/util/overview.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -DO NOT REMOVE THIS LINE (will be automatically removed). - -Provides utilities to facilitate Fractal API's use. These utilities are -independent of any implementation of the Fractal API. - \ No newline at end of file diff --git a/fractal/src/org/objectweb/fractal/util/package.html b/fractal/src/org/objectweb/fractal/util/package.html deleted file mode 100644 index 5144710586af836e560372b4a0691a6c72e6a7a8..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/fractal/util/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -Provides utilities to facilitate Fractal API's use. - -@since Fractal 1.0.6 - - diff --git a/fractal/src/org/objectweb/naming/Binder.java b/fractal/src/org/objectweb/naming/Binder.java deleted file mode 100644 index 3889a5625268fcce2f54f413c76911c1288134cf..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/naming/Binder.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Objectweb naming framework API - * Copyright (C) 2001-2002 France Telecom - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: architecture@objectweb.org - */ - -package org.objectweb.naming; - -/** - * A binder is a {@link NamingContext} that can also give access - * to the objects designated by the names it manages. - */ - -public interface Binder extends NamingContext { - - /** - * Returns an object that gives access to the object designated by the given - * name. This name must belong to this naming context, i.e., - * nc.bind(n, hints) is valid only if n.getNamingContext() == - * nc. The object returned by this method implements the Java interface - * of the designated object. It may also implement the {@link Name} - * interface. This method creates a binding object (or a binding component - * when it is used with the Fractal - * framework) that gives access to the designated object (this binding - * object can be empty, i.e., the bind method may directly return the - * designated object itself). - * - * @param n a name that has been created by this naming context. - * @param hints optional additional information. - * @return an object that gives access to the object designated by n. - * This object may also implement the {@link Name} interface. - * @throws NamingException if the binding fails (this is the case, for - * example, if the given name was not created by this naming context). - */ - - Object bind (Name n, Object hints) throws NamingException; -} diff --git a/fractal/src/org/objectweb/naming/Name.java b/fractal/src/org/objectweb/naming/Name.java deleted file mode 100644 index a09768f9a386f6662d9f82495510109b5c348561..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/naming/Name.java +++ /dev/null @@ -1,58 +0,0 @@ -/*** - * Objectweb naming framework API - * Copyright (C) 2001-2002 France Telecom - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: architecture@objectweb.org - */ - -package org.objectweb.naming; - -/** - * A name designates an object or an object interface. A name may also provide - * access to the object or interface it designates. Such a name implements both - * the {@link Name} interface and the (or a) Java interface of the object - * it designates. - */ - -public interface Name { - - /** - * Returns the {@link NamingContext} that created this name. - * In order for a name to implement both the {@link Name} interface and - * the Java interface of the object it designates, the methods of these two - * interfaces must have distinct names. To increase the probability of this - * case, this method has been named "getNamingContext" instead of - * "getContext", since "getNamingContext" is less frequent than "getContext". - * - * @return the {@link NamingContext} that created this name. - */ - - NamingContext getNamingContext (); - - /** - * Encodes this name as an array of bytes. This method can be used to send - * names over a network, or to store them on disk. - * - * @return an encoded form of this name. - * @throws NamingException if this name can not be encoded (this is the case, - * for example, of names that are only valid inside a given Java Virtual - * Machine, and that can therefore not be sent over a network or stored - * on a disk). - */ - - byte[] encode () throws NamingException; -} diff --git a/fractal/src/org/objectweb/naming/NamingContext.java b/fractal/src/org/objectweb/naming/NamingContext.java deleted file mode 100644 index 5fd454c86f7733c100b0db4b9f7152ccc578e73a..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/naming/NamingContext.java +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * Objectweb naming framework API - * Copyright (C) 2001-2002 France Telecom - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: architecture@objectweb.org - */ - -package org.objectweb.naming; - -/** - * A naming context creates and manages names. - */ - -public interface NamingContext { - - /** - * Creates a name in this naming context to designate the given object. The - * {@link Name#getNamingContext getNamingContext} method of the returned name - * will return this naming context, i.e., - * nc.export(o, hints).getNamingContext() == nc. - * - * @param o the object to be exported. This object may be a name of another - * naming context. - * @param hints optional additional information. - * @return a name that designates the given object in this naming context. - * @throws NamingException if the given object cannot be exported. - */ - - Name export (Object o, Object hints) throws NamingException; - - /** - * Decodes the given encoded name. The {@link Name#getNamingContext - * getNamingContext} method of the returned name will return this naming - * context, i.e., nc.decode(b).getNamingContext() == nc. - * - * @param b an array of byte containing the encoded form of a name created by - * this naming context. - * @return the decoded {@link Name} object. - * @throws NamingException if the given encoded name cannot be decoded (this - * is the case, for example, if the given encoded name was not created by - * this naming context). - */ - - Name decode (byte[] b) throws NamingException; -} diff --git a/fractal/src/org/objectweb/naming/NamingException.java b/fractal/src/org/objectweb/naming/NamingException.java deleted file mode 100644 index 3615972e76dfd511644b76ab61a7175e08fddfe4..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/naming/NamingException.java +++ /dev/null @@ -1,40 +0,0 @@ -/*** - * Objectweb naming framework API - * Copyright (C) 2001-2002 France Telecom - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: architecture@objectweb.org - */ - -package org.objectweb.naming; - -/** - * Thrown when a name can not be created, encoded, decoded, bound, and so on. - */ - -public class NamingException extends Exception { - - /** - * Constructs an {@link NamingException} with the specified - * detail message. - * - * @param msg the detail message. - */ - - public NamingException (final String msg) { - super(msg); - } -} diff --git a/fractal/src/org/objectweb/naming/overview.html b/fractal/src/org/objectweb/naming/overview.html deleted file mode 100644 index f53c984bd08ef0400bd6df12688e919c43756dd2..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/naming/overview.html +++ /dev/null @@ -1,25 +0,0 @@ - - - -DO NOT REMOVE THIS LINE (will be automatically removed). - - \ No newline at end of file diff --git a/fractal/src/org/objectweb/naming/package.html b/fractal/src/org/objectweb/naming/package.html deleted file mode 100644 index 9a690a084d5e3b589eaf3d02a3ff020467c8ba87..0000000000000000000000000000000000000000 --- a/fractal/src/org/objectweb/naming/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - - -Specifies the Objectweb naming framework API. -@since Fractal 1.0.5 - - diff --git a/fractaladl/README.txt b/fractaladl/README.txt deleted file mode 100644 index e2338b0f6f242af515583694eb101ee2ff749c44..0000000000000000000000000000000000000000 --- a/fractaladl/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -This directory is the base directory of the product. -It contains(*) the following items: - -- archive: ant files to build the jar(s) of the product, -- build.properties: properties to configure the build process, -- build.xml: main ant file to build the product, -- config: external libraries required only for building the product, -- doc: documentation of the product, -- etc: scripts to run the product, -- examples: examples of use of the product, -- externals: external libraires required for running the product, -- jdoc: ant files to build the javadoc documentation(s) of the product, -- sr': sources of the product, -- test: tests of the product, -- web: source of the web site of the product. - -(*) some items may not be present, depending on the product. diff --git a/fractaladl/archive/README.txt b/fractaladl/archive/README.txt deleted file mode 100644 index e0d72a77eeab2c75774e256e42b338274737fa5d..0000000000000000000000000000000000000000 --- a/fractaladl/archive/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory contains ant files to build the jars of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one jar file. - -- The name of the ant file must be the name of the jar it builds: - org-foo-bar.xml must build org-foo-bar.jar. - -- Among the elements which are included into a jar, you must specify - a manifest. It is adviced to store the manifest file in this directory. - The manifest file can be shared by several jars. The name of the manifest - file must be similar to the name of the jar file. - -- Only the default task is called on each ant file. - -- The jar file must be produced into the ${dist.lib} directory. - -Sample ant file: - - - - - - ... - - - - diff --git a/fractaladl/archive/fractal-adl.mf b/fractaladl/archive/fractal-adl.mf deleted file mode 100644 index 5f5af12fefb8ba11e6b6daa081531aca91f12d97..0000000000000000000000000000000000000000 --- a/fractaladl/archive/fractal-adl.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Fractal ADL parser" -Implementation-Version: "2.0" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractaladl/archive/fractal-adl.xml b/fractaladl/archive/fractal-adl.xml deleted file mode 100644 index 57ef554ea87a8d93428fd7ae10955f8807cc220d..0000000000000000000000000000000000000000 --- a/fractaladl/archive/fractal-adl.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/build.config b/fractaladl/build.config deleted file mode 100644 index 09d8922626548c362021525865d13946e74be99d..0000000000000000000000000000000000000000 --- a/fractaladl/build.config +++ /dev/null @@ -1,16 +0,0 @@ -# Defines values for the 'build.properties' build properties -# This file is used to build the project in the case of bundled external jars - -objectweb.ant.tasks.path config/ow_util_ant_tasks.jar - -asm.path externals/asm.jar - -fractal.path externals/fractal.jar - -monolog.path externals/ow_util_log_api.jar - -dtdparser.path externals/dtdparser.jar - -deployment-scheduling.path externals/ow_deployment_scheduling.jar - -junit.path test/lib/junit.jar \ No newline at end of file diff --git a/fractaladl/build.properties b/fractaladl/build.properties deleted file mode 100644 index 4a59ca4002b71fd0c9ae762627b634084a5cf442..0000000000000000000000000000000000000000 --- a/fractaladl/build.properties +++ /dev/null @@ -1,85 +0,0 @@ -############################################################################### -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################### - -# Some information about the product - -product.name fractaladl -product.version 2.0 - -############################################################################### -# BUILD -############################################################################### - -# Wich compiler do you want to use ? -# jikes is faster than javac but keeps line numbers in compiled classes, even -# with the -O option (javac removes line numbers and local variable names with -# this option, resulting in smaller classes) - -# build.compiler jikes - -# Build class path (classes needed to build the project) -# Classpath for the ObjectWeb utility Ant tasks (OWANTTASK_1_1) -# See http://forge.objectweb.org/projects/monolog - -# objectweb.ant.tasks.path ow_util_ant_tasks.jar - -############################################################################### -# EXTERNAL LIBRARIES -############################################################################### - -# Class path for the ASM library (ASM_1_4_2) -# See http://asm.objectweb.org - -# asm.path asm.jar - -# Class path for the Fractal API (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -# fractal.path fractal.jar - -# Class path for the Monolog API (MONOLOG_1_7) -# See http://monolog.objectweb.org - -# monolog.path ow_util_log_api.jar - -# Class path for the DTDParser library (version 1.21) -# See http://www.wutka.com/dtdparser.html - -# dtdparser.path dtdparser.jar - -# Class path for the ObjectWeb deployment scheduling library (version 1.0) -# See TODO - -# deployment-scheduling.path ow_deployment_scheduling.jar - -############################################################################### -# TESTS -############################################################################### - -# Class path for the JUnit library (version 3.7) -# See http://www.junit.org - -# junit.path junit.jar - -############################################################################### -# DOCUMENTATION -############################################################################### - -# URLs of external Javadocs - -monolog.url http://www.objectweb.org/monolog/jdoc/ow_util_log_api -fractal.url http://www.objectweb.org/fractal/current/doc/javadoc/fractal -jdk.url http://java.sun.com/j2se/1.3/docs/api diff --git a/fractaladl/build.xml b/fractaladl/build.xml deleted file mode 100644 index 9c6f95eb8f6d8ba0358f2001c69b540ca73f8b3a..0000000000000000000000000000000000000000 --- a/fractaladl/build.xml +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/config/README.txt b/fractaladl/config/README.txt deleted file mode 100644 index 4978babb44fb4f93c7d819e50bedad09c7086b79..0000000000000000000000000000000000000000 --- a/fractaladl/config/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains the external libraries required for building the -product, but which are not necessary to use it. diff --git a/fractaladl/config/ow_util_ant_tasks.jar b/fractaladl/config/ow_util_ant_tasks.jar deleted file mode 100644 index 4a502465e2d690a80931068d96563d895d9cb5b5..0000000000000000000000000000000000000000 Binary files a/fractaladl/config/ow_util_ant_tasks.jar and /dev/null differ diff --git a/fractaladl/doc/README.txt b/fractaladl/doc/README.txt deleted file mode 100644 index 84303fee616679f69995c94e1dd7d4198b338d64..0000000000000000000000000000000000000000 --- a/fractaladl/doc/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the documentation of the product. diff --git a/fractaladl/examples/common/README.txt b/fractaladl/examples/common/README.txt deleted file mode 100644 index 25b69f5c42c38f799f5acbc47423227adb4d987c..0000000000000000000000000000000000000000 --- a/fractaladl/examples/common/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -This directory contains the examples of the product. -It contains(*) the following items: - -- lib: jar files shared by all examples, -- etc: configuration files shared by all examples, -- README.txt: explains the organisation of the examples directory, -- all other directories contain(*) the following items: - - README.txt file: describes the example and its configuration, - - lib: jar files needed by the example, - - etc: configuration files needed by the example, - - src: source code of the example. - -(*) some items may not be present, depending on the product or example. \ No newline at end of file diff --git a/fractaladl/examples/common/build.xml b/fractaladl/examples/common/build.xml deleted file mode 100644 index 8c8608ebadee64b6155735643b937f4efe4fa7b9..0000000000000000000000000000000000000000 --- a/fractaladl/examples/common/build.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/examples/common/etc/build.properties b/fractaladl/examples/common/etc/build.properties deleted file mode 100644 index f38a27f728a29494c3f52d98f8eda4c543ce91db..0000000000000000000000000000000000000000 --- a/fractaladl/examples/common/etc/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Wich compiler do you want use ? - -build.compiler jikes - -# Class path of the ASM library (ASM_1_4_2) -# See http://asm.objectweb.org - -asm.path ../lib/asm.jar - -# Class path of the Fractal API library (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -fractal.path ../../externals/fractal.jar - -# Class path of Julia (JULIA_2_0) -# See http://fractal.objectweb.org - -julia.path ../lib/julia-asm.jar:../lib/julia-mixins.jar:../lib/julia-runtime.jar - -# Class path of the Fractal ADL parser (FRACTAL_ADL_2_0) -# See http://fractal.objectweb.org - -fractaladl.path ../../externals/ow_deployment_scheduling.jar:../../lib/fractal-adl.jar:../../externals/dtdparser.jar diff --git a/fractaladl/examples/common/lib/asm.jar b/fractaladl/examples/common/lib/asm.jar deleted file mode 100644 index 41e00315ffb0dbd0a386c5a7d39f3bea178804ee..0000000000000000000000000000000000000000 Binary files a/fractaladl/examples/common/lib/asm.jar and /dev/null differ diff --git a/fractaladl/examples/common/lib/julia-asm.jar b/fractaladl/examples/common/lib/julia-asm.jar deleted file mode 100644 index 6a8a7de3de4e80f6315aae586593b3bd0bc57b72..0000000000000000000000000000000000000000 Binary files a/fractaladl/examples/common/lib/julia-asm.jar and /dev/null differ diff --git a/fractaladl/examples/common/lib/julia-mixins.jar b/fractaladl/examples/common/lib/julia-mixins.jar deleted file mode 100644 index 44af2f6006db94f97907c525be68dd9433cb6e1e..0000000000000000000000000000000000000000 Binary files a/fractaladl/examples/common/lib/julia-mixins.jar and /dev/null differ diff --git a/fractaladl/examples/common/lib/julia-runtime.jar b/fractaladl/examples/common/lib/julia-runtime.jar deleted file mode 100644 index b416b02e98d6e6c2433916f0be1c025a9bb1ac2b..0000000000000000000000000000000000000000 Binary files a/fractaladl/examples/common/lib/julia-runtime.jar and /dev/null differ diff --git a/fractaladl/examples/helloworld/README.txt b/fractaladl/examples/helloworld/README.txt deleted file mode 100644 index 04f3d060416d69079fbf08aa6eb21b8e67580a2f..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -This example shows how to program a simple Fractal based application, -and how to deploy it. It also shows how Julia can be configured, and how -the Fractal ADL can be used to describe the architecture of an application, -and to deploy it. - -See the Fractal, the Fractal ADL and the Julia tutorials for more details -about this example. diff --git a/fractaladl/examples/helloworld/etc/execute.properties b/fractaladl/examples/helloworld/etc/execute.properties deleted file mode 100644 index c34d4d5b091b310ad1430ed5730c5633e830de9f..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/etc/execute.properties +++ /dev/null @@ -1,21 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -run.jvm.parameters \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -# Java class to be launched - -run.classname org.objectweb.fractal.adl.Launcher - -# Application arguments -# add "parser" to build the components automatically, by using a parser -# add "templates" to build the components through templates -# add "wrapper" to add an additional composite around each primitive - -run.parameters -fractal HelloWorld r -#run.parameters -fractal ClientServerImpl r -#run.parameters -fractal SharedHelloWorld r diff --git a/fractaladl/examples/helloworld/etc/julia.cfg b/fractaladl/examples/helloworld/etc/julia.cfg deleted file mode 100644 index 8c35125c35c6ea2c2e8f3f007fbdf08dc8850a92..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/etc/julia.cfg +++ /dev/null @@ -1,614 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -# no custom definitions diff --git a/fractaladl/examples/helloworld/src/AbstractClientServer.fractal b/fractaladl/examples/helloworld/src/AbstractClientServer.fractal deleted file mode 100644 index f74f30d655eb727baef481b90776c7105cd1ae04..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/AbstractClientServer.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/examples/helloworld/src/ClientImpl.fractal b/fractaladl/examples/helloworld/src/ClientImpl.fractal deleted file mode 100644 index c3977b1d754fdf48b0566ea4585c6c17c0b48402..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ClientImpl.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/examples/helloworld/src/ClientImpl.java b/fractaladl/examples/helloworld/src/ClientImpl.java deleted file mode 100644 index 4c5a724ce40340c9b751313ca7dd678f0395cc2c..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ClientImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -import org.objectweb.fractal.api.control.BindingController; - -public class ClientImpl implements Runnable, BindingController { - - private Service service; - - public ClientImpl () { - System.err.println("CLIENT created"); - } - - public void run () { - service.print("hello world"); - } - - public String[] listFc () { - return new String[] { "s" }; - } - - public Object lookupFc (final String cItf) { - if (cItf.equals("s")) { - return service; - } - return null; - } - - public void bindFc (final String cItf, final Object sItf) { - if (cItf.equals("s")) { - service = (Service)sItf; - } - } - - public void unbindFc (final String cItf) { - if (cItf.equals("s")) { - service = null; - } - } -} diff --git a/fractaladl/examples/helloworld/src/ClientServerImpl.fractal b/fractaladl/examples/helloworld/src/ClientServerImpl.fractal deleted file mode 100644 index feac91da2bd3ccc31d18e31484527aa3a897d6b5..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ClientServerImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaladl/examples/helloworld/src/ClientType.fractal b/fractaladl/examples/helloworld/src/ClientType.fractal deleted file mode 100644 index c56109d96310ca33f93bd0a23468cfc896066a7f..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ClientType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/examples/helloworld/src/HelloWorld.fractal b/fractaladl/examples/helloworld/src/HelloWorld.fractal deleted file mode 100644 index 459bcaa88eb859247fcacc7a10f1a103e0ac26fd..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/HelloWorld.fractal +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/examples/helloworld/src/RootType.fractal b/fractaladl/examples/helloworld/src/RootType.fractal deleted file mode 100644 index 473dcf74d8c48c05888df53a2f4dfa977209478e..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/RootType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/examples/helloworld/src/ServerImpl.fractal b/fractaladl/examples/helloworld/src/ServerImpl.fractal deleted file mode 100644 index 5f9160679cd448da3bcbd68cc53daaa10c5bd2b8..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ServerImpl.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/examples/helloworld/src/ServerImpl.java b/fractaladl/examples/helloworld/src/ServerImpl.java deleted file mode 100644 index b3d74d3f766b7674b7c123acad15c521a3f150ee..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ServerImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -public class ServerImpl implements Service, ServiceAttributes { - - private String header = ""; - - private int count = 0; - - public ServerImpl () { - System.err.println("SERVER created"); - } - - public void print (final String msg) { - new Exception() { - public String toString () { - return "Server: print method called"; - } - }.printStackTrace(); - System.err.println("Server: begin printing..."); - for (int i = 0; i < count; ++i) { - System.err.println(header + msg); - } - System.err.println("Server: print done."); - } - - public String getHeader () { - return header; - } - - public void setHeader (final String header) { - this.header = header; - } - - public int getCount () { - return count; - } - - public void setCount (final int count) { - this.count = count; - } -} diff --git a/fractaladl/examples/helloworld/src/ServerType.fractal b/fractaladl/examples/helloworld/src/ServerType.fractal deleted file mode 100644 index 4927ff4e85298630266e8d3040cfce4552da8239..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ServerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/examples/helloworld/src/Service.java b/fractaladl/examples/helloworld/src/Service.java deleted file mode 100644 index be688d32a4dd2be9cf41c8ebf5bbe2a2e842d045..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/Service.java +++ /dev/null @@ -1,26 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -public interface Service { - void print (String msg); -} diff --git a/fractaladl/examples/helloworld/src/ServiceAttributes.java b/fractaladl/examples/helloworld/src/ServiceAttributes.java deleted file mode 100644 index 4e909fcf2558d8a19e849ed3cbfa49d149fa159d..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/ServiceAttributes.java +++ /dev/null @@ -1,31 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -import org.objectweb.fractal.api.control.AttributeController; - -public interface ServiceAttributes extends AttributeController { - String getHeader (); - void setHeader (String header); - int getCount (); - void setCount (int count); -} diff --git a/fractaladl/examples/helloworld/src/SharedHelloWorld.fractal b/fractaladl/examples/helloworld/src/SharedHelloWorld.fractal deleted file mode 100644 index 6ce3bc759504916ba9d84837a6823a7f58d4b517..0000000000000000000000000000000000000000 --- a/fractaladl/examples/helloworld/src/SharedHelloWorld.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/externals/README.txt b/fractaladl/externals/README.txt deleted file mode 100644 index 336e5a5f98d9fbe884814c08329ea286ea55a00a..0000000000000000000000000000000000000000 --- a/fractaladl/externals/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the external libraries required for running the product. diff --git a/fractaladl/externals/asm.jar b/fractaladl/externals/asm.jar deleted file mode 100644 index 41e00315ffb0dbd0a386c5a7d39f3bea178804ee..0000000000000000000000000000000000000000 Binary files a/fractaladl/externals/asm.jar and /dev/null differ diff --git a/fractaladl/externals/dtdparser.jar b/fractaladl/externals/dtdparser.jar deleted file mode 100644 index ddb33dc33e512b1394953e10a83d1fdad438dffc..0000000000000000000000000000000000000000 Binary files a/fractaladl/externals/dtdparser.jar and /dev/null differ diff --git a/fractaladl/externals/fractal.jar b/fractaladl/externals/fractal.jar deleted file mode 100644 index 6bf74c05aaf416490008ba43dce643df09adbbd5..0000000000000000000000000000000000000000 Binary files a/fractaladl/externals/fractal.jar and /dev/null differ diff --git a/fractaladl/externals/ow_deployment_scheduling.jar b/fractaladl/externals/ow_deployment_scheduling.jar deleted file mode 100644 index 0f20b080a8d0979254b548c52dd40437060386ea..0000000000000000000000000000000000000000 Binary files a/fractaladl/externals/ow_deployment_scheduling.jar and /dev/null differ diff --git a/fractaladl/externals/ow_util_log_api.jar b/fractaladl/externals/ow_util_log_api.jar deleted file mode 100644 index 49cc3ace10fddc9973b7900bfc63501f0652abae..0000000000000000000000000000000000000000 Binary files a/fractaladl/externals/ow_util_log_api.jar and /dev/null differ diff --git a/fractaladl/jdoc/README.txt b/fractaladl/jdoc/README.txt deleted file mode 100644 index a78cb67fa8d1679fe5fd3fe8efc3aab86e5b6db8..0000000000000000000000000000000000000000 --- a/fractaladl/jdoc/README.txt +++ /dev/null @@ -1,39 +0,0 @@ -This directory contains ant files to build the javadocs of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one javadoc. - -- As there may exist several javadocs, all javadocs must be produced - in a sub dir of ${out.dist.jdoc}. For example the user javadoc could be - produced into the ${out.dist.jdoc}/user directory - -- The name of the ant file must be the name of the destination directory of the - javadoc it builds. - -- Only the default task is called on an xml file. - -Sample ant file: - - - - - - - - - - - - - - - - - - ... - - - - diff --git a/fractaladl/jdoc/fractal-adl.xml b/fractaladl/jdoc/fractal-adl.xml deleted file mode 100644 index 812f9174e401b179b0effe207bdc2293bfcc5f5a..0000000000000000000000000000000000000000 --- a/fractaladl/jdoc/fractal-adl.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/jdoc/fractal-list/package-list b/fractaladl/jdoc/fractal-list/package-list deleted file mode 100644 index 0c7ce27ea081eefb65b09e2cd0f5866cd084660f..0000000000000000000000000000000000000000 --- a/fractaladl/jdoc/fractal-list/package-list +++ /dev/null @@ -1,4 +0,0 @@ -org.objectweb.fractal.api -org.objectweb.fractal.api.control -org.objectweb.fractal.api.factory -org.objectweb.fractal.api.type diff --git a/fractaladl/jdoc/jdk-list/package-list b/fractaladl/jdoc/jdk-list/package-list deleted file mode 100644 index 7f582f053dd0c03fe4df1013b086217010da00f1..0000000000000000000000000000000000000000 --- a/fractaladl/jdoc/jdk-list/package-list +++ /dev/null @@ -1,76 +0,0 @@ -java.applet -java.awt -java.awt.color -java.awt.datatransfer -java.awt.dnd -java.awt.event -java.awt.font -java.awt.geom -java.awt.im -java.awt.im.spi -java.awt.image -java.awt.image.renderable -java.awt.print -java.beans -java.beans.beancontext -java.io -java.lang -java.lang.ref -java.lang.reflect -java.math -java.net -java.rmi -java.rmi.activation -java.rmi.dgc -java.rmi.registry -java.rmi.server -java.security -java.security.acl -java.security.cert -java.security.interfaces -java.security.spec -java.sql -java.text -java.util -java.util.jar -java.util.zip -javax.accessibility -javax.naming -javax.naming.directory -javax.naming.event -javax.naming.ldap -javax.naming.spi -javax.rmi -javax.rmi.CORBA -javax.sound.midi -javax.sound.midi.spi -javax.sound.sampled -javax.sound.sampled.spi -javax.swing -javax.swing.border -javax.swing.colorchooser -javax.swing.event -javax.swing.filechooser -javax.swing.plaf -javax.swing.plaf.basic -javax.swing.plaf.metal -javax.swing.plaf.multi -javax.swing.table -javax.swing.text -javax.swing.text.html -javax.swing.text.html.parser -javax.swing.text.rtf -javax.swing.tree -javax.swing.undo -javax.transaction -org.omg.CORBA -org.omg.CORBA_2_3 -org.omg.CORBA_2_3.portable -org.omg.CORBA.DynAnyPackage -org.omg.CORBA.ORBPackage -org.omg.CORBA.portable -org.omg.CORBA.TypeCodePackage -org.omg.CosNaming -org.omg.CosNaming.NamingContextPackage -org.omg.SendingContext -org.omg.stub.java.rmi diff --git a/fractaladl/jdoc/monolog-list/package-list b/fractaladl/jdoc/monolog-list/package-list deleted file mode 100644 index 1ed8775b725c050c235db5e1b94388c144232567..0000000000000000000000000000000000000000 --- a/fractaladl/jdoc/monolog-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.util.monolog.api diff --git a/fractaladl/src/org/objectweb/fractal/adl/ADLException.java b/fractaladl/src/org/objectweb/fractal/adl/ADLException.java deleted file mode 100644 index 10adad3d94b88e51017104cce701d677dc68175a..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/ADLException.java +++ /dev/null @@ -1,107 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.io.PrintStream; -import java.io.PrintWriter; - -/** - * Thrown when an error occurs during the analysis of an ADL definition. - */ - -public class ADLException extends Exception { - - /** - * The exception that caused this exception. May be null. - */ - - private Exception exception; - - /** - * Constructs a new {@link ParserException}. - * - * @param msg a detail message. - * @param src where the error is located. - */ - - public ADLException (final String msg, final Node src) { - super(src == null ? msg : msg + " (" + src.astGetSource() + ")"); - } - - /** - * Constructs a new {@link ParserException}. - * - * @param msg a detail message. - * @param src where the error is located. - * @param e the exception that caused this exception. - */ - - public ADLException (final String msg, final Node src, final Exception e) { - super(src == null ? msg : msg + " (" + src.astGetSource() + ")"); - this.exception = e; - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - System.err.println(this); - exception.printStackTrace(); - } else { - super.printStackTrace(); - } - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - s.println(this); - exception.printStackTrace(s); - } else { - super.printStackTrace(s); - } - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - s.write(this + "\n"); - exception.printStackTrace(s); - } else { - super.printStackTrace(s); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/AbstractBackend.fractal b/fractaladl/src/org/objectweb/fractal/adl/AbstractBackend.fractal deleted file mode 100644 index 710bd543c25e0f26c5ae1fd4b83787c191c66071..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/AbstractBackend.fractal +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/AbstractLoader.java b/fractaladl/src/org/objectweb/fractal/adl/AbstractLoader.java deleted file mode 100644 index a561338d4e8b9f7504a82eed1290b12fc73c81aa..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/AbstractLoader.java +++ /dev/null @@ -1,74 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import org.objectweb.fractal.api.control.BindingController; - -/** - * An abstract {@link Loader} that delegates to another {@link Loader}. - */ - -public abstract class AbstractLoader implements BindingController, Loader { - - /** - * Name of the mandatory interface bound to the {@link Loader} used by this - * loader. - */ - - public final static String LOADER_BINDING = "client-loader"; - - /** - * The {@link Loader} used by this loader. - */ - - public Loader clientLoader; - - // ------------------------------------------------------------------------ - // Implementation of the BindingController interface - // ------------------------------------------------------------------------ - - public String[] listFc () { - return new String[] { LOADER_BINDING }; - } - - public Object lookupFc (String s) { - if (LOADER_BINDING.equals(s)) { - return clientLoader; - } - return null; - } - - public void bindFc (String s, Object o) { - if (LOADER_BINDING.equals(s)) { - clientLoader = (Loader)o; - } - } - - public void unbindFc (String s) { - if (LOADER_BINDING.equals(s)) { - clientLoader = null; - } - } -} - diff --git a/fractaladl/src/org/objectweb/fractal/adl/AbstractNode.java b/fractaladl/src/org/objectweb/fractal/adl/AbstractNode.java deleted file mode 100644 index 21e015cbb24b40a3f550308858ea39ba1baccf3c..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/AbstractNode.java +++ /dev/null @@ -1,77 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.HashMap; -import java.util.Map; - -/** - * An abstract {@link Node}. - */ - -public abstract class AbstractNode implements Node { - - private String type; - - private String source; - - private Map decorations = new HashMap(); - - public AbstractNode (final String type) { - this.type = type; - } - - // -------------------------------------------------------------------------- - // Implementation of the Node interface - // -------------------------------------------------------------------------- - - public String astGetType () { - return type; - } - - public String astGetSource () { - return source; - } - - public void astSetSource (final String source) { - this.source = source; - } - - public Object astGetDecoration(String name) { - return decorations.get(name); - } - - public Map astGetDecorations() { - return new HashMap(decorations); - } - - public void astSetDecoration(String name, Object decoration) { - decorations.put(name, decoration); - } - - public void astSetDecorations(Map decorations) { - this.decorations.putAll(decorations); - } - -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/BackendType.fractal b/fractaladl/src/org/objectweb/fractal/adl/BackendType.fractal deleted file mode 100644 index dc6918e85c6087533acef543250632535ffd9762..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/BackendType.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/BasicCompiler.fractal b/fractaladl/src/org/objectweb/fractal/adl/BasicCompiler.fractal deleted file mode 100644 index bad7eb4e9a842ff5fef11dc85756061fcab834d2..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/BasicCompiler.fractal +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/BasicFactory.fractal b/fractaladl/src/org/objectweb/fractal/adl/BasicFactory.fractal deleted file mode 100644 index 61c688ab8da4f348d4fa82604405c01ee6312c71..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/BasicFactory.fractal +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/BasicFactory.java b/fractaladl/src/org/objectweb/fractal/adl/BasicFactory.java deleted file mode 100644 index 6fda8ba425cb2e02c17184f1f3e9a4a2d5194065..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/BasicFactory.java +++ /dev/null @@ -1,154 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.Map; - -import org.objectweb.deployment.scheduling.core.api.Scheduler; -import org.objectweb.deployment.scheduling.component.api.InstanceProviderTask; -import org.objectweb.fractal.api.control.BindingController; - -/** - * Basic implementation of the {@link Factory} interface. This implementation - * uses a {@link Loader} to load ADL definitions, a {@link Compiler} to compile - * them, and a {@link Scheduler} to execute the compiled tasks. - */ - -public class BasicFactory implements BindingController, Factory { - - /** - * Name of the client interface bound to the {@link Loader} used by this - * factory. - */ - - public final static String LOADER_BINDING = "loader"; - - /** - * Name of the client interface bound to the {@link Compiler} used by this - * factory. - */ - - public final static String COMPILER_BINDING = "compiler"; - - /** - * Name of the client interface bound to the {@link Scheduler} used by this - * factory. - */ - - public final static String SCHEDULER_BINDING = "scheduler"; - - /** - * The {@link Loader} used by this factory. - */ - - public Loader loader; - - /** - * The {@link Compiler} used by this factory. - */ - - public Compiler compiler; - - /** - * The {@link Scheduler} used by this factory. - */ - - public Scheduler scheduler; - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc() { - return new String[] { LOADER_BINDING, COMPILER_BINDING, SCHEDULER_BINDING }; - } - - public Object lookupFc (final String itf) { - if (itf.equals(LOADER_BINDING)) { - return loader; - } else if (itf.equals(COMPILER_BINDING)) { - return compiler; - } else if (itf.equals(SCHEDULER_BINDING)) { - return scheduler; - } - return null; - } - - public void bindFc (final String itf, final Object value) { - if (itf.equals(LOADER_BINDING)) { - loader = (Loader)value; - } else if (itf.equals(COMPILER_BINDING)) { - compiler = (Compiler)value; - } else if (itf.equals(SCHEDULER_BINDING)) { - scheduler = (Scheduler)value; - } - } - - public void unbindFc (final String itf) { - if (itf.equals(LOADER_BINDING)) { - loader = null; - } else if (itf.equals(COMPILER_BINDING)) { - compiler = null; - } else if (itf.equals(SCHEDULER_BINDING)) { - scheduler = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the Facfory interface - // -------------------------------------------------------------------------- - - public Object newComponent (final String name, final Map context) - throws ADLException - { - Definition d = loader.load(name, context); - // DEBUG - /* - try { - java.io.PrintWriter pw = new java.io.PrintWriter(System.err, true); - new org.objectweb.fractal.adl.xml.XMLWriter(pw) - .write((org.objectweb.fractal.adl.Node)d); - pw.flush(); - } catch (java.io.IOException e) { - } - */ - TaskMap m = new BasicTaskMap(); - compiler.compile(d, m, context); - /* - Task[] ts = m.getTasks(); - Set s = new HashSet(Arrays.asList(ts)); - for (int i = 0; i < ts.length; ++i) { - Task t = ts[i]; - Task[] ps = t.getPreviousTasks(); - for (int j = 0; j < ps.length; ++j) { - if (!s.contains(ps[j])) { - System.err.println(t+" " +ps[j]); - } - } - } - */ - scheduler.schedule(m.getTasks(), context); - return ((InstanceProviderTask)m.getTask("create", d)).getInstance(); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/BasicLoader.fractal b/fractaladl/src/org/objectweb/fractal/adl/BasicLoader.fractal deleted file mode 100644 index fa0094042cd79166fdf44061dae9c63c29d319a0..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/BasicLoader.fractal +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/BasicScheduler.fractal b/fractaladl/src/org/objectweb/fractal/adl/BasicScheduler.fractal deleted file mode 100644 index 4e95b620d30c61b308d3076d0ce5a3d0e35f1a2d..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/BasicScheduler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/BasicTaskMap.java b/fractaladl/src/org/objectweb/fractal/adl/BasicTaskMap.java deleted file mode 100644 index a04c62c34bb7e7b0c31078c36da8a7f3a71aeabc..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/BasicTaskMap.java +++ /dev/null @@ -1,89 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.HashMap; -import java.util.NoSuchElementException; - -import org.objectweb.deployment.scheduling.core.api.Task; - -/** - * Basic implementation of the {@link TaskMap} interface. - */ - -public class BasicTaskMap extends HashMap implements TaskMap { - - // -------------------------------------------------------------------------- - // Implementation of the TaskMap interface - // -------------------------------------------------------------------------- - - public Task[] getTasks () { - return (Task[])values().toArray(new Task[size()]); - } - - public Task getTask (final String type, final Object id) - throws NoSuchElementException - { - Task t = (Task)get(new Key(type, id)); - if (t == null) { - throw new NoSuchElementException(); - } - return t; - } - - public void addTask (final String type, final Object id, final Task task) { - Key key = new Key(type, id); - if (get(key) == null) { - put(key, task); - } - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class Key { - - public final String type; - - public final Object id; - - public Key (final String type, final Object id) { - this.type = type; - this.id = id; - } - - public boolean equals (final Object o) { - if (o instanceof Key) { - Key k = (Key)o; - return k.type.equals(type) && k.id.equals(id); - } - return false; - } - - public int hashCode () { - return type.hashCode()*id.hashCode(); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/Compiler.java b/fractaladl/src/org/objectweb/fractal/adl/Compiler.java deleted file mode 100644 index 65be1397d32936bfa8887b8e21c7b6506b5ac363..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/Compiler.java +++ /dev/null @@ -1,47 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.Map; - -/** - * An ADL definition compiler. Definitions are compiled into a set of - * {@link org.objectweb.deployment.scheduling.core.api.Task}s. - */ - -public interface Compiler { - - /** - * Compiles the given ADL definition. - * - * @param definition the ADL definition to be compiled. - * @param tasks where the tasks compiled from the definition must be put. - * @param context optional additional information. - */ - - void compile ( - Definition definition, - TaskMap tasks, - Map context) throws ADLException; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/CompilerType.fractal b/fractaladl/src/org/objectweb/fractal/adl/CompilerType.fractal deleted file mode 100644 index 66c40e4034b4f128d4bfaad18015b657018d249e..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/CompilerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/Definition.java b/fractaladl/src/org/objectweb/fractal/adl/Definition.java deleted file mode 100644 index c634d7b7155382a3b67b042045517051ccbf6d89..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/Definition.java +++ /dev/null @@ -1,47 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -/** - * An ADL definition. - */ - -public interface Definition { - - /** - * Returns the name of this definition. - * - * @return the name of this definition. - */ - - String getName (); - - /** - * Sets the name of this definition. - * - * @param name the new name of this definition. - */ - - void setName (String name); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/DelegateLoaderType.fractal b/fractaladl/src/org/objectweb/fractal/adl/DelegateLoaderType.fractal deleted file mode 100644 index ede6a1daf2635073812c76eb56d387d6ea040fd7..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/DelegateLoaderType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/Factory.java b/fractaladl/src/org/objectweb/fractal/adl/Factory.java deleted file mode 100644 index f00536fe7e2b7ca78039f188a6782b93b33f299c..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/Factory.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.Map; - -/** - * A component factory. - */ - -public interface Factory { - - /** - * Creates a new instance of the component whose name is given. This can be - * done by loading the ADL definition of this name, by compiling it into a - * set of tasks and by executing these tasks in the proper order. - * - * @param name the name of the component to be created. - * @param context optional additional information. - * @return the component that has been created. The type of this result - * depends on the implementation of this interface: it can be a Fractal - * component reference (if this factory creates Fractal components), it - * can be an identifier (if this factory generates source code that will - * create components, instead of directly creating components), etc. - * @throws ADLException if a problem occurs during the creation of the - * component. - */ - - Object newComponent (String name, Map context) throws ADLException; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/FactoryFactory.java b/fractaladl/src/org/objectweb/fractal/adl/FactoryFactory.java deleted file mode 100644 index f23f419da6ad2105c4093a298e0a984bcaed68e2..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/FactoryFactory.java +++ /dev/null @@ -1,185 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.deployment.scheduling.core.lib.BasicScheduler; -import org.objectweb.fractal.adl.arguments.ArgumentComponentLoader; -import org.objectweb.fractal.adl.arguments.ArgumentLoader; -import org.objectweb.fractal.adl.attributes.AttributeCompiler; -import org.objectweb.fractal.adl.attributes.AttributeLoader; -import org.objectweb.fractal.adl.attributes.JavaAttributeBuilder; -import org.objectweb.fractal.adl.bindings.BindingCompiler; -import org.objectweb.fractal.adl.bindings.JavaBindingBuilder; -import org.objectweb.fractal.adl.bindings.TypeBindingLoader; -import org.objectweb.fractal.adl.components.ComponentCompiler; -import org.objectweb.fractal.adl.components.JavaComponentBuilder; -import org.objectweb.fractal.adl.components.PrimitiveComponentCompiler; -import org.objectweb.fractal.adl.implementations.ImplementationCompiler; -import org.objectweb.fractal.adl.implementations.ImplementationLoader; -import org.objectweb.fractal.adl.implementations.JavaImplementationBuilder; -import org.objectweb.fractal.adl.interfaces.InterfaceLoader; -import org.objectweb.fractal.adl.types.JavaTypeBuilder; -import org.objectweb.fractal.adl.types.TypeCompiler; -import org.objectweb.fractal.adl.types.TypeLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -/** - * Provides static methods to get a {@link Factory} component. - */ - -public class FactoryFactory { - - public final static String FRACTAL_BACKEND = - "org.objectweb.fractal.adl.FractalBackend"; - - public final static String STATIC_FRACTAL_BACKEND = - "org.objectweb.fractal.adl.StaticFractalBackend"; - - public final static String JAVA_BACKEND = - "org.objectweb.fractal.adl.JavaBackend"; - - public final static String STATIC_JAVA_BACKEND = - "org.objectweb.fractal.adl.StaticJavaBackend"; - - private static Factory FACTORY; - - /** - * Returns a bootstrap {@link Factory}, with a Java backend. - * - * @return a bootstrap factory. - */ - - public static Factory getFactory () { - if (FACTORY != null) { - return FACTORY; - } - - BasicFactory r = new BasicFactory(); - - XMLLoader xmll = new XMLLoader(); - ArgumentLoader argl = new ArgumentLoader(); - InterfaceLoader itfl = new InterfaceLoader(); - TypeLoader typl = new TypeLoader(); - ImplementationLoader impll = new ImplementationLoader(); - AttributeLoader attrl1 = new AttributeLoader(); - ArgumentComponentLoader compl = new ArgumentComponentLoader(); - TypeBindingLoader bindl = new TypeBindingLoader(); - // necessary to check inherited/overriden attributes - AttributeLoader attrl2 = new AttributeLoader(); - - TypeCompiler typc = new TypeCompiler(); - ImplementationCompiler implc = new ImplementationCompiler(); - PrimitiveComponentCompiler compc = new PrimitiveComponentCompiler(); - BindingCompiler bindc = new BindingCompiler(); - AttributeCompiler attrc = new AttributeCompiler(); - ComponentCompiler allc = new ComponentCompiler(); - - JavaTypeBuilder typb = new JavaTypeBuilder(); - JavaImplementationBuilder implb = new JavaImplementationBuilder(); - JavaComponentBuilder compb = new JavaComponentBuilder(); - JavaBindingBuilder bindb = new JavaBindingBuilder(); - JavaAttributeBuilder attrb = new JavaAttributeBuilder(); - - BasicScheduler s = new BasicScheduler(); - - typc.bindFc(TypeCompiler.BUILDER_BINDING, typb); - implc.bindFc(ImplementationCompiler.BUILDER_BINDING, implb); - compc.bindFc(PrimitiveComponentCompiler.BUILDER_BINDING, compb); - bindc.bindFc(BindingCompiler.BUILDER_BINDING, bindb); - attrc.bindFc(AttributeCompiler.BUILDER_BINDING, attrb); - - argl.clientLoader = xmll; - itfl.clientLoader = argl; - typl.clientLoader = itfl; - impll.clientLoader = typl; - attrl1.clientLoader = impll; - compl.clientLoader = attrl1; - bindl.clientLoader = compl; - attrl2.clientLoader = bindl; - - allc.bindFc(ComponentCompiler.PRIMITIVE_COMPILERS_BINDING+"0", typc); - allc.bindFc(ComponentCompiler.PRIMITIVE_COMPILERS_BINDING+"1", implc); - allc.bindFc(ComponentCompiler.PRIMITIVE_COMPILERS_BINDING+"2", compc); - allc.bindFc(ComponentCompiler.PRIMITIVE_COMPILERS_BINDING+"3", bindc); - allc.bindFc(ComponentCompiler.PRIMITIVE_COMPILERS_BINDING+"4", attrc); - - r.bindFc(BasicFactory.LOADER_BINDING, attrl2); - r.bindFc(BasicFactory.COMPILER_BINDING, allc); - r.bindFc(BasicFactory.SCHEDULER_BINDING, s); - - FACTORY = r; - return r; - } - - /** - * Returns a {@link Factory} with the given backend. - * - * @param backend the desired backend. - * @return a {@link Factory} with the given backend. - * @throws ADLException if the factory cannot be created. - */ - - public static Factory getFactory (final String backend) throws ADLException { - return getFactory(backend, new HashMap()); - } - - /** - * Returns a {@link Factory} with the given backend. - * - * @param backend the desired backend. - * @param context additional optional information. - * @return a {@link Factory} with the given backend. - * @throws ADLException if the factory cannot be created. - */ - - public static Factory getFactory (final String backend, final Map context) - throws ADLException - { - return getFactory("org.objectweb.fractal.adl.BasicFactory", backend, context); - } - - /** - * Returns a {@link Factory} with the given implementation and backend. - * - * @param factory the name of the desired factory. - * @param backend the desired backend. - * @param context additional optional information. - * @return a {@link Factory} with the given backend. - * @throws ADLException if the factory cannot be created. - */ - - public static Factory getFactory ( - final String factory, - final String backend, - final Map context) throws ADLException - { - context.put("backend", backend); - Factory f = getFactory(); - Map c = (Map)f.newComponent(factory, context); - return (Factory)c.get("factory"); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/FactoryType.fractal b/fractaladl/src/org/objectweb/fractal/adl/FactoryType.fractal deleted file mode 100644 index 7089a5c78e3783293e93a2825f66c56d6a855408..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/FactoryType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/FractalBackend.fractal b/fractaladl/src/org/objectweb/fractal/adl/FractalBackend.fractal deleted file mode 100644 index 7c024f9c4ed712c60100d9a5299527c153a3f392..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/FractalBackend.fractal +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/JavaBackend.fractal b/fractaladl/src/org/objectweb/fractal/adl/JavaBackend.fractal deleted file mode 100644 index 57e12eaae324fb7bb3d4d344bbc325b7fd5c702d..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/JavaBackend.fractal +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/Launcher.java b/fractaladl/src/org/objectweb/fractal/adl/Launcher.java deleted file mode 100644 index 71c5cb81f124a0a7efd053e2b7516d53750e7f6e..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/Launcher.java +++ /dev/null @@ -1,117 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.LifeCycleController; - -import org.objectweb.fractal.util.Fractal; - -/** - * A class to launch a component from its definition from the command line. - * Usage: - * Launcher [-java|-fractal] <definition> [ <itf> ] - * where <definition> is the name of the component to be instantiated - * and started,and <itf> is the name of its Runnable interface, if it - * has one. - */ - -public class Launcher { - - private Launcher () { - } - - public static void main (final String[] args) throws Exception { - String[] pargs = parseArgs(args); - Object comp = createComponent(pargs); - - if (comp instanceof Component) { - LifeCycleController lc = null; - try { - lc = Fractal.getLifeCycleController((Component)comp); - } catch (NoSuchInterfaceException ignored) { - } - if (lc != null) { - lc.startFc(); - } - Runnable r = null; - try { - r = (Runnable)((Component)comp).getFcInterface(pargs[2]); - } catch (NoSuchInterfaceException ignored) { - } - if (r != null) { - r.run(); - } - } else { - if (comp instanceof LifeCycleController) { - ((LifeCycleController)comp).startFc(); - } - if (comp instanceof Runnable) { - ((Runnable)comp).run(); - } - } - } - - private static Object createComponent (String[] pargs) throws Exception { - if (pargs[0].equals("-java")) { - Factory f = FactoryFactory.getFactory(FactoryFactory.JAVA_BACKEND); - return ((Map)f.newComponent(pargs[1], new HashMap())).get(pargs[2]); - } else { - Factory f = FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - return f.newComponent(pargs[1], new HashMap()); - } - } - - private static String[] parseArgs (final String[] args) { - if (args.length < 1 || args.length > 3) { - parseError(); - } - String[] result = new String[3]; - if (args[0].equals("-java") || args[0].equals("-fractal")) { - if (args.length < 2) { - parseError(); - } - result[0] = args[0]; - result[1] = args[1]; - result[2] = args.length == 3 ? args[2] : "run"; - } else { - result[0] = "-java"; - result[1] = args[0]; - result[2] = args.length >= 2 ? args[1] : "run"; - } - return result; - } - - private static void parseError () { - System.out.println("Usage: Launcher [-java|-fractal] [ ]"); - System.out.print("where is the name of the component to be "); - System.out.print("instantiated and started,\nand is the name of "); - System.out.println("its Runnable interface, if it has one"); - System.exit(1); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/Loader.java b/fractaladl/src/org/objectweb/fractal/adl/Loader.java deleted file mode 100644 index 2ae896fe65fca7114dde2f2ff6780e93e6360cab..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/Loader.java +++ /dev/null @@ -1,46 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.Map; - -/** - * An ADL definition loader. Definitions can be loaded from arbitrary sources, - * and can be checked and transformed during the loading process. - */ - -public interface Loader { - - /** - * Loads the ADL definition whose name is given. - * - * @param name the name of an ADL definition. - * @param context optional additional information. - * @return the ADL definition whose name is given. - * @throws ADLException if the definition cannot be found, or if it contains - * errors. - */ - - Definition load (String name, Map context) throws ADLException; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/LoaderType.fractal b/fractaladl/src/org/objectweb/fractal/adl/LoaderType.fractal deleted file mode 100644 index 6849d52bba63e39b0e19f64d7702fda670801673..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/LoaderType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/Node.java b/fractaladl/src/org/objectweb/fractal/adl/Node.java deleted file mode 100644 index e9e76476ca602b063a9f1caddb275d9eb1f01fd6..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/Node.java +++ /dev/null @@ -1,153 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.Map; - -/** - * An Abstract Syntax Tree (AST) node. Each node has a type (which can be - * though of as the tag of an XML element), and can have attributes as well as - * sub nodes (which can be though of as XML attributes and XML sub elements). - */ - -public interface Node { - - /** - * Returns the type of this node. - * - * @return the type of this node. - */ - - String astGetType (); - - /** - * Returns the source of this node. - * - * @return the source of this node (such as a file name). - */ - - String astGetSource (); - - /** - * Sets the source of this node. - * - * @param source the source of this node (such as a file name). - */ - - void astSetSource (String source); - - /** - * Returns the attributes of this node. - * - * @return the attributes of this node. - */ - - Map astGetAttributes (); - - /** - * Sets the attributes of this node. - * - * @param attributes the attributes of this node that must be changed - * (attributes that are not defined in this argument are left unchanged). - */ - - void astSetAttributes (Map attributes); - - /** - * Returns a decoration of this node. - * - * @param name the decoration's name. - * @return a decoration of this node. May be null if this node - * does not have a decoration with the specified name. - */ - - Object astGetDecoration (String name); - - /** - * Sets a decoration of this node. - * - * @param name the decoration's name. - * @param decoration a decoration. - */ - - void astSetDecoration (String name, Object decoration); - - /** - * Returns the decorations of this node. - * - * @return the decorations of this node. - */ - - Map astGetDecorations (); - - /** - * Sets the decorations of this node. - * - * @param decorations the decorations of this node that must be changed - * (decorations that are not defined in this argument are left unchanged). - */ - - void astSetDecorations (Map decorations); - - /** - * Returns the types of the sub nodes that this node can have. - * - * @return the types of the sub nodes that this node can have. - */ - - String[] astGetNodeTypes (); - - /** - * Returns the sub nodes of this node that are of the given type. - * - * @param type a node type. - * @return the sub nodes of this node that are of the given type. - */ - - Node[] astGetNodes (String type); - - /** - * Adds a sub node to this node. - * - * @param node the sub node to be added to this node. - */ - - void astAddNode (String type, Node node); // TODO remove the type argument - - /** - * Removes a sub node from this node. - * - * @param node the sub node to be removed from this node. - */ - - void astRemoveNode (String type, Node node); // TODO remove the type argument - - /** - * Creates a new, empty AST node of the same type as this node. - * - * @return a new, empty AST node of the same type as this node. - */ - - Node astNewInstance (); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/NodeClassLoader.java b/fractaladl/src/org/objectweb/fractal/adl/NodeClassLoader.java deleted file mode 100644 index 36260173733b9b009e70c948d2476cfabf64b34e..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/NodeClassLoader.java +++ /dev/null @@ -1,441 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; -import org.objectweb.asm.Type; - -/** - * An abstract class loader to dynamically generate {@link Node} classes. - */ - -public abstract class NodeClassLoader extends ClassLoader implements Constants { - - /** - * Byte code of the dynamically generated classes. - */ - - private Map bytecodes = new HashMap(); - - public NodeClassLoader (final ClassLoader parent) { - super(parent); - } - - public ClassWriter generateClass ( - final String className, - final String astNodeName, - final String superClass, - final String[] itfs) throws ClassNotFoundException - { - String owner = className.replace('.', '/'); - String node = Type.getInternalName(Node.class); - - ClassWriter cw = new ClassWriter(true); - cw.visit(ACC_PUBLIC, owner, superClass, itfs, null); - - CodeVisitor icv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); - icv.visitVarInsn(ALOAD, 0); - icv.visitLdcInsn(astNodeName); - icv.visitMethodInsn(INVOKESPECIAL, superClass, "", "(Ljava/lang/String;)V"); - - CodeVisitor ani = cw.visitMethod( - ACC_PUBLIC, "astNewInstance", "()L" + node + ";", null, null); - ani.visitTypeInsn(NEW, owner); - ani.visitInsn(DUP); - ani.visitMethodInsn(INVOKESPECIAL, owner, "", "()V"); - ani.visitInsn(ARETURN); - ani.visitMaxs(0, 0); - - CodeVisitor aga = cw.visitMethod( - ACC_PUBLIC, "astGetAttributes", "()Ljava/util/Map;", null, null); - aga.visitTypeInsn(NEW, "java/util/HashMap"); - aga.visitInsn(DUP); - aga.visitMethodInsn(INVOKESPECIAL, "java/util/HashMap", "", "()V"); - aga.visitVarInsn(ASTORE, 1); - - CodeVisitor asa = cw.visitMethod( - ACC_PUBLIC, "astSetAttributes", "(Ljava/util/Map;)V", null, null); - - CodeVisitor agn = cw.visitMethod( - ACC_PUBLIC, "astGetNodeTypes", "()[Ljava/lang/String;", null, null); - agn.visitIntInsn(SIPUSH, getNodeCount(itfs)); - agn.visitTypeInsn(ANEWARRAY, "java/lang/String"); - - CodeVisitor agns = cw.visitMethod( - ACC_PUBLIC, "astGetNodes", "(Ljava/lang/String;)[L" + node + ";", null, null); - Label agnsEnd = new Label(); - agns.visitInsn(ACONST_NULL); - agns.visitVarInsn(ASTORE, 2); - - CodeVisitor aan = cw.visitMethod( - ACC_PUBLIC, "astAddNode", "(Ljava/lang/String;L" + node + ";)V", null, null); - Label aanEnd = new Label(); - - CodeVisitor arn = cw.visitMethod( - ACC_PUBLIC, "astRemoveNode", "(Ljava/lang/String;L" + node + ";)V", null, null); - Label arnEnd = new Label(); - - int count = 0; - Set methods = new HashSet(); - for (int i = 0; i < itfs.length; ++i) { - Method[] meths = loadClass(itfs[i].replace('/', '.')).getMethods(); - for (int j = 0; j < meths.length; ++j) { - Method meth = meths[j]; - String name = meth.getName(); - String desc = Type.getMethodDescriptor(meth); - - if (methods.contains(name + desc)) { - continue; - } - methods.add(name + desc); - - CodeVisitor cv = cw.visitMethod(ACC_PUBLIC, name, desc, null, null); - - if (name.startsWith("get")) { - String field = getFieldName(name, 3); - - if (!desc.endsWith(")Ljava/lang/String;")) { - boolean single = desc.indexOf(")[") == -1; - // generates code in "astGetNodes()" - agn.visitInsn(DUP); - agn.visitIntInsn(SIPUSH, count++); - agn.visitLdcInsn(getASTName(name, single)); - agn.visitInsn(AASTORE); - - // generates code in "astGetNodes(String)" - if (single) { - generateGetNodeMethod(agns, owner, name, field, desc.substring(2), agnsEnd); - } else { - generateGetNodesMethod(agns, owner, name, field, agnsEnd); - } - } - - if (desc.startsWith("()[")) { - // case of a getter method for a sub node with arity * or + - String fieldDesc = "Ljava/util/List;"; - String elemDesc = desc.substring(3); - - // generates the field - cw.visitField(ACC_PRIVATE, field, fieldDesc, null, null); - - // generates the getter method - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitMethodInsn( - INVOKEINTERFACE, "java/util/List", "size", "()I"); - cv.visitTypeInsn( - ANEWARRAY, elemDesc.substring(1, elemDesc.length() - 1)); - cv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - "toArray", - "([Ljava/lang/Object;)[Ljava/lang/Object;"); - cv.visitTypeInsn(CHECKCAST, "[" + elemDesc); - cv.visitInsn(ARETURN); - cv.visitMaxs(0, 0); - - // generates code to initialize the field in the constructor - icv.visitVarInsn(ALOAD, 0); - icv.visitTypeInsn(NEW, "java/util/ArrayList"); - icv.visitInsn(DUP); - icv.visitMethodInsn( - INVOKESPECIAL, "java/util/ArrayList", "", "()V"); - icv.visitFieldInsn(PUTFIELD, owner, field, fieldDesc); - - generateAddNodesMethod( - aan, owner, name, field, fieldDesc, aanEnd, true); - generateAddNodesMethod( - arn, owner, name, field, fieldDesc, arnEnd, false); - } else { - // case of a getter method for a sub node with arity 1 or ? - String fieldDesc = desc.substring(2); - - // generates the field - cw.visitField(ACC_PRIVATE, field, fieldDesc, null, null); - - // generates the getter method - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitInsn(ARETURN); - cv.visitMaxs(0, 0); - - if (fieldDesc.equals("Ljava/lang/String;")) { - // case of an attribute: - - // generates code in "astGetAttributes" - aga.visitVarInsn(ALOAD, 1); - aga.visitLdcInsn(getASTName(name, true)); - aga.visitVarInsn(ALOAD, 0); - aga.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - aga.visitMethodInsn( - INVOKEVIRTUAL, - "java/util/HashMap", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - aga.visitInsn(POP); - - // generates code in "astSetAttributes" - asa.visitVarInsn(ALOAD, 0); - asa.visitVarInsn(ALOAD, 1); - asa.visitLdcInsn(getASTName(name, true)); - asa.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "get", - "(Ljava/lang/Object;)Ljava/lang/Object;"); - asa.visitTypeInsn(CHECKCAST, "java/lang/String"); - asa.visitFieldInsn(PUTFIELD, owner, field, fieldDesc); - } else { - // case of a sub node: - generateAddNodeMethod( - aan, owner, name, field, fieldDesc, aanEnd, true); - generateAddNodeMethod( - arn, owner, name, field, fieldDesc, arnEnd, false); - } - } - } else if (name.startsWith("set")) { - String field = getFieldName(name, 3); - String fieldDesc = desc.substring(1, desc.length() - 2); - cv.visitVarInsn(ALOAD, 0); - cv.visitVarInsn(ALOAD, 1); - cv.visitFieldInsn(PUTFIELD, owner, field, fieldDesc); - cv.visitInsn(RETURN); - cv.visitMaxs(0, 0); - } else if (name.startsWith("add")) { - String field = getFieldName(name, 3) + "s"; - String fieldDesc = "Ljava/util/List;"; - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitVarInsn(ALOAD, 1); - cv.visitMethodInsn( - INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z"); - cv.visitInsn(POP); - cv.visitInsn(RETURN); - cv.visitMaxs(0, 0); - } else if (name.startsWith("remove")) { - String field = getFieldName(name, 6) + "s"; - String fieldDesc = "Ljava/util/List;"; - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitVarInsn(ALOAD, 1); - cv.visitMethodInsn( - INVOKEINTERFACE, "java/util/List", "remove", "(Ljava/lang/Object;)Z"); - cv.visitInsn(POP); - cv.visitInsn(RETURN); - cv.visitMaxs(0, 0); - } - } - } - - icv.visitInsn(RETURN); - icv.visitMaxs(0, 0); - - aga.visitVarInsn(ALOAD, 1); - aga.visitInsn(ARETURN); - aga.visitMaxs(0, 0); - - asa.visitInsn(RETURN); - asa.visitMaxs(0, 0); - - agn.visitInsn(ARETURN); - agn.visitMaxs(0, 0); - - agns.visitLabel(agnsEnd); - agns.visitVarInsn(ALOAD, 2); - agns.visitInsn(ARETURN); - agns.visitMaxs(0, 0); - - aan.visitLabel(aanEnd); - aan.visitInsn(RETURN); - aan.visitMaxs(0, 0); - - arn.visitLabel(arnEnd); - arn.visitInsn(RETURN); - arn.visitMaxs(0, 0); - - return cw; - } - - protected Class defineClass (final String name, final byte[] b) { - bytecodes.put(name.replace('.', '/') + ".class", b); - return defineClass(name, b, 0, b.length); - } - - public InputStream getResourceAsStream (final String name) { - InputStream is = super.getResourceAsStream(name); - if (is == null) { - byte[] b = (byte[])bytecodes.get(name); - if (b != null) { - is = new ByteArrayInputStream(b); - } - } - return is; - } - - private int getNodeCount (final String[] itfs) throws ClassNotFoundException { - int count = 0; - Set methods = new HashSet(); - for (int i = 0; i < itfs.length; ++i) { - Method[] meths = loadClass(itfs[i].replace('/', '.')).getMethods(); - for (int j = 0; j < meths.length; ++j) { - Method meth = meths[j]; - String name = meth.getName(); - String desc = Type.getMethodDescriptor(meth); - if (methods.contains(name + desc)) { - continue; - } - methods.add(name + desc); - if (name.startsWith("get") && !desc.endsWith(")Ljava/lang/String;")) { - ++count; - } - } - } - return count; - } - - private void generateGetNodeMethod ( - final CodeVisitor cv, - final String owner, final String name, - final String field, final String fieldDesc, final Label end) - { - Label l = generateIf(cv, getASTName(name, true)); - cv.visitInsn(ICONST_1); - cv.visitTypeInsn(ANEWARRAY, Type.getInternalName(Node.class)); - cv.visitInsn(DUP); - cv.visitInsn(ICONST_0); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitInsn(AASTORE); - cv.visitVarInsn(ASTORE, 2); - cv.visitJumpInsn(GOTO, end); - cv.visitLabel(l); - } - - private void generateGetNodesMethod ( - final CodeVisitor cv, - final String owner, final String name, - final String field, final Label end) - { - Label l = generateIf(cv, getASTName(name, false)); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, "Ljava/util/List;"); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, "Ljava/util/List;"); - cv.visitMethodInsn( - INVOKEINTERFACE, "java/util/List", "size", "()I"); - cv.visitTypeInsn( - ANEWARRAY, Type.getInternalName(Node.class)); - cv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - "toArray", - "([Ljava/lang/Object;)[Ljava/lang/Object;"); - cv.visitTypeInsn(CHECKCAST, "[" + Type.getDescriptor(Node.class)); - cv.visitVarInsn(ASTORE, 2); - cv.visitJumpInsn(GOTO, end); - cv.visitLabel(l); - } - - private void generateAddNodeMethod ( - final CodeVisitor cv, - final String owner, final String name, - final String field, final String fieldDesc, - final Label end, final boolean add) - { - String s = getASTName(name, true); - Label l = generateIf(cv, s); - cv.visitVarInsn(ALOAD, 0); - if (add) { - cv.visitVarInsn(ALOAD, 2); - cv.visitTypeInsn( - CHECKCAST, fieldDesc.substring(1, fieldDesc.length() - 1)); - } else { - cv.visitInsn(ACONST_NULL); - } - cv.visitFieldInsn(PUTFIELD, owner, field, fieldDesc); - cv.visitJumpInsn(GOTO, end); - cv.visitLabel(l); - } - - private void generateAddNodesMethod ( - final CodeVisitor cv, - final String owner, final String name, - final String field, final String fieldDesc, - final Label end, final boolean add) - { - String s = getASTName(name, false); - Label l = generateIf(cv, s); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitVarInsn(ALOAD, 2); - cv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - add ? "add" : "remove", - add ? "(Ljava/lang/Object;)Z" : "(Ljava/lang/Object;)Z"); - cv.visitInsn(POP); - cv.visitJumpInsn(GOTO, end); - cv.visitLabel(l); - } - - private Label generateIf (final CodeVisitor cv, final String name) { - Label l = new Label(); - cv.visitVarInsn(ALOAD, 1); - cv.visitLdcInsn(name); - cv.visitMethodInsn( - INVOKEVIRTUAL, - "java/lang/Object", - "equals", - "(Ljava/lang/Object;)Z"); - cv.visitJumpInsn(IFEQ, l); - return l; - } - - public static String getASTName (final String name, final boolean single) { - char c = Character.toLowerCase(name.charAt(3)); - if (single) { - return c + name.substring(4); - } else { - return c + name.substring(4, name.length() - 1); - } - } - - public static String getFieldName (final String name, final int prefix) { - char c = Character.toLowerCase(name.charAt(prefix)); - return "_" + c + name.substring(prefix + 1); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/Parser.java b/fractaladl/src/org/objectweb/fractal/adl/Parser.java deleted file mode 100644 index d366854449cecc975f73c45e85d21802b0eec0ee..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/Parser.java +++ /dev/null @@ -1,44 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.io.InputStream; - -/** - * An Abstract Syntax Tree (AST) parser. - */ - -public interface Parser { - - /** - * Parses the given input stream and constructs the corresponding AST. - * - * @param is the input stream that must be parsed. - * @param source the source of this input stream (such as a file name). - * @return the AST corresponding to the given input stream content. - * @throws ParserException if an error occurs during parsing. - */ - - Node parse (InputStream is, String source) throws ParserException; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/ParserException.java b/fractaladl/src/org/objectweb/fractal/adl/ParserException.java deleted file mode 100644 index 9b1beeab1f4b04d6985600d21bd3a82d31c605df..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/ParserException.java +++ /dev/null @@ -1,95 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.io.PrintStream; -import java.io.PrintWriter; - -/** - * Thrown when an error occurs during the parsing of a file. - */ - -public class ParserException extends Exception { - - /** - * The exception that caused this exception. May be null. - */ - - private Exception exception; - - /** - * Constructs a new {@link ParserException}. - * - * @param msg a detail message. - * @param e the exception that caused this exception. - */ - - public ParserException (final String msg, final Exception e) { - super(msg); - this.exception = e; - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - System.err.println(this); - exception.printStackTrace(); - } else { - super.printStackTrace(); - } - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - s.println(this); - exception.printStackTrace(s); - } else { - super.printStackTrace(s); - } - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - s.write(this + "\n"); - exception.printStackTrace(s); - } else { - super.printStackTrace(s); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/SchedulerType.fractal b/fractaladl/src/org/objectweb/fractal/adl/SchedulerType.fractal deleted file mode 100644 index 1ae3810a5a1266840223e2eb5946b58d84456a8a..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/SchedulerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/StaticFractalBackend.fractal b/fractaladl/src/org/objectweb/fractal/adl/StaticFractalBackend.fractal deleted file mode 100644 index b1aa06d2354bbd3d30e6642d4a4f63336aa9617d..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/StaticFractalBackend.fractal +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/StaticJavaBackend.fractal b/fractaladl/src/org/objectweb/fractal/adl/StaticJavaBackend.fractal deleted file mode 100644 index 0b3d8a017493f89084a3ea51ad00c9476a403aa0..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/StaticJavaBackend.fractal +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/TaskMap.java b/fractaladl/src/org/objectweb/fractal/adl/TaskMap.java deleted file mode 100644 index 8eea93389748fa0714a20d716c3b2e91b9514aa8..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/TaskMap.java +++ /dev/null @@ -1,65 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl; - -import java.util.NoSuchElementException; - -import org.objectweb.deployment.scheduling.core.api.Task; - -/** - * A map associating {@link Task}s to task identifiers and task types. - * Two tasks of two distinct types may have the same identifier. - */ - -public interface TaskMap { - - /** - * Returns the tasks contained in this task map. - * - * @return the tasks contained in this task map. - */ - - Task[] getTasks (); - - /** - * Returns the task of the given type and identifier. - * - * @param type the type of the task that must be returned. - * @param id the identifier of the task that must be returned. - * @return the task whose type and identifier are given. - * @throws NoSuchElementException if there is no such task. - */ - - Task getTask (String type, Object id) throws NoSuchElementException; - - /** - * Adds the given task to this task map. - * - * @param type the type of the task to be added. - * @param id the identifier of the task to be added. - * @param task the task itself. - */ - - void addTask (String type, Object id, Task task); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentComponentLoader.java b/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentComponentLoader.java deleted file mode 100644 index af65a16cbcb3ad6aedaea2f3b27bfb9b3a4693cc..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentComponentLoader.java +++ /dev/null @@ -1,89 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.arguments; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.components.ComponentLoader; - -public class ArgumentComponentLoader extends ComponentLoader { - - public Definition load ( - final List loaded, - final String name, - final Map context) throws ADLException - { - String n = name; - Map c = context; - int i = name.indexOf('('); - if (i != -1) { - if (!name.endsWith(")")) { - throw new ADLException("Syntax error in definition name", null); - } - - n = name.substring(0, i); - c = new HashMap(); - Iterator j = context.keySet().iterator(); - while (j.hasNext()) { - String key = (String)j.next(); - if (!key.startsWith(" arg ")) { - c.put(key, context.get(key)); - } - } - - String args = name.substring(i + 1, name.length() - 1); - StringTokenizer st = new StringTokenizer(args, ","); - i = 0; - while (st.hasMoreTokens()) { - c.put(" arg " + (i++), st.nextToken()); - } - } - return super.load(loaded, n, c); - } - - public Definition resolveDefinitions ( - final List loaded, - final String nameList, - final Map context) throws ADLException - { - int c = nameList.lastIndexOf('('); - int p = c == -1 ? nameList.lastIndexOf(',') : nameList.lastIndexOf(',', c); - if (p == -1) { - return load(loaded, nameList, context); - } else { - Definition d = resolveDefinitions(loaded, nameList.substring(0, p), context); - Definition e = load(loaded, nameList.substring(p + 1), context); - e = (Definition)clone((Node)e, new HashMap()); - e = (Definition)merge((Node)e, (Node)d); - return e; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentDefinition.java b/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentDefinition.java deleted file mode 100644 index 3496605d41f10daf6cb7d2eb5b09e650998ed748..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentDefinition.java +++ /dev/null @@ -1,31 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.arguments; - -import org.objectweb.fractal.adl.Definition; - -public interface ArgumentDefinition extends Definition { - String getArguments (); - void setArguments (String arguments); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentLoader.java b/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentLoader.java deleted file mode 100644 index 224f51657a1a0ec34ad01c8cf2a7613c9f141f51..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/arguments/ArgumentLoader.java +++ /dev/null @@ -1,123 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.arguments; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.StringTokenizer; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.AbstractLoader; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Node; - -public class ArgumentLoader extends AbstractLoader { - - // -------------------------------------------------------------------------- - // Implementation of the Loader interface - // -------------------------------------------------------------------------- - - public Definition load (final String name, final Map context) - throws ADLException - { - Definition d = clientLoader.load(name, context); - Map values = new HashMap(); - if (d instanceof ArgumentDefinition) { - String args = ((ArgumentDefinition)d).getArguments(); - if (args != null) { - StringTokenizer st = new StringTokenizer(args, ","); - int i = 0; - while (st.hasMoreTokens()) { - String arg = st.nextToken(); - Object value = context.get(arg); - if (value == null) { - value = context.get(" arg " + i); - } - if (value == null) { - throw new ADLException( - "No value defined for argument '" + arg + "'", (Node)d, null); - } - values.put(arg, value); - ++i; - } - ((ArgumentDefinition)d).setArguments(null); - } - } - evaluate((Node)d, values); - return d; - } - - // -------------------------------------------------------------------------- - // Argument evaluation methods - // -------------------------------------------------------------------------- - - void evaluate (final Node node, final Map context) - throws ADLException - { - Map attrs = node.astGetAttributes(); - Iterator i = attrs.keySet().iterator(); - while (i.hasNext()) { - String attr = (String)i.next(); - String value = (String)attrs.get(attr); - if (value != null) { - try { - value = evaluate(value, context); - } catch (ADLException e) { - throw new ADLException(e.getMessage(), node, null); - } - attrs.put(attr, value); - } - } - node.astSetAttributes(attrs); - - String[] nodeTypes = node.astGetNodeTypes(); - for (int j = 0; j < nodeTypes.length; ++j) { - Node[] nodes = node.astGetNodes(nodeTypes[j]); - for (int k = 0; k < nodes.length; ++k) { - Node n = nodes[k]; - if (n != null) { - evaluate(n, context); - } - } - } - } - - String evaluate (final String s, final Map context) throws ADLException { - int i = s.indexOf("${"); - if (i == -1) { - return s; - } - int j = s.indexOf('}', i); - if (j == -1) { - throw new ADLException("Malformed variable reference in '" + s + "'", null); - } - String arg = s.substring(i + 2, j); - String value = (String)context.get(arg); - if (value == null) { - throw new ADLException("Undefined variable '" + arg + "'", null); - } - return evaluate(s.substring(0, i) + value + s.substring(j + 1), context); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/arguments/package.html b/fractaladl/src/org/objectweb/fractal/adl/arguments/package.html deleted file mode 100644 index 1704005e856353fb5a4332f9f73e7d99f917f22f..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/arguments/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to define parameterizable components. This module requires -the "components" module. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/Attribute.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/Attribute.java deleted file mode 100644 index d9ea1807a2be6dc345c6731a3f5ba887759e1207..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/Attribute.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -/** - * An AST node interface to define an attribute. - */ - -public interface Attribute { - String getName (); - void setName (String name); - String getValue (); - void setValue (String value); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeBuilder.java deleted file mode 100644 index d96b9b809dccf4df5439904a2bb0b00411ef6e75..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeBuilder.java +++ /dev/null @@ -1,38 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -/** - * A builder interface to set component attributes. - */ - -public interface AttributeBuilder { - - void setAttribute ( - Object component, - String attributeController, - String name, - String value, - Object context) throws Exception; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeCompiler.java deleted file mode 100644 index 53303050a76c8cbf2d46368d708e14c2c4f3bba9..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeCompiler.java +++ /dev/null @@ -1,162 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -import java.util.Map; -import java.util.NoSuchElementException; - -import org.objectweb.deployment.scheduling.core.api.Task; -import org.objectweb.deployment.scheduling.component.api.InstanceProviderTask; -import org.objectweb.deployment.scheduling.component.lib.AbstractAttributeSetterTask; -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.TaskMap; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.components.PrimitiveCompiler; -import org.objectweb.fractal.api.control.BindingController; - -/** - * A {@link PrimitiveCompiler} to compile {@link Attributes} nodes in definitions. - */ - -public class AttributeCompiler implements BindingController, PrimitiveCompiler { - - /** - * Name of the mandatory interface bound to the {@link AttributeBuilder} used - * by this compiler. - */ - - public final static String BUILDER_BINDING = "builder"; - - /** - * The {@link AttributeBuilder} used by this compiler. - */ - - public AttributeBuilder builder; - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc() { - return new String[] { BUILDER_BINDING }; - } - - public Object lookupFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - return builder; - } - return null; - } - - public void bindFc (final String itf, final Object value) { - if (itf.equals(BUILDER_BINDING)) { - builder = (AttributeBuilder)value; - } - } - - public void unbindFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - builder = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the Compiler interface - // -------------------------------------------------------------------------- - - public void compile ( - final ComponentContainer container, - final TaskMap tasks, - final Map context) throws ADLException - { - if (container instanceof AttributesContainer) { - Attributes attributes = ((AttributesContainer)container).getAttributes(); - if (attributes != null) { - InstanceProviderTask createTask = - (InstanceProviderTask)tasks.getTask("create", container); - - Task startTask = tasks.getTask("start", container); - - Attribute[] attrs = attributes.getAttributes(); - for (int i = 0; i < attrs.length; ++i) { - try { - // the task may already exist, in case of a shared component - tasks.getTask("attr" + attrs[i].getName(), container); - } catch (NoSuchElementException e) { - AttributeTask t = new AttributeTask( - builder, - attributes.getSignature(), - attrs[i].getName(), - attrs[i].getValue()); - t.setInstanceProviderTask(createTask); - - startTask.addPreviousTask(t); - - tasks.addTask("attr" + attrs[i].getName(), container, t); - } - } - } - } - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class AttributeTask extends AbstractAttributeSetterTask { - - private AttributeBuilder builder; - - private String attributeController; - - private String name; - - public AttributeTask ( - final AttributeBuilder builder, - final String attributeController, - final String name, - final String value) - { - this.builder = builder; - this.attributeController = attributeController; - this.name = name; - setValue(value); - } - - public void execute (final Object context) throws Exception { - Object component = getInstanceProviderTask().getInstance(); - builder.setAttribute( - component, - attributeController, - name, - (String)getValue(), - context); - } - - public String toString () { - return "T" + System.identityHashCode(this) + - "[AttributeTask(" + name + "," + getValue() + ")]"; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeLoader.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeLoader.java deleted file mode 100644 index 4fa31c35ccd4997ae6f8418046e1f1c955566464..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributeLoader.java +++ /dev/null @@ -1,187 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -import java.lang.reflect.Method; -import java.util.Map; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.AbstractLoader; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.components.ComponentDefinition; - -/** - * A {@link org.objectweb.fractal.adl.Loader} to check {@link Attributes} nodes - * in definitions. This loader checks that the Java attribute controller - * interfaces specified in these nodes exist, and that the attribute names and - * values are consistent with the methods of theses interfaces. - */ - -public class AttributeLoader extends AbstractLoader { - - // -------------------------------------------------------------------------- - // Implementation of the Loader interface - // -------------------------------------------------------------------------- - - public Definition load (final String name, final Map context) - throws ADLException - { - Definition d = clientLoader.load(name, context); - boolean extend = false; - if (d instanceof ComponentDefinition) { - extend = ((ComponentDefinition)d).getExtends() != null; - } - checkNode(d, extend); - return d; - } - - // -------------------------------------------------------------------------- - // Checking methods - // -------------------------------------------------------------------------- - - private void checkNode (final Object node, final boolean extend) - throws ADLException - { - if (node instanceof AttributesContainer) { - checkAttributesContainer((AttributesContainer)node, extend); - } - if (node instanceof ComponentContainer) { - Component[] comps = ((ComponentContainer)node).getComponents(); - for (int i = 0; i < comps.length; i++) { - checkNode(comps[i], extend); - } - } - } - - private void checkAttributesContainer ( - final AttributesContainer container, - final boolean extend) throws ADLException - { - Attributes attrs = container.getAttributes(); - if (attrs != null) { - String signature = attrs.getSignature(); - if (signature == null) { - if (!extend) { - throw new ADLException("Signature missing", (Node)attrs); - } else { - return; - } - } - ClassLoader cl = getClass().getClassLoader(); - Class c; - try { - c = cl.loadClass(signature); - } catch (ClassNotFoundException e) { - throw new ADLException( - "Invalid signature '" + signature + "'", (Node)attrs, e); - } - - Attribute[] attributes = attrs.getAttributes(); - for (int i = 0; i < attributes.length; ++i) { - String attrName = attributes[i].getName(); - String attrValue = attributes[i].getValue(); - if (attrName == null) { - throw new ADLException("Attribute name missing", (Node)attributes[i]); - } - if (attrValue == null) { - throw new ADLException("Attribute value missing", (Node)attributes[i]); - } - String getterName = - "get" + - Character.toUpperCase(attrName.charAt(0)) + - attrName.substring(1); - Method getter; - try { - getter = c.getMethod(getterName, new Class[0]); - } catch (Exception e) { - throw new ADLException("No such attribute", (Node)attributes[i], e); - } - Class attrType = getter.getReturnType(); - if (attrType.isPrimitive()) { - if (attrType.equals(Integer.TYPE)) { - try { - Integer.valueOf(attrValue); - } catch (NumberFormatException e) { - throw new ADLException( - "Bad integer value: " + attrValue, (Node)attributes[i]); - } - } else if (attrType.equals(Long.TYPE)) { - try { - Long.valueOf(attrValue); - } catch (NumberFormatException e) { - throw new ADLException( - "Bad long value: " + attrValue, (Node)attributes[i]); - } - } else if (attrType.equals(Float.TYPE)) { - try { - Float.valueOf(attrValue); - } catch (NumberFormatException e) { - throw new ADLException( - "Bad float value: " + attrValue, (Node)attributes[i]); - } - } else if (attrType.equals(Double.TYPE)) { - try { - Double.valueOf(attrValue); - } catch (NumberFormatException e) { - throw new ADLException( - "Bad double value: " + attrValue, (Node)attributes[i]); - } - } else if (attrType.equals(Byte.TYPE)) { - try { - Byte.valueOf(attrValue); - } catch (NumberFormatException e) { - throw new ADLException( - "Bad byte value: " + attrValue, (Node)attributes[i]); - } - } else if (attrType.equals(Character.TYPE)) { - if (attrValue.length() != 1) { - throw new ADLException( - "Bad char value: " + attrValue, (Node)attributes[i]); - } - } else if (attrType.equals(Short.TYPE)) { - try { - Short.valueOf(attrValue); - } catch (NumberFormatException e) { - throw new ADLException( - "Bad short value: " + attrValue, (Node)attributes[i]); - } - } else if (attrType.equals(Boolean.TYPE)) { - if (!attrValue.equals("true") && !attrValue.equals("false")) { - throw new ADLException( - "Bad boolean value: " + attrValue, (Node)attributes[i]); - } - } else { - throw new ADLException("Unexpected case", (Node)attributes[i]); - } - } else if (attrType != String.class) { - throw new ADLException( - "Unsupported attribute type: " + attrType, (Node)attributes[i]); - } - } - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/Attributes.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/Attributes.java deleted file mode 100644 index 740fd07670787b9802d13d1993693507f6c45a33..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/Attributes.java +++ /dev/null @@ -1,36 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -/** - * An AST node interface to define a set of attributes. - */ - -public interface Attributes { - String getSignature (); - void setSignature (String signature); - Attribute[] getAttributes (); - void addAttribute (Attribute attr); - void removeAttribute (Attribute attr); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributesContainer.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributesContainer.java deleted file mode 100644 index 600cde8700a0d39bbfdd5f4264fe6c159fd6e101..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/AttributesContainer.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -/** - * An AST node interface for nodes that can contain attributes. - */ - -public interface AttributesContainer { - Attributes getAttributes (); - void setAttributes (Attributes attributes); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/FractalAttributeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/FractalAttributeBuilder.java deleted file mode 100644 index e5c983364fd26c5432409028ff405020e929ca53..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/FractalAttributeBuilder.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.AttributeController; -import org.objectweb.fractal.util.Fractal; - -/** - * A Fractal based implementation of the {@link AttributeBuilder} interface. - * This implementation uses the Fractal API to set component attributes. - */ - -public class FractalAttributeBuilder extends JavaAttributeBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the AttributeBuilder interface - // -------------------------------------------------------------------------- - - public void setAttribute ( - final Object component, - final String attributeController, - final String name, - final String value, - final Object context) throws Exception - { - AttributeController attrCont = - Fractal.getAttributeController((Component)component); - super.setAttribute(attrCont, attributeController, name, value, context); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/JavaAttributeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/JavaAttributeBuilder.java deleted file mode 100644 index fc60ebf87a7a7f807ea42275959c66e16d68a4b7..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/JavaAttributeBuilder.java +++ /dev/null @@ -1,93 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -import java.lang.reflect.Method; - -/** - * A Java based implementation of the {@link AttributeBuilder} interface. - */ - -public class JavaAttributeBuilder implements AttributeBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the AttributeBuilder interface - // -------------------------------------------------------------------------- - - public void setAttribute ( - final Object component, - final String attributeController, - final String name, - final String value, - final Object context) throws Exception - { - Class c = component.getClass(); - - String attrName = Character.toUpperCase(name.charAt(0)) + name.substring(1); - - // sets the attribute's value - String getterName = "get" + attrName; - String setterName = "set" + attrName; - Method getter = c.getMethod(getterName, new Class[0]); - Method setter = c.getMethod(setterName, new Class[] { - getter.getReturnType() - }); - Class attrType = getter.getReturnType(); - Object attrValue; - if (attrType.equals(String.class)) { - attrValue = value; - } else if (attrType.isPrimitive()) { - if (attrType.equals(Integer.TYPE)) { - attrValue = Integer.valueOf(value); - } else if (attrType.equals(Long.TYPE)) { - attrValue = Long.valueOf(value); - } else if (attrType.equals(Float.TYPE)) { - attrValue = Float.valueOf(value); - } else if (attrType.equals(Double.TYPE)) { - attrValue = Double.valueOf(value); - } else if (attrType.equals(Byte.TYPE)) { - attrValue = Byte.valueOf(value); - } else if (attrType.equals(Character.TYPE)) { - if (value.length() != 1) { - throw new Exception("Bad char value: " + value); - } - attrValue = new Character(value.charAt(0)); - } else if (attrType.equals(Short.TYPE)) { - attrValue = Short.valueOf(value); - } else if (attrType.equals(Boolean.TYPE)) { - if (!value.equals("true") && - !value.equals("false")) - { - throw new Exception("Bad boolean value: " + value); - } - attrValue = new Boolean(value.equals("true")); - } else { - throw new Exception("Unexpected case"); - } - } else { - throw new Exception("Unsupported attribute type: " + attrType); - } - setter.invoke(component, new Object[]{attrValue}); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/StaticFractalAttributeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/StaticFractalAttributeBuilder.java deleted file mode 100644 index 7032d2e3ccfb7b7148a23fbfef5a8455e44efd00..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/StaticFractalAttributeBuilder.java +++ /dev/null @@ -1,68 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -import java.io.PrintWriter; -import java.lang.reflect.Method; -import java.util.Map; - -/** - * A Fractal based, static implementation of the {@link AttributeBuilder} - * interface. This implementation produces code that uses the Fractal API to - * set component attributes. - */ - -public class StaticFractalAttributeBuilder implements AttributeBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the AttributeBuilder interface - // -------------------------------------------------------------------------- - - public void setAttribute ( - final Object component, - final String attributeController, - final String name, - final String value, - final Object context) throws Exception - { - String v = value; - Class c = getClass().getClassLoader().loadClass(attributeController); - String attrName = Character.toUpperCase(name.charAt(0)) + name.substring(1); - Method getter = c.getMethod("get" + attrName, new Class[0]); - if (getter.getReturnType() == String.class) { - // TODO handle escape characters (\n, \r, ...) - v = "\"" + v + "\""; - } - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("(("); - pw.print(attributeController); - pw.print(")Fractal.getAttributeController("); - pw.print(component); - pw.print(")).set"); - pw.print(attrName); - pw.print("("); - pw.print(v); - pw.println(");"); - } -} \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/StaticJavaAttributeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/attributes/StaticJavaAttributeBuilder.java deleted file mode 100644 index 7880f3cd6a6dbb2f8500a5621ee7dc33e1892e08..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/StaticJavaAttributeBuilder.java +++ /dev/null @@ -1,69 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.attributes; - -import java.io.PrintWriter; -import java.lang.reflect.Method; -import java.util.Map; - -/** - * A Java based, static implementation of the {@link AttributeBuilder} - * interface. This implementation produces standard Java code that sets - * component attributes. - */ - -public class StaticJavaAttributeBuilder implements AttributeBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the AttributeBuilder interface - // -------------------------------------------------------------------------- - - public void setAttribute ( - final Object component, - final String attributeController, - final String name, - final String value, - final Object context) throws Exception - { - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - if (((String)component).startsWith("P")) { - String v = value; - Class c = getClass().getClassLoader().loadClass(attributeController); - String attrName = Character.toUpperCase(name.charAt(0)) + name.substring(1); - Method getter = c.getMethod("get" + attrName, new Class[0]); - if (getter.getReturnType() == String.class) { - // TODO handle escape characters (\n, \r, ...) - v = "\"" + v + "\""; - } - pw.print(component); - pw.print(".set"); - pw.print(name); - pw.print('('); - pw.print(v); - pw.println(");"); - } else { - // does nothing: composite component attributes not supported - } - } -} \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/attributes/package.html b/fractaladl/src/org/objectweb/fractal/adl/attributes/package.html deleted file mode 100644 index e2653f10e5840ccdbd657b66918fb9743f7523e8..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/attributes/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to define component attributes. This module requires the -"components" module. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/Binding.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/Binding.java deleted file mode 100644 index e02e0a8d86e14d69cb7b9387ecc4e6a557167aad..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/Binding.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -/** - * An AST node interface to define a binding. - */ - -public interface Binding { - String getTo (); - void setTo (String arg); - String getFrom (); - void setFrom (String arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingBuilder.java deleted file mode 100644 index adc1a0d45486b8143ec52941308ace02cf85ac66..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -/** - * A builder interface to build bindings. - */ - -public interface BindingBuilder { - - int NORMAL_BINDING = 0; - - int EXPORT_BINDING = 1; - - int IMPORT_BINDING = 2; - - void bindComponent ( - int type, - Object client, - String clientItf, - Object server, - String serverItf, - Object context) throws Exception; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingCompiler.java deleted file mode 100644 index 93b4c52b412ab57d9970a372be0588072a882244..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingCompiler.java +++ /dev/null @@ -1,219 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -import java.util.HashMap; -import java.util.Map; -import java.util.NoSuchElementException; - -import org.objectweb.deployment.scheduling.core.api.Task; -import org.objectweb.deployment.scheduling.component.api.InstanceProviderTask; -import org.objectweb.deployment.scheduling.component.lib.AbstractRequireInstanceProviderTask; -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.TaskMap; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.components.ComponentPair; -import org.objectweb.fractal.adl.components.PrimitiveCompiler; -import org.objectweb.fractal.api.control.BindingController; - -/** - * A {@link PrimitiveCompiler} to compile {@link Binding} nodes in definitions. - */ - -public class BindingCompiler implements BindingController, PrimitiveCompiler { - - /** - * Name of the mandatory interface bound to the {@link BindingBuilder} used - * by this compiler. - */ - - public final static String BUILDER_BINDING = "builder"; - - /** - * The {@link BindingBuilder} used by this compiler. - */ - - public BindingBuilder builder; - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc() { - return new String[] { BUILDER_BINDING }; - } - - public Object lookupFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - return builder; - } - return null; - } - - public void bindFc (final String itf, final Object value) { - if (itf.equals(BUILDER_BINDING)) { - builder = (BindingBuilder)value; - } - } - - public void unbindFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - builder = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the Compiler interface - // -------------------------------------------------------------------------- - - public void compile ( - final ComponentContainer container, - final TaskMap tasks, - final Map context) throws ADLException - { - Map subComponents = new HashMap(); - subComponents.put("this", container); - Component[] comps = container.getComponents(); - for (int i = 0; i < comps.length; i++) { - subComponents.put(comps[i].getName(), comps[i]); - } - - if (container instanceof BindingContainer) { - Binding[] bindings = ((BindingContainer)container).getBindings(); - for (int i = 0; i < bindings.length; i++) { - Binding binding = bindings[i]; - - String value = binding.getFrom(); - int index = value.indexOf('.'); - Object clientComp = subComponents.get(value.substring(0, index)); - String clientItf = value.substring(index + 1); - - value = binding.getTo(); - index = value.indexOf('.'); - Object serverComp = subComponents.get(value.substring(0, index)); - String serverItf = value.substring(index + 1); - - InstanceProviderTask createClientTask = - (InstanceProviderTask)tasks.getTask("create", clientComp); - InstanceProviderTask createServerTask = - (InstanceProviderTask)tasks.getTask("create", serverComp); - - int type = BindingBuilder.NORMAL_BINDING; - if (binding.getFrom().startsWith("this.")) { - type = BindingBuilder.EXPORT_BINDING; - } - if (binding.getTo().startsWith("this.")) { - type = BindingBuilder.IMPORT_BINDING; - } - - try { - // the task may already exist, in case of a shared component - tasks.getTask("bind" + clientItf, clientComp); - } catch (NoSuchElementException e) { - BindTask bindTask = new BindTask(builder, type, clientItf, serverItf); - bindTask.setInstanceProviderTask(createClientTask); - bindTask.setServerInstanceProviderTask(createServerTask); - - tasks.addTask("bind" + clientItf, clientComp, bindTask); - - if (clientComp != container) { - Task addTask = tasks.getTask("add", new ComponentPair( - container, (Component)clientComp)); - bindTask.addPreviousTask(addTask); - } - if (serverComp != container) { - Task addTask = tasks.getTask("add", new ComponentPair( - container, (Component)serverComp)); - bindTask.addPreviousTask(addTask); - } - - Task startTask = tasks.getTask("start", clientComp); - startTask.addPreviousTask(bindTask); - } - } - } - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class BindTask extends AbstractRequireInstanceProviderTask { - - private InstanceProviderTask serverInstanceProviderTask; - - private BindingBuilder builder; - - private int type; - - private String clientItf; - - private String serverItf; - - public BindTask ( - final BindingBuilder builder, - final int type, - final String clientItf, - final String serverItf) - { - this.builder = builder; - this.type = type; - this.clientItf = clientItf; - this.serverItf = serverItf; - } - - public InstanceProviderTask getServerInstanceProviderTask () { - return serverInstanceProviderTask; - } - - public void setServerInstanceProviderTask (final InstanceProviderTask task) { - if (serverInstanceProviderTask != null) { - removePreviousTask(serverInstanceProviderTask); - } - serverInstanceProviderTask = task; - if (serverInstanceProviderTask != null) { - addPreviousTask(serverInstanceProviderTask); - } - } - - public void execute (final Object context) throws Exception { - Object client = getInstanceProviderTask().getInstance(); - Object server = getServerInstanceProviderTask().getInstance(); - builder.bindComponent(type, client, clientItf, server, serverItf, context); - } - - public Object getResult () { - return null; - } - - public void setResult (final Object result) { - } - - public String toString () { - return "T" + System.identityHashCode(this) + - "[BindTask(" + clientItf + "," + serverItf + ")]"; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingContainer.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingContainer.java deleted file mode 100644 index a6ab42d5d83a009194ff21f46bcbbe4db38283da..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -/** - * An AST node interface for nodes that can contain bindings. - */ - -public interface BindingContainer { - Binding[] getBindings (); - void addBinding (Binding arg); - void removeBinding (Binding arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingLoader.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingLoader.java deleted file mode 100644 index 9bdbe93aafbb9ef52aaa3a5abc8d09bfd1f224ba..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/BindingLoader.java +++ /dev/null @@ -1,141 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.AbstractLoader; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.interfaces.Interface; -import org.objectweb.fractal.adl.interfaces.InterfaceContainer; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * A {@link org.objectweb.fractal.adl.Loader} to check {@link Binding} nodes - * in definitions. This loader checks that the from and to interfaces - * specified in these nodes exist. - */ - -public class BindingLoader extends AbstractLoader { - - // -------------------------------------------------------------------------- - // Implementation of the Loader interface - // -------------------------------------------------------------------------- - - public Definition load (final String name, final Map context) - throws ADLException - { - Definition d = clientLoader.load(name, context); - checkNode(d); - return d; - } - - // -------------------------------------------------------------------------- - // Checking methods - // -------------------------------------------------------------------------- - - private void checkNode (final Object node) throws ADLException { - if (node instanceof BindingContainer) { - Map itfMap = new HashMap(); - if (node instanceof InterfaceContainer) { - Interface[] itfs = ((InterfaceContainer)node).getInterfaces(); - for (int i = 0; i < itfs.length; i++) { - Interface itf = itfs[i]; - itfMap.put("this." + itf.getName(), itf); - } - } - if (node instanceof ComponentContainer) { - Component[] comps = ((ComponentContainer)node).getComponents(); - for (int i = 0; i < comps.length; i++) { - Component comp = comps[i]; - if (comp instanceof InterfaceContainer) { - Interface[] itfs = ((InterfaceContainer)comp).getInterfaces(); - for (int j = 0; j < itfs.length; j++) { - Interface itf = itfs[j]; - itfMap.put(comp.getName() + "." + itf.getName(), itf); - } - } - } - } - Binding[] bindings = ((BindingContainer)node).getBindings(); - for (int i = 0; i < bindings.length; i++) { - Binding binding = bindings[i]; - checkBinding(binding, itfMap); - } - Set fromItfs = new HashSet(); - for (int i = 0; i < bindings.length; i++) { - if (fromItfs.contains(bindings[i].getFrom())) { - throw new ADLException( - "Multiple bindings from the same interface", (Node)bindings[i]); - } else { - fromItfs.add(bindings[i].getFrom()); - } - } - } - if (node instanceof ComponentContainer) { - Component[] comps = ((ComponentContainer)node).getComponents(); - for (int i = 0; i < comps.length; i++) { - checkNode(comps[i]); - } - } - } - - private void checkBinding (final Binding binding, final Map itfs) - throws ADLException - { - if (binding.getFrom() == null) { - throw new ADLException("'from' interface missing", (Node)binding); - } - if (binding.getTo() == null) { - throw new ADLException("'to' interface missing", (Node)binding); - } - Interface fromItf = getInterface(binding.getFrom(), itfs); - Interface toItf = getInterface(binding.getTo(), itfs); - if (fromItf == null && !binding.getFrom().endsWith("-controller")) { - throw new ADLException( - "No such interface '" + binding.getFrom() + "'", (Node)binding); - } else if (toItf == null && !binding.getTo().endsWith("-controller")) { - throw new ADLException( - "No such interface '" + binding.getTo() + "'", (Node)binding); - } - checkBinding(binding, fromItf, toItf); - } - - void checkBinding ( - final Binding binding, - final Interface fromItf, - final Interface toItf) throws ADLException - { - } - - Interface getInterface (final String name, final Map itfs) { - return (Interface)itfs.get(name); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/FractalBindingBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/FractalBindingBuilder.java deleted file mode 100644 index d5fa3c380df767a4c0d5ff13978ca4bd211a8fde..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/FractalBindingBuilder.java +++ /dev/null @@ -1,58 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.util.Fractal; - -/** - * A Fractal based implementation of the {@link BindingBuilder} interface. - * This implementation uses the Fractal API to bind components. - */ - -public class FractalBindingBuilder implements BindingBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the BindingBuilder interface - // -------------------------------------------------------------------------- - - public void bindComponent ( - final int type, - final Object client, - final String clientItf, - final Object server, - final String serverItf, - final Object context) throws Exception - { - BindingController bc = Fractal.getBindingController((Component)client); - Object itf; - if (type == IMPORT_BINDING) { - itf = Fractal.getContentController((Component)server).getFcInternalInterface(serverItf); - } else { - itf = ((Component)server).getFcInterface(serverItf); - } - bc.bindFc(clientItf, itf); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/JavaBindingBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/JavaBindingBuilder.java deleted file mode 100644 index dcb32eedc3c3e755fafa475a2f3a2bfaeb9e33b4..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/JavaBindingBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * A Java based implementation of the {@link BindingBuilder} interface. - */ - -public class JavaBindingBuilder implements BindingBuilder { - - /** - * TODO. - */ - - private Map bindingLists = new WeakHashMap(); - - // -------------------------------------------------------------------------- - // Implementation of the BindingBuilder interface - // -------------------------------------------------------------------------- - - public void bindComponent ( - final int type, - final Object clientComp, - final String clientItf, - final Object serverComp, - final String serverItf, - final Object context) throws Exception - { - Binding b = new Binding(); - b.client = clientComp; - b.clientInterface = clientItf; - b.server = serverComp; - b.serverInterface = serverItf; - - List bindings = (List)bindingLists.get(context); - if (bindings == null) { - bindings = new ArrayList(); - bindingLists.put(context, bindings); - } - bindings.add(b); - - for (int i = 0; i < bindings.size(); ++i) { - b = (Binding)bindings.get(i); - Object client = b.client; - String clientInterface = b.clientInterface; - Object server = b.server; - String serverInterface = b.serverInterface; - top: while (server != null && server instanceof Map) { - for (int j = 0; j < bindings.size(); ++j) { - b = (Binding)bindings.get(j); - if (b.client == server && b.clientInterface.equals(serverInterface)) { - server = b.server; - serverInterface = b.serverInterface; - continue top; - } - } - server = null; - } - if (server != null) { - if (client instanceof Map) { - ((Map)client).put(clientInterface, server); - } else { - Method m = client.getClass().getMethod("bindFc", new Class[] { - String.class, Object.class - }); - m.invoke(client, new Object[] { clientInterface, server }); - bindings.remove(i--); - } - } - } - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class Binding { - Object client; - String clientInterface; - Object server; - String serverInterface; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/StaticFractalBindingBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/StaticFractalBindingBuilder.java deleted file mode 100644 index b31498e6282b253a0eeecdf9839b6e867df83c38..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/StaticFractalBindingBuilder.java +++ /dev/null @@ -1,70 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -import java.io.PrintWriter; -import java.util.Map; - -/** - * A Fractal based, static implementation of the {@link BindingBuilder} - * interface. This implementation produces code that uses the Fractal API to - * bind components. - */ - -public class StaticFractalBindingBuilder implements BindingBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the BindingBuilder interface - // -------------------------------------------------------------------------- - - public void bindComponent ( - final int type, - final Object client, - final String clientItf, - final Object server, - final String serverItf, - final Object context) throws Exception - { - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("Fractal.getBindingController("); - pw.print(client); - pw.print(").bindFc(\""); - pw.print(clientItf); - pw.print("\", "); - if (type == IMPORT_BINDING) { - pw.print("Fractal.getContentController("); - pw.print(server); - pw.print(").getFcInternalInterface(\""); - pw.print(serverItf); - pw.print(")"); - } else { - pw.print(server); - pw.print(".getFcInterface(\""); - pw.print(serverItf); - pw.print(")"); - } - pw.println(");"); - } -} - diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/StaticJavaBindingBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/StaticJavaBindingBuilder.java deleted file mode 100644 index 191a2e47f1093b6878ce5cad6753313f3ad4122c..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/StaticJavaBindingBuilder.java +++ /dev/null @@ -1,121 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -import java.io.PrintWriter; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * A Java based, static implementation of the {@link BindingBuilder} interface. - * This implementation produces standard Java code that binds components. - */ - -public class StaticJavaBindingBuilder implements BindingBuilder { - - /** - * TODO. - */ - - private Map bindingLists = new WeakHashMap(); - - // -------------------------------------------------------------------------- - // Implementation of the BindingBuilder interface - // -------------------------------------------------------------------------- - - public void bindComponent ( - final int type, - final Object clientComp, - final String clientItf, - final Object serverComp, - final String serverItf, - final Object context) - { - Binding b = new Binding(); - b.client = (String)clientComp; - b.clientInterface = clientItf; - b.server = (String)serverComp; - b.serverInterface = serverItf; - - List bindings = (List)bindingLists.get(context); - if (bindings == null) { - bindings = new ArrayList(); - bindingLists.put(context, bindings); - } - bindings.add(b); - - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - - // generate code to create direct bindings between the primitive components - for (int i = 0; i < bindings.size(); ++i) { - b = (Binding)bindings.get(i); - String client = (String)b.client; - String clientInterface = b.clientInterface; - String server = (String)b.server; - String serverInterface = b.serverInterface; - top: while (server != null && !server.startsWith("P")) { - for (int j = 0; j < bindings.size(); ++j) { - b = (Binding)bindings.get(j); - if (b.client.equals(server) && b.clientInterface.equals(serverInterface)) { - server = b.server; - serverInterface = b.serverInterface; - continue top; - } - } - server = null; - } - if (server != null) { - if (client.startsWith("P") ){ - pw.print(client); - pw.print(".bindFc(\""); - pw.print(clientInterface); - pw.print("\","); - pw.print(server); - pw.println(");"); - bindings.remove(i--); - } else { - pw.print(client); - pw.print(".put(\""); - pw.print(clientInterface); - pw.print("\","); - pw.print(server); - pw.println(");"); - } - } - } - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class Binding { - String client; - String clientInterface; - String server; - String serverInterface; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/TypeBindingLoader.java b/fractaladl/src/org/objectweb/fractal/adl/bindings/TypeBindingLoader.java deleted file mode 100644 index 614bb3b267f356fe55ff9fb7ff183f6ff13d8629..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/TypeBindingLoader.java +++ /dev/null @@ -1,128 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.bindings; - -import org.objectweb.fractal.adl.bindings.BindingLoader; -import org.objectweb.fractal.adl.interfaces.Interface; -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.types.TypeInterface; - -import java.util.Iterator; -import java.util.Map; - -/** - * An extended {@link BindingLoader} for components with typed interfaces. In - * addition to the checks performed by {@link BindingLoader}, this - * implementation checks that from interfaces are client interfaces, that - * to interfaces are server interfaces, and that the signatures and contingency - * of client and server interfaces are compatible. - */ - -public class TypeBindingLoader extends BindingLoader { - - // -------------------------------------------------------------------------- - // Overriden methods - // -------------------------------------------------------------------------- - - void checkBinding ( - final Binding binding, - final Interface fromItf, - final Interface toItf) throws ADLException - { - if (fromItf instanceof TypeInterface && toItf instanceof TypeInterface) { - TypeInterface cItf = (TypeInterface)fromItf; - TypeInterface sItf = (TypeInterface)toItf; - if (binding.getFrom().startsWith("this.")) { - if (!TypeInterface.SERVER_ROLE.equals(cItf.getRole())) { - throw new ADLException( - "Invalid binding: 'from' interface is not an internal client interface", (Node)binding); - } - } else { - if (!TypeInterface.CLIENT_ROLE.equals(cItf.getRole())) { - throw new ADLException( - "Invalid binding: 'from' interface is not a client interface", (Node)binding); - } - } - if (binding.getTo().startsWith("this.")) { - if (!TypeInterface.CLIENT_ROLE.equals(sItf.getRole())) { - throw new ADLException( - "Invalid binding: 'to' interface is not an internal server interface", (Node)binding); - } - } else { - if (!TypeInterface.SERVER_ROLE.equals(sItf.getRole())) { - throw new ADLException( - "Invalid binding: 'to' interface is not a server interface", (Node)binding); - } - } - - boolean cIsMandatory = true; - if (TypeInterface.OPTIONAL_CONTINGENCY.equals(cItf.getContingency())) { - cIsMandatory = false; - } - boolean sIsMandatory = true; - if (TypeInterface.OPTIONAL_CONTINGENCY.equals(sItf.getContingency())) { - sIsMandatory = false; - } - if (cIsMandatory && !sIsMandatory) { - throw new ADLException( - "Invalid binding: binding from mandatory to optional interface", (Node)binding); - } - - ClassLoader cl = getClass().getClassLoader(); - try { - Class cClass = cl.loadClass(cItf.getSignature()); - Class sClass = cl.loadClass(sItf.getSignature()); - if (!cClass.isAssignableFrom(sClass)) { - throw new ADLException( - "Invalid binding: incompatible signatures", (Node)binding); - } - } catch (ClassNotFoundException e) { - } - } - } - - Interface getInterface (final String name, final Map itfs) { - Interface itf = super.getInterface(name, itfs); - if (itf == null) { - Iterator i = itfs.keySet().iterator(); - while (i.hasNext()) { - String n = (String)i.next(); - itf = (Interface)itfs.get(n); - if (itf instanceof TypeInterface) { - TypeInterface typeItf = (TypeInterface)itf; - String cardinality = typeItf.getCardinality(); - if (TypeInterface.COLLECTION_CARDINALITY.equals(cardinality)) { - if (name.startsWith(n)) { - return itf; - } - } - } - } - return null; - } else { - return itf; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/bindings/package.html b/fractaladl/src/org/objectweb/fractal/adl/bindings/package.html deleted file mode 100644 index 439380fe8964c6e47109eda474a71451d1143750..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/bindings/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -A Fractal ADL module to define component bindings. This module requires the -"components" and "interfaces" modules (the "types" module is also required to -use the TypeBindingLoader). - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/comments/Comment.java b/fractaladl/src/org/objectweb/fractal/adl/comments/Comment.java deleted file mode 100644 index 7e45fccdcddf72c78395b875b0313677506df3cd..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/comments/Comment.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.comments; - -/** - * An AST node interface to define a comment. - */ - -public interface Comment { - String getLanguage (); - void setLanguage (String language); - String getText (); - void setText (String text); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/comments/CommentContainer.java b/fractaladl/src/org/objectweb/fractal/adl/comments/CommentContainer.java deleted file mode 100644 index 98b33ea8cbd382ce661df8ac4afdbe6f8f5bda55..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/comments/CommentContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.comments; - -/** - * An AST node interface for nodes that can contain comments. - */ - -public interface CommentContainer { - Comment[] getComments (); - void addComment (Comment comment); - void removeComment (Comment comment); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/comments/package.html b/fractaladl/src/org/objectweb/fractal/adl/comments/package.html deleted file mode 100644 index 604889948da6ea84b2d128415539cbb17d2e0f69..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/comments/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to add comments in component definitions. This module -does not require any other module. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/Component.java b/fractaladl/src/org/objectweb/fractal/adl/components/Component.java deleted file mode 100644 index c4a0075980b6a920a938cf6d47b8e98eabf42d99..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/Component.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -/** - * An AST node interface to define a sub component. - */ - -public interface Component extends ComponentContainer { - String getName (); - void setName (String arg); - String getDefinition (); - void setDefinition (String arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/components/ComponentBuilder.java deleted file mode 100644 index 2c2a97919a743fbf710666caf5b4333690f542d9..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -/** - * A builder interface to add and start components. - */ - -public interface ComponentBuilder { - - void addComponent ( - Object superComponent, - Object subComponent, - String name, - Object context) throws Exception; - - void startComponent (Object component, Object context) throws Exception; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentCompiler.fractal b/fractaladl/src/org/objectweb/fractal/adl/components/ComponentCompiler.fractal deleted file mode 100644 index 435fdc03081802ebce748cc0fb5f1b89cdf73eec..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentCompiler.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/components/ComponentCompiler.java deleted file mode 100644 index f6818ee75ca6f0d1c2bff982cccf20c1bf5d95c4..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentCompiler.java +++ /dev/null @@ -1,117 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import java.util.Iterator; -import java.util.Map; -import java.util.TreeMap; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Compiler; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.TaskMap; -import org.objectweb.fractal.api.control.BindingController; - -/** - * Basic implementation of the {@link Compiler} interface. This implementation - * delegates definition compilation requests to a set of - * {@link PrimitiveCompiler}s. - */ - -public class ComponentCompiler implements BindingController, Compiler { - - /** - * Name of the collection interface bound to the {@link PrimitiveCompiler}s - * used by this compiler. - */ - - public final static String PRIMITIVE_COMPILERS_BINDING = "primitive-compilers"; - - /** - * The primitive compilers used by this compiler. - */ - - public Map primitiveCompilers = new TreeMap(); - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc() { - return (String[])primitiveCompilers.keySet().toArray(new String[primitiveCompilers.size()]); - } - - public Object lookupFc (final String itf) { - if (itf.startsWith(PRIMITIVE_COMPILERS_BINDING)) { - return primitiveCompilers.get(itf); - } - return null; - } - - public void bindFc (final String itf, final Object value) { - if (itf.startsWith(PRIMITIVE_COMPILERS_BINDING)) { - primitiveCompilers.put(itf, value); - } - } - - public void unbindFc (final String itf) { - if (itf.startsWith(PRIMITIVE_COMPILERS_BINDING)) { - primitiveCompilers.remove(itf); - } - } - - // -------------------------------------------------------------------------- - // Implementation of the Compiler interface - // -------------------------------------------------------------------------- - - public void compile ( - final Definition definition, - final TaskMap tasks, - final Map context) throws ADLException - { - if (definition instanceof ComponentContainer) { - compile((ComponentContainer)definition, tasks, context); - } - } - - // -------------------------------------------------------------------------- - // Compilation methods - // -------------------------------------------------------------------------- - - void compile ( - final ComponentContainer container, - final TaskMap tasks, - final Map context) throws ADLException - { - Component[] comps = container.getComponents(); - for (int i = 0; i < comps.length; i++) { - compile(comps[i], tasks, context); - } - - Iterator it = primitiveCompilers.values().iterator(); - while (it.hasNext()) { - ((PrimitiveCompiler)it.next()).compile(container, tasks, context); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentContainer.java b/fractaladl/src/org/objectweb/fractal/adl/components/ComponentContainer.java deleted file mode 100644 index c94441ddf9982fe8d8c55ff8b4bd6d168ce111c8..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -/** - * An AST node interface for nodes that can contain sub components. - */ - -public interface ComponentContainer { - Component[] getComponents (); - void addComponent (Component arg); - void removeComponent (Component arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentDefinition.java b/fractaladl/src/org/objectweb/fractal/adl/components/ComponentDefinition.java deleted file mode 100644 index b0ac7ff5f01209928008f7d9c41666bd8c257197..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentDefinition.java +++ /dev/null @@ -1,36 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import org.objectweb.fractal.adl.Definition; - -/** - * An extended {@link Definition} interface for definitions that can contain - * sub components. - */ - -public interface ComponentDefinition extends Definition, ComponentContainer { - String getExtends (); - void setExtends (String arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentLoader.java b/fractaladl/src/org/objectweb/fractal/adl/components/ComponentLoader.java deleted file mode 100644 index 31548c1bbb2837123768cff0535eca6a03af1944..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentLoader.java +++ /dev/null @@ -1,465 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.Type; -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.AbstractNode; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.AbstractLoader; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.NodeClassLoader; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Iterator; -import java.util.HashMap; -import java.util.Set; - -/** - * A {@link org.objectweb.fractal.adl.Loader} to check {@link Component} nodes - * in definitions. This loader checks sub component names, loads the definitons - * referenced by the component nodes (and the "extends" attribute), and merges - * all these definitions into a single one (by following inheritance rules). - */ - -public class ComponentLoader extends AbstractLoader { - - /** - * TODO. - */ - - private Map NAME_ATTRIBUTES; - - private MergeClassLoader mergeClassLoader; - - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public ComponentLoader () { - NAME_ATTRIBUTES = new HashMap(); - NAME_ATTRIBUTES.put("component", "name"); - NAME_ATTRIBUTES.put("interface", "name"); - NAME_ATTRIBUTES.put("binding", "from"); - NAME_ATTRIBUTES.put("attribute", "name"); - NAME_ATTRIBUTES.put("coordinates", "name"); - NAME_ATTRIBUTES.put("property", "name"); - mergeClassLoader = new MergeClassLoader(getClass().getClassLoader()); - } - - // ------------------------------------------------------------------------- - // Implementation of the Loader interface - // ------------------------------------------------------------------------- - - public Definition load (final String name, final Map context) - throws ADLException - { - return load(new ArrayList(), name, context); - } - - public Definition load ( - final List loaded, - final String name, - final Map context) throws ADLException - { - if (loaded.contains(name)) { - throw new ADLException("Cycle in definition references: " + loaded, null); - } - List l = new ArrayList(loaded); - l.add(name); - Definition d = clientLoader.load(name, context); - if (d instanceof ComponentDefinition) { - ComponentDefinition container = (ComponentDefinition)d; - normalizeComponentContainer(container); - if (container.getExtends() != null) { - try { - d = (Definition)merge((Node)d, (Node)resolveDefinitions(l, container.getExtends(), context)); - } catch (ADLException e) { - throw new ADLException( - "Cannot load super definition(s)", (Node)container, e); - } - container = (ComponentDefinition)d; - container.setExtends(null); - } - resolveComponentContainer(l, container, container, context); - } - return d; - } - - // ------------------------------------------------------------------------- - // First pass: normalization - // ------------------------------------------------------------------------- - - public void normalizeComponentContainer (final ComponentContainer container) - throws ADLException - { - Set names = new HashSet(); - Component[] comps = container.getComponents(); - for (int i = 0; i < comps.length; i++) { - Component comp = comps[i]; - String name = comp.getName(); - if (name == null) { - throw new ADLException("Component name missing", (Node)comp); - } - if (names.contains(name)) { - throw new ADLException( - "Duplicated component name '" + name + "'", (Node)comp); - } else { - names.add(name); - } - normalizeComponentContainer(comp); - if (name.indexOf('/') != -1) { - container.removeComponent(comp); - addComponent(container, comp); - } - } - } - - public void addComponent ( - final ComponentContainer container, Component comp) throws ADLException - { - String name = comp.getName(); - int p = name.indexOf('/'); - if (p == -1) { - Component c = getComponent(container, name); - if (c != null) { - container.removeComponent(c); - comp = (Component)merge((Node)comp, (Node)c); - } - container.addComponent(comp); - } else { - Component parent = getComponent(container, name.substring(0, p)); - if (parent == null) { - try { - parent = (Component)comp.getClass().newInstance(); - } catch (InstantiationException e) { - throw new Error("Internal error"); - } catch (IllegalAccessException e) { - throw new Error("Internal error"); - } - parent.setName(name.substring(0, p)); - container.addComponent(parent); - } - comp.setName(name.substring(p + 1)); - addComponent(parent, comp); - } - } - - public Component getComponent ( - final ComponentContainer container, - final String name) - { - Component[] comps = container.getComponents(); - for (int i = 0; i < comps.length; i++) { - Component comp = comps[i]; - if (comp.getName().equals(name)) { - return comp; - } - } - return null; - } - - public Component getPathComponent ( - final ComponentContainer container, - final String name) - { - int p = name.indexOf('/'); - if (p == -1) { - return getComponent(container, name); - } else { - Component parent = getComponent(container, name.substring(0, p)); - return getPathComponent(parent, name.substring(p + 1)); - } - } - - // ------------------------------------------------------------------------- - // Second pass: definition references resolution - // ------------------------------------------------------------------------- - - public void resolveComponentContainer ( - final List loaded, - final ComponentContainer topLevelDefinition, - final ComponentContainer container, - final Map context) throws ADLException - { - Component[] comps = container.getComponents(); - Component[] newComps = new Component[comps.length]; - for (int i = 0; i < comps.length; i++) { - newComps[i] = comps[i]; - } - - for (int i = 0; i < comps.length; i++) { - Component comp = comps[i]; - resolveComponentContainer(loaded, topLevelDefinition, comp, context); - String definition = comp.getDefinition(); - if (definition != null) { - if (definition.indexOf('/') != -1) { - // shared component - for (int j = 0; j < comps.length; j++) { - container.removeComponent(comps[j]); - } - for (int j = 0; j < comps.length; j++) { - container.addComponent(newComps[j]); - comps[j] = newComps[j]; - } - newComps[i] = getPathComponent(topLevelDefinition, definition); - } else { - Definition d; - try { - d = resolveDefinitions(loaded, definition, context); - } catch (ADLException e) { - throw new ADLException( - "Cannot load referenced definition(s)", (Node)comp, e); - } - newComps[i] = (Component)merge((Node)comp, (Node)d); - } - newComps[i].setDefinition(null); - } - } - - for (int i = 0; i < comps.length; i++) { - container.removeComponent(comps[i]); - } - for (int i = 0; i < comps.length; i++) { - container.addComponent(newComps[i]); - } - } - - public Definition resolveDefinitions ( - final List loaded, - final String nameList, - final Map context) throws ADLException - { - int p = nameList.lastIndexOf(','); - if (p == -1) { - return load(loaded, nameList, context); - } else { - Definition d = resolveDefinitions(loaded, nameList.substring(0, p), context); - Definition e = load(loaded, nameList.substring(p + 1), context); - e = (Definition)clone((Node)e, new HashMap()); - e = (Definition)merge((Node)e, (Node)d); - return e; - } - } - - public Node clone (final Node node, final Map clones) { - Node copy; - try { - copy = node.astNewInstance(); - } catch (Exception e) { - throw new Error("Internal error"); - } - copy.astSetAttributes(node.astGetAttributes()); - copy.astSetDecorations(node.astGetDecorations()); - String[] types = node.astGetNodeTypes(); - for (int i = 0; i < types.length; ++i) { - String type = types[i]; - Node[] subNodes = node.astGetNodes(type); - for (int j = 0; j < subNodes.length; j++) { - Node subNode = subNodes[j]; - Node subCopy; - if (subNode == null) { - subCopy = null; - } else { - subCopy = (Node)clones.get(subNode); - if (subCopy == null) { - subCopy = clone(subNode, clones); - clones.put(subNode, subCopy); - } - } - copy.astAddNode(type, subCopy); - } - } - return copy; - } - - // ------------------------------------------------------------------------- - // Utility methods: inheritance resolution - // ------------------------------------------------------------------------- - - public Node merge (Node elem, Node superElem) throws ADLException { - Class ec = elem.getClass(); - Class sec = superElem.getClass(); - if (ec.getClassLoader() != sec.getClassLoader()) { // TODO ok? - try { - String code = Integer.toHexString(ec.hashCode()*sec.hashCode()); - String name = "org.objectweb.fractal.adl.merged.Merged" + code; - Class merged = mergeClassLoader.mergeClass( - name, elem.astGetType(), new Class[] { ec, sec }); - Node newElem = (Node) merged.newInstance(); - Node newSuperElem = (Node) merged.newInstance(); - shallowCopy(elem, newElem); - shallowCopy(superElem, newSuperElem); - elem = newElem; - superElem = newSuperElem; - } catch (Exception e) { - throw new ADLException("Cannot merge AST classes", elem, e); - } - } - - // merges attributes - Map attrs = elem.astGetAttributes(); - Map superAttrs = superElem.astGetAttributes(); - Iterator i = superAttrs.keySet().iterator(); - while (i.hasNext()) { - String name = (String)i.next(); - String superValue = (String)superAttrs.get(name); - String value = (String)attrs.get(name); - if (superValue != null && value == null) { - attrs.put(name, superValue); - } - } - elem.astSetAttributes(attrs); - - // merges decorations - Map decors = elem.astGetDecorations(); - Map superDecors = superElem.astGetDecorations(); - superDecors.putAll(decors); - elem.astSetDecorations(superDecors); - - // merges sub nodes - String[] superNodeTypes = superElem.astGetNodeTypes(); - for (int j = 0; j < superNodeTypes.length; ++j) { - String superNodeType = superNodeTypes[j]; - Node[] superNodes = superElem.astGetNodes(superNodeType); - Node[] nodes = elem.astGetNodes(superNodeType); - - List newNodes = new ArrayList(); - for (int k = 0; k < nodes.length; ++k) { - newNodes.add(nodes[k]); - } - boolean changes = false; - - String nameAttr = (String)NAME_ATTRIBUTES.get(superNodeType); - - if (nameAttr == null) { - if (superNodes.length > 0 && superNodes[0] != null) { - if (nodes.length == 0 || nodes[0] == null) { - //elem.astAddNode(superNodeType, superNodes[0]); - newNodes.add(superNodes[0]); - changes = true; - } else { - Node newN = merge(nodes[0], superNodes[0]); - if (newN != nodes[0]) { - newNodes.set(newNodes.indexOf(nodes[0]), newN); - changes = true; - } - } - } - } else { - for (int k = 0; k < superNodes.length; ++k) { - String superName = (String)superNodes[k].astGetAttributes().get(nameAttr); - Node n = null; - for (int l = 0; l < nodes.length; ++l) { - String name = (String)nodes[l].astGetAttributes().get(nameAttr); - if (name.equals(superName)) { - n = nodes[l]; - break; - } - } - if (n == null) { - //elem.astAddNode(superNodeType, superNodes[k]); - newNodes.add(superNodes[k]); - changes = true; - } else { - Node newN = merge(n, superNodes[k]); - if (newN != n) { - newNodes.set(newNodes.indexOf(n), newN); - changes = true; - } - } - } - } - - if (changes) { - for (int k = 0; k < nodes.length; ++k) { - elem.astRemoveNode(superNodeType, nodes[k]); - } - for (int k = 0; k < newNodes.size(); ++k) { - elem.astAddNode(superNodeType, (Node)newNodes.get(k)); - } - } - } - - return elem; - } - - private void shallowCopy (final Node src, final Node dst) { - dst.astSetSource(src.astGetSource()); - dst.astSetAttributes(src.astGetAttributes()); - dst.astSetDecorations(src.astGetDecorations()); - String[] nodeTypes = src.astGetNodeTypes(); - for (int i = 0; i < nodeTypes.length; ++i) { - Node[] srcNodes = src.astGetNodes(nodeTypes[i]); - for (int j = 0; j < srcNodes.length; ++j) { - dst.astAddNode(nodeTypes[i], srcNodes[j]); - } - } - } - - static class MergeClassLoader extends NodeClassLoader { - - public MergeClassLoader (final ClassLoader parent) { - super(parent); - } - - public Class mergeClass (final String name, final String astNodeName, final Class[] classes) - throws ClassNotFoundException - { - try { - return loadClass(name); - } catch (ClassNotFoundException e) { - } - - Set itfs = new HashSet(); - for (int i = 0; i < classes.length; ++i) { - Class[] citfs = classes[i].getInterfaces(); - for (int j = 0; j < citfs.length; ++j) { - itfs.add(Type.getInternalName(citfs[j])); - } - } - - ClassWriter cw = generateClass( - name, - astNodeName, - Type.getInternalName(AbstractNode.class), - (String[])itfs.toArray(new String[itfs.size()])); - - /* DEBUG - try { - java.io.FileOutputStream fos = - new java.io.FileOutputStream(name + ".class"); - fos.write(cw.toByteArray()); - fos.close(); - } catch (Exception _) { - } - */ - return defineClass(name, cw.toByteArray()); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentPair.java b/fractaladl/src/org/objectweb/fractal/adl/components/ComponentPair.java deleted file mode 100644 index 5c8b1c6291f765b147691150b7aa5893830ee6fb..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/ComponentPair.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -public class ComponentPair { - - public final ComponentContainer container; - - public final Component comp; - - public ComponentPair ( - final ComponentContainer container, - final Component comp) - { - this.container = container; - this.comp = comp; - } - - public int hashCode () { - return container.hashCode() + comp.hashCode(); - } - - public boolean equals (final Object o) { - if (o instanceof ComponentPair) { - ComponentPair other = (ComponentPair)o; - return other.container == container && other.comp == comp; - } - return false; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/FractalComponentBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/components/FractalComponentBuilder.java deleted file mode 100644 index f61e346b853474810e4ebf33fe99599a3237d116..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/FractalComponentBuilder.java +++ /dev/null @@ -1,65 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.util.Fractal; - -/** - * A Fractal based implementation of the {@link ComponentBuilder} interface. - * This implementation uses the Fractal API to add and start components. - */ - -public class FractalComponentBuilder implements ComponentBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the ComponentBuilder interface - // -------------------------------------------------------------------------- - - public void addComponent ( - final Object superComponent, - final Object subComponent, - final String name, - final Object context) throws Exception - { - Fractal.getContentController((Component)superComponent) - .addFcSubComponent((Component)subComponent); - try { - Fractal.getNameController((Component)subComponent).setFcName(name); - } catch (NoSuchInterfaceException ignored) { - } - } - - public void startComponent (final Object component, final Object context) - throws Exception - { - // TODO - /*try { - Fractal.getLifeCycleController((Component)component).startFc(); - } catch (NoSuchInterfaceException ignored) { - } catch (NullPointerException ignored) { - }*/ - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/JavaComponentBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/components/JavaComponentBuilder.java deleted file mode 100644 index a13f7e99a7d99e42bf03ad3cdb2c29c1c6b3a9d7..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/JavaComponentBuilder.java +++ /dev/null @@ -1,54 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import org.objectweb.fractal.api.control.LifeCycleController; - -/** - * A Java based implementation of the {@link ComponentBuilder} interface. - */ - -public class JavaComponentBuilder implements ComponentBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the ComponentBuilder interface - // -------------------------------------------------------------------------- - - public void addComponent ( - final Object superComponent, - final Object subComponent, - final String name, - final Object context) - { - // does nothing - } - - public void startComponent (final Object component, final Object context) - throws Exception - { - if (component instanceof LifeCycleController) { - ((LifeCycleController)component).startFc(); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveCompiler.java deleted file mode 100644 index 120e1354e56a473e1e2af220cb06d71b0a364c84..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveCompiler.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import java.util.Map; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.TaskMap; - -/** - * A component definition compiler. This compiler compiles a single component - * at a time, i.e. it does not recursively compiles the definitions of the sub - * components of a component. - */ - -public interface PrimitiveCompiler { - - void compile ( - ComponentContainer container, - TaskMap tasks, - Map context) throws ADLException; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveCompilerType.fractal b/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveCompilerType.fractal deleted file mode 100644 index 001bbdb26c1b65ab398a55b91a15e80c8d352571..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveCompilerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveComponentCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveComponentCompiler.java deleted file mode 100644 index 40bc718e0e705c32935c04501a4dc7f175bf7d08..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/PrimitiveComponentCompiler.java +++ /dev/null @@ -1,184 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import java.util.Map; -import java.util.NoSuchElementException; - -import org.objectweb.deployment.scheduling.component.api.InstanceProviderTask; -import org.objectweb.deployment.scheduling.component.lib.AbstractRequireInstanceProviderTask; -import org.objectweb.deployment.scheduling.component.lib.AbstractInitializationTask; -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.TaskMap; -import org.objectweb.fractal.api.control.BindingController; - -/** - * A {@link PrimitiveCompiler} to compile {@link Component} nodes in definitions. - */ - -public class PrimitiveComponentCompiler implements BindingController, PrimitiveCompiler { - - /** - * Name of the mandatory interface bound to the {@link ComponentBuilder} used - * by this compiler. - */ - - public final static String BUILDER_BINDING = "builder"; - - /** - * The {@link ComponentBuilder} used by this compiler. - */ - - public ComponentBuilder builder; - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc() { - return new String[] { BUILDER_BINDING }; - } - - public Object lookupFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - return builder; - } - return null; - } - - public void bindFc (final String itf, final Object value) { - if (itf.equals(BUILDER_BINDING)) { - builder = (ComponentBuilder)value; - } - } - - public void unbindFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - builder = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the PrimitiveCompiler interface - // -------------------------------------------------------------------------- - - public void compile ( - final ComponentContainer container, - final TaskMap tasks, - final Map context) throws ADLException - { - InstanceProviderTask createTask = - (InstanceProviderTask)tasks.getTask("create", container); - - StartTask startTask = new StartTask(builder); - startTask.setInstanceProviderTask(createTask); - tasks.addTask("start", container, startTask); - - Component[] comps = ((ComponentContainer)container).getComponents(); - for (int i = 0; i < comps.length; i++) { - InstanceProviderTask createSubComponentTask = - (InstanceProviderTask)tasks.getTask("create", comps[i]); - - ComponentPair pair = new ComponentPair(container, comps[i]); - try { - // the task may already exist, in case of a shared component - tasks.getTask("add", pair); - } catch (NoSuchElementException e) { - AddTask addTask = new AddTask(builder, comps[i].getName()); - addTask.setInstanceProviderTask(createTask); - addTask.setSubInstanceProviderTask(createSubComponentTask); - tasks.addTask("add", pair, addTask); - } - - // to start super component only after all sub components are added: - // startTask.getPreviousTasks().addTask(addTask); - } - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class AddTask extends AbstractRequireInstanceProviderTask { - - private ComponentBuilder builder; - - private InstanceProviderTask subInstanceProviderTask; - - private String name; - - public AddTask (final ComponentBuilder builder, final String name) { - this.builder = builder; - this.name = name; - } - - public InstanceProviderTask getSubInstanceProviderTask () { - return subInstanceProviderTask; - } - - public void setSubInstanceProviderTask (final InstanceProviderTask task) { - if (subInstanceProviderTask != null) { - removePreviousTask(subInstanceProviderTask); - } - subInstanceProviderTask = task; - if (subInstanceProviderTask != null) { - addPreviousTask(subInstanceProviderTask); - } - } - - public void execute (final Object context) throws Exception { - Object parent = getInstanceProviderTask().getInstance(); - Object child = getSubInstanceProviderTask().getInstance(); - builder.addComponent(parent, child, name, context); - } - - public Object getResult () { - return null; - } - - public void setResult (Object result) { - } - - public String toString () { - return "T" + System.identityHashCode(this) + "[AddTask(" + name + ")]"; - } - } - - static class StartTask extends AbstractInitializationTask { - - private ComponentBuilder builder; - - public StartTask (final ComponentBuilder builder) { - this.builder = builder; - } - - public void execute (final Object context) throws Exception { - builder.startComponent(getInstanceProviderTask().getInstance(), context); - } - - public String toString () { - return "T" + System.identityHashCode(this) + "[StartTask()]"; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/StaticFractalComponentBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/components/StaticFractalComponentBuilder.java deleted file mode 100644 index 1b5ba5cfa57489da28ab0b9bc7add83875f44c49..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/StaticFractalComponentBuilder.java +++ /dev/null @@ -1,69 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import java.io.PrintWriter; -import java.util.Map; - -/** - * A Fractal based, static implementation of the {@link ComponentBuilder} - * interface. This implementation produces Java code that uses the Fractal API - * to add and start components. - */ - -public class StaticFractalComponentBuilder implements ComponentBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the ComponentBuilder interface - // -------------------------------------------------------------------------- - - public void addComponent ( - final Object superComponent, - final Object subComponent, - final String name, - final Object context) throws Exception - { - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("Fractal.getContentController("); - pw.print(superComponent); - pw.print(").addFcSubComponent("); - pw.print(subComponent); - pw.println(");"); - - pw.print("try { Fractal.getNameController("); - pw.print(subComponent); - pw.print(").setFcName(\""); - pw.print(name); - pw.println("\"); } catch (NoSuchInterfaceException ignored) { }"); - } - - public void startComponent (final Object component, final Object context) - throws Exception - { - PrintWriter pw = (PrintWriter)context; - pw.print("Fractal.getLifeCycleController("); - pw.print(component); - pw.println(").startFc();"); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/StaticJavaComponentBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/components/StaticJavaComponentBuilder.java deleted file mode 100644 index fc083c862e1303a4ecbedb93d51eee1f61a007f8..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/StaticJavaComponentBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.components; - -import java.io.PrintWriter; -import java.util.Map; - -/** - * A Java based, static implementation of the {@link ComponentBuilder} - * interface. This implementation produces standard Java code that adds and - * starts components. - */ - -public class StaticJavaComponentBuilder implements ComponentBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the ComponentBuilder interface - // -------------------------------------------------------------------------- - - public void addComponent ( - final Object superComponent, - final Object subComponent, - final String name, - final Object context) - { - // does nothing - } - - public void startComponent (final Object component, final Object context) { - String id = (String)component; - if (id.startsWith("P")) { - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("if ("); - pw.print(id); - pw.println(" instanceof LifeCycleController) {"); - pw.print(" ((LifeCycleController)"); - pw.print(id); - pw.println(").startFc();"); - pw.println("}"); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/components/package.html b/fractaladl/src/org/objectweb/fractal/adl/components/package.html deleted file mode 100644 index adee166dc243ffdbdf5277bc1a409c6b3d6c1016..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/components/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to define sub components. This module does not require any -other module. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/coordinates/Coordinates.java b/fractaladl/src/org/objectweb/fractal/adl/coordinates/Coordinates.java deleted file mode 100644 index ca14c32292ce1ba46f7392b04c3a054023097796..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/coordinates/Coordinates.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.coordinates; - -/** - * An AST node interface to define component coordinates. - */ - -public interface Coordinates extends CoordinatesContainer { - String getName (); - void setName (String name); - String getX0 (); - void setX0 (String x0); - String getX1 (); - void setX1 (String x1); - String getY0 (); - void setY0 (String y0); - String getY1 (); - void setY1 (String y1); - String getColor (); - void setColor (String color); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/coordinates/CoordinatesContainer.java b/fractaladl/src/org/objectweb/fractal/adl/coordinates/CoordinatesContainer.java deleted file mode 100644 index d080fa831aa11fdf4dc5494b30ac5d6da527fc79..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/coordinates/CoordinatesContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.coordinates; - -/** - * An AST node interface for nodes that can contain component coordinates. - */ - -public interface CoordinatesContainer { - Coordinates[] getCoordinatess (); - void addCoordinates (Coordinates coordinates); - void removeCoordinates (Coordinates coordinates); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/coordinates/package.html b/fractaladl/src/org/objectweb/fractal/adl/coordinates/package.html deleted file mode 100644 index a84b24dad81941996f065a76b2bca237c45e9ccf..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/coordinates/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to define component coordinates. This module does not -require any other module. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/Controller.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/Controller.java deleted file mode 100644 index 9e5af5b012c878d5d1e3f7c423ab1aa4f44db6d0..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/Controller.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -/** - * An AST node interface to define a component controller. - */ - -public interface Controller { - String getDescriptor (); - void setDescriptor (String descriptor); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/ControllerContainer.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/ControllerContainer.java deleted file mode 100644 index 0ca530a6a5c4807fd5269324fc03e336759c7357..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/ControllerContainer.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -/** - * An AST node interface for nodes that can contain a controller. - */ - -public interface ControllerContainer { - Controller getController (); - void setController (Controller controller); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/FractalImplementationBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/FractalImplementationBuilder.java deleted file mode 100644 index e7f6d4146883002b700bb10e79e59579620e7555..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/FractalImplementationBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -import java.util.Map; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.util.Fractal; - -/** - * A Fractal based implementation of the {@link ImplementationBuilder} - * interface. This implementation uses the Fractal API to create components. - */ - -public class FractalImplementationBuilder implements ImplementationBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the ImplementationBuilder interface - // -------------------------------------------------------------------------- - - public Object createComponent ( - final Object type, - final String name, - final Object controllerDesc, - final Object contentDesc, - final Object context) throws Exception - { - Component bootstrap = null; - if (context != null) { - bootstrap = (Component)((Map)context).get("bootstrap"); - } - if (bootstrap == null) { - bootstrap = Fractal.getBootstrapComponent(); - } - Component result = Fractal.getGenericFactory(bootstrap).newFcInstance( - (ComponentType)type, controllerDesc, contentDesc); - try { - Fractal.getNameController(result).setFcName(name); - } catch (NoSuchInterfaceException ignored) { - } - return result; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/Implementation.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/Implementation.java deleted file mode 100644 index b57ff72a69c6460a0ccc88f8ebbd7f6400bd706a..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/Implementation.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -/** - * An AST node interface to define a component implementation. - */ - -public interface Implementation { - String getClassName (); - void setClassName (String className); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationBuilder.java deleted file mode 100644 index 886f313a148a3c577ce9956dd5e9dde308877a92..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationBuilder.java +++ /dev/null @@ -1,38 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -/** - * A builder interface to create components. - */ - -public interface ImplementationBuilder { - - Object createComponent ( - Object type, - String name, - Object controllerDesc, - Object contentDesc, - Object context) throws Exception; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationCompiler.java deleted file mode 100644 index a3746be0db9cee89123e9d057bf751d997de4ec7..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationCompiler.java +++ /dev/null @@ -1,210 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -import java.util.Map; -import java.util.NoSuchElementException; - -import org.objectweb.deployment.scheduling.component.api.FactoryProviderTask; -import org.objectweb.deployment.scheduling.component.lib.AbstractInstanceProviderTask; -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.TaskMap; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.components.PrimitiveCompiler; -import org.objectweb.fractal.api.control.BindingController; - -/** - * A {@link PrimitiveCompiler} to compile {@link Implementation} nodes in definitions. - */ - -public class ImplementationCompiler implements BindingController, PrimitiveCompiler { - - /** - * Name of the mandatory interface bound to the {@link ImplementationBuilder} - * used by this compiler. - */ - - public final static String BUILDER_BINDING = "builder"; - - /** - * The {@link ImplementationBuilder} used by this compiler. - */ - - public ImplementationBuilder builder; - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc() { - return new String[] { BUILDER_BINDING }; - } - - public Object lookupFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - return builder; - } - return null; - } - - public void bindFc (final String itf, final Object value) { - if (itf.equals(BUILDER_BINDING)) { - builder = (ImplementationBuilder)value; - } - } - - public void unbindFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - builder = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the Compiler interface - // -------------------------------------------------------------------------- - - public void compile ( - final ComponentContainer container, - final TaskMap tasks, - final Map context) throws ADLException - { - boolean template = context != null && "true".equals(context.get("template")); - - String implementation = null; - if (container instanceof ImplementationContainer) { - ImplementationContainer ic = (ImplementationContainer)container; - Implementation i = ic.getImplementation(); - if (i != null) { - implementation = i.getClassName(); - } - } - - String controller = null; - if (container instanceof ControllerContainer) { - ControllerContainer cc = (ControllerContainer)container; - if (cc.getController() != null) { - controller = cc.getController().getDescriptor(); - } - } - - String name = null; - if (container instanceof Definition) { - name = ((Definition)container).getName(); - } else if (container instanceof Component) { - name = ((Component)container).getName(); - } - - Component[] comps = ((ComponentContainer)container).getComponents(); - - try { - // the task may already exist, in case of a shared component - tasks.getTask("create", container); - } catch (NoSuchElementException e) { - AbstractInstanceProviderTask createTask; - if (comps.length > 0 || implementation == null) { - if (implementation != null) { - throw new ADLException("Implementation must be empty", (Node)container); - } - if (controller == null) { - controller = "composite"; - } - if (template) { - createTask = newCreateTask(container, name, "compositeTemplate", new Object[] { controller, null }, context); - } else { - createTask = newCreateTask(container, name, controller, null, context); - } - } else { - if (controller == null) { - controller = "primitive"; - } - if (template) { - createTask = newCreateTask(container, name, "primitiveTemplate", new Object[] { controller, implementation }, context); - } else { - createTask = newCreateTask(container, name, controller, implementation, context); - } - } - - FactoryProviderTask typeTask = - (FactoryProviderTask)tasks.getTask("type", container); - createTask.setFactoryProviderTask(typeTask); - - tasks.addTask("create", container, createTask); - } - } - - public AbstractInstanceProviderTask newCreateTask ( - final ComponentContainer container, - final String name, - final Object controller, - final Object implementation, - final Map context) - { - return new CreateTask(builder, name, controller, implementation); - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class CreateTask extends AbstractInstanceProviderTask { - - ImplementationBuilder builder; - - String name; - - Object controllerDesc; - - Object contentDesc; - - public CreateTask ( - final ImplementationBuilder builder, - final String name, - final Object controllerDesc, - final Object contentDesc) - { - this.builder = builder; - this.name = name; - this.controllerDesc = controllerDesc; - this.contentDesc = contentDesc; - } - - public void execute (final Object context) throws Exception { - if (getInstance() != null) { - return; - } - Object type = getFactoryProviderTask().getFactory(); - Object result = builder.createComponent( - type, name, controllerDesc, contentDesc, context); - setInstance(result); - } - - public String toString () { - return "T" + System.identityHashCode(this) + - "[CreateTask(" + name + "," + controllerDesc + "," + contentDesc + ")]"; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationContainer.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationContainer.java deleted file mode 100644 index 8834ed2208a2385a85b9e3daaa0cd4c32e127487..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationContainer.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -/** - * An AST node interface for nodes that can contain a component implementation. - */ - -public interface ImplementationContainer { - Implementation getImplementation (); - void setImplementation (Implementation implementation); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationLoader.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationLoader.java deleted file mode 100644 index 05d8053e0309bd149bd5ec177d1de6e438a2f248..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/ImplementationLoader.java +++ /dev/null @@ -1,105 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -import java.util.Map; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.AbstractLoader; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; - -/** - * A {@link org.objectweb.fractal.adl.Loader} to check {@link Implementation} - * nodes in definitions. This loader checks that the Java classes specified in - * these nodes exist. - */ - -public class ImplementationLoader extends AbstractLoader { - - // -------------------------------------------------------------------------- - // Implementation of the Loader interface - // -------------------------------------------------------------------------- - - public Definition load (final String name, final Map context) - throws ADLException - { - Definition d = clientLoader.load(name, context); - checkNode(d); - return d; - } - - // -------------------------------------------------------------------------- - // Checking methods - // -------------------------------------------------------------------------- - - private void checkNode (final Object node) throws ADLException { - if (node instanceof ImplementationContainer) { - checkImplementationContainer((ImplementationContainer)node); - } - if (node instanceof ControllerContainer) { - checkControllerContainer((ControllerContainer)node); - } - if (node instanceof ComponentContainer) { - Component[] comps = ((ComponentContainer)node).getComponents(); - for (int i = 0; i < comps.length; i++) { - checkNode(comps[i]); - } - } - } - - private void checkImplementationContainer ( - final ImplementationContainer container) throws ADLException - { - Implementation impl = container.getImplementation(); - if (impl != null) { - String className = impl.getClassName(); - if (className == null) { - throw new ADLException( - "Implementation class name missing", (Node)impl); - } - ClassLoader cl = getClass().getClassLoader(); - try { - cl.loadClass(className); - } catch (ClassNotFoundException e) { - throw new ADLException( - "Invalid signature '" + className + "'", (Node)impl, e); - } - } - } - - private void checkControllerContainer ( - final ControllerContainer container) throws ADLException - { - Controller ctrl = container.getController(); - if (ctrl != null) { - if (ctrl.getDescriptor() == null) { - throw new ADLException( - "Controller descriptor missing", (Node)ctrl); - } - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/JavaImplementationBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/JavaImplementationBuilder.java deleted file mode 100644 index 4e11d78ba5109fab6e28600470579fea2e0c788d..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/JavaImplementationBuilder.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -import java.util.HashMap; - -/** - * A Java based implementation of the {@link ImplementationBuilder} interface. - */ - -public class JavaImplementationBuilder implements ImplementationBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the ImplementationBuilder interface - // -------------------------------------------------------------------------- - - public Object createComponent ( - final Object type, - final String name, - final Object controllerDesc, - final Object contentDesc, - final Object context) throws Exception - { - if (contentDesc == null) { - return new HashMap(); - } else { - String c = (String)contentDesc; - return getClass().getClassLoader().loadClass(c).newInstance(); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/StaticFractalImplementationBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/StaticFractalImplementationBuilder.java deleted file mode 100644 index f5f66b86726fea7d1fc8896bdf5fa258cefae1ab..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/StaticFractalImplementationBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -import java.io.PrintWriter; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * A Fractal based, static implementation of the {@link ImplementationBuilder} - * interface. This implementation produces Java code that uses the Fractal API - * to create components. - */ - -public class StaticFractalImplementationBuilder implements ImplementationBuilder { - - private Map counters = new WeakHashMap(); - - // -------------------------------------------------------------------------- - // Implementation of the ImplementationBuilder interface - // -------------------------------------------------------------------------- - - public Object createComponent ( - final Object type, - final String name, - final Object controllerDesc, - final Object contentDesc, - final Object context) throws Exception - { - Integer i = (Integer)counters.get(context); - if (i == null) { - i = new Integer(0); - } - counters.put(context, new Integer(i.intValue() + 1)); - String id = "C" + i; - - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("Component "); - pw.print(id); - pw.print(" = genericFactory.newFcInstance("); - pw.print(type); - pw.print(", \""); - pw.print(controllerDesc); - pw.print("\", "); - if (contentDesc == null) { - pw.print("null"); - } else if (contentDesc instanceof Object[]) { - Object[] descs = (Object[])contentDesc; - pw.print("new Object[] { \""); - pw.print(descs[0]); - pw.print("\", "); - if (descs[1] == null) { - pw.print("null"); - } else { - pw.print("\""); - pw.print(descs[1]); - pw.print("\""); - } - pw.print(" }"); - } else { - pw.print("\""); - pw.print(contentDesc); - pw.print("\""); - } - pw.println(");"); - - pw.print("try { Fractal.getNameController("); - pw.print(id); - pw.print(").setFcName(\""); - pw.print(name); - pw.println("\"); } catch (NoSuchInterfaceException ignored) { }"); - - return id; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/StaticJavaImplementationBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/implementations/StaticJavaImplementationBuilder.java deleted file mode 100644 index c8542be0cbf3b3feaf1edcb571c99bc82a223bd0..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/StaticJavaImplementationBuilder.java +++ /dev/null @@ -1,82 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.implementations; - -import java.io.PrintWriter; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * A Java based, static implementation of the {@link ImplementationBuilder} - * interface. This implementation produces standard Java code that creates - * components. - */ - -public class StaticJavaImplementationBuilder implements ImplementationBuilder { - - private Map primitiveCounters = new WeakHashMap(); - - private Map compositeCounters = new WeakHashMap(); - - // -------------------------------------------------------------------------- - // Implementation of the ImplementationBuilder interface - // -------------------------------------------------------------------------- - - public Object createComponent ( - final Object type, - final String name, - final Object controllerDesc, - final Object contentDesc, - final Object context) - { - if (contentDesc == null) { - Integer i = (Integer)compositeCounters.get(context); - if (i == null) { - i = new Integer(0); - } - String id = "C" + i; - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("Map "); - pw.print(id); - pw.println(" = new HashMap();"); - compositeCounters.put(context, new Integer(i.intValue() + 1)); - return id; - } else { - Integer i = (Integer)primitiveCounters.get(context); - if (i == null) { - i = new Integer(0); - } - String id = "P" + i; - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print(contentDesc); - pw.print(' '); - pw.print(id); - pw.print(" = new "); - pw.print(contentDesc); - pw.println("();"); - primitiveCounters.put(context, new Integer(i.intValue() + 1)); - return id; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/implementations/package.html b/fractaladl/src/org/objectweb/fractal/adl/implementations/package.html deleted file mode 100644 index c522f9fe6d565544eff7c6f7402bbc9db5e94a86..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/implementations/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to define component implementations. This module requires -the "components" module. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/interfaces/Interface.java b/fractaladl/src/org/objectweb/fractal/adl/interfaces/Interface.java deleted file mode 100644 index 985e9411d4d6814f4133b8d5d3d0422e57535aaf..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/interfaces/Interface.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.interfaces; - -/** - * An AST node interface to define a component interface. - */ - -public interface Interface { - String getName (); - void setName (String arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/interfaces/InterfaceContainer.java b/fractaladl/src/org/objectweb/fractal/adl/interfaces/InterfaceContainer.java deleted file mode 100644 index 8d4090d5fdcfc02e84a6fb64fe24f56f3e96515f..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/interfaces/InterfaceContainer.java +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.interfaces; - -/** - * An AST node interface for nodes that can contain interfaces. - */ - -public interface InterfaceContainer { - Interface[] getInterfaces (); - void addInterface (Interface arg); - void removeInterface (Interface arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/interfaces/InterfaceLoader.java b/fractaladl/src/org/objectweb/fractal/adl/interfaces/InterfaceLoader.java deleted file mode 100644 index 11e137483bcd3c1a80f302673222b8ac2a3893ba..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/interfaces/InterfaceLoader.java +++ /dev/null @@ -1,90 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.interfaces; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.AbstractLoader; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; - -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * A {@link org.objectweb.fractal.adl.Loader} to check {@link Interface} nodes - * in definitions. This loader checks that interface names are locally unique. - */ - -public class InterfaceLoader extends AbstractLoader { - - // -------------------------------------------------------------------------- - // Implementation of the Loader interface - // -------------------------------------------------------------------------- - - public Definition load (final String name, final Map context) - throws ADLException - { - Definition d = clientLoader.load(name, context); - checkNode(d); - return d; - } - - // -------------------------------------------------------------------------- - // Checking methods - // -------------------------------------------------------------------------- - - private void checkNode (final Object node) throws ADLException { - if (node instanceof InterfaceContainer) { - checkInterfaceContainer((InterfaceContainer)node); - } - if (node instanceof ComponentContainer) { - Component[] comps = ((ComponentContainer)node).getComponents(); - for (int i = 0; i < comps.length; i++) { - checkNode(comps[i]); - } - } - } - - private void checkInterfaceContainer (final InterfaceContainer container) - throws ADLException - { - Set names = new HashSet(); - Interface[] itfs = container.getInterfaces(); - for (int i = 0; i < itfs.length; i++) { - Interface itf = itfs[i]; - if (itf.getName() == null) { - throw new ADLException("Interface name missing", (Node)itf); - } - if (names.contains(itf.getName())) { - throw new ADLException( - "Duplicate interface name '" + itf.getName() + "'", (Node)itf); - } else { - names.add(itf.getName()); - } - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/interfaces/package.html b/fractaladl/src/org/objectweb/fractal/adl/interfaces/package.html deleted file mode 100644 index 3000745722c0ddd80cc611260c9344d88ea8b79f..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/interfaces/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to define component interfaces. This module requires the -"components" module. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/loggers/Logger.java b/fractaladl/src/org/objectweb/fractal/adl/loggers/Logger.java deleted file mode 100644 index 788501cb7245e79a1e90b2093c9d69edeea62dc0..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/loggers/Logger.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.loggers; - -/** - * An AST node interface to define a logger name. - */ - -public interface Logger { - String getName (); - void setName (String name); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/loggers/LoggerContainer.java b/fractaladl/src/org/objectweb/fractal/adl/loggers/LoggerContainer.java deleted file mode 100644 index bb55b50b375c3320d010ec8ee9e845bafdb6de69..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/loggers/LoggerContainer.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.loggers; - -/** - * An AST node interface for nodes that can contain a logger name. - */ - -public interface LoggerContainer { - Logger getLogger (); - void setLogger (Logger logger); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/loggers/package.html b/fractaladl/src/org/objectweb/fractal/adl/loggers/package.html deleted file mode 100644 index 98ca7e5a5b57a5c3729851772469e50b08eb32d4..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/loggers/package.html +++ /dev/null @@ -1,5 +0,0 @@ - - -A Fractal ADL module to define component logger names. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNode.java b/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNode.java deleted file mode 100644 index 7f7cee3353599e998ef55e2ecad7ab136b99da54..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNode.java +++ /dev/null @@ -1,29 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.nodes; - -public interface VirtualNode { - String getName (); - void setName (String name); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNodeContainer.java b/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNodeContainer.java deleted file mode 100644 index 76268e0f20b281314403e6bd93205f92523128d9..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNodeContainer.java +++ /dev/null @@ -1,29 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.nodes; - -public interface VirtualNodeContainer { - VirtualNode getVirtualNode (); - void setVirtualNode (VirtualNode node); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNodeImplementationCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNodeImplementationCompiler.java deleted file mode 100644 index 7717b130fed2ab46e6d49c6ab50f2603c1cf8b09..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/nodes/VirtualNodeImplementationCompiler.java +++ /dev/null @@ -1,99 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.nodes; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.deployment.scheduling.component.lib.AbstractInstanceProviderTask; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.implementations.ImplementationBuilder; -import org.objectweb.fractal.adl.implementations.ImplementationCompiler; - -public class VirtualNodeImplementationCompiler extends ImplementationCompiler { - - public AbstractInstanceProviderTask newCreateTask ( - final ComponentContainer container, - final String name, - final Object controller, - final Object implementation, - final Map context) - { - if (container instanceof VirtualNodeContainer) { - VirtualNode n = ((VirtualNodeContainer)container).getVirtualNode(); - if (n != null) { - return new RemoteCreateTask( - builder, name, controller, implementation, context.get(n.getName())); - } - } - return super.newCreateTask( - container, name, controller, implementation, context); - } - - static class RemoteCreateTask extends AbstractInstanceProviderTask { - - ImplementationBuilder builder; - - String name; - - Object controllerDesc; - - Object contentDesc; - - Object node; - - public RemoteCreateTask ( - final ImplementationBuilder builder, - final String name, - final Object controllerDesc, - final Object contentDesc, - final Object node) - { - this.builder = builder; - this.name = name; - this.controllerDesc = controllerDesc; - this.contentDesc = contentDesc; - this.node = node; - } - - public void execute (Object context) throws Exception { - if (getInstance() != null) { - return; - } - if (node != null && context instanceof Map) { - context = new HashMap((Map)context); - ((Map)context).put("bootstrap", node); - } - Object type = getFactoryProviderTask().getFactory(); - Object result = builder.createComponent( - type, name, controllerDesc, contentDesc, context); - setInstance(result); - } - - public String toString () { - return "T" + System.identityHashCode(this) + - "[CreateTask(" + name + "," + controllerDesc + "," + contentDesc + ")]"; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/nodes/package.html b/fractaladl/src/org/objectweb/fractal/adl/nodes/package.html deleted file mode 100644 index 6cb334b0b385afe78aa35da9bca7331aecae00cd..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/nodes/package.html +++ /dev/null @@ -1,5 +0,0 @@ - - -A Fractal ADL module for distributed component deployment. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/overview.html b/fractaladl/src/org/objectweb/fractal/adl/overview.html deleted file mode 100644 index 9f5a8fe2d89199aa803806e768efc898e5069bbd..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/overview.html +++ /dev/null @@ -1,55 +0,0 @@ - - - -DO NOT REMOVE THIS LINE (will be automatically removed). - -Fractal ADL is an extensible Architecture Description Language for the Fractal -component model. - -TODO -
    -
  • notion de module de l'ADL -
  • implementation basee sur un AST (ou plutot des ASTs), donc independante de toute syntaxe concrete -
  • parseur organise en trois couches -
      -
    • loader: charge les definitions, les verifie et les met sous forme canonique -
    • compiler: convertit les definitions en un graphe de taches -
    • builder: code des taches (soit interpretation directe, soit production de code Java ou C) -
    -
  • organisation du code: -
      -
    • package principal: definit le framework -
    • un package par module: -
        -
      • interface d'AST ajoutees par ce module -
      • composants du loader specifiques a ce module (*Loader) -
      • composants du compiler specifiques a ce module (*Compiler) -
      • composants du builder specifiques a ce module (*Builder) -
      -
    • package xml: code specifique a XML, necessaire seulement si on utilise une syntaxe concrete basee sur XML -
    -
- - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/package.html b/fractaladl/src/org/objectweb/fractal/adl/package.html deleted file mode 100644 index 33d53971b3c20a7400fa6cc98368ac73c1f43fa3..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/package.html +++ /dev/null @@ -1,5 +0,0 @@ - - -Defines the Fractal ADL framework. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/FractalTypeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/types/FractalTypeBuilder.java deleted file mode 100644 index e90ee7cf5fe3a70043f9d592f837a959ebe2e0c2..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/FractalTypeBuilder.java +++ /dev/null @@ -1,84 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.types; - -import java.util.Map; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.util.Fractal; - -/** - * A Fractal based implementation of the {@link TypeBuilder} interface. - * This implementation uses the Fractal API to create types. - */ - -public class FractalTypeBuilder implements TypeBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the TypeBuilder interface - // -------------------------------------------------------------------------- - - public Object createInterfaceType ( - final String name, - final String signature, - final String role, - final String contingency, - final String cardinality, - final Object context) throws Exception - { - // TODO : cache already created types ? - Component bootstrap = null; - if (context != null) { - bootstrap = (Component)((Map)context).get("bootstrap"); - } - if (bootstrap == null) { - bootstrap = Fractal.getBootstrapComponent(); - } - boolean client = "client".equals(role); - boolean optional = "optional".equals(contingency); - boolean collection = "collection".equals(cardinality); - return Fractal.getTypeFactory(bootstrap).createFcItfType( - name, signature, client, optional, collection); - } - - public Object createComponentType ( - final String name, - final Object[] interfaceTypes, - final Object context) throws Exception - { - Component bootstrap = null; - if (context != null) { - bootstrap = (Component)((Map)context).get("bootstrap"); - } - if (bootstrap == null) { - bootstrap = Fractal.getBootstrapComponent(); - } - InterfaceType[] types = new InterfaceType[interfaceTypes.length]; - for (int i = 0; i < types.length; ++i) { - types[i] = (InterfaceType)interfaceTypes[i]; - } - return Fractal.getTypeFactory(bootstrap).createFcType(types); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/JavaTypeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/types/JavaTypeBuilder.java deleted file mode 100644 index be83cd672548b0e7319db4b9eaaca2be1f480bf4..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/JavaTypeBuilder.java +++ /dev/null @@ -1,56 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.types; - -/** - * A Java based implementation of the {@link TypeBuilder} interface. - */ - -public class JavaTypeBuilder implements TypeBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the TypeBuilder interface - // -------------------------------------------------------------------------- - - public Object createInterfaceType ( - final String name, - final String signature, - final String role, - final String contingency, - final String cardinality, - final Object context) - { - // does nothing - return null; - } - - public Object createComponentType ( - final String name, - final Object[] interfaceTypes, - final Object context) - { - // does nothing - return null; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/StaticFractalTypeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/types/StaticFractalTypeBuilder.java deleted file mode 100644 index f53ebb0ab9693ab919b81da65419d87e290884c6..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/StaticFractalTypeBuilder.java +++ /dev/null @@ -1,104 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.types; - -import java.io.PrintWriter; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * A Fractal based, static implementation of the {@link TypeBuilder} interface. - * This implementation produces Java code that uses the Fractal API to create - * types. - */ - -public class StaticFractalTypeBuilder implements TypeBuilder { - - private Map itfCounters = new WeakHashMap(); - - private Map compCounters = new WeakHashMap(); - - // -------------------------------------------------------------------------- - // Implementation of the TypeBuilder interface - // -------------------------------------------------------------------------- - - public Object createInterfaceType ( - final String name, - final String signature, - final String role, - final String contingency, - final String cardinality, - final Object context) throws Exception - { - Integer i = (Integer)itfCounters.get(context); - if (i == null) { - i = new Integer(0); - } - itfCounters.put(context, new Integer(i.intValue() + 1)); - String id = "IT" + i; - - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("InterfaceType "); - pw.print(id); - pw.print(" = typeFactory.createFcItfType(\""); - pw.print(name); - pw.print("\", \""); - pw.print(signature); - pw.print("\", "); - pw.print("client".equals(role)); - pw.print(", "); - pw.print("optional".equals(contingency)); - pw.print(", "); - pw.print("collection".equals(cardinality)); - pw.println(");"); - - return id; - } - - public Object createComponentType ( - final String name, - final Object[] interfaceTypes, - final Object context) throws Exception - { - Integer i = (Integer)compCounters.get(context); - if (i == null) { - i = new Integer(0); - } - compCounters.put(context, new Integer(i.intValue() + 1)); - String id = "CT" + i; - - PrintWriter pw = (PrintWriter)context; - pw.print("ComponentType "); - pw.print(id); - pw.print(" = typeFactory.createFcType(new InterfaceType [] { "); - for (int j = 0; j < interfaceTypes.length; ++j) { - if (j > 0) { - pw.print(", "); - } - pw.print(interfaceTypes[j]); - } - pw.println(" });"); - return id; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/TypeBuilder.java b/fractaladl/src/org/objectweb/fractal/adl/types/TypeBuilder.java deleted file mode 100644 index 280494586f6aed93b07e6843ad81b0ed1b309e08..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/TypeBuilder.java +++ /dev/null @@ -1,44 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.types; - -/** - * A builder interface to build interface and component types. - */ - -public interface TypeBuilder { - - Object createInterfaceType ( - String name, - String signature, - String role, - String contingency, - String cardinality, - Object context) throws Exception; - - Object createComponentType ( - String name, - Object[] interfaceTypes, - Object context) throws Exception; -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/TypeCompiler.java b/fractaladl/src/org/objectweb/fractal/adl/types/TypeCompiler.java deleted file mode 100644 index ccab08c583653b6dc3c23e904f138028c8355783..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/TypeCompiler.java +++ /dev/null @@ -1,174 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.types; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.NoSuchElementException; - -import org.objectweb.deployment.scheduling.component.lib.AbstractFactoryProviderTask; -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.TaskMap; -import org.objectweb.fractal.adl.attributes.Attributes; -import org.objectweb.fractal.adl.attributes.AttributesContainer; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.components.PrimitiveCompiler; -import org.objectweb.fractal.adl.interfaces.Interface; -import org.objectweb.fractal.adl.interfaces.InterfaceContainer; -import org.objectweb.fractal.api.control.BindingController; - -/** - * A {@link PrimitiveCompiler} to compile {@link TypeInterface} nodes in definitions. - */ - -public class TypeCompiler implements BindingController, PrimitiveCompiler { - - /** - * Name of the mandatory interface bound to the {@link TypeBuilder} used - * by this compiler. - */ - - public final static String BUILDER_BINDING = "builder"; - - /** - * The {@link TypeBuilder} used by this compiler. - */ - - public TypeBuilder builder; - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc() { - return new String[] { BUILDER_BINDING }; - } - - public Object lookupFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - return builder; - } - return null; - } - - public void bindFc (final String itf, final Object value) { - if (itf.equals(BUILDER_BINDING)) { - builder = (TypeBuilder)value; - } - } - - public void unbindFc (final String itf) { - if (itf.equals(BUILDER_BINDING)) { - builder = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the Compiler interface - // -------------------------------------------------------------------------- - - public void compile ( - final ComponentContainer container, - final TaskMap tasks, - final Map context) throws ADLException - { - if (container instanceof InterfaceContainer) { - try { - // the task may already exist, in case of a shared component - tasks.getTask("type", container); - } catch (NoSuchElementException e) { - CreateTypeTask createTypeTask = - new CreateTypeTask(builder, (InterfaceContainer)container); - tasks.addTask("type", container, createTypeTask); - } - } - } - - // -------------------------------------------------------------------------- - // Inner classes - // -------------------------------------------------------------------------- - - static class CreateTypeTask extends AbstractFactoryProviderTask { - - private TypeBuilder builder; - - private InterfaceContainer container; - - public CreateTypeTask ( - final TypeBuilder builder, - final InterfaceContainer container) - { - this.builder = builder; - this.container = container; - } - - public void execute (final Object context) throws Exception { - if (getFactory() != null) { - return; - } - List itfTypes = new ArrayList(); - Interface[] itfs = container.getInterfaces(); - for (int i = 0; i < itfs.length; i++) { - if (itfs[i] instanceof TypeInterface) { - TypeInterface itf = (TypeInterface)itfs[i]; - Object itfType = builder.createInterfaceType( - itf.getName(), - itf.getSignature(), - itf.getRole(), - itf.getContingency(), - itf.getCardinality(), - context); - itfTypes.add(itfType); - } - } - if (container instanceof AttributesContainer) { // TODO improve module separation - Attributes attr = ((AttributesContainer)container).getAttributes(); - if (attr != null) { - Object itfType = builder.createInterfaceType( - "attribute-controller", - attr.getSignature(), - "server", - "mandatory", - "singleton", - context); - itfTypes.add(itfType); - } - } - String name = null; - if (container instanceof Definition) { - name = ((Definition)container).getName(); - } else if (container instanceof Component) { - name = ((Component)container).getName(); - } - setFactory(builder.createComponentType(name, itfTypes.toArray(), context)); - } - - public String toString () { - return "T" + System.identityHashCode(this) + "[CreateTypeTask()]"; - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/TypeInterface.java b/fractaladl/src/org/objectweb/fractal/adl/types/TypeInterface.java deleted file mode 100644 index f9f977f85c98b56f59e3c1e4a6fb3b9dad1f7608..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/TypeInterface.java +++ /dev/null @@ -1,47 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.types; - -import org.objectweb.fractal.adl.interfaces.Interface; - -/** - * An AST node interface to define typed interfaces. - */ - -public interface TypeInterface extends Interface { - String SINGLETON_CARDINALITY = "singleton"; - String COLLECTION_CARDINALITY = "collection"; - String MANDATORY_CONTINGENCY = "mandatory"; - String OPTIONAL_CONTINGENCY = "optional"; - String SERVER_ROLE = "server"; - String CLIENT_ROLE = "client"; - String getCardinality (); - void setCardinality (String arg); - String getContingency (); - void setContingency (String arg); - String getSignature (); - void setSignature (String arg); - String getRole (); - void setRole (String arg); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/TypeLoader.java b/fractaladl/src/org/objectweb/fractal/adl/types/TypeLoader.java deleted file mode 100644 index 27b39d0f6020c2d3712d072e32fd962991bbc3a2..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/TypeLoader.java +++ /dev/null @@ -1,127 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.types; - -import java.util.Map; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.AbstractLoader; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.components.Component; -import org.objectweb.fractal.adl.components.ComponentContainer; -import org.objectweb.fractal.adl.components.ComponentDefinition; -import org.objectweb.fractal.adl.interfaces.Interface; -import org.objectweb.fractal.adl.interfaces.InterfaceContainer; - -/** - * A {@link org.objectweb.fractal.adl.Loader} to check {@link TypeInterface} - * nodes in definitions. This loader checks that the Java interfaces specified - * in these nodes exist. - */ - -public class TypeLoader extends AbstractLoader { - - // -------------------------------------------------------------------------- - // Implementation of the Loader interface - // -------------------------------------------------------------------------- - - public Definition load (final String name, final Map context) - throws ADLException - { - Definition d = clientLoader.load(name, context); - boolean extend = false; - if (d instanceof ComponentDefinition) { - extend = ((ComponentDefinition)d).getExtends() != null; - } - checkNode(d, extend); - return d; - } - - // -------------------------------------------------------------------------- - // Checking methods - // -------------------------------------------------------------------------- - - private void checkNode (final Object node, final boolean extend) - throws ADLException - { - if (node instanceof InterfaceContainer) { - checkInterfaceContainer((InterfaceContainer)node, extend); - } - if (node instanceof ComponentContainer) { - Component[] comps = ((ComponentContainer)node).getComponents(); - for (int i = 0; i < comps.length; i++) { - checkNode(comps[i], extend); - } - } - } - - private void checkInterfaceContainer ( - final InterfaceContainer container, - final boolean extend) throws ADLException - { - ClassLoader cl = getClass().getClassLoader(); - Interface[] itfs = container.getInterfaces(); - for (int i = 0; i < itfs.length; i++) { - Interface itf = itfs[i]; - if (itf instanceof TypeInterface) { - String signature = ((TypeInterface)itf).getSignature(); - if (signature == null) { - if (!extend) { - throw new ADLException("Signature missing", (Node)itf); - } - } else { - try { - cl.loadClass(signature); - } catch (ClassNotFoundException e) { - throw new ADLException( - "Invalid signature '" + signature + "'", (Node)itf, e); - } - } - String role = ((TypeInterface)itf).getRole(); - if (role == null) { - if (!extend) { - throw new ADLException("Role missing", (Node)itf); - } - } else { - if (!role.equals("client") && !role.equals("server")) { - throw new ADLException("Invalid role '" + role + "'", (Node)itf); - } - } - String contingency = ((TypeInterface)itf).getContingency(); - if (contingency != null) { - if (!contingency.equals("mandatory") && !contingency.equals("optional")) { - throw new ADLException("Invalid contingency '" + contingency + "'", (Node)itf); - } - } - String cardinality = ((TypeInterface)itf).getCardinality(); - if (cardinality != null) { - if (!cardinality.equals("singleton") && !cardinality.equals("collection")) { - throw new ADLException("Invalid cardinality '" + cardinality + "'", (Node)itf); - } - } - } - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/types/package.html b/fractaladl/src/org/objectweb/fractal/adl/types/package.html deleted file mode 100644 index 788ef454e4c05a9d4efb85fd1e679835790fec58..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/types/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -A Fractal ADL module to define interface types. This module requires the -"components" and "interfaces" modules. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/DTDHandler.java b/fractaladl/src/org/objectweb/fractal/adl/xml/DTDHandler.java deleted file mode 100644 index e8f2eeb4a05100431e7ef9d5c2026ac99ec536fa..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/DTDHandler.java +++ /dev/null @@ -1,379 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.xml; - -import org.objectweb.fractal.adl.xml.XMLNodeClassLoader; - -import com.wutka.dtd.DTD; -import com.wutka.dtd.DTDParser; -import com.wutka.dtd.DTDProcessingInstruction; -import com.wutka.dtd.DTDElement; -import com.wutka.dtd.DTDSequence; -import com.wutka.dtd.DTDAttribute; -import com.wutka.dtd.DTDName; -import com.wutka.dtd.DTDCardinal; -import com.wutka.dtd.DTDItem; -import com.wutka.dtd.DTDChoice; -import com.wutka.dtd.DTDMixed; -import com.wutka.dtd.DTDContainer; - -import java.io.InputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.Map; -import java.util.HashMap; -import java.util.Iterator; -import java.util.StringTokenizer; -import java.util.Set; -import java.util.HashSet; -import java.lang.reflect.Method; - -import org.objectweb.asm.Type; -import org.xml.sax.SAXException; - -class DTDHandler { - - void checkDTD (final InputStream is, final XMLNodeClassLoader loader) - throws IOException, ClassNotFoundException, SAXException - { - // Associates DTD elements to AST node names - // Keys are AST node names, values are DTDElement objects - Map astElements = new HashMap(); - - DTD dtd = new DTDParser(new InputStreamReader(is)).parse(); - Iterator i = dtd.items.iterator(); - while (i.hasNext()) { - Object item = i.next(); - - if (item instanceof DTDProcessingInstruction) { - String pi = ((DTDProcessingInstruction)item).getText(); - - if (pi.startsWith("add")) { - Map args = checkProcessingInstruction(pi); - String ast = (String)args.get("ast"); - String itf = (String)args.get("itf"); - - if (ast == null || itf == null) { - throw new SAXException( - "Invalid processing instruction " + - "('ast' and/or 'itf' argument missing): " + - pi); - } - - DTDElement astElement = (DTDElement)astElements.get(ast); - if (astElement == null) { - astElement = new DTDElement(ast); - astElement.setContent(new DTDSequence()); - astElements.put(ast, astElement); - } - checkASTClass(loader.loadClass(itf), astElement); - - loader.addASTNodeInterface(ast, itf); - } else if (pi.startsWith("map")) { - Map args = checkProcessingInstruction(pi); - String xml = (String)args.get("xml"); - String ast = (String)args.get("ast"); - - if (xml == null || ast == null) { - throw new SAXException( - "Invalid processing instruction " + - "('xml' and/or 'ast' argument missing): " + - pi); - } - - if (xml.indexOf('.') == -1) { - loader.addASTNodeMapping(ast, xml); - } else { - if (ast.indexOf('.') == -1) { - throw new SAXException( - "Invalid processing instruction " + - "(incompatible 'xml' and 'ast' arguments)" + - pi); - } - loader.addASTAttributeMapping(ast, xml); - } - } - } else if (item instanceof DTDElement) { - DTDElement xmlElem = (DTDElement)item; - String xmlName = xmlElem.getName(); - String astName = loader.getASTName(xmlName); - DTDElement astElem = (DTDElement)astElements.get(astName); - if (astElem == null) { - throw new SAXException( - "Invalid DTD : no AST node defined for element '" + xmlName + "'"); - } - checkDTDItem(xmlElem.getContent(), new HashSet()); - checkDTDItem(astElem.getContent(), new HashSet()); - Arities xmlArities = getArities(xmlElem.getContent(), null); - Arities astArities = getArities(astElem.getContent(), null); - - Iterator x = xmlArities.keySet().iterator(); - while (x.hasNext()) { - String xmlSubNode = (String)x.next(); - String astSubNode = loader.getASTName(xmlSubNode); - Arity xmlSubNodeArity = (Arity)xmlArities.get(xmlSubNode); - Arity astSubNodeArity = (Arity)astArities.get(astSubNode); - if (astSubNodeArity == null) { - throw new SAXException( - "Invalid DTD : no AST node defined for sub element '" + - xmlSubNode + "' of element '" + xmlName + "'"); - } - if ((astSubNodeArity.max > 1 && xmlSubNodeArity.max <= 1) || - (astSubNodeArity.max <= 1 && xmlSubNodeArity.max > 1)) - { - throw new SAXException( - "Invalid DTD : arity of sub element '" + xmlSubNode + - "' of element '" + xmlName + "' incompatible with arity of AST" + - " sub node '" + astSubNode + "' of AST node '" + astName + "'"); - } - } - - Iterator a = astArities.keySet().iterator(); - while (a.hasNext()) { - String astSubNode = (String)a.next(); - String xmlSubNode = loader.getXMLElement(astSubNode); - Arity xmlSubNodeArity = (Arity)xmlArities.get(xmlSubNode); - if (xmlSubNodeArity == null) { - throw new SAXException( - "Invalid DTD : no sub element defined in '" + xmlName + - "' element for sub node '" + astSubNode + "' of AST node '" + - astName + "'"); - } - } - - x = xmlElem.attributes.keySet().iterator(); - while (x.hasNext()) { - String xmlAttr = (String)x.next(); - String astAttr = loader.getASTAttribute(xmlName, xmlAttr); - if (astElem.getAttribute(astAttr) == null) { - throw new SAXException( - "Invalid DTD : no AST attribute defined for XML attribute '" + - xmlAttr + "' of element '" + xmlName + "'"); - } - } - - a = astElem.attributes.keySet().iterator(); - while (a.hasNext()) { - String astAttr = (String)a.next(); - String xmlAttr = loader.getXMLAttribute(astName, astAttr); - if (xmlElem.getAttribute(xmlAttr) == null) { - throw new SAXException( - "Invalid DTD : no XML attribute defined in element '" + xmlName + - "' for attribute '" + astAttr + "' of AST node '" + astName + "'"); - } - } - } - } - } - - private Map checkProcessingInstruction (final String pi) throws SAXException { - Map m = new HashMap(); - StringTokenizer st = new StringTokenizer(pi); - if (st.hasMoreTokens()) { - st.nextToken(); - } else { - throw new SAXException("Invalid processing instruction: " + pi); - } - while (st.hasMoreTokens()) { - String t = st.nextToken(); - int p = t.indexOf("=\""); - if (p == -1 || !t.endsWith("\"")) { - throw new SAXException("Invalid processing instruction: " + pi); - } - String key = t.substring(0, p); - String value = t.substring(p + 2, t.length() - 1); - m.put(key, value); - } - return m; - } - - private void checkASTClass (final Class c, final DTDElement elt) { - Set meths = new HashSet(); - Method[] methods = c.getMethods(); - for (int i = 0; i < methods.length; i++) { - Method method = methods[i]; - meths.add(method.getName() + Type.getMethodDescriptor(method)); - } - Iterator i = meths.iterator(); - while (i.hasNext()) { - String meth = (String)i.next(); - if (meth.startsWith("get") && meth.endsWith("()Ljava/lang/String;")) { - String attr = meth.substring(3, meth.indexOf('(')); - if (meths.contains("set" + attr + "(Ljava/lang/String;)V")) { - attr = Character.toLowerCase(attr.charAt(0)) + attr.substring(1); - elt.setAttribute(attr, new DTDAttribute(attr)); - } - } else if (meth.startsWith("get") && meth.indexOf("()") != -1) { - String subElt = meth.substring(3, meth.indexOf('(')); - String subEltDesc = meth.substring(meth.indexOf(')') + 1); - DTDName dtdName = null; - if (subEltDesc.charAt(0) == '[') { - if (subElt.endsWith("s")) { - subElt = subElt.substring(0, subElt.length() - 1); - subEltDesc = subEltDesc.substring(1); - String addMeth = "add" + subElt + "(" + subEltDesc + ")V"; - String removeMeth = "remove" + subElt + "(" + subEltDesc + ")V"; - if (meths.contains(addMeth) && meths.contains(removeMeth)) { - subElt = Character.toLowerCase(subElt.charAt(0)) + subElt.substring(1); - dtdName = new DTDName(subElt); - dtdName.setCardinal(DTDCardinal.ZEROMANY); - } - } - } else if (meths.contains("set" + subElt + "(" + subEltDesc + ")V")) { - subElt = Character.toLowerCase(subElt.charAt(0)) + subElt.substring(1); - dtdName = new DTDName(subElt); - } - if (dtdName != null) { - boolean add = true; - DTDItem[] items = ((DTDSequence)elt.getContent()).getItems(); - for (int j = 0; j < items.length; ++j) { - if (((DTDName)items[j]).getValue().equals(dtdName.getValue())) { - add = false; - break; - } - } - if (add) { - ((DTDSequence)elt.getContent()).add(dtdName); - } - } - } - } - } - - private void checkDTDItem (final DTDItem item, final Set names) { - if (item instanceof DTDContainer) { - DTDItem[] items = ((DTDContainer)item).getItems(); - for (int i = 0; i < items.length; i++) { - checkDTDItem(items[i], names); - } - } else if (item instanceof DTDName) { - String name = ((DTDName)item).getValue(); - if (names.contains(name)) { - throw new RuntimeException("Not supported"); // TODO explain - } else { - names.add(name); - } - } - } - - private Arities getArities (final DTDItem item, final Arity arity) { - Arities result = new Arities(); - Arity a = arity == null ? new Arity(item) : arity.mult(new Arity(item)); - if (item instanceof DTDChoice) { - DTDItem[] items = ((DTDChoice)item).getItems(); - for (int j = 0; j < items.length; j++) { - result.union(getArities(items[j], a)); - } - } else if (item instanceof DTDSequence) { - DTDItem[] items = ((DTDSequence)item).getItems(); - for (int j = 0; j < items.length; j++) { - result.add(getArities(items[j], a)); - } - } else if (item instanceof DTDMixed) { - throw new RuntimeException("Mixed content not supported"); // TODO - } else if (item instanceof DTDName) { - result.put(((DTDName)item).getValue(), a); - } - return result; - } - - static class Arities extends HashMap { - - public void add (final Arities arities) { - Iterator i = arities.keySet().iterator(); - while (i.hasNext()) { - String item = (String)i.next(); - Arity a = getArity(item); - Arity b = arities.getArity(item); - put(item, a.add(b)); - } - } - - public void mult (final Arities arities) { - Iterator i = arities.keySet().iterator(); - while (i.hasNext()) { - String item = (String)i.next(); - Arity a = getArity(item); - Arity b = arities.getArity(item); - put(item, a.mult(b)); - } - } - - public void union (final Arities arities) { - Iterator i = arities.keySet().iterator(); - while (i.hasNext()) { - String item = (String)i.next(); - Arity a = getArity(item); - Arity b = arities.getArity(item); - put(item, a.union(b)); - } - } - - private Arity getArity (final String item) { - Arity a = (Arity)get(item); - return a == null ? new Arity(0, 0) : a; - } - } - - static class Arity { - - final float min; - - final float max; - - public Arity (final float min, final float max) { - this.min = min; - this.max = max; - } - - public Arity (final DTDItem i) { - DTDCardinal c = i.getCardinal(); - if (c == DTDCardinal.NONE) { - min = 1; - max = 1; - } else if (c == DTDCardinal.OPTIONAL) { - min = 0; - max = 1; - } else if (c == DTDCardinal.ZEROMANY) { - min = 0; - max = Float.POSITIVE_INFINITY; - } else /*if (c == DTDCardinal.ONEMANY)*/ { - min = 0; - max = Float.POSITIVE_INFINITY; - } - } - - public Arity add (final Arity a) { - return new Arity(min + a.min, max + a.max); - } - - public Arity mult (final Arity a) { - return new Arity(min * a.min, max * a.max); - } - - public Arity union (final Arity a) { - return new Arity(Math.min(min, a.min), Math.max(max, a.max)); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLLoader.java b/fractaladl/src/org/objectweb/fractal/adl/xml/XMLLoader.java deleted file mode 100644 index 0ede18c7a46e91d2819414d925aadf1f778fe474..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLLoader.java +++ /dev/null @@ -1,80 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.xml; - -import java.io.InputStream; -import java.util.Map; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.Parser; -import org.objectweb.fractal.adl.ParserException; - -/** - * A {@link Loader} that loads definitions from XML files. - */ - -public class XMLLoader implements Loader { - - private Parser parser; - - public XMLLoader () { - this(true); - } - - public XMLLoader (boolean validate) { - parser = new XMLParser(validate); - } - - public Definition load (final String name, final Map context) - throws ADLException - { - try { - String file = name.replace('.', '/') + ".fractal"; - ClassLoader cl = getClass().getClassLoader(); - if (cl == null) { - cl = ClassLoader.getSystemClassLoader(); - } - InputStream is = cl.getResourceAsStream(file); - if (is == null) { - throw new ADLException( - "Cannot find '" + file + "' in the classpath", null); - } - Definition d = (Definition)parser.parse(is, file); - if (d.getName() == null) { - throw new ADLException("Definition name missing", (Node)d); - } - if (!d.getName().equals(name)) { - throw new ADLException( - "Wrong definition name ('" + name + - "' expected, instead of '" + d.getName() + "')", (Node)d); - } - return d; - } catch (ParserException e) { - throw new ADLException("Cannot load '" + name + "'", null, e); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLNode.java b/fractaladl/src/org/objectweb/fractal/adl/xml/XMLNode.java deleted file mode 100644 index 5a90730c8a7196ded6b42d9c8ce7d5951bfccebc..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLNode.java +++ /dev/null @@ -1,42 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.xml; - -import org.objectweb.fractal.adl.AbstractNode; -import org.xml.sax.Attributes; - -/** - * An {@link AbstractNode} with initialization methods for SAX parsers. - */ - -public abstract class XMLNode extends AbstractNode { - - public XMLNode (final String type) { - super(type); - } - - public abstract void xmlSetAttributes (Attributes xmlAttrs); - - public abstract void xmlAddNode (String xmlName, XMLNode node); -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLNodeClassLoader.java b/fractaladl/src/org/objectweb/fractal/adl/xml/XMLNodeClassLoader.java deleted file mode 100644 index ea4c9036c143e30d8d01491a948094bfdf7809ae..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLNodeClassLoader.java +++ /dev/null @@ -1,336 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.xml; - -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.NodeClassLoader; - -import org.objectweb.asm.Type; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Label; - -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.HashSet; -import java.lang.reflect.Method; - -/** - * A {@link NodeClassLoader} that generates {@link XMLNode} node classes. - */ - -class XMLNodeClassLoader extends NodeClassLoader { - - // -------------------------------------------------------------------------- - // AST node definitions - // -------------------------------------------------------------------------- - - /** - * Stores the set of AST interfaces that each AST node must implement. - * Keys are AST node names, values are sets of internal interface names. - */ - - private Map astItfs; - - // -------------------------------------------------------------------------- - // Mapping between AST names and XML names - // -------------------------------------------------------------------------- - - /** - * Stores the AST node names corresponding to each XML element name. - * Keys are XML element names, values are AST node names. - */ - - private Map astNodes; - - /** - * Stores the XML element names corresponding to each AST node name. - * Keys are AST node names, values are XML element names. - */ - - private Map xmlElements; - - /** - * Stores the AST attribute names corresponding to each XML attribute name. - * Keys are XML node.attribute names, values are AST attribute names. - */ - - private Map astAttributes; - - /** - * Stores the XML attribute names corresponding to each AST attribute name. - * Keys are AST node.attribute names, values are XML attribute names. - */ - - private Map xmlAttributes; - - // -------------------------------------------------------------------------- - // Constructor - // -------------------------------------------------------------------------- - - public XMLNodeClassLoader (final ClassLoader parent) { - super(parent); - astItfs = new HashMap(); - astNodes = new HashMap(); - xmlElements = new HashMap(); - astAttributes = new HashMap(); - xmlAttributes = new HashMap(); - } - - // -------------------------------------------------------------------------- - // Mapping initialization and accessor methods - // -------------------------------------------------------------------------- - - void addASTNodeInterface (final String astNode, final String itf) { - Set s = (Set)astItfs.get(astNode); - if (s == null) { - s = new HashSet(); - astItfs.put(astNode, s); - } - s.add(itf.replace('.', '/')); - } - - void addASTNodeMapping (final String astName, final String xmlName) { - xmlElements.put(astName, xmlName); - astNodes.put(xmlName, astName); - } - - void addASTAttributeMapping (final String astName, final String xmlName) { - xmlAttributes.put(astName, xmlName.substring(xmlName.indexOf('.') + 1)); - astAttributes.put(xmlName, astName.substring(astName.indexOf('.') + 1)); - } - - String getASTName (final String xmlElement) { - String astName = (String)astNodes.get(xmlElement); - return astName == null ? xmlElement : astName; - } - - String getXMLElement (final String astNode) { - String xmlElement = (String)xmlElements.get(astNode); - return xmlElement == null ? astNode : xmlElement; - } - - String getASTAttribute (final String xmlNode, final String xmlAttr) { - String astAttribute = (String)astAttributes.get(xmlNode + "." + xmlAttr); - return astAttribute == null ? xmlAttr : astAttribute; - } - - String getXMLAttribute (final String astNode, final String astAttr) { - String xmlAttribute = (String)xmlAttributes.get(astNode + "." + astAttr); - return xmlAttribute == null ? astAttr : xmlAttribute; - } - - String getASTClassName (final String xmlElement) { - String astNode = (String)astNodes.get(xmlElement); - if (astNode == null) { - astNode = xmlElement; - } - return getASTClass(astNode); - } - - // -------------------------------------------------------------------------- - // Overriden ClassLoader method - // -------------------------------------------------------------------------- - - protected Class findClass (final String name) throws ClassNotFoundException { - if (isASTClass(name)) { - byte[] b = generateClass(getASTNode(name)); - /* DEBUG - try { - java.io.FileOutputStream fos = - new java.io.FileOutputStream(name + ".class"); - fos.write(b); - fos.close(); - } catch (Exception _) { - } - */ - return defineClass(name, b); - } - return super.findClass(name); - } - - // -------------------------------------------------------------------------- - // Class generation methods - // -------------------------------------------------------------------------- - - private byte[] generateClass (final String astNodeName) - throws ClassNotFoundException - { - String owner = getASTClass(astNodeName).replace('.', '/'); - String xmlNode = Type.getInternalName(XMLNode.class); - String node = Type.getInternalName(Node.class); - Set itfSet = (Set)astItfs.get(astNodeName); - String[] itfs = (String[])itfSet.toArray(new String[itfSet.size()]); - - ClassWriter cw = generateClass(getASTClassName(astNodeName), astNodeName, xmlNode, itfs); - - CodeVisitor xsa = cw.visitMethod( - ACC_PUBLIC, - "xmlSetAttributes", - "(Lorg/xml/sax/Attributes;)V", - null, - null); - - CodeVisitor xan = cw.visitMethod( - ACC_PUBLIC, - "xmlAddNode", - "(Ljava/lang/String;L" + xmlNode + ";)V", - null, - null); - Label xanEnd = new Label(); - - int count = 0; - Set methods = new HashSet(); - for (int i = 0; i < itfs.length; ++i) { - Method[] meths = loadClass(itfs[i].replace('/', '.')).getMethods(); - for (int j = 0; j < meths.length; ++j) { - Method meth = meths[j]; - String name = meth.getName(); - String desc = Type.getMethodDescriptor(meth); - - if (methods.contains(name + desc)) { - continue; - } - methods.add(name + desc); - - if (name.startsWith("get")) { - String field = getFieldName(name, 3); - - if (desc.startsWith("()[")) { - // case of a getter method for a sub node with arity * or + - String fieldDesc = "Ljava/util/List;"; - String elemDesc = desc.substring(3); - generateAddNodesMethod( - xan, owner, name, field, fieldDesc, xanEnd, true); - } else { - // case of a getter method for a sub node with arity 1 or ? - String fieldDesc = desc.substring(2); - - if (fieldDesc.equals("Ljava/lang/String;")) { - // case of an attribute: - // generates code in "xmlSetAttributes" - xsa.visitVarInsn(ALOAD, 0); - xsa.visitVarInsn(ALOAD, 1); - xsa.visitLdcInsn( - getXMLAttribute(astNodeName, getASTName(name, true))); - xsa.visitMethodInsn( - INVOKEINTERFACE, - "org/xml/sax/Attributes", - "getValue", - "(Ljava/lang/String;)Ljava/lang/String;"); - xsa.visitFieldInsn(PUTFIELD, owner, field, fieldDesc); - } else { - // case of a sub node: - generateAddNodeMethod( - xan, owner, name, field, fieldDesc, xanEnd, true); - } - } - } - } - } - - xsa.visitInsn(RETURN); - xsa.visitMaxs(0, 0); - - xan.visitLabel(xanEnd); - xan.visitInsn(RETURN); - xan.visitMaxs(0, 0); - - return cw.toByteArray(); - } - - private void generateAddNodeMethod ( - final CodeVisitor cv, - final String owner, final String name, - final String field, final String fieldDesc, - final Label end, final boolean add) - { - String s = getASTName(name, true); - Label l = generateIf(cv, getXMLElement(s)); - cv.visitVarInsn(ALOAD, 0); - if (add) { - cv.visitVarInsn(ALOAD, 2); - cv.visitTypeInsn( - CHECKCAST, fieldDesc.substring(1, fieldDesc.length() - 1)); - } else { - cv.visitInsn(ACONST_NULL); - } - cv.visitFieldInsn(PUTFIELD, owner, field, fieldDesc); - cv.visitJumpInsn(GOTO, end); - cv.visitLabel(l); - } - - private void generateAddNodesMethod ( - final CodeVisitor cv, - final String owner, final String name, - final String field, final String fieldDesc, - final Label end, final boolean add) - { - String s = getASTName(name, false); - Label l = generateIf(cv, getXMLElement(s)); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, owner, field, fieldDesc); - cv.visitVarInsn(ALOAD, 2); - cv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - add ? "add" : "remove", - add ? "(Ljava/lang/Object;)Z" : "(Ljava/lang/Object;)Z"); - cv.visitInsn(POP); - cv.visitJumpInsn(GOTO, end); - cv.visitLabel(l); - } - - private Label generateIf (final CodeVisitor cv, final String name) { - Label l = new Label(); - cv.visitVarInsn(ALOAD, 1); - cv.visitLdcInsn(name); - cv.visitMethodInsn( - INVOKEVIRTUAL, - "java/lang/Object", - "equals", - "(Ljava/lang/Object;)Z"); - cv.visitJumpInsn(IFEQ, l); - return l; - } - - // -------------------------------------------------------------------------- - // Naming rules - // -------------------------------------------------------------------------- - - private final static String PKG = "org.objectweb.fractal.adl.ast.xml."; - - private static String getASTClass (final String astNodeName) { - return PKG + astNodeName + "Impl"; - } - - private static boolean isASTClass (final String name) { - return name.startsWith(PKG) && name.endsWith("Impl"); - } - - private static String getASTNode (final String astClassName) { - return astClassName.substring(PKG.length(), astClassName.length() - 4); - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLParser.java b/fractaladl/src/org/objectweb/fractal/adl/xml/XMLParser.java deleted file mode 100644 index 63af0e84bf51ac71f6736c5de9e73449a49d0343..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLParser.java +++ /dev/null @@ -1,232 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.xml; - -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.Parser; -import org.objectweb.fractal.adl.ParserException; -import org.objectweb.fractal.adl.xml.XMLNodeClassLoader; -import org.objectweb.fractal.adl.xml.DTDHandler; -import org.objectweb.fractal.adl.xml.XMLNode; - -import java.io.InputStream; -import java.io.IOException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.net.URL; -import java.net.MalformedURLException; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.helpers.DefaultHandler; -import org.xml.sax.SAXException; -import org.xml.sax.InputSource; -import org.xml.sax.Attributes; -import org.xml.sax.SAXNotRecognizedException; -import org.xml.sax.Locator; -import org.xml.sax.SAXParseException; - -/** - * An extensible XML parser that constructs strongly typed abstract syntax trees. - */ - -public class XMLParser extends DefaultHandler implements Parser { - - /** - * TODO - */ - - SAXParserFactory spf; - - /** - * Associates an ASTClassLoader to each DTD. - * Keys are DTD names, values are ASTClassLoader objects. - */ - - Map loaders; - - /** - * Name of the file that is currently being parsed. - */ - - String file; - - /** - * Loader used for the elements that are currently being parsed. - */ - - XMLNodeClassLoader loader; - - /** - * Stack of the elements that are currently being parsed. - */ - - List stack; - - /** - * Top level element of the elements that are currently being parsed. - */ - - XMLNode result; - - /** - * TODO. - */ - - Locator locator; - - int line; - - // -------------------------------------------------------------------------- - // Constructor - // -------------------------------------------------------------------------- - - public XMLParser () { - this(true); - } - - public XMLParser (boolean validate) { - loaders = new HashMap(); - stack = new ArrayList(); - spf = SAXParserFactory.newInstance(); - spf.setValidating(validate); - } - - // -------------------------------------------------------------------------- - // Implementation of the Parser interface - // -------------------------------------------------------------------------- - - public Node parse (final InputStream is, final String name) - throws ParserException - { - file = name; - try { - SAXParser sp = spf.newSAXParser(); - sp.parse(new InputSource(is), this); - return result; - } catch (IOException e) { - throw new ParserException("Parser error (" + file + ":" + line + ")", e); - } catch (ParserConfigurationException e) { - throw new ParserException("Parser error (" + file + ":" + line + ")", e); - } catch (SAXException e) { - throw new ParserException("Parser error (" + file + ":" + line + ")", e); - } - } - - // -------------------------------------------------------------------------- - // Overriden DefaultHandler methods - // -------------------------------------------------------------------------- - - public void setDocumentLocator (final Locator locator) { - super.setDocumentLocator(locator); - this.locator = locator; - } - - public InputSource resolveEntity ( - final String publicId, - final String systemId) throws SAXException - { - // finds the AST class loader for the "systemID" DTD - loader = (XMLNodeClassLoader)loaders.get(systemId); - if (loader == null) { - loader = new XMLNodeClassLoader(getClass().getClassLoader()); - loaders.put(systemId, loader); - - try { - InputStream is; - // gets an InputStream to read the DTD - if (systemId.startsWith("classpath://")) { - is = getClass().getClassLoader().getResourceAsStream( - systemId.substring("classpath://".length())); - } else if (systemId.startsWith("file:")) { - is = new URL(systemId).openStream(); - } else { - throw new SAXNotRecognizedException( - "Unrecognized system identifier: " + systemId); - } - // verifies the DTD and initializes the AST class loader - new DTDHandler().checkDTD(is, loader); - } catch (MalformedURLException e) { - throw new SAXException("Cannot find the DTD", e); - } catch (IOException e) { - throw new SAXException("Cannot read the DTD", e); - } catch (ClassNotFoundException e) { - throw new SAXException("Cannot check the DTD", e); - } - } - - if (systemId.startsWith("classpath://")) { - return new InputSource(getClass().getClassLoader().getResourceAsStream( - systemId.substring("classpath://".length()))); - } else { - return null; - } - } - - public void startElement ( - final String uri, - final String localName, - final String qualifiedName, - final Attributes attributes) throws SAXException - { - String xmlNodeClassName = loader.getASTClassName(qualifiedName); - XMLNode o; - try { - o = (XMLNode)loader.loadClass(xmlNodeClassName).newInstance(); - } catch (Exception e) { - throw new SAXException("Internal error", e); - } - o.astSetSource(file + ":" + locator.getLineNumber()); - o.xmlSetAttributes(attributes); - if (stack.size() == 0) { - result = o; - } else { - Object p = stack.get(stack.size() - 1); - ((XMLNode)p).xmlAddNode(qualifiedName, o); - } - stack.add(o); - } - - public void endElement ( - final String uri, - final String localName, - final String qualifiedName) throws SAXException - { - stack.remove(stack.size() - 1); - } - - public void error (final SAXParseException e) throws SAXException { - line = locator.getLineNumber(); - throw e; - } - - public void fatalError (final SAXParseException e) throws SAXException { - line = locator.getLineNumber(); - throw e; - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLWriter.java b/fractaladl/src/org/objectweb/fractal/adl/xml/XMLWriter.java deleted file mode 100644 index 46ec9f4cddaf88b88af1de7f20b9841e7fad50b3..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/XMLWriter.java +++ /dev/null @@ -1,95 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.xml; - -import java.io.IOException; -import java.io.Writer; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.objectweb.fractal.adl.Node; - -/** - * A class to write {@link Node} based abstract syntax trees in XML form. - */ - -public class XMLWriter { - - private Writer w; - - public XMLWriter (final Writer writer) { - this.w = writer; - } - - public void write (final Node node) throws IOException { - write("", node); - } - - private void write (final String indent, final Node node) throws IOException { - w.write(indent); - w.write('<'); - w.write(node.astGetType()); - Map attrs = node.astGetAttributes(); - Iterator i = attrs.keySet().iterator(); - while (i.hasNext()) { - String attr = (String)i.next(); - String value = (String)attrs.get(attr); - if (value != null) { - w.write(' '); - w.write(attr); - w.write("=\""); - w.write(value); - w.write("\""); - } - } - List subNodes = new ArrayList(); - String[] subNodeTypes = node.astGetNodeTypes(); - for (int j = 0; j < subNodeTypes.length; ++j) { - Node[] nodes = node.astGetNodes(subNodeTypes[j]); - for (int k = 0; k < nodes.length; ++k) { - if (nodes[k] != null) { - subNodes.add(nodes[k]); - } - } - } - - if (subNodes.size() > 0) { - w.write(">\n"); - - String subIndent = indent + " "; - for (int j = 0; j < subNodes.size(); ++j) { - write(subIndent, (Node)subNodes.get(j)); - } - - w.write(indent); - w.write("\n"); - } else { - w.write("/>\n"); - } - } -} diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/basic.dtd b/fractaladl/src/org/objectweb/fractal/adl/xml/basic.dtd deleted file mode 100644 index 8908e9114a91ee74f50d212da4199837873cf23f..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/basic.dtd +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/core.dtd b/fractaladl/src/org/objectweb/fractal/adl/xml/core.dtd deleted file mode 100644 index e3e451950379fa170e2d0f44696997c10bcd4f5b..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/core.dtd +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/package.html b/fractaladl/src/org/objectweb/fractal/adl/xml/package.html deleted file mode 100644 index a5a45527261dca2a2fd27f653caf3b202b30567e..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -Provides XML based implementations of {@link org.objectweb.fractal.adl.Parser} -and {@link org.objectweb.fractal.adl.Loader}. - - \ No newline at end of file diff --git a/fractaladl/src/org/objectweb/fractal/adl/xml/standard.dtd b/fractaladl/src/org/objectweb/fractal/adl/xml/standard.dtd deleted file mode 100644 index 73742bdccb4cf4e14b3fba70f8284862eccff2b9..0000000000000000000000000000000000000000 --- a/fractaladl/src/org/objectweb/fractal/adl/xml/standard.dtd +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/build.xml b/fractaladl/test/build.xml deleted file mode 100644 index 6c6439f5d858bd1ca6476f2630c105d7d5c50cca..0000000000000000000000000000000000000000 --- a/fractaladl/test/build.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/conf.xml b/fractaladl/test/conform/conf.xml deleted file mode 100644 index d4769d00326f2dce8f82cdf9e575d12ac798fbe3..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/conf.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/Test.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/Test.java deleted file mode 100644 index 6e677adbcdfef5b3db64d332b72238e996c7178e..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/Test.java +++ /dev/null @@ -1,144 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import java.io.PrintWriter; -import java.io.Writer; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Node; -import org.objectweb.fractal.adl.xml.XMLWriter; - -import junit.framework.TestCase; - -public class Test extends TestCase { - - public Test (final String name) { - super(name); - } - - public void print (final Node n) { - try { - Writer w = new PrintWriter(System.err, true); - new XMLWriter(w).write(n); - w.flush(); - } catch (Exception e) { - } - } - - public void compare (final Definition d, final Definition e) { - compare((Node)d, (Node)e); - } - - public void compare (final Node n, final Node m) { - if (!n.astGetType().equals(m.astGetType())) { - fail(); - } - - Map nAttrs = n.astGetAttributes(); - Map mAttrs = m.astGetAttributes(); - if (n.astGetType().equals("definition")) { - mAttrs.put("name", nAttrs.get("name")); - } - Iterator it = nAttrs.keySet().iterator(); - while (it.hasNext()) { - Object key = it.next(); - if (nAttrs.get(key) == null) { - it.remove(); - } - } - it = mAttrs.keySet().iterator(); - while (it.hasNext()) { - Object key = it.next(); - if (mAttrs.get(key) == null) { - it.remove(); - } - } - if (!nAttrs.equals(mAttrs)) { - fail(); - } - - String[] nNames = n.astGetNodeTypes(); - String[] mNames = m.astGetNodeTypes(); - Set nSet = new HashSet(Arrays.asList(nNames)); - Set mSet = new HashSet(Arrays.asList(nNames)); - if (!nSet.equals(mSet)) { - fail(); - } - for (int i = 0; i < nNames.length; ++i) { - Node[] nNodes = n.astGetNodes(nNames[i]); - Node[] mNodes = m.astGetNodes(nNames[i]); - if (nNodes.length != mNodes.length) { - fail(); - } - for (int j = 0; j < nNodes.length; ++j) { - boolean ok = false; - for (int k = 0; k < mNodes.length; ++k) { - if (nNodes[j] == null) { - if (mNodes[k] == null) { - ok = true; - break; - } - } else if (mNodes[k] != null) { - try { - compare(nNodes[j], mNodes[k]); - ok = true; - break; - } catch (Throwable t) { - } - } - } - if (!ok) { - fail(); - } - } - for (int k = 0; k < mNodes.length; ++k) { - boolean ok = false; - for (int j = 0; j < nNodes.length; ++j) { - if (mNodes[k] == null) { - if (nNodes[j] == null) { - ok = true; - break; - } - } else if (nNodes[j] != null) { - try { - compare(nNodes[j], mNodes[k]); - ok = true; - break; - } catch (Throwable t) { - } - } - } - if (!ok) { - fail(); - } - } - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestArguments.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestArguments.java deleted file mode 100644 index 30b57da9a7ed3d553022ba2eec8d3aab6687bf6e..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestArguments.java +++ /dev/null @@ -1,133 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import java.util.Map; -import java.util.HashMap; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.arguments.ArgumentLoader; -import org.objectweb.fractal.adl.arguments.ArgumentComponentLoader; -import org.objectweb.fractal.adl.attributes.AttributeLoader; -import org.objectweb.fractal.adl.bindings.TypeBindingLoader; -import org.objectweb.fractal.adl.implementations.ImplementationLoader; -import org.objectweb.fractal.adl.interfaces.InterfaceLoader; -import org.objectweb.fractal.adl.types.TypeLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestArguments extends Test { - - public Loader l; - - public Map context; - - public TestArguments (final String name) { - super(name); - } - - protected void setUp () { - context = new HashMap(); - - ArgumentLoader pv = new ArgumentLoader(); - InterfaceLoader iv = new InterfaceLoader(); - TypeLoader tv = new TypeLoader(); - ImplementationLoader impv = new ImplementationLoader(); - AttributeLoader attrv1 = new AttributeLoader(); - ArgumentComponentLoader compv = new ArgumentComponentLoader(); - TypeBindingLoader bindv = new TypeBindingLoader(); - AttributeLoader attrv2 = new AttributeLoader(); - - pv.clientLoader = new XMLLoader(false); - iv.clientLoader = pv; - tv.clientLoader = iv; - impv.clientLoader = tv; - attrv1.clientLoader = impv; - compv.clientLoader = attrv1; - bindv.clientLoader = compv; - attrv2.clientLoader = bindv; - l = attrv2; - } - - public void test1 () throws ADLException { - context.put("p", "org.objectweb.fractal.adl.conform.components.IImpl"); - Definition d1 = l.load("ARG1", context); - Definition d2 = l.load("ARG2", null); - compare(d1, d2); - } - - public void test2 () { - try { - l.load("ARG1", context); - fail(); - } catch (ADLException e) { - } - } - - public void test3 () throws ADLException { - context.put("p", "org.objectweb.fractal.adl.conform.components.IImpl"); - context.put("q", "ARG1"); - context.put("r", "primitive"); - Definition d1 = l.load("ARG3", context); - Definition d2 = l.load("ARG4", null); - compare(d1, d2); - } - - public void test4 () throws ADLException { - context.put("p", "org.objectweb.fractal.adl.conform.components.IImpl"); - context.put("q", "org.objectweb.fractal.adl.conform.components.IImpl"); - Definition d1 = l.load("ARG5", context); - Definition d2 = l.load("ARG6", null); - compare(d1, d2); - } - - public void test5 () throws ADLException { - context.put("u1", "org.objectweb.fractal.adl.conform.components.IImpl"); - context.put("v1", "org.objectweb.fractal.adl.conform.components.IImpl"); - context.put("u2", "org.objectweb.fractal.adl.conform.components.IImpl"); - context.put("v2", "org.objectweb.fractal.adl.conform.components.IImpl"); - Definition d1 = l.load("ARG7", context); - Definition d2 = l.load("ARG8", null); - compare(d1, d2); - } - - public void test6 () { - try { - context.put("u", "org.objectweb.fractal.adl.conform.components.IImpl"); - l.load("ARG9", context); - fail(); - } catch (ADLException e) { - } - } - - public void test7 () { - try { - context.put("u", "org.objectweb.fractal.adl.conform.components.IImpl"); - l.load("ARG10", context); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestAttributes.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestAttributes.java deleted file mode 100644 index 78f54c7a166b98ad1e78b94a5ef82f34278c07b1..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestAttributes.java +++ /dev/null @@ -1,112 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.attributes.AttributeLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestAttributes extends Test { - - public Loader l; - - public TestAttributes (final String name) { - super(name); - } - - protected void setUp () { - AttributeLoader attrLoader = new AttributeLoader(); - attrLoader.clientLoader = new XMLLoader(false); - l = attrLoader; - } - - public void test1 () throws ADLException { - assertNotNull(l.load("ATTR1", null)); - } - - public void test2 () { - try { - l.load("ATTR2", null); - fail(); - } catch (ADLException e) { - } - } - - public void test3 () { - try { - l.load("ATTR3", null); - fail(); - } catch (ADLException e) { - } - } - - public void test4 () { - try { - l.load("ATTR4", null); - fail(); - } catch (ADLException e) { - } - } - - public void test5 () { - try { - l.load("ATTR5", null); - fail(); - } catch (ADLException e) { - } - } - - public void test6 () { - try { - l.load("ATTR6", null); - fail(); - } catch (ADLException e) { - } - } - - public void test7 () { - try { - l.load("ATTR7", null); - fail(); - } catch (ADLException e) { - } - } - - public void test8 () { - try { - l.load("ATTR8", null); - fail(); - } catch (ADLException e) { - } - } - - public void test9 () { - try { - l.load("ATTR9", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestAutoCreate.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestAutoCreate.java deleted file mode 100644 index bb4a929a251a133981f5a83f32f0c520dc4065b8..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestAutoCreate.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; - -public class TestAutoCreate extends Test { - - public TestAutoCreate (final String name) { - super(name); - } - - public void test () throws Exception { - Factory f = FactoryFactory.getFactory(); - Map ctxt = new HashMap(); - ctxt.put( - "backend", - "org.objectweb.fractal.adl.JavaBackend"); - // creates a new parser component with the bootstrap one - Map m = (Map)f.newComponent("org.objectweb.fractal.adl.BasicFactory", ctxt); - f = (Factory)m.get("factory"); - // uses this new parser to check that it has been correctly created - m = (Map)f.newComponent("org.objectweb.fractal.adl.BasicFactory", ctxt); - f = (Factory)m.get("factory"); - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestBindings.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestBindings.java deleted file mode 100644 index b13bae1bd69563c2ee9f715ed6f493c460fa7c76..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestBindings.java +++ /dev/null @@ -1,104 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.bindings.BindingLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestBindings extends Test { - - public Loader l; - - public TestBindings (final String name) { - super(name); - } - - protected void setUp () { - BindingLoader bindLoader = new BindingLoader(); - bindLoader.clientLoader = new XMLLoader(false); - l = bindLoader; - } - - public void test1 () throws ADLException { - assertNotNull(l.load("BIND1", null)); - } - - public void test2 () { - try { - l.load("BIND2", null); - fail(); - } catch (ADLException e) { - } - } - - public void test3 () { - try { - l.load("BIND3", null); - fail(); - } catch (ADLException e) { - } - } - - public void test4 () { - try { - l.load("BIND4", null); - fail(); - } catch (ADLException e) { - } - } - - public void test5 () { - try { - l.load("BIND5", null); - fail(); - } catch (ADLException e) { - } - } - - public void test6 () { - try { - l.load("BIND6", null); - fail(); - } catch (ADLException e) { - } - } - - public void test7 () { - try { - l.load("BIND7", null); - fail(); - } catch (ADLException e) { - } - } - - public void test8 () { - try { - l.load("BIND8", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestComponents.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestComponents.java deleted file mode 100644 index e0bcd3a5955b75186b10af075078d56ae670fa49..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestComponents.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.components.ComponentLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestComponents extends Test { - - public Loader l; - - public TestComponents (final String name) { - super(name); - } - - protected void setUp () { - ComponentLoader compLoader = new ComponentLoader(); - compLoader.clientLoader = new XMLLoader(false); - l = compLoader; - } - - public void test1 () throws ADLException { - l.load("COMP1", null); - } - - public void test2 () throws ADLException { - Definition d1 = l.load("COMP2", null); - Definition d2 = l.load("COMP3", null); - compare(d1, d2); - } - - public void test3 () throws ADLException { - try { - l.load("COMP4", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestCore.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestCore.java deleted file mode 100644 index a8e92ba2fe6588db800dc43816873c35f9715db0..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestCore.java +++ /dev/null @@ -1,69 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestCore extends Test { - - public Loader l; - - public TestCore (final String name) { - super(name); - } - - protected void setUp () { - l = new XMLLoader(false); - } - - public void test1 () throws ADLException { - assertNotNull(l.load("K1", null)); - } - - public void test2 () throws ADLException { - try { - l.load("K2", null); - fail(); - } catch (ADLException e) { - } - } - - public void test3 () throws ADLException { - try { - l.load("K3", null); - fail(); - } catch (ADLException e) { - } - } - - public void test4 () throws ADLException { - try { - l.load("error", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestImplementations.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestImplementations.java deleted file mode 100644 index 3482221d02620aad16ff7f0656c315d34a8a83a9..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestImplementations.java +++ /dev/null @@ -1,68 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.implementations.ImplementationLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestImplementations extends Test { - - public Loader l; - - public TestImplementations (final String name) { - super(name); - } - - protected void setUp () { - ImplementationLoader implLoader = new ImplementationLoader(); - implLoader.clientLoader = new XMLLoader(false); - l = implLoader; - } - - public void test1 () throws ADLException { - assertNotNull(l.load("IMPL1", null)); - } - - public void test2 () throws ADLException { - assertNotNull(l.load("IMPL2", null)); - } - - public void test3 () { - try { - l.load("IMPL3", null); - fail(); - } catch (ADLException e) { - } - } - - public void test4 () { - try { - l.load("IMPL4", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestInterfaces.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestInterfaces.java deleted file mode 100644 index 459035488074be43eac8ffa368998de6a9ef4910..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestInterfaces.java +++ /dev/null @@ -1,65 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.interfaces.InterfaceLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestInterfaces extends Test { - - public Loader l; - - public TestInterfaces (final String name) { - super(name); - } - - protected void setUp () { - InterfaceLoader itfLoader = new InterfaceLoader(); - itfLoader.clientLoader = new XMLLoader(false); - l = itfLoader; - } - - - public void test1 () throws ADLException { - assertNotNull(l.load("ITF1", null)); - } - - public void test2 () { - try { - l.load("ITF2", null); - fail(); - } catch (ADLException e) { - } - } - - public void test3 () { - try { - l.load("ITF3", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestMix.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestMix.java deleted file mode 100644 index deedc34fba8e3952120aaa9e4388677ee973d61c..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestMix.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.components.ComponentLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestMix extends Test { - - public Loader l; - - public TestMix (final String name) { - super(name); - } - - protected void setUp () { - ComponentLoader compLoader = new ComponentLoader(); - compLoader.clientLoader = new XMLLoader(false); - l = compLoader; - } - - public void test1 () throws ADLException { - Definition d1 = l.load("MIX1", null); - Definition d2 = l.load("MIX2", null); - Definition d3 = l.load("MIX3", null); - compare(d2, d3); - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestReferences.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestReferences.java deleted file mode 100644 index eb4f8699213663bada53986f0c2f8ef17cf36f1b..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestReferences.java +++ /dev/null @@ -1,128 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Definition; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.attributes.AttributeLoader; -import org.objectweb.fractal.adl.bindings.TypeBindingLoader; -import org.objectweb.fractal.adl.components.ComponentLoader; -import org.objectweb.fractal.adl.implementations.ImplementationLoader; -import org.objectweb.fractal.adl.interfaces.InterfaceLoader; -import org.objectweb.fractal.adl.types.TypeLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestReferences extends Test { - - public Loader l; - - public TestReferences (final String name) { - super(name); - } - - protected void setUp () { - ComponentLoader compLoader = new ComponentLoader(); - compLoader.clientLoader = new XMLLoader(false); - l = compLoader; - } - - public void test1 () throws ADLException { - Definition d1 = l.load("REF1", null); - Definition d2 = l.load("REF2", null); - Definition d3 = l.load("REF3", null); - compare(d2, d3); - } - - public void test2 () throws ADLException { - Definition d1 = l.load("REF4", null); - Definition d2 = l.load("REF5", null); - compare(d1, d2); - } - - public void test3 () throws ADLException { - Definition d1 = l.load("REF6", null); - Definition d2 = l.load("REF7", null); - compare(d1, d2); - } - - public void test4 () throws ADLException { - Definition d1 = l.load("REF8", null); - Definition d2 = l.load("REF9", null); - Definition d3 = l.load("REF10", null); - compare(d2, d3); - } - - public void test5 () throws ADLException { - Definition d1 = l.load("REF11", null); - Definition d2 = l.load("REF12", null); - compare(d1, d2); - } - - public void test6 () throws ADLException { - Definition d1 = l.load("REF13", null); - Definition d2 = l.load("REF14", null); - compare(d1, d2); - } - - public void test7 () throws ADLException { - InterfaceLoader iv = new InterfaceLoader(); - TypeLoader tv = new TypeLoader(); - ImplementationLoader impv = new ImplementationLoader(); - AttributeLoader attrv1 = new AttributeLoader(); - ComponentLoader compv = new ComponentLoader(); - TypeBindingLoader bv = new TypeBindingLoader(); - AttributeLoader attrv2 = new AttributeLoader(); - - iv.clientLoader = new XMLLoader(false); - tv.clientLoader = iv; - impv.clientLoader = tv; - attrv1.clientLoader = impv; - compv.clientLoader = attrv1; - bv.clientLoader = compv; - attrv2.clientLoader = bv; - l = attrv2; - - Definition d1 = l.load("REF15", null); - Definition d2 = l.load("REF16", null); - Definition d3 = l.load("REF17", null); - compare(d2, d3); - } - - public void test8 () throws ADLException { - try { - l.load("REF18", null); - fail(); - } catch (ADLException e) { - } - } - - public void test9 () throws ADLException { - try { - l.load("REF19", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestTypeBindings.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestTypeBindings.java deleted file mode 100644 index 663c058e2127ead0c216900890dbf2b523049f57..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestTypeBindings.java +++ /dev/null @@ -1,116 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.bindings.TypeBindingLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestTypeBindings extends Test { - - public Loader l; - - public TestTypeBindings (final String name) { - super(name); - } - - protected void setUp () { - TypeBindingLoader bindLoader = new TypeBindingLoader(); - bindLoader.clientLoader = new XMLLoader(false); - l = bindLoader; - } - - public void test1 () throws ADLException { - assertNotNull(l.load("TYPBIND1", null)); - } - - public void test2 () throws ADLException { - assertNotNull(l.load("TYPBIND2", null)); - } - - public void test3 () { - try { - l.load("TYPBIND3", null); - fail(); - } catch (ADLException e) { - } - } - - public void test4 () { - try { - l.load("TYPBIND4", null); - fail(); - } catch (ADLException e) { - } - } - - public void test5 () { - try { - l.load("TYPBIND5", null); - fail(); - } catch (ADLException e) { - } - } - - public void test6 () { - try { - l.load("TYPBIND6", null); - fail(); - } catch (ADLException e) { - } - } - - public void test7 () { - try { - l.load("TYPBIND7", null); - fail(); - } catch (ADLException e) { - } - } - - public void test8 () { - try { - l.load("TYPBIND8", null); - fail(); - } catch (ADLException e) { - } - } - - public void test9 () { - try { - l.load("TYPBIND9", null); - fail(); - } catch (ADLException e) { - } - } - - public void test10 () { - try { - l.load("TYPBIND10", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestTypes.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestTypes.java deleted file mode 100644 index b0d8a6285a5dbde2e43d23353ad11c74af86ed12..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/TestTypes.java +++ /dev/null @@ -1,96 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Loader; -import org.objectweb.fractal.adl.types.TypeLoader; -import org.objectweb.fractal.adl.xml.XMLLoader; - -public class TestTypes extends Test { - - public Loader l; - - public TestTypes (final String name) { - super(name); - } - - protected void setUp () { - TypeLoader typLoader = new TypeLoader(); - typLoader.clientLoader = new XMLLoader(false); - l = typLoader; - } - - public void test1 () throws ADLException { - assertNotNull(l.load("TYP1", null)); - } - - public void test2 () throws ADLException { - try { - l.load("TYP2", null); - fail(); - } catch (ADLException e) { - } - } - - public void test3 () { - try { - l.load("TYP3", null); - fail(); - } catch (ADLException e) { - } - } - - public void test4 () { - try { - l.load("TYP4", null); - fail(); - } catch (ADLException e) { - } - } - - public void test5 () { - try { - l.load("TYP5", null); - fail(); - } catch (ADLException e) { - } - } - - public void test6 () { - try { - l.load("TYP6", null); - fail(); - } catch (ADLException e) { - } - } - - public void test7 () { - try { - l.load("TYP7", null); - fail(); - } catch (ADLException e) { - } - } -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/I.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/I.java deleted file mode 100644 index f9fa8d649d770edce3d05a9034b913f8eef0f1e0..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/I.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform.components; - -public interface I { - void m (); -} \ No newline at end of file diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/IAttributes.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/IAttributes.java deleted file mode 100644 index ebbbe750256d40958e15e059fff4e1e457adc56b..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/IAttributes.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform.components; - -public interface IAttributes { - int getInt (); - void setInt (int i); - float getFloat (); - void setFloat (float f); - String getString (); - void setString (String s); -} \ No newline at end of file diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/IImpl.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/IImpl.java deleted file mode 100644 index a7d0cc379efba0e50fbf161954a10c9cec434dd5..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/IImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform.components; - -public class IImpl implements I, IAttributes { - - private int i; - - private float f; - - private String s; - - public void m () { - } - - public int getInt () { - return i; - } - - public void setInt (int i) { - this.i = i; - } - - public float getFloat () { - return f; - } - - public void setFloat (float f) { - this.f = f; - } - - public String getString () { - return s; - } - - public void setString (String s) { - this.s = s; - } -} \ No newline at end of file diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/J.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/J.java deleted file mode 100644 index d6c34a7fbcb1d384e0df20bb5872267f61c1b6c0..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/J.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform.components; - -public interface J extends I { - void n (); -} \ No newline at end of file diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/JImpl.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/JImpl.java deleted file mode 100644 index fd9a1a6ec81f9469ee78c2943d94af5b8b279903..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/JImpl.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform.components; - -public class JImpl extends IImpl { - - public void n () { - } -} \ No newline at end of file diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/KImpl.java b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/KImpl.java deleted file mode 100644 index 187a5d94f9f4db876b3658e348602361443096eb..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/components/KImpl.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Fractal ADL Parser - * Copyright (C) 2002-2004 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.adl.conform.components; - -public class KImpl { - -} diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG1.fractal deleted file mode 100644 index e8d5d468dcf2b08c2cf7a399bc4de375047742b0..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG1.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG10.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG10.fractal deleted file mode 100644 index f1db5526b2ead33033891d4d932f40e97ce6356e..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG10.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG2.fractal deleted file mode 100644 index cce44c97af87d526fd1cd84d5155095b78df9ada..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG2.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG3.fractal deleted file mode 100644 index b2c39520122abe4902529e2587afce6c67279e57..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG3.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG4.fractal deleted file mode 100644 index f0aa5ccaac7ba098fb3667c3eab915481f3e190e..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG4.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG5.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG5.fractal deleted file mode 100644 index 07cba97780446b6d4c8c0147d8ca5ca36c1c2034..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG5.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG6.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG6.fractal deleted file mode 100644 index fd51472e60470ea1019074bafae41603d2d4ce6f..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG6.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG7.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG7.fractal deleted file mode 100644 index 829668e7593cafb0e9655c532ea0b949c7baa436..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG7.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG8.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG8.fractal deleted file mode 100644 index 8befb700dca35f53bced7cf243f819cf155b9964..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG8.fractal +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG9.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG9.fractal deleted file mode 100644 index ab35d064d1e050bf4e6c4be4de7b98d86e764458..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ARG9.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR1.fractal deleted file mode 100644 index 8c2849fff0cc51ad06b4e713cccb96f9daea4a0f..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR1.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR2.fractal deleted file mode 100644 index 83cf043d534aba429075945376b6287db67ac4fc..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR2.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR3.fractal deleted file mode 100644 index f9e8e7b8a0bb0e67d3ac698bdd0517ada88743ce..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR3.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR4.fractal deleted file mode 100644 index d6edd38b93736f143767afd1c16cd30815eb3deb..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR4.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR5.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR5.fractal deleted file mode 100644 index 3bdc8a670a12901a170d5cdac3bb721aa9c7fad9..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR5.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR6.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR6.fractal deleted file mode 100644 index a15d9a04dcd38e5a893cb103583e6c97f2e52f45..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR6.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR7.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR7.fractal deleted file mode 100644 index 348204ffb67963b0bfb89243e4767cbd4de8a401..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR7.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR8.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR8.fractal deleted file mode 100644 index a96218e37aeceb790ccacef7ec4cf01cff6ebfb8..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR8.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR9.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR9.fractal deleted file mode 100644 index ac982ce65c2d06eff9d5e83918bb2a07d651ee87..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ATTR9.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND1.fractal deleted file mode 100644 index 48f72cdbfc259b2f30a457843f33e42f25610d73..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND1.fractal +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND2.fractal deleted file mode 100644 index a7b39c57d8e80181f7479534109b2e23d9485f18..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND2.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND3.fractal deleted file mode 100644 index 501c9313d6438f632adab977e307001a40ffffa2..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND3.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND4.fractal deleted file mode 100644 index c5da3075889d5603b2abc4a68e5f4bd65227bfff..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND4.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND5.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND5.fractal deleted file mode 100644 index b85721856a9d690b183ba8e27ef3b6b7266de226..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND5.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND6.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND6.fractal deleted file mode 100644 index 8ec6df3b07128568b3617cece5533212ca82cca2..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND6.fractal +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND7.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND7.fractal deleted file mode 100644 index 11263cd177b4657e6c1478207d54d3523cf84531..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND7.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND8.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND8.fractal deleted file mode 100644 index 906faaa8edbff14820e9164e87660c5978f0dd6a..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/BIND8.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP1.fractal deleted file mode 100644 index 50a9a6ae0fabecff3c4187ceb073a3f23f4f37ce..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP1.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP2.fractal deleted file mode 100644 index 6a08588b2d3bfbf1074d4ed2931f7e61043a3c58..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP2.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP3.fractal deleted file mode 100644 index bedf2f570cbe40a22706c32d7d57248e45eae353..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP3.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP4.fractal deleted file mode 100644 index 9474699a05cdb24e89068b9e94ae00c2f6dfe005..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/COMP4.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL1.fractal deleted file mode 100644 index 971ac0fd16a34657d3ee7881d9edb9181b132799..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL1.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL2.fractal deleted file mode 100644 index 492d623ebd8b089ad9e2def54ffa385503ffb374..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL2.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL3.fractal deleted file mode 100644 index 3b7b364cb223c1cfa13b3d7c727722061365e7c4..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL3.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL4.fractal deleted file mode 100644 index 82b3250dc1a4d09bd206df7e8f1f75d2916b1ba7..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/IMPL4.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF1.fractal deleted file mode 100644 index 58f5ab998edbb2be0bd00fddcc73c49ffe7095ba..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF1.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF2.fractal deleted file mode 100644 index a2e9295ea1c438114ef77182c29558789dd6a021..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF2.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF3.fractal deleted file mode 100644 index b27e40dd88411f3e68385d0b4efa3a8f858eaff4..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/ITF3.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K1.fractal deleted file mode 100644 index 8f261e905ea69392ce61136dd84362361d5fe0c2..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K1.fractal +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K2.fractal deleted file mode 100644 index 7d0f431e7ca037710297e042a6d6bb6d3188f36f..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K2.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K3.fractal deleted file mode 100644 index 8931affa444887af4df42f26db1a91060e8196eb..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/K3.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX1.fractal deleted file mode 100644 index 832e25ee052de53364c4888d4f50de2e6552361f..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX1.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX2.fractal deleted file mode 100644 index a5f11927dfa5fc16ae988302f46d2601e294685e..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX2.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX3.fractal deleted file mode 100644 index f5cb039f740b5e69c153b636e7f2c01c04ae748a..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/MIX3.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF1.fractal deleted file mode 100644 index e9b8dadf1826444aa26807005b40dd1b3ffdf4a5..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF1.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF10.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF10.fractal deleted file mode 100644 index 353e0fcfe18ab200d5c6f631d24c9cffc1cd64c2..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF10.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF11.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF11.fractal deleted file mode 100644 index 7bc956f7948136bf461b8466a9fe7ec96f0ceea4..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF11.fractal +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF12.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF12.fractal deleted file mode 100644 index dca644953f3de6bb0b898db0014f047e24f207da..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF12.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF13.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF13.fractal deleted file mode 100644 index 7944cfb8ad8d8e956c505d6bc0795c4e2e7e0e35..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF13.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF14.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF14.fractal deleted file mode 100644 index 82c07621694dd1f66f13ac2be7e682017904f297..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF14.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF15.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF15.fractal deleted file mode 100644 index 9e24e0085369102aa954aed82fb19174d997c876..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF15.fractal +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF16.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF16.fractal deleted file mode 100644 index 881affe72620e9e1b924de78603f7e7b55274492..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF16.fractal +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF17.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF17.fractal deleted file mode 100644 index 83c1375a21f411a9c01d893a395547045b63a265..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF17.fractal +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF18.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF18.fractal deleted file mode 100644 index b090f1da868aae78d7a84c833ea94c4450deae5f..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF18.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF19.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF19.fractal deleted file mode 100644 index 9e6cbf0a864cb061b086293f6be69c9493d270eb..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF19.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF2.fractal deleted file mode 100644 index 43cccb7baaf4dc74b7a939d55c888258adf6fda5..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF2.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF20.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF20.fractal deleted file mode 100644 index 19bb39612c0c3381b90b41715ce8994e7d247b6a..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF20.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF3.fractal deleted file mode 100644 index b36a43f50bce56c81c8e0b99943f847d0f5660d6..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF3.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF4.fractal deleted file mode 100644 index 00841e0f3b261f930e09e91c06637d18e2147418..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF4.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF5.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF5.fractal deleted file mode 100644 index a0f5a34969bb6869228a0a3245d24b70253ea050..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF5.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF6.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF6.fractal deleted file mode 100644 index 8147021d45a3d48cd0979944ace51a9645814b2e..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF6.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF7.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF7.fractal deleted file mode 100644 index 6d80eb03cffbb40a0b53945f4261b4d6f01f4555..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF7.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF8.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF8.fractal deleted file mode 100644 index 627fde521ceae0f028e164378c20787d1b67237e..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF8.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF9.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF9.fractal deleted file mode 100644 index 1eb9220d3fc8f0da1ba894277a7935f0087205d4..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/REF9.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP1.fractal deleted file mode 100644 index 1011680fc7a788046a91f38ece8e00d3b13d8c48..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP1.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP2.fractal deleted file mode 100644 index c0022f40894098ac6e61150424e0af140027f390..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP2.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP3.fractal deleted file mode 100644 index 907f84dadef4b3627b81f37d4293367259e64843..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP3.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP4.fractal deleted file mode 100644 index 1c96f054d0a2c686ffd70493b566bf121d62158f..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP4.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP5.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP5.fractal deleted file mode 100644 index d5609ef2af0e9a7c5baad0c38c08db3ce3206997..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP5.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP6.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP6.fractal deleted file mode 100644 index f3e005a3d2c742b6699f6c888872ceae8cbe1cb1..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP6.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP7.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP7.fractal deleted file mode 100644 index 84781f4b3db4f78d11b5eb1a6e540e3f4137f0a0..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYP7.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND1.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND1.fractal deleted file mode 100644 index 2ede616ff76e2c1f94019a9b64197e1a098992f6..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND1.fractal +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND10.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND10.fractal deleted file mode 100644 index b02d1b33bc39bea9ce362c24b36ac5dc0f8f01b2..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND10.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND2.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND2.fractal deleted file mode 100644 index 15ca5052aabe794ef3e1a9390e6863cd88f03fa2..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND2.fractal +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND3.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND3.fractal deleted file mode 100644 index 39ce3ba0186f162fca444ce9eb0b576b0f8ab056..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND3.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND4.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND4.fractal deleted file mode 100644 index 50c1433c9b9725572c074f3e5ff08a2859d9d454..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND4.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND5.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND5.fractal deleted file mode 100644 index d1e3c57eb5089ecf77770216f8d8ca2b10ea7bc5..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND5.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND6.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND6.fractal deleted file mode 100644 index c5701ed0c9ae8cf92e6914f5daec75afe1c8d4be..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND6.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND7.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND7.fractal deleted file mode 100644 index 93949ad87c10dd1be01c1aee8d0dccb94093d5af..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND7.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND8.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND8.fractal deleted file mode 100644 index 4741bcd6bb60aaea588ebb81abb4250478bbfdf9..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND8.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND9.fractal b/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND9.fractal deleted file mode 100644 index e503c6cb1f00b59a09222d4f6a0397a274c425e3..0000000000000000000000000000000000000000 --- a/fractaladl/test/conform/org/objectweb/fractal/adl/conform/definitions/TYPBIND9.fractal +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fractaladl/test/lib/junit.jar b/fractaladl/test/lib/junit.jar deleted file mode 100644 index 914a5cfa9b467c86d2841b32c367295653ed754c..0000000000000000000000000000000000000000 Binary files a/fractaladl/test/lib/junit.jar and /dev/null differ diff --git a/fractaljmx/README.txt b/fractaljmx/README.txt deleted file mode 100644 index e2338b0f6f242af515583694eb101ee2ff749c44..0000000000000000000000000000000000000000 --- a/fractaljmx/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -This directory is the base directory of the product. -It contains(*) the following items: - -- archive: ant files to build the jar(s) of the product, -- build.properties: properties to configure the build process, -- build.xml: main ant file to build the product, -- config: external libraries required only for building the product, -- doc: documentation of the product, -- etc: scripts to run the product, -- examples: examples of use of the product, -- externals: external libraires required for running the product, -- jdoc: ant files to build the javadoc documentation(s) of the product, -- sr': sources of the product, -- test: tests of the product, -- web: source of the web site of the product. - -(*) some items may not be present, depending on the product. diff --git a/fractaljmx/archive/README.txt b/fractaljmx/archive/README.txt deleted file mode 100644 index e0d72a77eeab2c75774e256e42b338274737fa5d..0000000000000000000000000000000000000000 --- a/fractaljmx/archive/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory contains ant files to build the jars of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one jar file. - -- The name of the ant file must be the name of the jar it builds: - org-foo-bar.xml must build org-foo-bar.jar. - -- Among the elements which are included into a jar, you must specify - a manifest. It is adviced to store the manifest file in this directory. - The manifest file can be shared by several jars. The name of the manifest - file must be similar to the name of the jar file. - -- Only the default task is called on each ant file. - -- The jar file must be produced into the ${dist.lib} directory. - -Sample ant file: - - - - - - ... - - - - diff --git a/fractaljmx/archive/fractal-jmx-tmpl.mf b/fractaljmx/archive/fractal-jmx-tmpl.mf deleted file mode 100644 index 246fe3e8f3a9ed00a5cf07ff6f5d36e2c4f0c026..0000000000000000000000000000000000000000 --- a/fractaljmx/archive/fractal-jmx-tmpl.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Fractal jmx template definitions" -Implementation-Version: "0.1" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractaljmx/archive/fractal-jmx-tmpl.xml b/fractaljmx/archive/fractal-jmx-tmpl.xml deleted file mode 100644 index 00fe328fc9f7cc554ad2c4bccb43ebcdb92995b3..0000000000000000000000000000000000000000 --- a/fractaljmx/archive/fractal-jmx-tmpl.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/fractaljmx/archive/fractal-jmx.mf b/fractaljmx/archive/fractal-jmx.mf deleted file mode 100644 index cb6f8976c2c841056a1e0fd5be5258bcf90576dd..0000000000000000000000000000000000000000 --- a/fractaljmx/archive/fractal-jmx.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Fractal jmx" -Implementation-Version: "0.1" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractaljmx/archive/fractal-jmx.xml b/fractaljmx/archive/fractal-jmx.xml deleted file mode 100644 index ed011500c3a59de124a0e05275d112d9d00b4894..0000000000000000000000000000000000000000 --- a/fractaljmx/archive/fractal-jmx.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/fractaljmx/build.config b/fractaljmx/build.config deleted file mode 100644 index 3e65a50ee3460787da855cf9622872fe9b0ab668..0000000000000000000000000000000000000000 --- a/fractaljmx/build.config +++ /dev/null @@ -1,15 +0,0 @@ -# Defines values for the 'build.properties' build properties -# This file is used to build the project in the case of bundled external jars - -objectweb.ant.tasks.path config/ow_util_ant_tasks.jar - -asm.path externals/asm.jar - -fractal.path externals/fractal.jar - -julia.path externals/julia-asm.jar:externals/julia-mixins.jar:externals/julia-runtime.jar - -fractaladl.path externals/fractal-adl.jar - -jmx.path externals/jmxri.jar:externals/jmxtools.jar - diff --git a/fractaljmx/build.properties b/fractaljmx/build.properties deleted file mode 100644 index 4816d1305f5aed464266b05fe0eb6c9034b6891c..0000000000000000000000000000000000000000 --- a/fractaljmx/build.properties +++ /dev/null @@ -1,76 +0,0 @@ -############################################################################### -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################### - -# Some information about the product - -product.name fractaljmx -product.version 0.1 - -############################################################################### -# BUILD -############################################################################### - -# Wich compiler do you want to use ? - -# build.compiler jikes - -# Build class path (classes needed to build the project) -# Classpath for the ObjectWeb utility Ant tasks (OWANTTASK_1_1) -# See http://forge.objectweb.org/projects/monolog - -# objectweb.ant.tasks.path ow_util_ant_tasks.jar - - -############################################################################### -# EXTERNAL LIBRARIES -############################################################################### - -# Class path for the ASM library (ASM_1_4_2) -# See http://asm.objectweb.org - -# asm.path asm.jar - -# Class path for the Fractal API (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -# fractal.path fractal.jar - -# Class path of Julia (JULIA_2_0) -# See http://fractal.objectweb.org - -# julia.path julia-asm.jar:julia-mixins.jar:julia-runtime.jar - -# Class path for the Fractal ADL Parser (FRACTAL_ADL_2_0) -# See http://fractal.objectweb.org - -# fractaladl.path fractal-adl.jar - -# Class path for the JMX APIs, tools and implementation (Reference Implementation Version 1.2.1) -# See http://java.sun.com/products/JavaManagement - -# jmx.path jmxri.jar:jmxtools.jar - -############################################################################### -# DOCUMENTATION -############################################################################### - -# URLs of external Javadocs - -fractal.url http://www.objectweb.org/fractal/current/doc/javadoc/fractal -julia.url http://www.objectweb.org/fractal/current/doc/javadoc/julia -asm.url http://www.objectweb.org/asm/current/doc/javadoc/user -jdk.url http://java.sun.com/j2se/1.3/docs/api -j2ee.url http://java.sun.com/j2ee/1.4/docs/api diff --git a/fractaljmx/build.xml b/fractaljmx/build.xml deleted file mode 100644 index 1e4cd342138465dde67f0cb249318a858f5e45cf..0000000000000000000000000000000000000000 --- a/fractaljmx/build.xml +++ /dev/null @@ -1,271 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaljmx/config/README.txt b/fractaljmx/config/README.txt deleted file mode 100644 index 4978babb44fb4f93c7d819e50bedad09c7086b79..0000000000000000000000000000000000000000 --- a/fractaljmx/config/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains the external libraries required for building the -product, but which are not necessary to use it. diff --git a/fractaljmx/config/ow_util_ant_tasks.jar b/fractaljmx/config/ow_util_ant_tasks.jar deleted file mode 100644 index 9d918a02c15cc45f880fbf604f3954308d7c2645..0000000000000000000000000000000000000000 Binary files a/fractaljmx/config/ow_util_ant_tasks.jar and /dev/null differ diff --git a/fractaljmx/doc/README.txt b/fractaljmx/doc/README.txt deleted file mode 100644 index 84303fee616679f69995c94e1dd7d4198b338d64..0000000000000000000000000000000000000000 --- a/fractaljmx/doc/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the documentation of the product. diff --git a/fractaljmx/doc/javadoc/figures/fractal-jmx-scope.fig b/fractaljmx/doc/javadoc/figures/fractal-jmx-scope.fig deleted file mode 100644 index 08be652778810ee87cbe1538fd865edb1181700c..0000000000000000000000000000000000000000 --- a/fractaljmx/doc/javadoc/figures/fractal-jmx-scope.fig +++ /dev/null @@ -1,55 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 1542 3556 2400 4241 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 1542 3556 2400 3556 2400 4241 1542 4241 1542 3556 -4 0 0 50 -1 2 9 0.0000 4 105 330 1612 3727 Agent\001 --6 -6 988 3536 1578 3830 -6 1430 3536 1578 3830 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1540 3684 1467 3684 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1467 3573 1467 3794 --6 -4 2 0 50 -1 0 10 0.0000 4 105 435 1393 3720 Admin\001 --6 -6 3420 3690 3600 4005 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3543 3855 3461 3855 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3461 3740 3461 3966 --6 -6 1530 3285 2610 3600 -6 1530 3420 1890 3600 -6 1530 3420 1890 3600 -6 1546 3426 1848 3591 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1696 3549 1696 3467 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1811 3467 1585 3467 --6 --6 --6 -4 2 0 50 -1 0 10 0.0000 4 105 1110 2603 3426 AdminAttributes\001 --6 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 810 2565 5580 2565 5580 5220 810 5220 810 2565 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 3060 3150 5355 3150 5355 4815 3060 4815 3060 3150 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 3555 3600 4275 3600 4275 4275 3555 4275 3555 3600 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 585 2160 6075 2160 6075 5715 585 5715 585 2160 -4 0 0 50 -1 2 12 0.0000 4 135 135 710 2369 A\001 -4 0 0 50 -1 2 12 0.0000 4 135 135 1035 2880 B\001 -4 0 0 50 -1 2 12 0.0000 4 135 120 3240 3420 C\001 -4 0 0 50 -1 2 12 0.0000 4 135 135 3690 3870 D\001 -4 2 0 50 -1 0 10 0.0000 4 105 60 3375 3915 I\001 diff --git a/fractaljmx/doc/javadoc/figures/fractal-jmx-scope.gif b/fractaljmx/doc/javadoc/figures/fractal-jmx-scope.gif deleted file mode 100644 index f8c30626ae1ea21b4259fc4c77f89e587fe532f6..0000000000000000000000000000000000000000 Binary files a/fractaljmx/doc/javadoc/figures/fractal-jmx-scope.gif and /dev/null differ diff --git a/fractaljmx/doc/javadoc/figures/fractal-jmx.fig b/fractaljmx/doc/javadoc/figures/fractal-jmx.fig deleted file mode 100644 index 9f9ada57930d32071241e83dcaf44bc4efdf1943..0000000000000000000000000000000000000000 --- a/fractaljmx/doc/javadoc/figures/fractal-jmx.fig +++ /dev/null @@ -1,85 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 684 3058 1542 3743 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 684 3058 1542 3058 1542 3743 684 3743 684 3058 -4 0 0 50 -1 2 9 0.0000 4 137 503 718 3229 Adaptor\001 --6 -6 1543 3093 1617 3317 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1617 3206 1543 3206 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1617 3093 1617 3317 --6 -6 2624 3008 4969 3789 -6 4112 3058 4969 3743 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4112 3058 4969 3058 4969 3743 4112 3743 4112 3058 -4 0 0 50 -1 2 9 0.0000 4 103 526 4147 3229 Listener\001 --6 -6 2624 3296 4147 3610 -6 3991 3296 4147 3610 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4029 3337 4029 3570 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4107 3452 4029 3452 --6 -6 2624 3375 3951 3492 -4 2 0 50 -1 0 10 0.0000 4 118 1327 3951 3492 NotificationListener\001 --6 --6 --6 -6 733 2942 1069 3107 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 901 3067 901 2982 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1025 2982 775 2982 --6 -6 2397 4771 3255 5456 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2397 4771 3255 4771 3255 5456 2397 5456 2397 4771 -4 0 0 50 -1 2 9 0.0000 4 137 366 2467 4942 Agent\001 --6 -6 2364 4519 3458 4806 -6 2401 4641 2703 4806 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2551 4764 2551 4682 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2666 4682 2440 4682 --6 -4 2 0 50 -1 0 10 0.0000 4 113 1069 3458 4641 AdminAttributes\001 --6 -6 1843 4751 2433 5045 -6 2285 4751 2433 5045 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2395 4899 2322 4899 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2322 4788 2322 5009 --6 -4 2 0 50 -1 0 10 0.0000 4 111 405 2248 4935 Admin\001 --6 -6 3255 4800 3337 5045 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3337 4924 3255 4924 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3337 4800 3337 5045 --6 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 45.70 91.40 - 3358 4909 4009 3468 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 45.70 91.40 - 1652 3192 2430 4635 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 540 2070 8428 2070 8428 5873 540 5873 540 2070 -4 0 0 50 -1 2 12 0.0000 4 122 399 710 2369 Host\001 -4 2 0 50 -1 0 10 0.0000 4 166 1297 1947 2942 AdaptorAttributes\001 -4 2 0 50 -1 0 10 0.0000 4 105 615 2250 3240 adminAtt\001 -4 0 0 50 -1 0 10 0.0000 4 105 480 3419 5006 listener\001 diff --git a/fractaljmx/doc/javadoc/figures/fractal-jmx.gif b/fractaljmx/doc/javadoc/figures/fractal-jmx.gif deleted file mode 100644 index 726f76b8cb940d049fea03de1bb5abf7e367e1bc..0000000000000000000000000000000000000000 Binary files a/fractaljmx/doc/javadoc/figures/fractal-jmx.gif and /dev/null differ diff --git a/fractaljmx/examples/comanche/README b/fractaljmx/examples/comanche/README deleted file mode 100644 index de4d600946fbd0b42233ecbe0b328c1b2e49a416..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/README +++ /dev/null @@ -1,6 +0,0 @@ -Comanche is the minimal HTTP server described in the Fractal tutorial. - -Uses one of the application arguments proposed in: etc/execute.properties -to enable JMX management of Comanche (as described in the Fractal JMX tutorial). - - diff --git a/fractaljmx/examples/comanche/etc/execute.properties b/fractaljmx/examples/comanche/etc/execute.properties deleted file mode 100644 index c6eddf6dc39ba9023de7fdf3f6a89477b18c1682..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/etc/execute.properties +++ /dev/null @@ -1,21 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -run.jvm.parameters \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -# Java class to be launched - -run.classname org.objectweb.fractal.adl.Launcher - -# Application arguments -# use "comanche.Comanche" to run Comanche -# use "comanche.JmxComanche1" to run Comanche with the default management -# then open http://localhost:8082 to connect a browser to the JMX agent -# use "comanche.JmxComanche2" to run Comanche with a customized management -# then open http://localhost:8081 to connect a browser to the JMX agent - -run.parameters -fractal comanche.JmxComanche1 r \ No newline at end of file diff --git a/fractaljmx/examples/comanche/etc/julia.cfg b/fractaljmx/examples/comanche/etc/julia.cfg deleted file mode 100644 index e37b27e20a4d5bd4115798ee80a95c4c006393c6..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/etc/julia.cfg +++ /dev/null @@ -1,647 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -(statPrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - (stat-controller org.objectweb.fractal.jmx.julia.stat.StatController) - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - (org.objectweb.fractal.jmx.julia.stat.BasicStatController 5000) - #(org.objectweb.fractal.jmx.julia.stat.ExponentialSmoothingStatController 5000 0.5) - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - org.objectweb.fractal.jmx.julia.stat.StatCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) diff --git a/fractaljmx/examples/comanche/index.html b/fractaljmx/examples/comanche/index.html deleted file mode 100644 index ce78834a5608fc796b4836531aebd9ba3ed8024f..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Welcome in Comanche! -
-This is a test page to test the Comanche server. - \ No newline at end of file diff --git a/fractaljmx/examples/comanche/src/comanche/Analyzer.fractal b/fractaljmx/examples/comanche/src/comanche/Analyzer.fractal deleted file mode 100644 index 3e7d7093e9f361c2170e4cddf4e4c32e77f985a3..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Analyzer.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/AnalyzerType.fractal b/fractaljmx/examples/comanche/src/comanche/AnalyzerType.fractal deleted file mode 100644 index c3f241f977965a0499f4628bcdaab44d299cfff2..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/AnalyzerType.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/Backend.fractal b/fractaljmx/examples/comanche/src/comanche/Backend.fractal deleted file mode 100644 index 69457768d572b53813cea65898d004c93af0c8e9..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Backend.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/BackendType.fractal b/fractaljmx/examples/comanche/src/comanche/BackendType.fractal deleted file mode 100644 index 92a8b09da155a8e95d3953fc604e0417f0bfc15b..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/BackendType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/BasicLogger.java b/fractaljmx/examples/comanche/src/comanche/BasicLogger.java deleted file mode 100644 index 86924686e16badb1cbf6ea36749a406e0f3987a1..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/BasicLogger.java +++ /dev/null @@ -1,24 +0,0 @@ -package comanche; - -public class BasicLogger implements Logger, LoggerAttributes { - - private String header = ""; - - // ------------------------------------------------------------------------- - // implements attribute controller - // ------------------------------------------------------------------------- - public String getHeader() { - return header; - } - - public void setHeader(final String header) { - this.header = header; - } - - // ------------------------------------------------------------------------- - // implements Logger interface - // ------------------------------------------------------------------------- - public void log(String msg) { - System.out.println(header + " " + msg); - } -} diff --git a/fractaljmx/examples/comanche/src/comanche/Comanche.fractal b/fractaljmx/examples/comanche/src/comanche/Comanche.fractal deleted file mode 100644 index ca67ce597d430af5ee716d501136b69f9092ab34..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Comanche.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/ComancheType.fractal b/fractaljmx/examples/comanche/src/comanche/ComancheType.fractal deleted file mode 100644 index 0e42e0ee86d4d753b08dc3a6123d8c075ce487bb..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/ComancheType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/Dispatcher.fractal b/fractaljmx/examples/comanche/src/comanche/Dispatcher.fractal deleted file mode 100644 index ec115f1da4cdebed5ae2b9dd923988404eef09e9..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Dispatcher.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/DispatcherType.fractal b/fractaljmx/examples/comanche/src/comanche/DispatcherType.fractal deleted file mode 100644 index 2682937b3d606ee68f06fd0b58666306efb0675f..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/DispatcherType.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/ErrorHandler.fractal b/fractaljmx/examples/comanche/src/comanche/ErrorHandler.fractal deleted file mode 100644 index 636c109f542f3d6d43bd323cf462c4289f0f1431..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/ErrorHandler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/ErrorRequestHandler.java b/fractaljmx/examples/comanche/src/comanche/ErrorRequestHandler.java deleted file mode 100644 index 735a5f69c1a0d9443af4a72cb114d22f2e15bd17..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/ErrorRequestHandler.java +++ /dev/null @@ -1,9 +0,0 @@ -package comanche; -import java.io.*; - -public class ErrorRequestHandler implements RequestHandler { - public void handleRequest (Request r) throws IOException { - r.out.print("HTTP/1.0 404 Not Found\n\n"); - r.out.print("Document not found."); - } -} diff --git a/fractaljmx/examples/comanche/src/comanche/FileHandler.fractal b/fractaljmx/examples/comanche/src/comanche/FileHandler.fractal deleted file mode 100644 index 47b91c181a19a7f0147e93715dbf3510f71e3a14..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/FileHandler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/FileRequestHandler.java b/fractaljmx/examples/comanche/src/comanche/FileRequestHandler.java deleted file mode 100644 index e4bdbe3903fc14850acc7ceeeadaebfad144469e..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/FileRequestHandler.java +++ /dev/null @@ -1,18 +0,0 @@ -package comanche; -import java.io.*; - -public class FileRequestHandler implements RequestHandler { - public void handleRequest (Request r) throws IOException { - File f = new File(r.url); - if (f.exists() && !f.isDirectory()) { - InputStream is = new FileInputStream(f); - byte[] data = new byte[is.available()]; - is.read(data); - is.close(); - r.out.print("HTTP/1.0 200 OK\n\n"); - r.out.write(data); - } else { - throw new IOException("File not found"); - } - } -} diff --git a/fractaljmx/examples/comanche/src/comanche/Frontend.fractal b/fractaljmx/examples/comanche/src/comanche/Frontend.fractal deleted file mode 100644 index de64b1c066167e8a1100576c8b72ebcd05b9f04f..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Frontend.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/FrontendType.fractal b/fractaljmx/examples/comanche/src/comanche/FrontendType.fractal deleted file mode 100644 index d7a8d67c859c8a62b695a81d0a97d7fceda9ef3b..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/FrontendType.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/Handler.fractal b/fractaljmx/examples/comanche/src/comanche/Handler.fractal deleted file mode 100644 index a0b17d20d8f740e87ec9c52be8b450d1fd246040..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Handler.fractal +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/JmxComanche1.fractal b/fractaljmx/examples/comanche/src/comanche/JmxComanche1.fractal deleted file mode 100644 index 7f0d5f819ae8dd76231038e0ddadabc4b4366cf9..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/JmxComanche1.fractal +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/JmxComanche2.fractal b/fractaljmx/examples/comanche/src/comanche/JmxComanche2.fractal deleted file mode 100644 index 6c5cc7b8847d708113475eb1b221ed3061040775..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/JmxComanche2.fractal +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/Logger.fractal b/fractaljmx/examples/comanche/src/comanche/Logger.fractal deleted file mode 100644 index 3d905dc2052de37d143d723f2df29a10c841f9fc..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Logger.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/Logger.java b/fractaljmx/examples/comanche/src/comanche/Logger.java deleted file mode 100644 index 241561a53c89351530e333ec75f7c271c4a7480e..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Logger.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public interface Logger { - void log (String msg); -} diff --git a/fractaljmx/examples/comanche/src/comanche/LoggerAttributes.java b/fractaljmx/examples/comanche/src/comanche/LoggerAttributes.java deleted file mode 100644 index 1041b5d4a3c8d6eebe648d2a11767933cc2b701a..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/LoggerAttributes.java +++ /dev/null @@ -1,8 +0,0 @@ -package comanche; - -import org.objectweb.fractal.api.control.AttributeController; - -public interface LoggerAttributes extends AttributeController { - String getHeader (); - void setHeader (String header); -} diff --git a/fractaljmx/examples/comanche/src/comanche/LoggerType.fractal b/fractaljmx/examples/comanche/src/comanche/LoggerType.fractal deleted file mode 100644 index 6b6cdbcbebd0184ff27aaa8ebe9f4b08abf887bc..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/LoggerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/MultiThreadScheduler.fractal b/fractaljmx/examples/comanche/src/comanche/MultiThreadScheduler.fractal deleted file mode 100644 index c345848d11351cb1d53104585d47603ad2b8ef27..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/MultiThreadScheduler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/MultiThreadScheduler.java b/fractaljmx/examples/comanche/src/comanche/MultiThreadScheduler.java deleted file mode 100644 index adf8bb4d91c15fd014f7bae585c59212aba73612..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/MultiThreadScheduler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public class MultiThreadScheduler implements Scheduler { - public void schedule (Runnable task) { new Thread(task).start(); } -} diff --git a/fractaljmx/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal b/fractaljmx/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal deleted file mode 100644 index 9566c389686b9daa422ed738fde3742d86390f0a..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/Receiver.fractal b/fractaljmx/examples/comanche/src/comanche/Receiver.fractal deleted file mode 100644 index 74363878f74b875479710eed95b617a03d796117..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Receiver.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/ReceiverType.fractal b/fractaljmx/examples/comanche/src/comanche/ReceiverType.fractal deleted file mode 100644 index 6ff55d785bc4dc50af11e625810c78d19eb43aaa..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/ReceiverType.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractaljmx/examples/comanche/src/comanche/Request.java b/fractaljmx/examples/comanche/src/comanche/Request.java deleted file mode 100644 index 200c4b658f35cb079fdc1ccaa89d403672046e19..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Request.java +++ /dev/null @@ -1,11 +0,0 @@ -package comanche; -import java.io.*; -import java.net.*; - -public class Request { - public Socket s; - public Reader in; - public PrintStream out; - public String url; - public Request (Socket s) { this.s = s; } -} diff --git a/fractaljmx/examples/comanche/src/comanche/RequestAnalyzer.java b/fractaljmx/examples/comanche/src/comanche/RequestAnalyzer.java deleted file mode 100644 index 945c0df259109e6d9b3b0222fb64681dd88b5da6..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/RequestAnalyzer.java +++ /dev/null @@ -1,36 +0,0 @@ -package comanche; -import java.io.*; -import org.objectweb.fractal.api.control.BindingController; - -public class RequestAnalyzer implements RequestHandler, BindingController { - private RequestHandler rh; - private Logger l; - // configuration aspect - public String[] listFc () { return new String[] { "l", "rh" }; } - public Object lookupFc (String itfName) { - if (itfName.equals("l")) { return l; } - else if (itfName.equals("rh")) { return rh; } - else return null; - } - public void bindFc (String itfName, Object itfValue) { - if (itfName.equals("l")) { l = (Logger)itfValue; } - else if (itfName.equals("rh")) { rh = (RequestHandler)itfValue; } - } - public void unbindFc (String itfName) { - if (itfName.equals("l")) { l = null; } - else if (itfName.equals("rh")) { rh = null; } - } - // functional aspect - public void handleRequest (Request r) throws IOException { - r.in = new InputStreamReader(r.s.getInputStream()); - r.out = new PrintStream(r.s.getOutputStream()); - String rq = new LineNumberReader(r.in).readLine(); - l.log(rq); - if (rq.startsWith("GET ")) { - r.url = rq.substring(5, rq.indexOf(' ', 4)); - rh.handleRequest(r); - } - r.out.close(); - r.s.close(); - } -} diff --git a/fractaljmx/examples/comanche/src/comanche/RequestDispatcher.java b/fractaljmx/examples/comanche/src/comanche/RequestDispatcher.java deleted file mode 100644 index 2e851ce2519c1a703e07745f0ebb6e6e5e70a241..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/RequestDispatcher.java +++ /dev/null @@ -1,31 +0,0 @@ -package comanche; -import java.io.*; -import java.util.*; -import org.objectweb.fractal.api.control.BindingController; - -public class RequestDispatcher implements RequestHandler, BindingController { - private Map handlers = new TreeMap(); - // configuration aspect - public String[] listFc () { - return (String[])handlers.keySet().toArray(new String[handlers.size()]); - } - public Object lookupFc (String itfName) { - if (itfName.startsWith("h")) { return handlers.get(itfName); } - else return null; - } - public void bindFc (String itfName, Object itfValue) { - if (itfName.startsWith("h")) { handlers.put(itfName, itfValue); } - } - public void unbindFc (String itfName) { - if (itfName.startsWith("h")) { handlers.remove(itfName); } - } - // functional aspect - public void handleRequest (Request r) throws IOException { - Iterator i = handlers.values().iterator(); - while (i.hasNext()) { - try { - ((RequestHandler)i.next()).handleRequest(r); return; - } catch (IOException _) { } - } - } -} diff --git a/fractaljmx/examples/comanche/src/comanche/RequestHandler.java b/fractaljmx/examples/comanche/src/comanche/RequestHandler.java deleted file mode 100644 index 0e8d749b9ed86faa47a9ec2019f9dab2e9dddd1c..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/RequestHandler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public interface RequestHandler { - void handleRequest (Request r) throws java.io.IOException; -} diff --git a/fractaljmx/examples/comanche/src/comanche/RequestReceiver.java b/fractaljmx/examples/comanche/src/comanche/RequestReceiver.java deleted file mode 100644 index d5067d4eacfd6a4dc74e65862be7d9b90122e0e0..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/RequestReceiver.java +++ /dev/null @@ -1,41 +0,0 @@ -package comanche; -import java.io.*; -import java.net.*; -import org.objectweb.fractal.api.control.BindingController; - -public class RequestReceiver implements Runnable, BindingController { - private Scheduler s; - private RequestHandler rh; - // configuration aspect - public String[] listFc () { return new String[] { "s", "rh" }; } - public Object lookupFc (String itfName) { - if (itfName.equals("s")) { return s; } - else if (itfName.equals("rh")) { return rh; } - else return null; - } - public void bindFc (String itfName, Object itfValue) { - if (itfName.equals("s")) { s = (Scheduler)itfValue; } - else if (itfName.equals("rh")) { rh = (RequestHandler)itfValue; } - } - public void unbindFc (String itfName) { - if (itfName.equals("s")) { s = null; } - else if (itfName.equals("rh")) { rh = null; } - } - // functional aspect - public void run () { - try { - ServerSocket ss = new ServerSocket(8080); - System.out.println("Comanche HTTP Server ready on port 8080."); - while (true) { - final Socket socket = ss.accept(); - s.schedule(new Runnable () { - public void run () { - try { - rh.handleRequest(new Request(socket)); - } catch (IOException _) { } - } - }); - } - } catch (IOException e) { e.printStackTrace(); } - } -} diff --git a/fractaljmx/examples/comanche/src/comanche/Scheduler.java b/fractaljmx/examples/comanche/src/comanche/Scheduler.java deleted file mode 100644 index d3a047de430b0b568d9106c8411686b42ad349e4..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Scheduler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public interface Scheduler { - void schedule (Runnable task); -} diff --git a/fractaljmx/examples/comanche/src/comanche/SequentialScheduler.java b/fractaljmx/examples/comanche/src/comanche/SequentialScheduler.java deleted file mode 100644 index e49d07e3532e7b0f97b1e98f73a765b9a7a156d0..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/SequentialScheduler.java +++ /dev/null @@ -1,5 +0,0 @@ -package comanche; - -public class SequentialScheduler implements Scheduler { - public void schedule (Runnable task) { task.run(); } -} diff --git a/fractaljmx/examples/comanche/src/comanche/Server.java b/fractaljmx/examples/comanche/src/comanche/Server.java deleted file mode 100644 index fbb5db157dd222ffa57eaf073979c40377d596db..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/comanche/src/comanche/Server.java +++ /dev/null @@ -1,20 +0,0 @@ -package comanche; - -public class Server { - public static void main (String[] args) { - RequestReceiver rr = new RequestReceiver(); - RequestAnalyzer ra = new RequestAnalyzer(); - RequestDispatcher rd = new RequestDispatcher(); - FileRequestHandler frh = new FileRequestHandler(); - ErrorRequestHandler erh = new ErrorRequestHandler(); - Scheduler s = new MultiThreadScheduler(); - Logger l = new BasicLogger(); - rr.bindFc("rh", ra); - rr.bindFc("s", s); - ra.bindFc("rh", rd); - ra.bindFc("l", l); - rd.bindFc("h0", frh); - rd.bindFc("h1", erh); - rr.run(); - } -} \ No newline at end of file diff --git a/fractaljmx/examples/common/README.txt b/fractaljmx/examples/common/README.txt deleted file mode 100644 index 453bc6f610990e2408c5d483d7c2c4bedbc563ff..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/common/README.txt +++ /dev/null @@ -1,11 +0,0 @@ -This directory contains the examples. Its organization is the following: -- 'lib' directory (optional): jar files shared by all examples, -- 'etc' directory: configuration files shared by all examples, -- 'README' file: explains the organisation of the examples directory, -- Each other directory contains an example. - -The organization of each example directory is the following: -- 'README' file: describes the example and its configuration, -- 'lib' directory (optional): jar files needed by the example, -- 'etc' directory: configuration files needed by the example, -- 'src' directory: source code of the example. diff --git a/fractaljmx/examples/common/build.xml b/fractaljmx/examples/common/build.xml deleted file mode 100644 index a8acb224fe6bc807b0a8a698b0dd5ac47da29fcc..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/common/build.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaljmx/examples/common/etc/build.properties b/fractaljmx/examples/common/etc/build.properties deleted file mode 100644 index a289c9e6af6cec0df1a731342f057d3d1d034d45..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/common/etc/build.properties +++ /dev/null @@ -1,26 +0,0 @@ -# Wich compiler do you want use ? -build.compiler jikes - -# Class path for the ASM library (version 1.4.1 or higher) -# See http://asm.objectweb.org -asm.path ../../externals/asm.jar - -# Class path for the Fractal API (version 2.0 or higher) -# See http://fractal.objectweb.org -fractal.path ../../externals/fractal.jar - -# Class path of Julia (Fractal API implementation, version 2.0 or higher) -# See http://fractal.objectweb.org -julia.path ../../externals/julia-asm.jar:../../externals/julia-mixins.jar:../../externals/julia-runtime.jar - -# Class path for the FractalADL parser (version 1.0 or higher) -# See http://fractal.objectweb.org -fractaladl.path ../../externals/fractal-adl.jar:../../externals/dtdparser.jar:../../externals/ow_deployment_scheduling.jar - -# Class path for FractalJMX (version 0.1 or higher) -# See http://fractal.objectweb.org -fractaljmx.path ../../lib/fractal-jmx.jar:../../lib/fractal-jmx-tmpl.jar - -# Class path for the JMX APIs, tools and implementation (Reference Implementation Version 1.2.1) -# See http://java.sun.com/products/JavaManagement -jmx.path ../../externals/jmxri.jar:../../externals/jmxtools.jar diff --git a/fractaljmx/examples/host/README b/fractaljmx/examples/host/README deleted file mode 100644 index d679d755c5dc9370d3f54f4765a2c39e118b71ca..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/host/README +++ /dev/null @@ -1,12 +0,0 @@ -This basic example illustrates how the JMX agent, introduced in the Fractal JMX tutorial, -enables JMX management of itself as a stand-alone Fractal application. - -The composite-template "org.objectweb.fractal.jmx.AgentHost" is provided in the -Fractal JMX distribution. -It is composed of three sub-components: an agent, a listener and an HTML adaptor. -To connect a browser to the JMX agent (when "org.objectweb.fractal.jmx.AgentHost" -is instanciated), open this page in a web browser: - - http://localhost:8082/ - - \ No newline at end of file diff --git a/fractaljmx/examples/host/build.xml b/fractaljmx/examples/host/build.xml deleted file mode 100644 index 68edbb48f1d33628645224f59278b94a3ecb2b64..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/host/build.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaljmx/examples/host/etc/execute.properties b/fractaljmx/examples/host/etc/execute.properties deleted file mode 100644 index 5d9de470cf39cbbe9f210502a42bd706174c4167..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/host/etc/execute.properties +++ /dev/null @@ -1,16 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -run.jvm.parameters \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -# Java class to be launched - -run.classname org.objectweb.fractal.adl.Launcher - -# Application arguments - -run.parameters -fractal org.objectweb.fractal.jmx.AgentHost diff --git a/fractaljmx/examples/host/etc/julia.cfg b/fractaljmx/examples/host/etc/julia.cfg deleted file mode 100644 index ab60231d18a09ff16eeee9dd06982a123469df8f..0000000000000000000000000000000000000000 --- a/fractaljmx/examples/host/etc/julia.cfg +++ /dev/null @@ -1,613 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - diff --git a/fractaljmx/externals/README.txt b/fractaljmx/externals/README.txt deleted file mode 100644 index 336e5a5f98d9fbe884814c08329ea286ea55a00a..0000000000000000000000000000000000000000 --- a/fractaljmx/externals/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the external libraries required for running the product. diff --git a/fractaljmx/externals/asm.jar b/fractaljmx/externals/asm.jar deleted file mode 100644 index 41e00315ffb0dbd0a386c5a7d39f3bea178804ee..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/asm.jar and /dev/null differ diff --git a/fractaljmx/externals/dtdparser.jar b/fractaljmx/externals/dtdparser.jar deleted file mode 100644 index ddb33dc33e512b1394953e10a83d1fdad438dffc..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/dtdparser.jar and /dev/null differ diff --git a/fractaljmx/externals/fractal-adl.jar b/fractaljmx/externals/fractal-adl.jar deleted file mode 100644 index 2df7d57c362e43a33cecfce8a011cbd2f4575293..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/fractal-adl.jar and /dev/null differ diff --git a/fractaljmx/externals/fractal.jar b/fractaljmx/externals/fractal.jar deleted file mode 100644 index 6bf74c05aaf416490008ba43dce643df09adbbd5..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/fractal.jar and /dev/null differ diff --git a/fractaljmx/externals/jmxri.jar b/fractaljmx/externals/jmxri.jar deleted file mode 100644 index 71428a6e1ce8bad1d4fb63fd691b4e707ba75cf6..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/jmxri.jar and /dev/null differ diff --git a/fractaljmx/externals/jmxtools.jar b/fractaljmx/externals/jmxtools.jar deleted file mode 100644 index 2e93c3b9d65a02a0aee3c52569cb376e1dbd87fa..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/jmxtools.jar and /dev/null differ diff --git a/fractaljmx/externals/julia-asm.jar b/fractaljmx/externals/julia-asm.jar deleted file mode 100644 index 6a8a7de3de4e80f6315aae586593b3bd0bc57b72..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/julia-asm.jar and /dev/null differ diff --git a/fractaljmx/externals/julia-mixins.jar b/fractaljmx/externals/julia-mixins.jar deleted file mode 100644 index 44af2f6006db94f97907c525be68dd9433cb6e1e..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/julia-mixins.jar and /dev/null differ diff --git a/fractaljmx/externals/julia-runtime.jar b/fractaljmx/externals/julia-runtime.jar deleted file mode 100644 index b416b02e98d6e6c2433916f0be1c025a9bb1ac2b..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/julia-runtime.jar and /dev/null differ diff --git a/fractaljmx/externals/ow_deployment_scheduling.jar b/fractaljmx/externals/ow_deployment_scheduling.jar deleted file mode 100644 index 0f20b080a8d0979254b548c52dd40437060386ea..0000000000000000000000000000000000000000 Binary files a/fractaljmx/externals/ow_deployment_scheduling.jar and /dev/null differ diff --git a/fractaljmx/jdoc/README.txt b/fractaljmx/jdoc/README.txt deleted file mode 100644 index a78cb67fa8d1679fe5fd3fe8efc3aab86e5b6db8..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/README.txt +++ /dev/null @@ -1,39 +0,0 @@ -This directory contains ant files to build the javadocs of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one javadoc. - -- As there may exist several javadocs, all javadocs must be produced - in a sub dir of ${out.dist.jdoc}. For example the user javadoc could be - produced into the ${out.dist.jdoc}/user directory - -- The name of the ant file must be the name of the destination directory of the - javadoc it builds. - -- Only the default task is called on an xml file. - -Sample ant file: - - - - - - - - - - - - - - - - - - ... - - - - diff --git a/fractaljmx/jdoc/asm-list/package-list b/fractaljmx/jdoc/asm-list/package-list deleted file mode 100644 index bb747831f391377a36ec383802760eee02fb9741..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/asm-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.asm diff --git a/fractaljmx/jdoc/fractal-jmx.xml b/fractaljmx/jdoc/fractal-jmx.xml deleted file mode 100644 index b3244051170401d87db6764ca0cc77eabc28824a..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/fractal-jmx.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractaljmx/jdoc/fractal-list/package-list b/fractaljmx/jdoc/fractal-list/package-list deleted file mode 100644 index 0c7ce27ea081eefb65b09e2cd0f5866cd084660f..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/fractal-list/package-list +++ /dev/null @@ -1,4 +0,0 @@ -org.objectweb.fractal.api -org.objectweb.fractal.api.control -org.objectweb.fractal.api.factory -org.objectweb.fractal.api.type diff --git a/fractaljmx/jdoc/j2ee-list/package-list b/fractaljmx/jdoc/j2ee-list/package-list deleted file mode 100644 index 5494b3eb262ba79714501f86b3f160676dee9a02..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/j2ee-list/package-list +++ /dev/null @@ -1,7 +0,0 @@ -javax.management -javax.management.loading -javax.management.modelmbean -javax.management.monitor -javax.management.openmbean -javax.management.relation -javax.management.timer \ No newline at end of file diff --git a/fractaljmx/jdoc/jdk-list/package-list b/fractaljmx/jdoc/jdk-list/package-list deleted file mode 100644 index 7f582f053dd0c03fe4df1013b086217010da00f1..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/jdk-list/package-list +++ /dev/null @@ -1,76 +0,0 @@ -java.applet -java.awt -java.awt.color -java.awt.datatransfer -java.awt.dnd -java.awt.event -java.awt.font -java.awt.geom -java.awt.im -java.awt.im.spi -java.awt.image -java.awt.image.renderable -java.awt.print -java.beans -java.beans.beancontext -java.io -java.lang -java.lang.ref -java.lang.reflect -java.math -java.net -java.rmi -java.rmi.activation -java.rmi.dgc -java.rmi.registry -java.rmi.server -java.security -java.security.acl -java.security.cert -java.security.interfaces -java.security.spec -java.sql -java.text -java.util -java.util.jar -java.util.zip -javax.accessibility -javax.naming -javax.naming.directory -javax.naming.event -javax.naming.ldap -javax.naming.spi -javax.rmi -javax.rmi.CORBA -javax.sound.midi -javax.sound.midi.spi -javax.sound.sampled -javax.sound.sampled.spi -javax.swing -javax.swing.border -javax.swing.colorchooser -javax.swing.event -javax.swing.filechooser -javax.swing.plaf -javax.swing.plaf.basic -javax.swing.plaf.metal -javax.swing.plaf.multi -javax.swing.table -javax.swing.text -javax.swing.text.html -javax.swing.text.html.parser -javax.swing.text.rtf -javax.swing.tree -javax.swing.undo -javax.transaction -org.omg.CORBA -org.omg.CORBA_2_3 -org.omg.CORBA_2_3.portable -org.omg.CORBA.DynAnyPackage -org.omg.CORBA.ORBPackage -org.omg.CORBA.portable -org.omg.CORBA.TypeCodePackage -org.omg.CosNaming -org.omg.CosNaming.NamingContextPackage -org.omg.SendingContext -org.omg.stub.java.rmi diff --git a/fractaljmx/jdoc/julia-list/package-list b/fractaljmx/jdoc/julia-list/package-list deleted file mode 100644 index c013278131393ba6328b2d4c00e76574719c0081..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/julia-list/package-list +++ /dev/null @@ -1,3 +0,0 @@ -org.objectweb.fractal.julia -org.objectweb.fractal.julia.asm -org.objectweb.fractal.julia.loader diff --git a/fractaljmx/jdoc/monolog-list/package-list b/fractaljmx/jdoc/monolog-list/package-list deleted file mode 100644 index 1ed8775b725c050c235db5e1b94388c144232567..0000000000000000000000000000000000000000 --- a/fractaljmx/jdoc/monolog-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.util.monolog.api diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/AdaptorType.fractal b/fractaljmx/src/org/objectweb/fractal/jmx/AdaptorType.fractal deleted file mode 100644 index 9de2e0e7d0199d5368dd558407e57d1ae8c4d1b7..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/AdaptorType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/AgentHost.fractal b/fractaljmx/src/org/objectweb/fractal/jmx/AgentHost.fractal deleted file mode 100644 index a4cd19fe7aa345dc6dca371bfc52f0a45a38450a..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/AgentHost.fractal +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/AgentType.fractal b/fractaljmx/src/org/objectweb/fractal/jmx/AgentType.fractal deleted file mode 100644 index 948f48acffad74231effc8fdeb92673bfdf93f7b..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/AgentType.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/BasicAgent.fractal b/fractaljmx/src/org/objectweb/fractal/jmx/BasicAgent.fractal deleted file mode 100644 index b5b43208fbf85ba9d9b51e1d408b139d6d80b13e..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/BasicAgent.fractal +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/BasicListener.fractal b/fractaljmx/src/org/objectweb/fractal/jmx/BasicListener.fractal deleted file mode 100644 index 37064ec215b1a29baa2b18c2c6c64cc414652817..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/BasicListener.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/ListenerType.fractal b/fractaljmx/src/org/objectweb/fractal/jmx/ListenerType.fractal deleted file mode 100644 index 830898180e21fcdb3b5718fe04cc97cf49ed4833..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/ListenerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/RI_HtmlAdaptor.fractal b/fractaljmx/src/org/objectweb/fractal/jmx/RI_HtmlAdaptor.fractal deleted file mode 100644 index d462b7b259dacbf79bf6bf84db3a8093e8cccaf7..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/RI_HtmlAdaptor.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/Admin.java b/fractaljmx/src/org/objectweb/fractal/jmx/agent/Admin.java deleted file mode 100644 index 909dfd86640970e6fba000f10e760813fcc78d16..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/Admin.java +++ /dev/null @@ -1,126 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ - -package org.objectweb.fractal.jmx.agent; - -import javax.management.JMException; - -/** - * A simple interface for MBean manipulation on the Fractal JMX agent side. - * This interface allows an agent component implementing this interface to register MBeans in its scope, where: - *
    - *
  • the scope of the agent represents its super-components and all sub-components recursively enclosed in its - * super-components (or in itself if the agent has no super-components). - *
  • the MBeans represent component server interfaces or standard JMX - * {@link javax.management.monitor.MonitorMBean monitors} for observing component attributes. - *
- * - *

For example, in the architecture depicted below, where an agent is added to the composite B: - *

- *

- *

- *
    - *
  • The component B, C, D and Agent (itself) are in the agent scope and then candidate - * to expose MBeans representing their server interfaces or observer on their attributes. - *
  • The component A is not in the agent scope, and then cannot be managed, since - * it is not a super-component of the agent. - *
- *
- * - *

Naming convention: - * In JMX, an {@link javax.management.ObjectName ObjectName} represents a reference - * to an MBean in the agent. - * It is unique within an {@link javax.management.MBeanServer MBeanServer} and consists - * of two parts: the domain name and an unordered list of propert-value pairs. - * The string representation of an object name must follow the following syntax: - *

- *    [DomainName]:property=value,[,property=value]*
- * 
- * - * In Fractal JMX, the object name of an MBean representing a component server interface uses this syntax as follows: - *

- *    FC/[path]component@id[shared]:itf=interface
- * 
- * where: - *
    - *
  • component: is the name of the component, as returned by {@link org.objectweb.fractal.api.control.NameController NameController}. - *
  • interface: is the name of a server interface of the component, - * as returned by {@link org.objectweb.fractal.api.type.InterfaceType InterfaceType}. - *
  • path: is a (slash separated) name sequence of the successive super-components of the component, - * in the reverse order. - *
  • shared: is an optional field set to "-shared" if the component may be identified by several paths - * (i.e. if the component or some component, in its super-component hierarchy, is shared). - *
  • id: is an inelegant, but unique, component identifier introduced to avoid JMX name clashes, - * since nothing prevents the same Fractal name sequence to identify several components. - *
- * - * For example, in the figure above, the MBean representing the interface I of the component D - * is identified by: - * - *

- *    FC/A/B/C/D@56e32:itf=I
- * 
- * - * where @56e32 is the unique identifier of component D. - * This identifier is generated by the agent and can be ignored. - * - *

This naming convention: - *

    - *
  • requires components to have a {@link org.objectweb.fractal.api.control.NameController NameController} - * and to avoid (in component or interface names) characters interpreted in specific ways by - * {@link javax.management.ObjectName ObjectName} (e.g. ":", "*", "&"...). - *
  • is used by the - * {@link AdminAttributes agent attributes} - * to filter the relevant MBeans. - * Only the MBeans, whose - * {@link javax.management.ObjectName ObjectName} - * matches a pattern defined by these attributes, are registered in the agent. - * These MBeans represent either component server interfaces or monitors for observing component attributes. - * In the latter case, the naming convention used by the agent attributes considers some additional property-value pairs - * reserved for the configuration of JMX monitors. - *
- * - * @version 0.1 - */ -public interface Admin { - - /** - * Registers MBeans in the agent. - * This method allows the agent component (implementing this interface) to register MBeans in its scope, - * where: - *
    - *
  • the scope of the agent represents its super-components and all sub-components recursively enclosed in its - * super-components (or in itself if the agent has no super-components). - *
  • the MBeans represent component (server) interfaces or standard JMX - * {@link javax.management.monitor.MonitorMBean monitors} for observing component attributes. - *
- * - *

This method: - *

    - *
  • first unregisters (previously registered) MBeans in the agent.
  • - *
  • then registers MBeans in the scope that match the {@link AdminAttributes filter attributes} of the agent. - *
- * - * @throws JMException if a problem occurs during the MBean registration. - */ - void expose() throws JMException; - -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/AdminAttributes.java b/fractaljmx/src/org/objectweb/fractal/jmx/agent/AdminAttributes.java deleted file mode 100644 index 3d1de82613d63e4de722804d0ba852a60f2b0557..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/AdminAttributes.java +++ /dev/null @@ -1,260 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2001-2002 France Telecom, INRIA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.agent; - -import org.objectweb.fractal.api.control.AttributeController; -import javax.management.MBeanServer; - -/** - * Attribute controller of the agent component. - * This interface provides attributes for filtering MBeans in the scope of the agent. - * Only the MBeans, whose {@link javax.management.ObjectName ObjectName} matches a pattern defined by these attributes, - * are registered in the agent. - * - *

Available filters: - *

    - *
  • ItfPatterns: for filtering component interface MBeans. - *
  • MonitorStringPatterns: for filtering - * {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans. - *
  • MonitorCounterPatterns: for filtering - * {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans. - *
  • MonitorGaugePatterns: for filtering - * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans. - *
- * - * The syntax of these filters relies on the naming convention defined in {@link Admin} - * for component interfaces, - * except for some additional property-value pairs reserved for the configuration of JMX monitors. - * - * - * @version 0.1 - */ -public interface AdminAttributes extends AttributeController { - /*int getDepth (); - void setDepth (int depth);*/ - - /** - * Returns the patterns for filtering components interface MBeans. - * - * @return the patterns for filtering components interface MBeans. - * - * @see #setItfPatterns - */ - String getItfPatterns(); - - /** - * Sets the patterns for filtering components interface MBeans. - * Any component interface, whose {@link javax.management.ObjectName ObjectName} matches one of these patterns, - * can be registered in the agent. - * - *

The syntax of this filter is defined to equal a sequence of (";" separated) string representations of - * {@link javax.management.ObjectName ObjectName} patterns. - * For example: - *

-	 *    *:itf=attribute-controller,*;*/Foo/*:*
-	 * 
- * represents two patterns that can match respectively: - *
    - *
  • the attribute controller interface of any component.
  • - *
  • any server interface of any component, if a super-component (in the content hierarchy) - * of this component is named "Foo".
  • - *
- * - * @param str the patterns for filtering components interface MBeans. - */ - void setItfPatterns(String str); - - /** - * Returns the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans. - * - * @return the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans. - * - * @see #setMonitorStringPatterns - */ - String getMonitorStringPatterns(); - - /** - * Sets the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans. - * Any getter of type string, specified in a component interface whose - * {@link javax.management.ObjectName ObjectName} matches one of these patterns, - * can be observed by a {@link javax.management.monitor.StringMonitorMBean string monitor}. - * - *

The syntax of this filter is defined to equal a sequence of (";" separated) string representations of - * {@link javax.management.ObjectName ObjectName} patterns. Where the following properties are - * reserved for the configuration of a {@link javax.management.monitor.StringMonitorMBean string monitor} - * (as defined in the JMX specification): - *

    - *
  • observedAttribute: the attribute being observed.
  • - *
  • granularityPeriod: the granularity period (in milliseconds).
  • - *
  • stringToCompare: the string to compare with the observed attribute.
  • - *
  • notifyDiffer: the differing notification's on/off switch value.
  • - *
  • notifyMatch: the matching notification's on/off switch value.
  • - *
- * - *

For example: - *

-	 *    *:itf=attribute-controller,observedAttribute=Foo,granularityPeriod=5000,
-	 *      stringToCompare=fooval,notifyDiffer=true,notifyMatch=true,*
-	 * 
- * represents a pattern that can match the attribute controller interface of any component, - * if this interface specifies a string attribute "Foo". - * This attribute will be monitored every 5000 ms and compared with the value "fooval". - * As defined in the JMX specification: - *

    - *
  • A {@link javax.management.monitor.MonitorNotification#STRING_TO_COMPARE_VALUE_MATCHED match notification} - * is sent when the value of the attribute "Foo" first matches the value "fooval". - * Subsequent matchings of "fooval" do not cause further notifications unless the attribute value - * differs from "fooval".
  • - *
  • A {@link javax.management.monitor.MonitorNotification#STRING_TO_COMPARE_VALUE_DIFFERED differ notification} - * is sent when the value of the attribute "Foo" first differs from the value "fooval". - * Subsequent differences from "fooval" do not cause further notifications unless the attribute value - * matches "fooval".
  • - *
- * - * - * @param str the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans. - */ - void setMonitorStringPatterns(String str); - - /** - * Returns the patterns for filtering {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans. - * - * @return the patterns for filtering {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans. - * - * @see #setMonitorCounterPatterns - */ - String getMonitorCounterPatterns(); - - /** - * Sets the patterns for filtering {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans. - * Any getter of type integer (Byte, Integer, Short, Long), - * specified in a component interface whose - * {@link javax.management.ObjectName ObjectName} matches one of these patterns, - * can be observed by a {@link javax.management.monitor.CounterMonitorMBean counter monitor}. - * - *

The syntax of this filter is defined to equal a sequence of (";" separated) string representations of - * {@link javax.management.ObjectName ObjectName} patterns. Where the following properties are - * reserved for the configuration of a {@link javax.management.monitor.CounterMonitorMBean counter monitor} - * (as defined in the JMX specification): - *

    - *
  • observedAttribute: the attribute being observed.
  • - *
  • granularityPeriod: the granularity period (in milliseconds).
  • - *
  • initThreshold: the initial threshold value.
  • - *
  • modulus: the modulus value.
  • - *
  • offset: the offset value.
  • - *
  • differenceMode: the difference mode flag value.
  • - *
- * - *

For example: - *

-	 *    *:itf=stat-controller,observedAttribute=NumberOfMethodCall,granularityPeriod=5000,
-	 *      initThreshold=2,modulus=0,offset=10,differenceMode=false,*
-	 * 
- * represents a pattern that can match the interface "stat-controller" of any component, - * if this interface specifies an integer attribute named "NumberOfMethodCall". - * This attribute will be monitored every 5000 ms. - * {@link javax.management.monitor.MonitorNotification#THRESHOLD_VALUE_EXCEEDED Threshold notifications} - * are sent, as defined in the JMX specification for a - * {@link javax.management.monitor.CounterMonitorMBean counter monitor} configured with: - * InitThreshold=2, Modulus=0, Offset=10 and DifferenceMode=false - * (by default Notify=true). - * - * @param str the patterns for filtering - * {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans. - */ - void setMonitorCounterPatterns(String str); - - /** - * Returns the patterns for filtering - * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans. - * - * @return the patterns for filtering - * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans. - * - * @see #setMonitorGaugePatterns - */ - String getMonitorGaugePatterns(); - - /** - * Sets the patterns for filtering - * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans. - * Any getter of type integer or floating-point (Byte, Integer, Short, - * Long, Float, Double), specified in a component interface whose - * {@link javax.management.ObjectName ObjectName} matches one of these patterns, - * can be observed by a {@link javax.management.monitor.GaugeMonitorMBean gauge monitor}. - * - *

The syntax of this filter is defined to equal a sequence of (";" separated) string representations of - * {@link javax.management.ObjectName ObjectName} patterns. Where the following properties are - * reserved for the configuration of a {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} - * (as defined in the JMX specification): - *

    - *
  • observedAttribute: the attribute being observed.
  • - *
  • granularityPeriod: the granularity period (in milliseconds).
  • - *
  • lowThreshold: the low threshold value.
  • - *
  • highThreshold: the low threshold value.
  • - *
  • differenceMode: the difference mode flag value.
  • - *
- * - *

For example: - *

-	 *    *:itf=stat-controller,observedAttribute=RateOfMethodCall,granularityPeriod=5000,
-	 *      lowThreshold=0.05,highThreshold=0.15,differenceMode=false,*
-	 * 
- * represents a pattern that can match the interface "stat-controller" of any component, - * if this interface specifies an integer or floating-point attribute named "RateOfMethodCall". - * This attribute will be monitored every 5000 ms. - * {@link javax.management.monitor.MonitorNotification#THRESHOLD_HIGH_VALUE_EXCEEDED Threshold high notifications} - * and - * {@link javax.management.monitor.MonitorNotification#THRESHOLD_LOW_VALUE_EXCEEDED Threshold low notifications} - * are sent, as defined in the JMX specification for a - * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} configured with: - * LowThreshold=0.05, HighThreshold=0.15 and DifferenceMode=false - * (by default NotifyHigh=true and NotifyLow=true). - * - * - * - * @param str the patterns for filtering - * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans. - */ - void setMonitorGaugePatterns(String str); - - /** - * Returns the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent. - * - * This method allows raw MBean manipulation on the Fractal JMX agent side. - * - * @return the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent. - */ - MBeanServer getRawMBeanServer(); - - /** - * Sets the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent. - * - *

This method is unsupported, but specified since the Fractal - * {@link org.objectweb.fractal.api.control.AttributeController attribute controller} - * API requires getter and setter methods for each attribute. - * - * @param srv the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent. - * - * @throws NoSuchInterfaceException. - */ - void setRawMBeanServer(MBeanServer srv) throws UnsupportedOperationException; -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/Agent.java b/fractaljmx/src/org/objectweb/fractal/jmx/agent/Agent.java deleted file mode 100644 index 7c0a251a4df9e58e1210e54f40b5f4a92f8bdb50..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/Agent.java +++ /dev/null @@ -1,383 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.agent; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.util.Fractal; - -import javax.management.ObjectName; -import javax.management.MBeanServer; -import javax.management.MBeanServerFactory; -import javax.management.NotificationListener; -import javax.management.NotificationFilter; -import javax.management.Notification; -import javax.management.JMException; -import javax.management.AttributeNotFoundException; -import javax.management.JMRuntimeException; -import javax.management.modelmbean.ModelMBean; -import javax.management.modelmbean.InvalidTargetObjectTypeException; -import javax.management.monitor.MonitorNotification; -import java.util.*; - -/** - * A component representing the JMX agent level. - * This component encapsulates a JMX {@link javax.management.MBeanServer MBeanServer} and - * allows MBean manipulation by implementing the {@link Admin} interface for registering MBeans, - * and the {@link AdminAttributes} interface for filtering MBeans. - * Where the MBeans represent component server interfaces or JMX - * {@link javax.management.monitor.MonitorMBean monitors} for observing component attributes. - * - *

The binding controller part of this component sets the [required] listener component - * that handles JMX notifications sent out by the {@link javax.management.monitor.MonitorMBean monitors}. - * The life-cycle controller part bootstraps this component by registering two MBeans representing - * its {@link Admin} and {@link AdminAttributes} interfaces. - * These two interfaces are identified respectively in the agent by the {@link ObjectName}: - *

- *    Agent:itf=admin
- *    Agent:itf=attribute-controller
- * 
- * - *

The naming convention used for the MBeans representing component server interfaces is defined in {@link Admin}. - * The {@link javax.management.monitor.MonitorMBean monitors} are identified by the {@link ObjectName}: - *

- *    AgentService:type=monitorType,monitor=index[,attributeType=attType]
- * 
- * where: - *
    - *
  • monitorType: is the type of the JMX monitor (counter, gauge or string). - *
  • index: represents the position at which the monitor is specified, for a given filter of the - * {@link AdminAttributes} interface. - *
  • attType: is the type of the attribute being observed (for counter and gauge - * monitors only, since they handle several integer or floating-point attribute types). - *
- * - * @version 0.1 - */ -public class Agent implements BindingController, LifeCycleController, AdminAttributes, Admin { - private MBeanServer _server = MBeanServerFactory.newMBeanServer("Fractal"); - private int _depth = -1; - private String _itfPatterns = "*:*"; - private String _stringMonitors = ""; - private String _counterMonitors = ""; - private String _gaugeMonitors = ""; - private Component _myId = null; - private NotificationListener _listener = null; - private AgentContext _ctx = new AgentContext(); - - // ------------------------------------------------------------------------- - // implements Binding controller - // ------------------------------------------------------------------------- - public String[] listFc() { - return new String[] { "listener" }; - } - - public Object lookupFc(final String itfName) { - if (itfName.equals("listener")) { - return _listener; - } else - return null; - } - - public void bindFc(final String itfName, final Object itfValue) { - if (itfName.equals("component")) { - _myId = (Component) itfValue; - } else if (itfName.equals("listener")) { - _listener = (NotificationListener) itfValue; - } - } - - public void unbindFc(final String itfName) { - if (itfName.equals("listener")) { - _listener = null; - } - } - - // ------------------------------------------------------------------------- - // implements LifeCycle controller - // ------------------------------------------------------------------------- - public String getFcState() { - return null; - } - - public void startFc() { - try { - ObjectName oName = new ObjectName(CONST.ADMIN + ":itf=admin"); - exposeFcItf(_myId, oName, "admin"); - oName = new ObjectName(CONST.ADMIN + ":itf=attribute-controller"); - exposeFcItf(_myId, oName, "attribute-controller"); - } catch (JMException e) { - throw new JMRuntimeException(e.toString()); - } - } - - public void stopFc() {} - - // ------------------------------------------------------------------------- - // implements Attribute controller - // ------------------------------------------------------------------------- - /*public int getDepth() { - return _depth; - } - - public void setDepth(final int depth) { - this._depth = depth; - }*/ - - public String getItfPatterns() { - return _itfPatterns; - } - - public void setItfPatterns(final String str) { - this._itfPatterns = (str == null) ? "" : str; - } - - public String getMonitorStringPatterns() { - return _stringMonitors; - } - - public void setMonitorStringPatterns(final String str) { - this._stringMonitors = (str == null) ? "" : str; - } - - public String getMonitorCounterPatterns() { - return _counterMonitors; - } - - public void setMonitorCounterPatterns(final String counters) { - this._counterMonitors = (counters == null) ? "" : counters; - } - - public String getMonitorGaugePatterns() { - return _gaugeMonitors; - } - - public void setMonitorGaugePatterns(final String gauges) { - this._gaugeMonitors = (gauges == null) ? "" : gauges; - } - - public MBeanServer getRawMBeanServer() { - return _server; - } - - public void setRawMBeanServer(final MBeanServer srv) { - throw new UnsupportedOperationException(); - } - - // ------------------------------------------------------------------------- - // implements Admin - // ------------------------------------------------------------------------- - /*public MBeanServer rawAdmin() { - return server; - }*/ - - public void expose() throws JMException { - try { - // clean - unregisterMBean(CONST.FC + "*:*"); - unregisterMBean(CONST.MONITOR + "*:*"); - // reset agent context - _ctx.reset(_itfPatterns, _stringMonitors, _counterMonitors, _gaugeMonitors); - // expose components - Component ids[] = (Component[]) exposeSuper(_myId, new HashSet()).toArray(new Component[0]); - exposeSub(ids, 0); - // starts monitors - startMonitors(_ctx.getMonitors()); - } catch (RuntimeException e) { - //e.printStackTrace(); - throw new JMException(e.toString()); - } - } - - // ------------------------------------------------------------------------- - // expose methods - // ------------------------------------------------------------------------- - private Set exposeSuper(Component id, Set set) { - try { - SuperController supCtrl = Fractal.getSuperController(id); - Component ids[] = supCtrl.getFcSuperComponents(); - if (ids.length == 0){ - set.add(id); - } - else for (int j = 0; j < ids.length; j++) { - try{ - ids[j].getFcInterface("admin"); - exposeSuper(ids[j], set); - } catch (NoSuchInterfaceException e) { set.add(ids[j]);} - } - } catch (NoSuchInterfaceException e) { set.add(id);} - return set; - } - - private void exposeSub(Component ids[], int crtDepth) throws JMException { - if (_depth >= 0 && crtDepth > _depth) - return; - for (int i = 0; i < ids.length; i++) { - // register subcomponents - try { - ContentController cCtrl = Fractal.getContentController(ids[i]); - exposeSub(cCtrl.getFcSubComponents(), crtDepth + 1); - } catch (NoSuchInterfaceException ignored) {} - // register component infos - String[] names = getFullFCName(ids[i]); - for (int j = 0; j < names.length; j++) { - exposeFCinfos(ids[i], "/" + names[j] + '@' + Integer.toHexString(ids[i].hashCode())); - } - } - } - - private void exposeFCinfos(Component id, String name) throws JMException { - InterfaceType[] itfts = ((ComponentType) id.getFcType()).getFcInterfaceTypes(); - String domain = CONST.FC + name + (isShared(id) ? "-shared" : ""); - for (int j = 0; j < itfts.length; j++) { - ObjectName oName = new ObjectName(domain + ":itf=" + itfts[j].getFcItfName()); - if (!itfts[j].isFcClientItf() && (_ctx.matchItfPatterns(oName) || _ctx.matchMonitorPatterns(oName))) { - exposeFcItf(id, oName, itfts[j].getFcItfName()); - boolean ret = setObservers(oName, _ctx.getMonitors()); - if (!(_ctx.matchItfPatterns(oName) || ret)) - _server.unregisterMBean(oName); - } - } - } - - private boolean exposeFcItf(Component cid, ObjectName oname, String itfName) throws JMException { - boolean ret = false; - try { - if (_server.isRegistered(oname)) - return true; - // itf signature - InterfaceType itfType = ((ComponentType) cid.getFcType()).getFcInterfaceType(itfName); - String signature = itfType.getFcItfSignature(); - // introspect & register - ModelMBean rmBean = Introspector.createMBean(cid.getFcInterface(itfName), Class.forName(signature)); - _server.registerMBean(rmBean, oname); - ret = true; - } catch (NoSuchInterfaceException ignored) {} catch (InvalidTargetObjectTypeException e) { - throw new IllegalStateException(e.toString()); - } catch (ClassNotFoundException e) { - throw new IllegalStateException(e.toString()); - } - return ret; - } - - private boolean setObservers(ObjectName oName, AgentMonitorMBean[] monitors) throws JMException { - boolean ret = false; - for (int i = 0; i < monitors.length; i++) { - try { - Class c = _server.getAttribute(oName, monitors[i].getObservedAttribute()).getClass(); - if (monitors[i].getPattern().apply(oName) && c.equals(monitors[i].getAttributeType())) { - monitors[i].addObservedObject(oName); - ret = true; - } - } catch (AttributeNotFoundException ignored) {} - } - return ret; - } - - private void startMonitors(AgentMonitorMBean[] monitors) throws JMException { - if (_listener == null) - return; - for (int i = 0; i < monitors.length; i++) { - ObjectName[] oNames = monitors[i].getObservedObjects(); - if (oNames.length == 0) - continue; - ObjectName monitorName = _server.registerMBean(monitors[i], null).getObjectName(); - for (int j = 0; j < oNames.length; j++) - _server.addNotificationListener(monitorName, _listener, new Filter(oNames[j]), oNames[j]); - monitors[i].start(); - } - } - - class Filter implements NotificationFilter { - ObjectName observedObject; - Filter(ObjectName observedObject) { - this.observedObject = observedObject; - } - - public boolean isNotificationEnabled(Notification n) { - MonitorNotification notif = (MonitorNotification) n; - if (observedObject.equals(notif.getObservedObject())) - return true; - return false; - } - } - - // ------------------------------------------------------------------------- - // JMX utils - // ------------------------------------------------------------------------- - private void unregisterMBean(String pattern) throws JMException { - ObjectName o = new ObjectName(pattern); - Set s = _server.queryNames(o, null); - for (Iterator i = s.iterator(); i.hasNext();) - _server.unregisterMBean((ObjectName) i.next()); - } - - // ------------------------------------------------------------------------- - // Fractal utils - // ------------------------------------------------------------------------- - private boolean isShared(Component id) { - boolean shared = false; - try { - Component ids[] = Fractal.getSuperController(id).getFcSuperComponents(); - if (ids.length > 1) - shared = true; - else if (ids.length > 1) - shared = isShared(ids[0]); - } catch (NoSuchInterfaceException ignored) {} - return shared; - } - - private String[] getFullFCName(Component id) { - String[] names = null; - try { - Component ids[] = Fractal.getSuperController(id).getFcSuperComponents(); - List l = new ArrayList(); - for (int i = 0; i < ids.length; i++) { - String[] tmp = getFullFCName(ids[i]); - for (int j = 0; j < tmp.length; j++) - tmp[j] += "/" + getFCName(id); - l.addAll(Arrays.asList(tmp)); - } - names = (String[]) l.toArray(new String[l.size()]); - } catch (NoSuchInterfaceException ignored) {} - if (names == null || names.length == 0) { - names = new String[1]; - names[0] = getFCName(id); - } - return names; - } - - private String getFCName(Component id) { - try { - NameController nc = Fractal.getNameController(id); - return nc.getFcName(); - } catch (NoSuchInterfaceException e) { - throw new IllegalStateException("NameController required"); - } - } -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/AgentContext.java b/fractaljmx/src/org/objectweb/fractal/jmx/agent/AgentContext.java deleted file mode 100644 index e3a83c525220c29e179998d8fbaade5e910d38ba..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/AgentContext.java +++ /dev/null @@ -1,429 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.agent; - -// JMX -import javax.management.ObjectName; -import javax.management.MBeanServer; -import javax.management.JMException; -import javax.management.MalformedObjectNameException; -import javax.management.monitor.MonitorMBean; -import javax.management.monitor.StringMonitor; -import javax.management.monitor.CounterMonitor; -import javax.management.monitor.GaugeMonitor; - -import java.util.*; - -/** - * The context of the agent component (handles patterns and monitors). - * - * @version 0.1 - */ -public class AgentContext { - private ObjectName[] _itfPatterns = new ObjectName[0]; - private ObjectName[] _monitorPatterns = new ObjectName[0]; - private AgentMonitorMBean[] _monitors = new AgentMonitorMBean[0]; - - // ------------------------------------------------------------------------- - // public - // ------------------------------------------------------------------------- - /** - * returns the current {@link AgentMonitorMBean monitors}. - * - * @return the current {@link AgentMonitorMBean monitors}. - */ - public AgentMonitorMBean[] getMonitors() { - return _monitors; - } - - /** - * Checks if an {@link ObjectName} matches the current patterns for filtering component interface MBeans. - * - * @param oName the {@link ObjectName} to check. - * @return true if it matches, false otherwhise. - */ - public boolean matchItfPatterns(ObjectName oName) { - if (matchPatterns(_itfPatterns, oName)) - return true; - return false; - } - - /** - * Checks if an {@link ObjectName} matches the current patterns for filtering monitor MBeans. - * - * @param oName the {@link ObjectName} to check. - * @return true if it matches, false otherwhise. - */ - public boolean matchMonitorPatterns(ObjectName oName) { - if (matchPatterns(_monitorPatterns, oName)) - return true; - return false; - } - - /** - * Resets this {@link Agent agent} context. - * - *

This method translates the {@link org.objectweb.fractal.jmx.agent.AdminAttributes agent attributes}, - * in their corresponding {@link ObjectName} patterns and {@link AgentMonitorMBean monitors}. - * - * @param fc the agent attribute for filtering component interface MBeans. - * @param str the agent attribute for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans. - * @param counter the agent attribute for filtering {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans. - * @param gauge the agent attribute for filtering {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans. - * - * @throws JMException if a problem occurs during the translation. - */ - public void reset(String fc, String str, String counter, String gauge) throws JMException { - cleanMonitors(_monitors); - set(fc, str, counter, gauge); - } - - // ------------------------------------------------------------------------- - // reset - // ------------------------------------------------------------------------- - private void cleanMonitors(MonitorMBean[] monitors) { - for (int i = 0; i < monitors.length; i++) { - monitors[i].stop(); - ObjectName[] onames = monitors[i].getObservedObjects(); - for (int j = 0; j < onames.length; j++) { - monitors[i].removeObservedObject(onames[j]); - } - } - } - - private void set(String fc, String str, String counter, String gauge) throws JMException { - // creates monitors - AgentMonitorMBean[] stringMonitors = createStringMonitors(str); - AgentMonitorMBean[] counterMonitors = createCounterMonitors(counter); - AgentMonitorMBean[] gaugeMonitors = createGaugeMonitors(gauge); - // merge monitors - List l = new ArrayList(Arrays.asList(stringMonitors)); - l.addAll(Arrays.asList(counterMonitors)); - l.addAll(Arrays.asList(gaugeMonitors)); - _monitors = (AgentMonitorMBean[]) l.toArray(new AgentMonitorMBean[0]); - // creates patterns - _itfPatterns = createItfPatterns(fc); - l = new ArrayList(Arrays.asList(getMonitorPatterns(_monitors))); - _monitorPatterns = (ObjectName[]) l.toArray(new ObjectName[0]); - } - - // ------------------------------------------------------------------------- - // patterns - // ------------------------------------------------------------------------- - private ObjectName[] createItfPatterns(String str) throws MalformedObjectNameException { - String[] strTab = split(str, ";"); - ObjectName[] oNames = new ObjectName[strTab.length]; - for (int i = 0; i < strTab.length; i++) { - try { - oNames[i] = new ObjectName(strTab[i]); - } catch (MalformedObjectNameException e) { - throw new MalformedObjectNameException( - "pattern \"" + strTab[i] + "\" is an invalid string representation of JMX object name"); - } - } - return oNames; - } - - private boolean matchPatterns(ObjectName[] patterns, ObjectName oName) { - for (int i = 0; i < patterns.length; i++) { - if (patterns[i].apply(oName)) - return true; - } - return false; - } - - private ObjectName[] getMonitorPatterns(AgentMonitorMBean[] monitors) { - ObjectName[] oNames = new ObjectName[monitors.length]; - for (int i = 0; i < oNames.length; i++) - oNames[i] = monitors[i].getPattern(); - return oNames; - } - - // ------------------------------------------------------------------------- - // String monitor - // ------------------------------------------------------------------------- - private AgentMonitorMBean[] createStringMonitors(String str) throws MalformedObjectNameException { - String[] strTab = split(str, ";"); - //System.out.println("- " + Arrays.asList(strTab)); - MyStringMonitor[] gauges = new MyStringMonitor[strTab.length]; - for (int i = 0; i < strTab.length; i++) { - try { - ObjectName oName = new ObjectName(strTab[i]); - Hashtable h = oName.getKeyPropertyList(); - gauges[i] = new MyStringMonitor((i + 1)); - // set String monitor params - gauges[i].setObservedAttribute((String) remove(h, "observedAttribute")); - gauges[i].setGranularityPeriod(Long.parseLong((String) remove(h, "granularityPeriod"))); - gauges[i].setStringToCompare((String) remove(h, "stringToCompare")); - gauges[i].setNotifyDiffer(Boolean.valueOf((String) remove(h, "notifyDiffer")).booleanValue()); - gauges[i].setNotifyMatch(Boolean.valueOf((String) remove(h, "notifyMatch")).booleanValue()); - if (oName.isPropertyPattern()) - gauges[i].setPattern(new ObjectName(oName.getDomain() + ":" + asString(h) + ",*")); - else - gauges[i].setPattern(new ObjectName(oName.getDomain(), h)); - } catch (Exception e) { - throw new IllegalStateException( - "String monitor \"" + strTab[i] + "\" is invalid. " + e.toString() + ". " + CONST.STRING_SYNTAX); - } - } - return gauges; - } - - class MyStringMonitor extends StringMonitor implements AgentMonitorMBean { - private ObjectName _pattern; - private int _i; - - MyStringMonitor(int i) throws JMException { - this._pattern = new ObjectName("*:*"); - this._i = i; - } - - public ObjectName getPattern() { - return _pattern; - } - - public void setPattern(ObjectName pattern) { - _pattern = pattern; - } - public Class getAttributeType() { - return String.class; - } - - public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { - super.preRegister(server, name); - return new ObjectName(CONST.MONITOR + ":type=stringMonitor" + ",observer=" + _i); - } - } - - // ------------------------------------------------------------------------- - // Counter monitor - // ------------------------------------------------------------------------- - private AgentMonitorMBean[] createCounterMonitors(String str) throws MalformedObjectNameException { - String[] strTab = split(str, ";"); - MyCounterMonitor[] counters = new MyCounterMonitor[strTab.length * 4]; - for (int i = 0; i < strTab.length; i++) { - try { - ObjectName oName = new ObjectName(strTab[i]); - Hashtable h = oName.getKeyPropertyList(); - int j = i * 4; - counters[j] = new MyCounterMonitor((i + 1), Long.class); - // set Counter monitor params - counters[j].setObservedAttribute((String) remove(h, "observedAttribute")); - counters[j].setGranularityPeriod(Long.parseLong((String) remove(h, "granularityPeriod"))); - counters[j].setInitThreshold(Long.valueOf((String) remove(h, "initThreshold"))); - counters[j].setNotify(true); - counters[j].setModulus(Long.valueOf((String) remove(h, "modulus"))); - counters[j].setOffset(Long.valueOf((String) remove(h, "offset"))); - counters[j].setDifferenceMode(Boolean.valueOf((String) remove(h, "differenceMode")).booleanValue()); - if (oName.isPropertyPattern()) - counters[j].setPattern(new ObjectName(oName.getDomain() + ":" + asString(h) + ",*")); - else - counters[j].setPattern(new ObjectName(oName.getDomain(), h)); - counters[j + 1] = new MyCounterMonitor(counters[j], Integer.class); - counters[j + 2] = new MyCounterMonitor(counters[j], Short.class); - counters[j + 3] = new MyCounterMonitor(counters[j], Byte.class); - } catch (Exception e) { - throw new IllegalStateException( - "Counter monitor \"" + strTab[i] + "\" is invalid. " + e.toString() + ". " + CONST.COUNTER_SYNTAX); - } - } - return counters; - } - - class MyCounterMonitor extends CounterMonitor implements AgentMonitorMBean { - private ObjectName _pattern; - private int _i; - private Class _attType; - - MyCounterMonitor(int i, Class attType) throws JMException { - this._pattern = new ObjectName("*:*"); - this._i = i; - this._attType = attType; - } - - MyCounterMonitor(MyCounterMonitor g, Class attType) throws MalformedObjectNameException { - this._pattern = g.getPattern(); - this._i = g._i; - this._attType = attType; - setObservedAttribute(g.getObservedAttribute()); - setGranularityPeriod(g.getGranularityPeriod()); - setDifferenceMode(g.getDifferenceMode()); - setNotify(g.getNotify()); - if (attType.equals(Long.class)) { - setInitThreshold(new Long(g.getInitThreshold().longValue())); - setModulus(new Long(g.getModulus().longValue())); - setOffset(new Long(g.getOffset().longValue())); - } else if (attType.equals(Integer.class)) { - setInitThreshold(new Integer(g.getInitThreshold().intValue())); - setModulus(new Integer(g.getModulus().intValue())); - setOffset(new Integer(g.getOffset().intValue())); - } else if (attType.equals(Short.class)) { - setInitThreshold(new Short(g.getInitThreshold().shortValue())); - setModulus(new Short(g.getModulus().shortValue())); - setOffset(new Short(g.getOffset().shortValue())); - } else if (attType.equals(Byte.class)) { - setInitThreshold(new Byte(g.getInitThreshold().byteValue())); - setModulus(new Byte(g.getModulus().byteValue())); - setOffset(new Byte(g.getOffset().byteValue())); - } else - throw new IllegalStateException(attType + " is an invalid counter threshold type"); - } - - public ObjectName getPattern() { - return _pattern; - } - - public void setPattern(ObjectName pattern) { - _pattern = pattern; - } - - public Class getAttributeType() { - return _attType; - } - - public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { - super.preRegister(server, name); - return new ObjectName( - CONST.MONITOR + ":type=counterMonitor" + ",observer=" + _i + ",attributeType=" + _attType.getName()); - } - } - - // ------------------------------------------------------------------------- - // Gauge monitor - // ------------------------------------------------------------------------- - private AgentMonitorMBean[] createGaugeMonitors(String str) throws MalformedObjectNameException { - String[] strTab = split(str, ";"); - MyGaugeMonitor[] gauges = new MyGaugeMonitor[strTab.length * 6]; - for (int i = 0; i < strTab.length; i++) { - try { - ObjectName oName = new ObjectName(strTab[i]); - Hashtable h = oName.getKeyPropertyList(); - int j = i * 4; - gauges[j] = new MyGaugeMonitor((i + 1), Double.class); - // set Gauge monitor params - gauges[j].setObservedAttribute((String) remove(h, "observedAttribute")); - gauges[j].setGranularityPeriod(Long.parseLong((String) remove(h, "granularityPeriod"))); - gauges[j].setNotifyLow(true); - gauges[j].setNotifyHigh(true); - gauges[j].setThresholds( - Double.valueOf((String) remove(h, "highThreshold")), - Double.valueOf((String) remove(h, "lowThreshold"))); - gauges[j].setDifferenceMode(Boolean.valueOf((String) remove(h, "differenceMode")).booleanValue()); - if (oName.isPropertyPattern()) - gauges[j].setPattern(new ObjectName(oName.getDomain() + ":" + asString(h) + ",*")); - else - gauges[j].setPattern(new ObjectName(oName.getDomain(), h)); - gauges[j + 1] = new MyGaugeMonitor(gauges[j], Float.class); - gauges[j + 2] = new MyGaugeMonitor(gauges[j], Long.class); - gauges[j + 3] = new MyGaugeMonitor(gauges[j], Integer.class); - gauges[j + 4] = new MyGaugeMonitor(gauges[j], Short.class); - gauges[j + 5] = new MyGaugeMonitor(gauges[j], Byte.class); - } catch (Exception e) { - throw new IllegalStateException( - "Gauge monitor \"" + strTab[i] + "\" is invalid. " + e.toString() + ". " + CONST.GAUGE_SYNTAX); - } - } - return gauges; - } - - class MyGaugeMonitor extends GaugeMonitor implements AgentMonitorMBean { - private ObjectName _pattern; - private int _i; - private Class _attType; - - MyGaugeMonitor(int i, Class attType) throws JMException { - this._pattern = new ObjectName("*:*"); - this._i = i; - this._attType = attType; - } - - MyGaugeMonitor(MyGaugeMonitor g, Class attType) { - this._pattern = g.getPattern(); - this._i = g._i; - this._attType = attType; - setObservedAttribute(g.getObservedAttribute()); - setGranularityPeriod(g.getGranularityPeriod()); - setDifferenceMode(g.getDifferenceMode()); - setNotifyLow(g.getNotifyLow()); - setNotifyHigh(g.getNotifyHigh()); - Number high = g.getHighThreshold(); - Number low = g.getLowThreshold(); - if (attType.equals(Double.class)) - setThresholds(new Double(high.doubleValue()), new Double(low.doubleValue())); - else if (attType.equals(Float.class)) - setThresholds(new Float(high.floatValue()), new Float(low.floatValue())); - else if (attType.equals(Long.class)) - setThresholds(new Long(high.longValue()), new Long(low.longValue())); - else if (attType.equals(Integer.class)) - setThresholds(new Integer(high.intValue()), new Integer(low.intValue())); - else if (attType.equals(Short.class)) - setThresholds(new Short(high.shortValue()), new Short(low.shortValue())); - else if (attType.equals(Byte.class)) - setThresholds(new Byte(high.byteValue()), new Byte(low.byteValue())); - else - throw new IllegalStateException(attType + " is an invalid gauge threshold type"); - } - - public ObjectName getPattern() { - return _pattern; - } - - public void setPattern(ObjectName pattern) { - _pattern = pattern; - } - - public Class getAttributeType() { - return _attType; - } - - public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { - super.preRegister(server, name); - return new ObjectName( - CONST.MONITOR + ":type=gaugeMonitor" + ",observer=" + _i + ",attributeType=" + _attType.getName()); - } - } - - // ------------------------------------------------------------------------- - // Java utils - // ------------------------------------------------------------------------- - private String[] split(String str, String regex) { // JDK1.4 !!! - if (str == null || str.matches(" *")) - return new String[0]; - return str.split(regex); - } - - private Object remove(Hashtable h, String key) throws Exception { - if (h.containsKey(key)) - return h.remove(key); - throw new Exception("property \"" + key + "\" is missing"); - } - - private String asString(Hashtable h) { - String str = ""; - for (Iterator i = h.entrySet().iterator(); i.hasNext();) { - Map.Entry e = (Map.Entry) i.next(); - str += e.getKey() + "=" + e.getValue(); - if (i.hasNext()) - str += ","; - } - return str; - } -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/AgentMonitorMBean.java b/fractaljmx/src/org/objectweb/fractal/jmx/agent/AgentMonitorMBean.java deleted file mode 100644 index 1b5b31314ef9a624725691ecef686a6eb5045031..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/AgentMonitorMBean.java +++ /dev/null @@ -1,53 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.agent; - -import javax.management.ObjectName; -import javax.management.monitor.MonitorMBean; - -/** - * A customized {@link MonitorMBean} interface. - * - * @version 0.1 - */ -public interface AgentMonitorMBean extends MonitorMBean { - - /** - * Returns the type of attribute which can be observed by this {@link MonitorMBean}. - * This is usefull when this monitor can handle several attribute types - * (e.g. {@link javax.management.monitor.CounterMonitorMBean counter} and - * {@link javax.management.monitor.GaugeMonitorMBean gauge} monitors handle several integer - * or floating-point attribute types) - * - * @return the type of attribute which can be observed by this {@link MonitorMBean}. - */ - Class getAttributeType(); - - /** - * Returns an {@link ObjectName} pattern which can be used for filtering MBeans. - * Typically, only MBeans, whose {@link javax.management.ObjectName ObjectName} matches this pattern, - * must be added in the set of observed MBeans. - * - * @return an {@link ObjectName} pattern. - */ - ObjectName getPattern(); -} - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/CONST.java b/fractaljmx/src/org/objectweb/fractal/jmx/agent/CONST.java deleted file mode 100644 index d12bb7fa3e6b6603ae7c8ece0e5d315fabeaaf7b..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/CONST.java +++ /dev/null @@ -1,39 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.agent; -/** - * Specifies constants. - * - * @version 0.1 - */ -class CONST { - static final public String ADMIN = "Agent"; - static final public String MONITOR = "AgentService"; - static final public String FC = "FC"; - static final private String PREFIX_SYNTAX = - "\nSyntax [domainName]:observedAttribute=value,granularityPeriod=value"; - static final public String STRING_SYNTAX = - PREFIX_SYNTAX + ",stringToCompare=value,notifyDiffer=value,notifyMatch=value[,otherProperty=value]*"; - static final public String COUNTER_SYNTAX = - PREFIX_SYNTAX + ",initThreshold=value,modulus=value,offset=value,differenceMode=value[,otherProperty=value]*"; - static final public String GAUGE_SYNTAX = - PREFIX_SYNTAX + ",lowThreshold=value,highThreshold=value,differenceMode=value[,otherProperty=value]*"; -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/Introspector.java b/fractaljmx/src/org/objectweb/fractal/jmx/agent/Introspector.java deleted file mode 100644 index 297ad7a74cd56392b70f31237b4d2a39d75a23c4..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/Introspector.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * The JMX 4 Distributed Open Processing (JMX4ODP) - * - * Copyright (C) 2003 by Lucas McGregor - * All Rights Reserved. - * - * This software is released under the terms of the following - * licenses: - * - * - The BSD License (see LICENSE.BSD). - * - * While not mandated by the BSD license, any patches you make to the - * JMX 4 Distributed Open Processing source code may be contributed back into the - * JMX 4 Distributed Open Processing project at your discretion. Contributions will - * benefit the Open Source community. Submissions may be made at: - * - * http://jmx4odp.sourceforge.net - * - * As per the BSD liscence, credit must be given to Lucas McGregor - * and the synerr dot org project. - **/ -package org.objectweb.fractal.jmx.agent; - -import javax.management.Descriptor; -import javax.management.JMException; -import javax.management.modelmbean.RequiredModelMBean; -import javax.management.modelmbean.DescriptorSupport; -import javax.management.modelmbean.ModelMBeanInfo; -import javax.management.modelmbean.ModelMBeanInfoSupport; -import javax.management.modelmbean.ModelMBeanAttributeInfo; -import javax.management.modelmbean.ModelMBeanOperationInfo; -import javax.management.modelmbean.ModelMBeanConstructorInfo; -import javax.management.modelmbean.ModelMBeanNotificationInfo; -import javax.management.modelmbean.InvalidTargetObjectTypeException; - -import java.util.Vector; -import java.lang.reflect.Method; - -/** - * Uses introspection to build ModelMBeans. - * @author Lucas McGregor, slightly modified for Fractal JMX - */ -public class Introspector { - private final static boolean VERBOSE = true; - private final static boolean VERBOSE_DEBUG = false; - - private Introspector() {} - - /** - * Uses introspection to create an MBean that can manage methods and attributes of an object. - * - * @return a RequiredModelMBean that can manage the object. - * - * @param obj the object to introspect. - * - * @throws JMException if a problem occurs during introspection. - */ - public static RequiredModelMBean createMBean(Object obj) - throws JMException { - try{ - return createMBean(obj, obj.getClass()); - } - catch(InvalidTargetObjectTypeException e){ - throw new IllegalStateException(e.toString()); - } - } - - /** - * Uses introspection to create an MBean that can manage some methods and attributes of an object. - * These methods and attributes are specified in a class assignable to the object class. - * - * @return a RequiredModelMBean that can manage the object. - * - * @param obj the object to introspect. - * @param assign a class assignable to the object class. - * - * @throws InvalidTargetObjectTypeException if assign is not assignable to the object class. - * @throws JMException if a problem occurs during introspection. - */ - public static RequiredModelMBean createMBean(Object obj, Class assign) - throws JMException, InvalidTargetObjectTypeException { - Class objClass = obj.getClass(); - if (!assign.isAssignableFrom(objClass)) - throw new InvalidTargetObjectTypeException(assign + " not a superclass or superinterface of " + objClass); - Method[] methods = assign.getMethods(); - Vector attributes = new Vector(); - Vector operators = new Vector(); - - // GET THE LIST OF METHODS IN THE OBJECT - for (int i = 0; i < methods.length; i++) { - // IF THE METHOD STARTS WITH "is," "get," or "set" THEN TRY TO ADD AN ATTRIBUTE TO THE MODELMBEAN - if ((methods[i].getName().startsWith("get")) - || (methods[i].getName().startsWith("set")) - || (methods[i].getName().startsWith("is"))) { - try { - ModelMBeanAttributeInfo mmai = doAttribute(methods, i); - if (mmai != null) - attributes.add(mmai); - } catch (Exception e) { - if (VERBOSE) - e.printStackTrace(); - } - } - - // ADD THE METHOD AS AN OPERATION TO THE MODEL MBEAN - try { - ModelMBeanOperationInfo mmoi = doOperation(methods, i); - if (mmoi != null) - operators.add(mmoi); - } catch (Exception e) { - if (VERBOSE) - e.printStackTrace(); - } - } - - // ATTRIBUTES - ModelMBeanAttributeInfo[] attributeArray = new ModelMBeanAttributeInfo[attributes.size()]; - for (int i_ = 0; i_ < attributeArray.length; i_++) { - attributeArray[i_] = (ModelMBeanAttributeInfo) attributes.get(i_); - } - - // METHODS - ModelMBeanOperationInfo[] operatorArray = new ModelMBeanOperationInfo[operators.size()]; - for (int i_ = 0; i_ < operatorArray.length; i_++) { - operatorArray[i_] = (ModelMBeanOperationInfo) operators.get(i_); - } - - // Descriptor - Descriptor desc = new DescriptorSupport(); - desc.setField("name", objClass.getName()); - desc.setField("descriptorType", "MBean"); - - // CREATE MODELMBEAN - ModelMBeanInfo mminfo = - new ModelMBeanInfoSupport( - objClass.getName(), - objClass.getName(), - attributeArray, - new ModelMBeanConstructorInfo[0], - operatorArray, - new ModelMBeanNotificationInfo[0], - desc); - RequiredModelMBean model = new RequiredModelMBean(mminfo); - model.setManagedResource(obj, "ObjectReference"); - return model; - } - - /** - * Build the ModelMBeanOperationInfo for the method. Take the array - * of the objects methods and the index of the method to work on. - **/ - private static ModelMBeanOperationInfo doOperation(Method methods[], int i) throws JMException { - if (VERBOSE_DEBUG) - System.out.println("ObjectIntrospector: processing operation: " + methods[i].getName()); - - Descriptor desc = new DescriptorSupport(); - desc.setField("name", methods[i].getName()); - desc.setField("descriptorType", "operation"); - // MAKE SURE THAT THE AGENT DOESN'T READ FROM CACHE (0 does not work with JMX RI) - desc.setField("currencyTimeLimit", "1"); - - // IF THE METHOD STARTS WITH "get" or "is" TREAT IT AS A GETTER. - // IF IT STARTS WITH A "set" TREAT IT AS A SETTER. - if ((methods[i].getName().startsWith("get") || methods[i].getName().startsWith("is")) - && (methods[i].getParameterTypes().length == 0)) - desc.setField("role", "getter"); - else if (methods[i].getName().startsWith("set") && methods[i].getParameterTypes().length == 1) - desc.setField("role", "setter"); - else - desc.setField("role", "operation"); - - ModelMBeanOperationInfo mmoi = new ModelMBeanOperationInfo(methods[i].getName(), methods[i], desc); - return mmoi; - } - - /** - * Build the ModelMBeanAttributeInfo for the method. Take the array - * of the objects methods and the index of the method to work on. It - * needs the entire array of methods to determine matching sets of - * setters and getters. - **/ - private static ModelMBeanAttributeInfo doAttribute(Method methods[], int i) throws JMException { - if (VERBOSE_DEBUG) - System.out.println("ObjectIntrospector: processing attribute: " + methods[i].getName()); - - String name = null; - Method getter = null; - Method setter = null; - String type = null; - - // THIS METHOD IS A GETTER - if ((methods[i].getName().startsWith("get")) && (methods[i].getParameterTypes().length == 0)) { - String setName = "s" + methods[i].getName().substring(1); - name = methods[i].getName().substring(3); - getter = methods[i]; - type = methods[i].getReturnType().getName(); - // CHECK TO SEE IF THERE IS THE EQUVALENT WRITE OBJECT - for (int i_ = 0; i_ < methods.length; i_++) { - if (methods[i_].getName().equals(setName)) { - setter = methods[i_]; - break; - } - } - - } // THIS OBJECT IS A SETTER - else if ((methods[i].getName().startsWith("set")) && (methods[i].getParameterTypes().length == 1)) { - String getName = "g" + methods[i].getName().substring(1); - name = methods[i].getName().substring(3); - // CHECK TO SEE IF THERE IS THE EQUVALENT READ OBJECT - // IF SO, THEN THE GET EQUIVALENT WOULD HAVE RETURNED - // A ModelMBeanAttributeInfo, SO RETURN A NULL - // SO THIS ATTRIBUTE DOESN'T SHOW UP TWICE - for (int i_ = 0; i_ < methods.length; i_++) { - if (methods[i_].getName().equals(getName)) { - return null; - } - } - setter = methods[i]; - type = methods[i].getParameterTypes()[0].getName(); - - } // THIS OBJECT IS A GETTER WITH NO SETTER - else if ((methods[i].getName().startsWith("is")) && (methods[i].getParameterTypes() == null)) { - name = methods[i].getName().substring(2); - getter = methods[i]; - type = boolean.class.getName(); - } // NOT A COMPLIENT get, set, OR is ATTRIBUTE - else { - return null; - } - - Descriptor desc = new DescriptorSupport(); - desc.setField("name", name); // THE NAME THAT THE ATTRIBUTE WILL HAVE - desc.setField("descriptorType", "attribute"); // THIS IS MANDATORY FOR ANY ATTRIBUTES DESCRIPTION - desc.setField("displayName", name); - // MAKE SURE THAT THE AGENT DOESN'T READ FROM CACHE (0 does not work with JMX RI) - desc.setField("currencyTimeLimit", "1"); - - if (getter != null) - desc.setField("getMethod", getter.getName()); - if (setter != null) - desc.setField("setMethod", setter.getName()); - - ModelMBeanAttributeInfo mmai = - new ModelMBeanAttributeInfo(name, type, name, (getter != null), (setter != null), false, desc); - - return mmai; - } -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/agent/package.html b/fractaljmx/src/org/objectweb/fractal/jmx/agent/package.html deleted file mode 100644 index 4d59d562df5e37f063270df21785fa729162c779..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/agent/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - -Provides a component representing the JMX agent level. - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/comm/CommunicatorAttributes.java b/fractaljmx/src/org/objectweb/fractal/jmx/comm/CommunicatorAttributes.java deleted file mode 100644 index a43c27b05b6ab0c5d8d65f2713bd5457b3296f2f..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/comm/CommunicatorAttributes.java +++ /dev/null @@ -1,46 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.comm; - -import org.objectweb.fractal.api.control.AttributeController; - -/** - * A minimal attribute controller for protocol adaptor components. - * - * @version 0.1 - */ -public interface CommunicatorAttributes extends AttributeController { - - /** - * Gets the port number used by this component. - * - * @return the port number used by this component. - */ - int getPort (); - - /** - * Sets the port number used by this Component. - * - * @param port the port number used by this Component. - */ - void setPort (int port); -} - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/comm/RI_HtmlAdaptor.java b/fractaljmx/src/org/objectweb/fractal/jmx/comm/RI_HtmlAdaptor.java deleted file mode 100644 index 220a4ac434badc2d101a69f162bccb123f168753..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/comm/RI_HtmlAdaptor.java +++ /dev/null @@ -1,165 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.comm; - -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; - -import org.objectweb.fractal.jmx.agent.AdminAttributes; - -// JMX -import javax.management.ObjectName; -import javax.management.JMException; -import javax.management.InstanceNotFoundException; -import javax.management.JMRuntimeException; -// JMX-RI -import com.sun.jdmk.comm.HtmlAdaptorServer; - -/** - * A component based on the HTML protocol adaptor provided by the JMXTM 1.2 - * Reference Implementation. - * This adaptor allows an HTML browser to manage all MBeans in the Fractal JMX agent side. - * To connect a browser to the agent, open this page in a web browser: - *

    - * http://host:port - *
- * where: - *
    - *
  • host is the host name of the machine on which the agent is running (or localhost if the agent is local). - *
  • port is the port number used by the HTML server in the agent (default: 8082). - *
- * This HTML protocol adaptor provides the following main HTML pages for managing MBeans in the agent: - *
    - *
  • Agent View: Provides a list of object names of all the MBeans registered in the agent. - *
  • Agent Administration: Registers and unregisters MBeans in the agent. - *
  • MBean View: Reads and writes MBean attributes and perform operations on MBeans in the agent. - *
- * - *

The binding controller part of this component allows to set the (required) agent component. - * The {@link CommunicatorAttributes attribute controller} part allows to set the port number used to - * connect a browser to the agent. - * The life-cycle controller part registers this component in the agent when it starts, - * if it is not already registered or if its port attribute has changed. - * The underlying HTML protocol adaptor is implemented as a dynamic MBean, - * and can be managed: - *

    - *
  • as described in the JMXTM 1.2 Reference Implementation documentation. - *
    It is identified in the agent by the {@link ObjectName}: RI_HtmlAdaptor:type=html,port=port - *
  • - *
  • or indirectly by accessing the MBean representing the {@link CommunicatorAttributes attribute controller} - * of this component. - *
    In this case, it is required to stop and (re)start the component to take account a new port number, - * and to browse a page with the new port. - *
  • - *
- * - * - * @version 0.1 - */ -public class RI_HtmlAdaptor implements BindingController, LifeCycleController, CommunicatorAttributes { - private static final String ADAPTOR = "RI_HtmlAdaptor"; - private AdminAttributes _adminAtt; - private HtmlAdaptorServer _htmlAdaptor = new HtmlAdaptorServer(); - private int _port = _htmlAdaptor.getPort(); - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - public String[] listFc() { - return new String[] { "adminAtt" }; - } - - public Object lookupFc(final String itfName) { - if (itfName.equals("adminAtt")) - return _adminAtt; - else - return null; - } - - public void bindFc(final String itfName, final Object itfValue) { - if (itfName.equals("adminAtt")) { - _adminAtt = (AdminAttributes) itfValue; - } - } - - public void unbindFc(final String itfName) { - if (itfName.equals("adminAtt")) { - _adminAtt = null; - } - } - - // ------------------------------------------------------------------------- - // implementation of the LifeCycleController interface - // ------------------------------------------------------------------------- - public String getFcState() { - return null; - } - - public synchronized void startFc() { - ObjectName oName; - String id = '@' + Integer.toHexString(this.hashCode()); - try { - //System.out.println("->tries to start with port=" + port); - if (_htmlAdaptor != null - && _htmlAdaptor.getState() == HtmlAdaptorServer.ONLINE - && _htmlAdaptor.getPort() == _port) { - //System.out.println("<-already started with port=" + port); - return; - } - // unregister & stops - if (_htmlAdaptor != null) { - _htmlAdaptor.stop(); - oName = new ObjectName(ADAPTOR + id + ":type=html,port=" + _htmlAdaptor.getPort()); - try { - _adminAtt.getRawMBeanServer().unregisterMBean(oName); - } catch (InstanceNotFoundException ignore) {} - } - // registers & starts - _htmlAdaptor = new HtmlAdaptorServer(_port); - oName = new ObjectName(ADAPTOR + id + ":type=html,port=" + _port); - _adminAtt.getRawMBeanServer().registerMBean(_htmlAdaptor, oName); - _htmlAdaptor.start(); - // checks - if (!_htmlAdaptor.waitState(HtmlAdaptorServer.ONLINE, 5000)) - throw new JMRuntimeException( - "HtmlAdaptorServer failed to start with port=" - + _htmlAdaptor.getPort() - + ", current state=" - + _htmlAdaptor.getState()); - //System.out.println("<-started with port=" + htmlAdaptor.getPort()); - } catch (JMException e) { - throw new JMRuntimeException(e.toString()); - } - } - - public void stopFc() {} - - // ------------------------------------------------------------------------- - // implements Attribute controller - // ------------------------------------------------------------------------- - public int getPort() { - return _port; - } - - public void setPort(final int port) { - this._port = port; - } -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/comm/package.html b/fractaljmx/src/org/objectweb/fractal/jmx/comm/package.html deleted file mode 100644 index faadc4a536d22c84b651c7da3cd67215e5f17145..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/comm/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - -Provides specific components related to the JMX distributed services level (e.g HTTP protocol adaptors) - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/julia/package.html b/fractaljmx/src/org/objectweb/fractal/jmx/julia/package.html deleted file mode 100644 index 904afcd7df704a486f832492814066f21867111b..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/julia/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - -Julia dependancies (e.g optional controllers...) - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/BasicStatController.java b/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/BasicStatController.java deleted file mode 100644 index b837f5c16e6dba997f05e5868124ca52adae8317..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/BasicStatController.java +++ /dev/null @@ -1,183 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.julia.stat; - -import org.objectweb.fractal.julia.loader.Tree; -import org.objectweb.fractal.julia.loader.Initializable; - -/** - * Simple implementation of {@link StatController}. - *
    - *
  • The number of (intercepted) method calls, returned by this implementation, - * is incremented as usual each time a call is made on the server interfaces of the component - * (control interfaces excluded). - *
  • The rate of (intercepted) method calls, returned by this implementation, are re-computed every {@link #_period period}. - * The value of this period must be positive and can be fixed by {@link #initialize initialize}. - *
- * - * @version 0.1 - */ -public class BasicStatController implements StatController, Initializable { - - /** - * The minimal time interval used for rate re-computation, in milliseconds (default value is 5000). - *

Its value must be positive and can be fixed by {@link #initialize initialize}. - */ - protected long _period = 5000; - - /** - * Number of calls to preMethod, i.e., the total number of method calls. - */ - private int _calls; - - /** - * Number of calls to preMethod during the current sample. - */ - private int _callsCrtSample; - - /** - * Rate of calls to preMethod during the last sample. - */ - private double _rateOfMethodCall; - - /** - * Number of calls to postMethod, i.e., the total number of method success - * (since postMethod is not called inside a finally block - see - * StatCodeGenerator - it is not called if the intercepted method throws an - * exception). - */ - private int _success; - - /** - * Number of calls to postMethod during the current sample. - */ - private int _successCrtSample; - - /** - * Rate of calls to preMethod during the last sample. - */ - private double _rateOfMethodSuccess; - - /** - * Sample start time - */ - private long _startSample = System.currentTimeMillis(); - - // ------------------------------------------------------------------------- - // implementation of the Initializable interface - // ------------------------------------------------------------------------- - /** - * Initializes this object with the given arguments. - * The first subtree (if any) must represent the value of {@link #_period period}. - * - * @param args the arguments to be used to initialize this object. - * @throws NumberFormatException - * if the first subtree is not a valid string representation of a long value. - * @throws IllegalStateException if the firts subtree does not represent a positive value. - */ - public void initialize(final Tree args) { - //System.out.println("-- " + args.toString() + ", period=" + period); - if (args.getSize() == 0) - return; - _period = Long.valueOf(args.getSubTree(0).toString()).longValue(); - if (_period < 1) - throw new IllegalStateException("period=" + _period + " is invalid. The value must be positive."); - //System.out.println("-- " + args.toString() + ", period=" + period); - } - - // ------------------------------------------------------------------------- - // implementation of the StatController interface - // ------------------------------------------------------------------------- - public synchronized void reset() { - _calls = 0; - _callsCrtSample = 0; - _rateOfMethodCall = 0; - _success = 0; - _successCrtSample = 0; - _rateOfMethodSuccess = 0; - _startSample = System.currentTimeMillis(); - } - - public int getNumberOfMethodCall() { - return _calls; - } - - public int getNumberOfMethodSuccess() { - return _success; - } - - public double getRateOfMethodCall() { - resetSample(); - return _rateOfMethodCall; - } - - public double getRateOfMethodSuccess() { - resetSample(); - return _rateOfMethodSuccess; - } - - private synchronized void resetSample() { - long t = System.currentTimeMillis(); - if (t < _startSample + _period) - return; - _rateOfMethodCall = (double)(_callsCrtSample * 1000) / (t - _startSample); - _callsCrtSample = 0; - _rateOfMethodSuccess = (double)(_successCrtSample * 1000) / (t - _startSample); - _successCrtSample = 0; - _startSample = t; - } - - // ------------------------------------------------------------------------- - // methods called by the associated interceptor - // ------------------------------------------------------------------------- - /** - * A preMethod called by the associated interceptor. - * This preMethod increments the number of method calls that have been made on the server - * interfaces of the component (control interfaces excluded). - * - * @param method the method that is intercepted. - */ - public void statPreMethod(final String method) { - synchronized (this) { - ++_calls; - ++_callsCrtSample; - } - } - - /** - * A postMethod called by the associated interceptor. - * Since postMethod is not called inside a finally block - see - * StatCodeGenerator - it is not called if the intercepted method throws an - * exception. - *

This postMethod increments the number of method calls that have been made on the server - * interfaces of the component (control interfaces excluded), and that have - * "succeded", i.e., that have not thrown an exception. - * - * @param method the method that is intercepted. - */ - public void statPostMethod(final String method) { - synchronized (this) { - ++_success; - ++_successCrtSample; - } - } -} - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/ExponentialSmoothingStatController.java b/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/ExponentialSmoothingStatController.java deleted file mode 100644 index 186791f09dfd905c174b6842fa774d7672794eae..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/ExponentialSmoothingStatController.java +++ /dev/null @@ -1,107 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.julia.stat; - -import org.objectweb.fractal.julia.loader.Tree; - -/** - * Extends {@link BasicStatController} with an exponential smoothing method for the rate computation. - * The rate values returned by this implementation are computed as follows: - *

- *            ST = (alpha * xT) + ((1 - alpha) * ST-1)
- * 
- * - * where: - *
    - *
  • ST: is the current smoothed rate value. It represents a weighted average of all past rate values - * returned by {@link BasicStatController}. - *
  • alpha: is the {@link #_alpha smoothing constant}. - * Its value must be in the interval [0-1] and can be fixed by {@link #initialize initialize}. - *
    If alpha equals 1, the rate values returned by this implementation are similar to the values returned by - * {@link BasicStatController}. - *
  • xT: is the current actual rate value returned by {@link BasicStatController}. - *
  • ST-1: is the previous smoothed rate value. - *
- * - * - * @version 0.1 - */ -public class ExponentialSmoothingStatController extends BasicStatController { - /** - * Smoothing constant (default value is 0.5). - *

Its value must be in the interval [0-1] and can be fixed by {@link #initialize initialize}. - */ - protected double _alpha = 0.5; - - private double _lastRateOfMethodCall; - - private double _lastRateOfMethodSuccess; - - // ------------------------------------------------------------------------- - // overload BasicStatController - // ------------------------------------------------------------------------- - /** - * Initializes this object with the given arguments. - * The first subtree (if any) must represent the value of {@link #_period period}. - * The second subtree (if any) must represent the value of the {@link #_alpha smoothing constant}. - * - * @param args the arguments to be used to initialize this object. - * @throws NumberFormatException - * if the first subtree is not a valid string representation of a long value, - * or if the second subtree is not a valid string representation of a double value. - * @throws IllegalStateException - * if the firts subtree does not represent a positive value - * or if the second subtree does not represent a value in the interval [0-1]. - */ - public void initialize(final Tree args) { - //System.out.println("-- " + args.toString() + ", period=" + period + ", alpha=" + alpha); - if (args.getSize() == 0) - return; - else if (args.getSize() == 1){ - super.initialize(args); - return; - } - super.initialize(args); - _alpha = Double.valueOf(args.getSubTree(1).toString()).doubleValue(); - if ((_alpha < 0) || (_alpha > 1)) - throw new IllegalStateException("alpha=" + _alpha + " is invalid. The value must in the interval [0-1]."); - //System.out.println("-- " + args.toString() + ", period=" + period + ", alpha=" + alpha); - } - - public double getRateOfMethodCall() { - return _lastRateOfMethodCall = expSmoothing(super.getRateOfMethodCall(), _lastRateOfMethodCall); - } - - public double getRateOfMethodSuccess() { - return _lastRateOfMethodSuccess = expSmoothing(super.getRateOfMethodSuccess(), _lastRateOfMethodSuccess); - } - - public void reset() { - super.reset(); - _lastRateOfMethodCall = 0; - _lastRateOfMethodSuccess = 0; - } - - private double expSmoothing(double newRate, double lastRate) { - return (_alpha * newRate) + (1 - _alpha) * lastRate; - } -} - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/StatCodeGenerator.java b/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/StatCodeGenerator.java deleted file mode 100644 index 2e56fc870f30e97f560ca901f7c1a37a779c1da6..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/StatCodeGenerator.java +++ /dev/null @@ -1,68 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - * - * Authors: Eric Bruneton - */ -package org.objectweb.fractal.jmx.julia.stat; - -import org.objectweb.fractal.julia.asm.SimpleCodeGenerator; -import java.lang.reflect.Method; - -/** - * This code generator generates interception code. It uses the following form for - * all methods: - * - *

- * method-signature {
- *   return-type result;
- *   delegate.statPreMethod(method-name);
- *   // original method code, where returns are replaced with gotos
- *   delegate.statPostMethod(method-name);
- *   return result;
- * }
- * 
- * - * where delegate is initialized with the following code: - * - *

- * delegate = (...)ic.getInterface("stat-controller");
- * 
- */ -public class StatCodeGenerator extends SimpleCodeGenerator { - protected String getControllerInterfaceName() { - return "stat-controller"; - } - - protected String getPreMethodName() { - return "statPreMethod"; - } - - protected String getPostMethodName() { - return "statPostMethod"; - } - - protected Class getContextType() { - return Void.TYPE; - } - - protected String getMethodName(final Method m) { - return m.getName(); - } -} diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/StatController.java b/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/StatController.java deleted file mode 100644 index 51d5d23b83c6ba62aeaf8316237b1284223db774..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/StatController.java +++ /dev/null @@ -1,72 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.julia.stat; - -/** - * An interface for observing method calls. - * More precisely, a controller implementing this interface returns the number and the rate - * of method calls that have been made on the server interfaces of a component - * (control interfaces excluded). - * - * @version 0.1 - */ -public interface StatController { - - /** - * Gets the number of method calls. - * - * @return the number of method calls that have been made on the server - * interfaces of the component (control interfaces excluded). - */ - int getNumberOfMethodCall(); - - /** - * Gets the number of method calls that have "succeded". - * - * @return the number of method calls that have been made on the server - * interfaces of the component (control interfaces excluded), and that have - * "succeded", i.e., that have not thrown an exception. - */ - int getNumberOfMethodSuccess(); - - /** - * Gets the rate of method calls. - * - * @return the rate of method calls (number / second) that have been made on the server - * interfaces of the component (control interfaces excluded). - */ - double getRateOfMethodCall(); - - /** - * Gets the rate of method calls that have "succeded". - * - * @return the rate of method calls (number / second) that have been made on the server - * interfaces of the component (control interfaces excluded), and that have - * "succeded", i.e., that have not thrown an exception. - */ - double getRateOfMethodSuccess(); - - /** - * Resets (to zero) the values returned by this controller. - */ - void reset(); -} - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/package.html b/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/package.html deleted file mode 100644 index 67e021b08fd91fb9dd7b0f0309c6a51e20c3b709..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/julia/stat/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - -Provides (Julia) controllers for observing method calls. - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/listener/BasicListener.java b/fractaljmx/src/org/objectweb/fractal/jmx/listener/BasicListener.java deleted file mode 100644 index 3fbc73710de0e0700c0042359e22848615e664a4..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/listener/BasicListener.java +++ /dev/null @@ -1,88 +0,0 @@ -/*** - * Fractal JMX - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: fractal@objectweb.org - */ -package org.objectweb.fractal.jmx.listener; - -import javax.management.Notification; -import javax.management.monitor.MonitorNotification; -import javax.management.NotificationListener; - -import java.util.Date; - -/** - * Provides a simple listener component. - * An object of this class can be used to receive notifications sent out by standard monitoring services - * (counter, gauge and string) of the JMX specification. All notifications received will be write to user screen. - * - * @version 0.1 - */ -public class BasicListener implements NotificationListener { - - // ------------------------------------------------------------------------- - // Implementation of the NotificationListener interface - // ------------------------------------------------------------------------- - /** - * Invoked when a JMX notification occurs. Currently handles {@link MonitorNotification monitor notifications} - * sent out by standard monitoring services (counter, gauge and string) of the JMX specification. - * This listener will print to user screen the following information (part of the received monitor notification, - * except for the date): - *
    - *
  • the {@link Date} representing the time at which the monitor notification is received,
  • - *
  • the notification type,
  • - *
  • the monitor source on which the Event initially occurred,
  • - *
  • the observed object of this monitor notification,
  • - *
  • the observed attribute of this monitor notification,
  • - *
  • the threshold/string (depending on the monitor type) that triggered off this monitor notification,
  • - *
  • the derived gauge of this monitor notification.
  • - *
- * - * @param n The notification (should be an instance of {@link MonitorNotification}). - * @param handback An opaque object, not used by this simple implementation. - * - * @throws ClassCastException if the received notification is not instance of {@link MonitorNotification}. - */ - public void handleNotification(Notification n, Object handback) { - MonitorNotification notif = (MonitorNotification) n; - StringBuffer msg = new StringBuffer(150); - msg.append("\n"); - if (notif.getType().equals(MonitorNotification.STRING_TO_COMPARE_VALUE_MATCHED) - || notif.getType().equals(MonitorNotification.STRING_TO_COMPARE_VALUE_DIFFERED)) { - msg.append("***** String Monitor"); - } else if (notif.getType().equals(MonitorNotification.THRESHOLD_VALUE_EXCEEDED)) { - msg.append("***** Counter Monitor"); - } else if ( - notif.getType().equals(MonitorNotification.THRESHOLD_HIGH_VALUE_EXCEEDED) - || notif.getType().equals(MonitorNotification.THRESHOLD_LOW_VALUE_EXCEEDED)) { - msg.append("***** Gauge Monitor"); - } else - msg.append("***** Unexpected Monitor notication !!!"); - msg.append(" (" + new Date() + ")"); - msg.append("\n* NotificationType: " + notif.getType()); - msg.append("\n* Src: " + notif.getSource()); - msg.append("\n* ObservedObject: " + notif.getObservedObject()); - msg.append("\n* ObservedAttribute: " + notif.getObservedAttribute()); - msg.append("\n* Trigger: " + notif.getTrigger()); - msg.append("\n* DerivedGauge: " + notif.getDerivedGauge()); - //msg.append("\n* handback: " + handback); - msg.append("\n*****"); - System.out.println(msg); - } -} - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/listener/package.html b/fractaljmx/src/org/objectweb/fractal/jmx/listener/package.html deleted file mode 100644 index ac6905c0b210e5a51190c1001222f5862f00def9..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/listener/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - -Provides specific components that handle JMX notifications. - - diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/overview.html b/fractaljmx/src/org/objectweb/fractal/jmx/overview.html deleted file mode 100644 index b5e9f97f82dbd92c6dd5f40d2408c705bd88bea4..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/overview.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - -DO NOT REMOVE THIS LINE (will be automatically removed). -This document is the specification for Fractal JMX v0.1, a small tool that enables JMX management of Fractal applications. -This version of Fractal JMX is based on the -Fractal -Specification v2.0, and the JavaTM Management extensions -(JMXTM) -Instrumentation and Agent Specification v1.2. -Fractal JMX is not Julia dependant except for some additional and optional controllers that allow to equip Fractal -components with basic statistics on method calls. - -

The resources that can be managed using Fractal JMX v0.1 are component server interfaces or monitors for observing -component attributes. -Fractal JMX does not impose intrusive management code or extra metadata to enable JMX management of these resources. -The JMX agent level, responsible for delegating all the invocations between the management applications and the -managed resources, is represented in Fractal JMX by a generic Fractal -agent -component, -whose only requirement is to be added in the Fractal application to be managed. -This agent component enables JMX management of its host application by dynamically exploring -the component structure and creating managed beans (MBeans) that represent either component -server interfaces or monitors for observing component attributes. - -

Fractal JMX is a set of Fractal components. -The core agent component can be composed with listener and adaptor components. -See the Fractal JMX tutorial -for more general documentation about Fractal JMX. - \ No newline at end of file diff --git a/fractaljmx/src/org/objectweb/fractal/jmx/package.html b/fractaljmx/src/org/objectweb/fractal/jmx/package.html deleted file mode 100644 index e7dadcbdae98a302cfb0fc786592ae0af21a8f42..0000000000000000000000000000000000000000 --- a/fractaljmx/src/org/objectweb/fractal/jmx/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - -Provides miscellaneous classes of Fractal JMX - - diff --git a/fractalrmi/README.txt b/fractalrmi/README.txt deleted file mode 100644 index e2338b0f6f242af515583694eb101ee2ff749c44..0000000000000000000000000000000000000000 --- a/fractalrmi/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -This directory is the base directory of the product. -It contains(*) the following items: - -- archive: ant files to build the jar(s) of the product, -- build.properties: properties to configure the build process, -- build.xml: main ant file to build the product, -- config: external libraries required only for building the product, -- doc: documentation of the product, -- etc: scripts to run the product, -- examples: examples of use of the product, -- externals: external libraires required for running the product, -- jdoc: ant files to build the javadoc documentation(s) of the product, -- sr': sources of the product, -- test: tests of the product, -- web: source of the web site of the product. - -(*) some items may not be present, depending on the product. diff --git a/fractalrmi/archive/README.txt b/fractalrmi/archive/README.txt deleted file mode 100644 index e0d72a77eeab2c75774e256e42b338274737fa5d..0000000000000000000000000000000000000000 --- a/fractalrmi/archive/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory contains ant files to build the jars of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one jar file. - -- The name of the ant file must be the name of the jar it builds: - org-foo-bar.xml must build org-foo-bar.jar. - -- Among the elements which are included into a jar, you must specify - a manifest. It is adviced to store the manifest file in this directory. - The manifest file can be shared by several jars. The name of the manifest - file must be similar to the name of the jar file. - -- Only the default task is called on each ant file. - -- The jar file must be produced into the ${dist.lib} directory. - -Sample ant file: - - - - - - ... - - - - diff --git a/fractalrmi/archive/fractal-rmi-tmpl.mf b/fractalrmi/archive/fractal-rmi-tmpl.mf deleted file mode 100644 index 33ddee815d66f4ad70602d534c74e2b7219a4932..0000000000000000000000000000000000000000 --- a/fractalrmi/archive/fractal-rmi-tmpl.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Fractal ADL template definitions for Fractal RMI" -Implementation-Version: "1.2" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractalrmi/archive/fractal-rmi-tmpl.xml b/fractalrmi/archive/fractal-rmi-tmpl.xml deleted file mode 100644 index 116a3ca296f3cfd5d01bd1ac2bc43fab6d9b63df..0000000000000000000000000000000000000000 --- a/fractalrmi/archive/fractal-rmi-tmpl.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/fractalrmi/archive/fractal-rmi.mf b/fractalrmi/archive/fractal-rmi.mf deleted file mode 100644 index 6f596719d5772a5c4bcdbf90902d85ca0da90188..0000000000000000000000000000000000000000 --- a/fractalrmi/archive/fractal-rmi.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Fractal components for Remote Method Invocation" -Implementation-Version: "1.2" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractalrmi/archive/fractal-rmi.xml b/fractalrmi/archive/fractal-rmi.xml deleted file mode 100644 index 8df5b27d92e381227026dc0c46f8590384d25c4e..0000000000000000000000000000000000000000 --- a/fractalrmi/archive/fractal-rmi.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - diff --git a/fractalrmi/archive/jonathan.mf b/fractalrmi/archive/jonathan.mf deleted file mode 100644 index cff2219afadcee423e35d9d9678c87a394c9da83..0000000000000000000000000000000000000000 --- a/fractalrmi/archive/jonathan.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Jonathan core components" -Implementation-Version: "3.0A10" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractalrmi/archive/jonathan.xml b/fractalrmi/archive/jonathan.xml deleted file mode 100644 index b4e488e5e3a83e618bd849cadb96c625740edd8d..0000000000000000000000000000000000000000 --- a/fractalrmi/archive/jonathan.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/fractalrmi/build.config b/fractalrmi/build.config deleted file mode 100644 index 1793094fded13ff4bbbd1ab5cff38ae15b599127..0000000000000000000000000000000000000000 --- a/fractalrmi/build.config +++ /dev/null @@ -1,12 +0,0 @@ -# Defines values for the 'build.properties' build properties -# This file is used to build the project in the case of bundled external jars - -objectweb.ant.tasks.path config/ow_util_ant_tasks.jar - -asm.path externals/asm.jar - -fractal.path externals/fractal.jar - -fractaladl.path externals/fractal-adl.jar:externals/dtdparser.jar:externals/ow_deployment_scheduling.jar - -monolog.path externals/ow_util_log_api.jar diff --git a/fractalrmi/build.properties b/fractalrmi/build.properties deleted file mode 100644 index 67ce33775a2b992a07274d1338db7caab6c69b2f..0000000000000000000000000000000000000000 --- a/fractalrmi/build.properties +++ /dev/null @@ -1,73 +0,0 @@ -############################################################################### -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################### - -# Some information about the product - -product.name fractalrmi -product.version 0.2 - -############################################################################### -# BUILD -############################################################################### - -# Wich compiler do you want to use ? -# jikes is faster than javac but keeps line numbers in compiled classes, even -# with the -O option (javac removes line numbers and local variable names with -# this option, resulting in smaller classes) - -# build.compiler jikes - -# Build class path (classes needed to build the project) -# Classpath for the ObjectWeb utility Ant tasks (OWANTTASK_1_1) -# See http://forge.objectweb.org/projects/monolog - -# objectweb.ant.tasks.path ow_util_ant_tasks.jar - -############################################################################### -# EXTERNAL LIBRARIES -############################################################################### - -# Class path for the ASM library (ASM_1_4_2) -# See http://asm.objectweb.org - -# asm.path asm.jar - -# Class path for the Fractal API (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -# fractal.path fractal.jar - -# Class path for the FractalADL parser (FRACTAL_ADL_2_0) -# See http://fractal.objectweb.org - -# fractaladl.path fractal-adl.jar:dtdparser.jar:ow_deployment_scheduling.jar - -# Class path for the Monolog API (MONOLOG_1_7) -# See http://monolog.objectweb.org - -# monolog.path ow_util_log_api.jar - -############################################################################### -# DOCUMENTATION -############################################################################### - -# URLs of external Javadocs - -monolog.url http://www.objectweb.org/monolog/jdoc/ow_util_log_api -fractal.url http://www.objectweb.org/fractal/current/doc/javadoc/fractal -jonathan.url http://www.objectweb.org/jonathan/current/doc/apis -asm.url http://www.objectweb.org/asm/current/doc/javadoc/user -jdk.url http://java.sun.com/j2se/1.3/docs/api diff --git a/fractalrmi/build.xml b/fractalrmi/build.xml deleted file mode 100644 index b057d1956fd670238262db1d9838b235f38a7a70..0000000000000000000000000000000000000000 --- a/fractalrmi/build.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/config/README.txt b/fractalrmi/config/README.txt deleted file mode 100644 index 4978babb44fb4f93c7d819e50bedad09c7086b79..0000000000000000000000000000000000000000 --- a/fractalrmi/config/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains the external libraries required for building the -product, but which are not necessary to use it. diff --git a/fractalrmi/config/ow_util_ant_tasks.jar b/fractalrmi/config/ow_util_ant_tasks.jar deleted file mode 100644 index 4a502465e2d690a80931068d96563d895d9cb5b5..0000000000000000000000000000000000000000 Binary files a/fractalrmi/config/ow_util_ant_tasks.jar and /dev/null differ diff --git a/fractalrmi/doc/README.txt b/fractalrmi/doc/README.txt deleted file mode 100644 index 84303fee616679f69995c94e1dd7d4198b338d64..0000000000000000000000000000000000000000 --- a/fractalrmi/doc/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the documentation of the product. diff --git a/fractalrmi/doc/javadoc/figures/fractalrmi.fig b/fractalrmi/doc/javadoc/figures/fractalrmi.fig deleted file mode 100644 index 0b58804f0c2234741d39172dc4e0ab86139b1bd6..0000000000000000000000000000000000000000 --- a/fractalrmi/doc/javadoc/figures/fractalrmi.fig +++ /dev/null @@ -1,290 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -140.00 -Single --2 -1200 2 -0 32 #808080 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1440 1035 4410 630 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1440 1260 3285 1260 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1440 1485 2160 1980 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3015 1980 3285 1305 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4140 1305 4410 855 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 6 - 0 0 1.00 60.00 120.00 - 6390 1530 6615 1530 6615 270 360 270 360 1035 585 1035 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1440 1710 2160 3330 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3015 3330 5535 1575 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3015 2205 5535 1530 -2 1 0 1 32 7 53 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3015 2430 4185 2835 -2 1 0 1 32 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3008 3540 4185 2880 -2 1 0 1 32 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5040 2880 6885 2880 -2 1 0 1 32 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6390 1755 6885 2835 -2 1 0 1 32 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3015 3780 6885 2925 -2 1 0 1 32 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3018 4016 6885 3555 -2 2 0 0 7 7 52 0 20 0.000 0 0 -1 0 0 5 - 3825 2700 3915 2700 3915 2790 3825 2790 3825 2700 -2 2 0 0 7 7 52 0 20 0.000 0 0 -1 0 0 5 - 6615 2835 6705 2835 6705 2925 6615 2925 6615 2835 -2 2 0 0 7 7 52 0 20 0.000 0 0 -1 0 0 5 - 6660 2925 6750 2925 6750 3015 6660 3015 6660 2925 -2 1 0 1 32 7 53 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6390 1980 6885 3510 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 945 1395 1125 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 1170 1395 1350 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 1395 1395 1575 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 1620 1395 1800 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1350 1035 1395 1035 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1350 1260 1395 1260 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1350 1485 1395 1485 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1350 1710 1395 1710 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 675 1035 630 1035 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 630 945 630 1125 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 1845 1395 2025 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1350 1935 1395 1935 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 1890 2970 2070 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 2115 2970 2295 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 2340 2970 2520 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 1980 2970 1980 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 2205 2970 2205 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 2430 2970 2430 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2250 1980 2205 1980 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2205 1890 2205 2070 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1215 4095 1395 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4050 1305 4095 1305 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3375 1305 3330 1305 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3330 1215 3330 1395 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4500 630 4455 630 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5220 540 5220 720 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5175 630 5220 630 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 765 4455 945 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4500 855 4455 855 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 540 4455 720 -2 2 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 5 - 4500 495 5175 495 5175 945 4500 945 4500 495 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6345 1440 6345 1620 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6345 1665 6345 1845 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6345 1890 6345 2070 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6300 1530 6345 1530 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6300 1755 6345 1755 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6300 1980 6345 1980 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5625 1530 5580 1530 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5580 1440 5580 1620 -2 2 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 5 - 5625 1395 6300 1395 6300 2070 5625 2070 5625 1395 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4275 2880 4230 2880 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4230 2790 4230 2970 -2 2 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 5 - 4275 2745 4950 2745 4950 3195 4275 3195 4275 2745 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4995 2790 4995 2970 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4995 2880 4950 2880 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3015 4230 3960 4230 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4815 4230 5535 4230 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4050 4230 4005 4230 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4005 4140 4005 4320 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 4050 4095 4725 4095 4725 4545 4050 4545 4050 4095 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4770 4140 4770 4320 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4770 4230 4725 4230 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 3240 2970 3420 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 3465 2970 3645 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 3690 2970 3870 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 3915 2970 4095 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 3330 2970 3330 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 3555 2970 3555 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 3780 2970 3780 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 4005 2970 4005 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2250 3330 2205 3330 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2205 3240 2205 3420 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 4140 2970 4320 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 4230 2970 4230 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2250 3195 2925 3195 2925 4320 2250 4320 2250 3195 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5625 4230 5580 4230 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5580 4140 5580 4320 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 5625 4095 6300 4095 6300 4545 5625 4545 5625 4095 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6975 2880 6930 2880 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6930 2790 6930 2970 -2 2 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6975 2745 7650 2745 7650 3195 6975 3195 6975 2745 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6975 3555 6930 3555 -2 1 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6930 3465 6930 3645 -2 2 0 1 32 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6975 3420 7650 3420 7650 3870 6975 3870 6975 3420 -2 2 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 5 - 3375 1170 4050 1170 4050 1620 3375 1620 3375 1170 -2 2 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2250 1845 2925 1845 2925 2745 2250 2745 2250 1845 -2 2 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 5 - 675 900 1350 900 1350 2250 675 2250 675 900 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 2070 1395 2250 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1350 2160 1395 2160 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 2565 2970 2745 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 2655 2970 2655 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1440 4095 1620 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4050 1530 4095 1530 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5220 765 5220 945 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5175 855 5220 855 -2 1 0 1 0 7 51 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5265 630 5535 1485 -4 0 4 50 0 0 8 0.0000 4 90 210 720 1035 Rmi\001 -4 0 4 50 0 0 6 0.0000 4 90 450 1440 1125 stub-factory\001 -4 0 4 50 0 0 6 0.0000 4 75 285 1440 1350 adapter\001 -4 0 4 50 0 0 6 0.0000 4 75 480 1440 1575 rmi-protocol\001 -4 0 4 50 0 0 6 0.0000 4 75 465 1440 1800 tcp-protocol\001 -4 0 4 50 0 0 6 0.0000 4 90 585 1440 2025 context-factory\001 -4 0 4 50 0 0 8 0.0000 4 90 330 720 1170 Binder\001 -4 2 4 50 0 0 8 1.5708 4 105 810 630 1170 NamingContext\001 -4 0 4 50 0 0 6 0.0000 4 75 285 3015 2070 adapter\001 -4 0 4 50 0 0 8 0.0000 4 90 210 2295 1980 Rmi\001 -4 0 4 50 0 0 8 0.0000 4 75 450 2295 2115 Protocol\001 -4 0 4 50 0 0 6 0.0000 4 90 705 3015 2295 marshaller-factory\001 -4 0 4 50 0 0 6 0.0000 4 60 360 3015 2520 scheduler\001 -4 2 4 50 0 0 8 1.5708 4 75 450 2205 2115 Protocol\001 -4 2 4 50 0 0 8 0.0000 4 105 810 3195 1395 NamingContext\001 -4 0 4 50 0 0 6 0.0000 4 90 615 4140 1395 skeleton-factory\001 -4 0 4 50 0 0 8 0.0000 4 90 210 3420 1305 Rmi\001 -4 0 4 50 0 0 8 0.0000 4 105 405 3420 1455 Adapter\001 -4 0 4 50 0 0 8 0.0000 4 105 390 4545 765 Factory\001 -4 0 4 50 0 0 8 0.0000 4 90 450 4545 630 RmiStub\001 -4 0 4 50 0 0 6 0.0000 4 90 705 5265 720 marshaller-factory\001 -4 0 4 50 0 0 8 0.0000 4 90 210 5670 1530 Rmi\001 -4 0 4 50 0 0 8 0.0000 4 75 555 5670 1665 Marshaller\001 -4 0 4 50 0 0 8 0.0000 4 105 390 5670 1800 Factory\001 -4 0 4 50 0 0 6 0.0000 4 60 285 6390 1620 domain\001 -4 0 4 50 0 0 6 0.0000 4 90 585 6390 1845 context-factory\001 -4 0 4 50 0 0 6 0.0000 4 90 525 6390 2070 chunk-factory\001 -4 0 32 50 0 0 8 0.0000 4 75 570 4320 2880 JScheduler\001 -4 0 32 50 0 0 6 0.0000 4 90 585 5040 2970 context-factory\001 -4 0 0 50 0 0 6 0.0000 4 90 630 4815 4320 delegate-factory\001 -4 0 0 50 0 0 8 0.0000 4 90 225 4095 4365 Mgr\001 -4 0 0 50 0 0 8 0.0000 4 90 630 4095 4230 JConnection\001 -4 2 0 50 0 0 8 1.5708 4 75 450 2205 3465 Protocol\001 -4 0 0 50 0 0 8 0.0000 4 105 300 2295 3330 TcpIp\001 -4 0 0 50 0 0 8 0.0000 4 75 450 2295 3465 Protocol\001 -4 0 0 50 0 0 6 0.0000 4 90 720 3015 4320 connection-factory\001 -4 0 0 50 0 0 6 0.0000 4 60 360 3015 3645 scheduler\001 -4 0 0 50 0 0 6 0.0000 4 90 705 3015 3420 marshaller-factory\001 -4 0 0 50 0 0 6 0.0000 4 90 585 3015 3870 context-factory\001 -4 0 0 50 0 0 6 0.0000 4 90 525 3015 4095 chunk-factory\001 -4 0 0 50 0 0 8 0.0000 4 75 240 5670 4230 IPv4\001 -4 0 0 50 0 0 8 0.0000 4 90 585 5670 4365 Connection\001 -4 0 0 50 0 0 8 0.0000 4 105 390 5670 4500 Factory\001 -4 0 32 50 0 0 8 0.0000 4 75 480 7020 2880 JContext\001 -4 0 32 50 0 0 8 0.0000 4 105 390 7020 3015 Factory\001 -4 0 32 50 0 0 8 0.0000 4 75 375 7020 3555 JChunk\001 -4 0 32 50 0 0 8 0.0000 4 105 390 7020 3690 Factory\001 -4 0 4 50 0 0 6 0.0000 4 90 240 1440 2250 logger\001 -4 0 4 50 0 0 6 0.0000 4 90 240 3015 2745 logger\001 -4 0 4 50 0 0 6 0.0000 4 90 240 4140 1620 logger\001 -4 0 4 50 0 0 6 0.0000 4 90 240 5265 945 logger\001 diff --git a/fractalrmi/doc/javadoc/figures/fractalrmi.gif b/fractalrmi/doc/javadoc/figures/fractalrmi.gif deleted file mode 100644 index 3afcea1dbab335ffe673663096c5151236571c5a..0000000000000000000000000000000000000000 Binary files a/fractalrmi/doc/javadoc/figures/fractalrmi.gif and /dev/null differ diff --git a/fractalrmi/examples/common/README.txt b/fractalrmi/examples/common/README.txt deleted file mode 100644 index 453bc6f610990e2408c5d483d7c2c4bedbc563ff..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/common/README.txt +++ /dev/null @@ -1,11 +0,0 @@ -This directory contains the examples. Its organization is the following: -- 'lib' directory (optional): jar files shared by all examples, -- 'etc' directory: configuration files shared by all examples, -- 'README' file: explains the organisation of the examples directory, -- Each other directory contains an example. - -The organization of each example directory is the following: -- 'README' file: describes the example and its configuration, -- 'lib' directory (optional): jar files needed by the example, -- 'etc' directory: configuration files needed by the example, -- 'src' directory: source code of the example. diff --git a/fractalrmi/examples/common/build.xml b/fractalrmi/examples/common/build.xml deleted file mode 100644 index 227d1b91e2071cd22a48cd8bd91bec4dcd5e02f4..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/common/build.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/examples/common/etc/build.properties b/fractalrmi/examples/common/etc/build.properties deleted file mode 100644 index 98c5b8c6cc4fc1811ad3483f6a8b75f5db85009b..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/common/etc/build.properties +++ /dev/null @@ -1,33 +0,0 @@ -# Wich compiler do you want use ? - -build.compiler jikes - -# Class path of the ASM library (ASM_1_4_2) -# See http://asm.objectweb.org - -asm.path ../../externals/asm.jar - -# Class path of the Fractal API library (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -fractal.path ../../externals/fractal.jar - -# Class path for the FractalADL parser (FRACTAL_ADL_2_0) -# See http://fractal.objectweb.org - -fractaladl.path ../../externals/fractal-adl.jar:../../externals/dtdparser.jar:../../externals/ow_deployment_scheduling.jar - -# Class path for the Monolog API (MONOLOG_1_7) -# See http://monolog.objectweb.org - -monolog.path ../../externals/ow_util_log_api.jar - -# Class path of FractalRMI (FRACTAL_RMI_0_2) -# See http://fractal.objectweb.org - -fractalrmi.path ../../lib/jonathan.jar:../../lib/fractal-rmi.jar:../../lib/fractal-rmi-tmpl.jar - -# Class path of Julia (JULIA_2_0) -# See http://fractal.objectweb.org - -julia.path ../lib/julia-asm.jar:../lib/julia-mixins.jar:../lib/julia-runtime.jar diff --git a/fractalrmi/examples/common/lib/julia-asm.jar b/fractalrmi/examples/common/lib/julia-asm.jar deleted file mode 100644 index 6a8a7de3de4e80f6315aae586593b3bd0bc57b72..0000000000000000000000000000000000000000 Binary files a/fractalrmi/examples/common/lib/julia-asm.jar and /dev/null differ diff --git a/fractalrmi/examples/common/lib/julia-mixins.jar b/fractalrmi/examples/common/lib/julia-mixins.jar deleted file mode 100644 index 44af2f6006db94f97907c525be68dd9433cb6e1e..0000000000000000000000000000000000000000 Binary files a/fractalrmi/examples/common/lib/julia-mixins.jar and /dev/null differ diff --git a/fractalrmi/examples/common/lib/julia-runtime.jar b/fractalrmi/examples/common/lib/julia-runtime.jar deleted file mode 100644 index b416b02e98d6e6c2433916f0be1c025a9bb1ac2b..0000000000000000000000000000000000000000 Binary files a/fractalrmi/examples/common/lib/julia-runtime.jar and /dev/null differ diff --git a/fractalrmi/examples/rmi/README.txt b/fractalrmi/examples/rmi/README.txt deleted file mode 100644 index 25f6f563970beb3bd04725a1b6f7fba347cb52bc..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -This example shows how the Fractal RMI binder can be used to deploy -Fractal applications in a distributed way. - -The ServerLauncher class constructs an instance of the Fractal RMI binder, -by using the Fractal ADL parser, and then uses this binder to export the -component identity interface of the Fractal bootstrap component. The -remote reference of this interface is then stored on disk. - -The ClientLauncher class also constructs an instance of the Fractal RMI -binder, and uses it to create a remote binding to the previously exported -interface. It then constructs the composite template of the application -normally, by using the Fractal API. The only difference with the hello -world example is that two bootstrap components are used (a local one and -a remote one, which is used exactly as if it were local - distribution is -transparent). When the template factory interface of the remote bootstrap -component is used to create a template, this template is created in the -same JVM as the bootstrap component, i.e., remotely. The resulting -composite template therefore contains a local sub template, for the -client, and a remote sub template, for the server. When this template is -instantiated, each sub template creates an instance it is own JVM, which -results in a composite component with a local client sub component, and -a remote server sub component. - -Note: this example also shows the dynamic class loading feature of the -Fractal RMI binder. For example, the ServerImpl class, which is not -included in the classpath of the ServerLauncher, is dynamically -downloaded from the deployer host when the server template is remotely -created. This dynamic loading feature reuses the Java RMI mechanisms, -which use the java.rmi.server.codebase system property, and which -require a SecurityManager. diff --git a/fractalrmi/examples/rmi/build.xml b/fractalrmi/examples/rmi/build.xml deleted file mode 100644 index 5815e392962fb15efa6b4202b657cbe1beecdcf4..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/build.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/ClientImpl.java b/fractalrmi/examples/rmi/clt/rmi/clt/ClientImpl.java deleted file mode 100644 index fedd4198bc12848fa291a54c4297027ef6ff3a47..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/ClientImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package rmi.clt; - -import org.objectweb.fractal.api.control.BindingController; - -public class ClientImpl implements Main, BindingController { - - private Service service; - - public ClientImpl () { - System.err.println("CLIENT CREATED"); - } - - public void main (final String[] args) { - service.print("hello world"); - ///* - int l = 0; - float n = 0; - float total = 0; - while (true) { - long t = System.currentTimeMillis(); - for (int i = 0; i < 10000; ++i) { - service.init(); - } - float d = System.currentTimeMillis() - t; - ++l; - if (l > 5) { - d = d/10000f; - n = n + 1; - total = total + d; - System.err.println( - "empty remote method call: " + d + " ms (mean = " + total/n+ ")"); - } - } - //*/ - } - - public String[] listFc () { - return new String[] { "s" }; - } - - public Object lookupFc (final String cItf) { - if (cItf.equals("s")) { - return service; - } - return null; - } - - public void bindFc (final String cItf, final Object sItf) { - if (cItf.equals("s")) { - service = (Service)sItf; - } - } - - public void unbindFc (final String cItf) { - if (cItf.equals("s")) { - service = null; - } - } -} diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/ClientLauncher.java b/fractalrmi/examples/rmi/clt/rmi/clt/ClientLauncher.java deleted file mode 100644 index e0e7d25342453d76d0d1af9d0cf573f3b4c958ba..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/ClientLauncher.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package rmi.clt; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; - -import org.objectweb.fractal.api.Component; - -import org.objectweb.fractal.rmi.registry.NamingService; -import org.objectweb.fractal.rmi.registry.Registry; - -import org.objectweb.fractal.util.Fractal; - -public class ClientLauncher { - - public static void main (final String[] args) throws Exception { - // the RMI class loader does not work if there is no security manager - System.setSecurityManager(new SecurityManager()); - - boolean useWrapper = false; - for (int i = 0; i < args.length; ++i) { - useWrapper |= args[i].equals("wrapper"); - } - - NamingService ns = Registry.getRegistry(); - - String name = useWrapper ? "rmi.clt.WrappedClientServer" : "rmi.clt.ClientServer"; - - Map context = new HashMap(); - context.put("remote-node", ns.lookup("server-host")); - - Factory f = FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component c = (Component)f.newComponent(name, context); - - // start root component - Fractal.getLifeCycleController(c).startFc(); - - // call main method - ((Main)c.getFcInterface("m")).main(new String[0]); - } -} diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/ClientServer.fractal b/fractalrmi/examples/rmi/clt/rmi/clt/ClientServer.fractal deleted file mode 100644 index c979f340e0e13468a057a538132485ba1e149d99..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/ClientServer.fractal +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/Main.java b/fractalrmi/examples/rmi/clt/rmi/clt/Main.java deleted file mode 100644 index fe9034160fe8422a87b1dbbc1ad39cece4a62a70..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package rmi.clt; - -public interface Main { - void main (String[] args); -} diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/ServerImpl.java b/fractalrmi/examples/rmi/clt/rmi/clt/ServerImpl.java deleted file mode 100644 index 6b6c6ba052dadb3573ca04f0e350dd5ee3dc5a48..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/ServerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package rmi.clt; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header = ""; - - private int count = 0; - - public ServerImpl () { - System.err.println("SERVER CREATED"); - } - - public void init () { - } - - public void print (final String msg) { - new Exception() { - public String toString () { - return "Server: print method called"; - } - }.printStackTrace(); - System.err.println("Server: begin printing..."); - for (int i = 0; i < count; ++i) { - System.err.println(header + msg); - } - System.err.println("Server: print done."); - } - - public String getHeader () { - return header; - } - - public void setHeader (final String header) { - this.header = header; - } - - public int getCount () { - return count; - } - - public void setCount (final int count) { - this.count = count; - } -} diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/Service.java b/fractalrmi/examples/rmi/clt/rmi/clt/Service.java deleted file mode 100644 index 98306c0777191a1136ac69eb956467326547f174..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/Service.java +++ /dev/null @@ -1,29 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package rmi.clt; - -public interface Service { - void init (); - void print (String msg); -} diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/ServiceAttributes.java b/fractalrmi/examples/rmi/clt/rmi/clt/ServiceAttributes.java deleted file mode 100644 index e98819437368131fb4d06d0cf92c9c6fa045eaf3..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/ServiceAttributes.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package rmi.clt; - -import org.objectweb.fractal.api.control.AttributeController; - -public interface ServiceAttributes extends AttributeController { - String getHeader (); - void setHeader (String header); - int getCount (); - void setCount (int count); -} diff --git a/fractalrmi/examples/rmi/clt/rmi/clt/WrappedClientServer.fractal b/fractalrmi/examples/rmi/clt/rmi/clt/WrappedClientServer.fractal deleted file mode 100644 index c7c2eb472c539e74ca8491a671aff988fa973260..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/clt/rmi/clt/WrappedClientServer.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/examples/rmi/etc/execute.properties b/fractalrmi/examples/rmi/etc/execute.properties deleted file mode 100644 index e5cbd2e3f391c76bc804ed98c2668aafdf78713d..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/etc/execute.properties +++ /dev/null @@ -1,38 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -# the java.rmi.server.codebase URL is used to annotate classes when -# they are marshalled and sent remotely, so that the remote host can -# download then from this URL if it does have this class in its own -# classpath. This property is not needed for the hosts on which the -# application is deployed. It is needed only for the deployer host. - -run.clt.jvm.parameters \ - -Djava.security.policy=etc/java.policy \ - -Djava.rmi.server.codebase=file:build/clt/ \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -run.srv.jvm.parameters \ - -Djava.security.policy=etc/java.policy \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -run.ns.jvm.parameters \ - -Djava.security.policy=etc/java.policy \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -# Java class to be launched - -run.clt.classname rmi.clt.ClientLauncher -run.srv.classname rmi.srv.ServerLauncher - -# Application arguments - -run.clt.parameters wrapper -run.srv.parameters diff --git a/fractalrmi/examples/rmi/etc/java.policy b/fractalrmi/examples/rmi/etc/java.policy deleted file mode 100644 index abf784729561866d356188979e5d77c2635c620b..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/etc/java.policy +++ /dev/null @@ -1,4 +0,0 @@ -grant { - // Allow everything for now - permission java.security.AllPermission; -}; diff --git a/fractalrmi/examples/rmi/etc/julia.cfg b/fractalrmi/examples/rmi/etc/julia.cfg deleted file mode 100644 index 8c35125c35c6ea2c2e8f3f007fbdf08dc8850a92..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/etc/julia.cfg +++ /dev/null @@ -1,614 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -# no custom definitions diff --git a/fractalrmi/examples/rmi/srv/rmi/srv/ServerLauncher.java b/fractalrmi/examples/rmi/srv/rmi/srv/ServerLauncher.java deleted file mode 100644 index 357e621ee623f458b13a4b764535dee52187d669..0000000000000000000000000000000000000000 --- a/fractalrmi/examples/rmi/srv/rmi/srv/ServerLauncher.java +++ /dev/null @@ -1,41 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package rmi.srv; -import org.objectweb.fractal.rmi.registry.NamingService; -import org.objectweb.fractal.rmi.registry.Registry; - -import org.objectweb.fractal.util.Fractal; - -public class ServerLauncher { - - public static void main (final String[] args) throws Exception { - // the RMI class loader does not work if there is no security manager - System.setSecurityManager(new SecurityManager()); - - NamingService ns = Registry.getRegistry(); - ns.bind("server-host", Fractal.getBootstrapComponent()); - - System.err.println("Server ready."); - } -} diff --git a/fractalrmi/externals/README.txt b/fractalrmi/externals/README.txt deleted file mode 100644 index 336e5a5f98d9fbe884814c08329ea286ea55a00a..0000000000000000000000000000000000000000 --- a/fractalrmi/externals/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the external libraries required for running the product. diff --git a/fractalrmi/externals/asm.jar b/fractalrmi/externals/asm.jar deleted file mode 100644 index 41e00315ffb0dbd0a386c5a7d39f3bea178804ee..0000000000000000000000000000000000000000 Binary files a/fractalrmi/externals/asm.jar and /dev/null differ diff --git a/fractalrmi/externals/dtdparser.jar b/fractalrmi/externals/dtdparser.jar deleted file mode 100644 index ddb33dc33e512b1394953e10a83d1fdad438dffc..0000000000000000000000000000000000000000 Binary files a/fractalrmi/externals/dtdparser.jar and /dev/null differ diff --git a/fractalrmi/externals/fractal-adl.jar b/fractalrmi/externals/fractal-adl.jar deleted file mode 100644 index 2df7d57c362e43a33cecfce8a011cbd2f4575293..0000000000000000000000000000000000000000 Binary files a/fractalrmi/externals/fractal-adl.jar and /dev/null differ diff --git a/fractalrmi/externals/fractal.jar b/fractalrmi/externals/fractal.jar deleted file mode 100644 index 6bf74c05aaf416490008ba43dce643df09adbbd5..0000000000000000000000000000000000000000 Binary files a/fractalrmi/externals/fractal.jar and /dev/null differ diff --git a/fractalrmi/externals/ow_deployment_scheduling.jar b/fractalrmi/externals/ow_deployment_scheduling.jar deleted file mode 100644 index 0f20b080a8d0979254b548c52dd40437060386ea..0000000000000000000000000000000000000000 Binary files a/fractalrmi/externals/ow_deployment_scheduling.jar and /dev/null differ diff --git a/fractalrmi/externals/ow_util_log_api.jar b/fractalrmi/externals/ow_util_log_api.jar deleted file mode 100644 index 49cc3ace10fddc9973b7900bfc63501f0652abae..0000000000000000000000000000000000000000 Binary files a/fractalrmi/externals/ow_util_log_api.jar and /dev/null differ diff --git a/fractalrmi/jdoc/README.txt b/fractalrmi/jdoc/README.txt deleted file mode 100644 index a78cb67fa8d1679fe5fd3fe8efc3aab86e5b6db8..0000000000000000000000000000000000000000 --- a/fractalrmi/jdoc/README.txt +++ /dev/null @@ -1,39 +0,0 @@ -This directory contains ant files to build the javadocs of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one javadoc. - -- As there may exist several javadocs, all javadocs must be produced - in a sub dir of ${out.dist.jdoc}. For example the user javadoc could be - produced into the ${out.dist.jdoc}/user directory - -- The name of the ant file must be the name of the destination directory of the - javadoc it builds. - -- Only the default task is called on an xml file. - -Sample ant file: - - - - - - - - - - - - - - - - - - ... - - - - diff --git a/fractalrmi/jdoc/asm-list/package-list b/fractalrmi/jdoc/asm-list/package-list deleted file mode 100644 index a5d8120a2ddf779ee56f5caf3a59dd10c76e8f01..0000000000000000000000000000000000000000 --- a/fractalrmi/jdoc/asm-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.asm diff --git a/fractalrmi/jdoc/fractal-list/package-list b/fractalrmi/jdoc/fractal-list/package-list deleted file mode 100644 index 0c7ce27ea081eefb65b09e2cd0f5866cd084660f..0000000000000000000000000000000000000000 --- a/fractalrmi/jdoc/fractal-list/package-list +++ /dev/null @@ -1,4 +0,0 @@ -org.objectweb.fractal.api -org.objectweb.fractal.api.control -org.objectweb.fractal.api.factory -org.objectweb.fractal.api.type diff --git a/fractalrmi/jdoc/fractal-rmi.xml b/fractalrmi/jdoc/fractal-rmi.xml deleted file mode 100644 index 5ddd4e981f7efbfd4ffebd2c650776252632eaf2..0000000000000000000000000000000000000000 --- a/fractalrmi/jdoc/fractal-rmi.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/jdoc/jdk-list/package-list b/fractalrmi/jdoc/jdk-list/package-list deleted file mode 100644 index 7f582f053dd0c03fe4df1013b086217010da00f1..0000000000000000000000000000000000000000 --- a/fractalrmi/jdoc/jdk-list/package-list +++ /dev/null @@ -1,76 +0,0 @@ -java.applet -java.awt -java.awt.color -java.awt.datatransfer -java.awt.dnd -java.awt.event -java.awt.font -java.awt.geom -java.awt.im -java.awt.im.spi -java.awt.image -java.awt.image.renderable -java.awt.print -java.beans -java.beans.beancontext -java.io -java.lang -java.lang.ref -java.lang.reflect -java.math -java.net -java.rmi -java.rmi.activation -java.rmi.dgc -java.rmi.registry -java.rmi.server -java.security -java.security.acl -java.security.cert -java.security.interfaces -java.security.spec -java.sql -java.text -java.util -java.util.jar -java.util.zip -javax.accessibility -javax.naming -javax.naming.directory -javax.naming.event -javax.naming.ldap -javax.naming.spi -javax.rmi -javax.rmi.CORBA -javax.sound.midi -javax.sound.midi.spi -javax.sound.sampled -javax.sound.sampled.spi -javax.swing -javax.swing.border -javax.swing.colorchooser -javax.swing.event -javax.swing.filechooser -javax.swing.plaf -javax.swing.plaf.basic -javax.swing.plaf.metal -javax.swing.plaf.multi -javax.swing.table -javax.swing.text -javax.swing.text.html -javax.swing.text.html.parser -javax.swing.text.rtf -javax.swing.tree -javax.swing.undo -javax.transaction -org.omg.CORBA -org.omg.CORBA_2_3 -org.omg.CORBA_2_3.portable -org.omg.CORBA.DynAnyPackage -org.omg.CORBA.ORBPackage -org.omg.CORBA.portable -org.omg.CORBA.TypeCodePackage -org.omg.CosNaming -org.omg.CosNaming.NamingContextPackage -org.omg.SendingContext -org.omg.stub.java.rmi diff --git a/fractalrmi/jdoc/jonathan-list/package-list b/fractalrmi/jdoc/jonathan-list/package-list deleted file mode 100644 index d4201d9f6fb3d7002aaae78108d6e8fc1c76a7f4..0000000000000000000000000000000000000000 --- a/fractalrmi/jdoc/jonathan-list/package-list +++ /dev/null @@ -1,8 +0,0 @@ -org.objectweb.jonathan.apis -org.objectweb.jonathan.apis.kernel -org.objectweb.jonathan.apis.binding -org.objectweb.jonathan.apis.presentation -org.objectweb.jonathan.apis.protocols -org.objectweb.jonathan.apis.protocols.ip -org.objectweb.jonathan.apis.resources -org.objectweb.jonathan.apis.stub_factories diff --git a/fractalrmi/jdoc/monolog-list/package-list b/fractalrmi/jdoc/monolog-list/package-list deleted file mode 100644 index 1ed8775b725c050c235db5e1b94388c144232567..0000000000000000000000000000000000000000 --- a/fractalrmi/jdoc/monolog-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.util.monolog.api diff --git a/fractalrmi/src/org/objectweb/fractal/jonathan/JConnectionMgr.java b/fractalrmi/src/org/objectweb/fractal/jonathan/JConnectionMgr.java deleted file mode 100644 index 34556e06697a601a4992ce085816ff6567e867c5..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/jonathan/JConnectionMgr.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.jonathan; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.jonathan.apis.protocols.ip.TcpIpConnectionMgr; - -/** - * A Fractal compliant {@link - * org.objectweb.jonathan.libs.resources.tcpip.JConnectionMgr} subclass. - */ - -public class JConnectionMgr - extends org.objectweb.jonathan.libs.resources.tcpip.JConnectionMgr - implements BindingController -{ - - public JConnectionMgr () { - super(5, null); - } - - public String[] listFc () { - return new String[] { "delegate-factory" }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("delegate-factory")) { - return factory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("delegate-factory")) { - factory = (TcpIpConnectionMgr)serverItf; - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("delegate-factory")) { - factory = null; - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/jonathan/JContextFactory.java b/fractalrmi/src/org/objectweb/fractal/jonathan/JContextFactory.java deleted file mode 100644 index 4f096288f425d4b614a9201d02dcd3d15ea9165b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/jonathan/JContextFactory.java +++ /dev/null @@ -1,172 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.jonathan; - -import org.objectweb.jonathan.apis.kernel.Component; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.kernel.Element; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.kernel.Name; - -import java.util.Enumeration; -import java.util.HashMap; - -/** - * A minimal and Fractal compliant {@link ContextFactory} implementation. - */ - -public class JContextFactory implements ContextFactory { - - public Context newContext () { - return new JContext(); - } - - public Context newContext (Context context) { - return new JContext(); - } - - /** - * A minimal implementation of the {@link Context} interface. - */ - - static class JContext extends HashMap implements Context { - - public void acquire () { - } - - public Element addElement (Name name, Class aClass, int i) { - throw new RuntimeException("Not implemented"); - } - - public Element addElement (Name name, Class aClass, Object o) { - throw new RuntimeException("Not implemented"); - } - - public Element addElement (Name name, Component component) { - throw new RuntimeException("Not implemented"); - } - - public Element addElement (String s, Class aClass, int i, char c) { - put(s, new Integer(i)); - return null; - } - - public Element addElement (String s, Class aClass, Object o, char c) { - put(s, o); - return null; - } - - public Element addElement (String s, Component component, char c) { - throw new RuntimeException("Not implemented"); - } - - public Context addOrGetContext (Name name) { - throw new RuntimeException("Not implemented"); - } - - public Context addOrGetContext (String s, char c) { - throw new RuntimeException("Not implemented"); - } - - public Component fork () { - throw new RuntimeException("Not implemented"); - } - - public Component getComponent (Name name) { - throw new RuntimeException("Not implemented"); - } - - public Component getComponent (String s, char c) { - throw new RuntimeException("Not implemented"); - } - - public Element getElement (Name name) { - throw new RuntimeException("Not implemented"); - } - - public Element getElement (String s, char c) { - throw new RuntimeException("Not implemented"); - } - - public Enumeration getElements () { - throw new RuntimeException("Not implemented"); - } - - public Object getFactoryValue () throws JonathanException { - throw new RuntimeException("Not implemented"); - } - - public int getIntValue () { - throw new RuntimeException("Not implemented"); - } - - public int getIntValue (Name name) { - throw new RuntimeException("Not implemented"); - } - - public int getIntValue (String s, char c) { - return ((Integer)get(s)).intValue(); - } - - public Element getReference () { - throw new RuntimeException("Not implemented"); - } - - public Context getScope () { - throw new RuntimeException("Not implemented"); - } - - public Class getType () { - throw new RuntimeException("Not implemented"); - } - - public Object getValue () { - throw new RuntimeException("Not implemented"); - } - - public Object getValue (Name name) { - throw new RuntimeException("Not implemented"); - } - - public Object getValue (String s, char c) { - return get(s); - } - - public void release () { - } - - public void reset () { - throw new RuntimeException("Not implemented"); - } - - public Element setReference (Element element) { - throw new RuntimeException("Not implemented"); - } - - public Context setScope (Context context) { - throw new RuntimeException("Not implemented"); - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/jonathan/JScheduler.java b/fractalrmi/src/org/objectweb/fractal/jonathan/JScheduler.java deleted file mode 100644 index c993b2963c941d27c5dd050fcf3bf1ac368a4249..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/jonathan/JScheduler.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.jonathan; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.jonathan.apis.kernel.ContextFactory; - -/** - * A Fractal compliant {@link org.objectweb.jonathan.libs.resources.JScheduler} - * subclass. - */ - -public class JScheduler - extends org.objectweb.jonathan.libs.resources.JScheduler - implements BindingController -{ - - public JScheduler () { - super(null); - } - - public String[] listFc () { - return new String[] { "context-factory" }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("context-factory")) { - return context_factory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("context-factory")) { - context_factory = (ContextFactory)serverItf; - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("context-factory")) { - context_factory = null; - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/jonathan/TcpIpProtocol.java b/fractalrmi/src/org/objectweb/fractal/jonathan/TcpIpProtocol.java deleted file mode 100644 index 2ed8250aa603c4190de3947b13e493c619ec7beb..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/jonathan/TcpIpProtocol.java +++ /dev/null @@ -1,100 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.jonathan; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.presentation.MarshallerFactory; -import org.objectweb.jonathan.apis.protocols.ip.TcpIpConnectionMgr; -import org.objectweb.jonathan.apis.resources.ChunkFactory; -import org.objectweb.jonathan.apis.resources.Scheduler; - -/** - * A Fractal compliant {@link - * org.objectweb.jonathan.libs.protocols.tcpip.TcpIpProtocol} subclass. - */ - -public class TcpIpProtocol - extends org.objectweb.jonathan.libs.protocols.tcpip.TcpIpProtocol - implements BindingController -{ - - public TcpIpProtocol () { - super(null, null, null, null, null); - } - - public String[] listFc () { - return new String[] { - "connection-factory", - "marshaller-factory", - "chunk-factory", - "scheduler", - "context-factory" - }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("connection-factory")) { - return connection_mgr; - } else if (clientItfName.equals("marshaller-factory")) { - return marshaller_factory; - } else if (clientItfName.equals("chunk-factory")) { - return chunk_factory; - } else if (clientItfName.equals("scheduler")) { - return scheduler; - } else if (clientItfName.equals("context-factory")) { - return context_factory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("connection-factory")) { - connection_mgr = (TcpIpConnectionMgr)serverItf; - } else if (clientItfName.equals("marshaller-factory")) { - marshaller_factory = (MarshallerFactory)serverItf; - } else if (clientItfName.equals("chunk-factory")) { - chunk_factory = (ChunkFactory)serverItf; - } else if (clientItfName.equals("scheduler")) { - scheduler = (Scheduler)serverItf; - } else if (clientItfName.equals("context-factory")) { - context_factory = (ContextFactory)serverItf; - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("connection-factory")) { - connection_mgr = null; - } else if (clientItfName.equals("marshaller-factory")) { - marshaller_factory = null; - } else if (clientItfName.equals("chunk-factory")) { - chunk_factory = null; - } else if (clientItfName.equals("scheduler")) { - scheduler = null; - } else if (clientItfName.equals("context-factory")) { - context_factory = null; - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/jonathan/package.html b/fractalrmi/src/org/objectweb/fractal/jonathan/package.html deleted file mode 100644 index d5d9197de400f4221cc8bccdf43a409f80c0c0f4..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/jonathan/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -Provides Fractal compliant sub classes of some Jonathan classes. - -@since Fractal 1.0.6 - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/Binder.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/Binder.fractal deleted file mode 100644 index b2eeff4a4c6a9075e333a6b5e4dce243741c066e..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/Binder.fractal +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/BinderType.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/BinderType.fractal deleted file mode 100644 index f75253d3adff351563228cbc4553798c150f5265..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/BinderType.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/ORB.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/ORB.fractal deleted file mode 100644 index b1c9a6de6f7e5d137b482729a9eb7bfb357c4ca2..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/ORB.fractal +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/ORBType.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/ORBType.fractal deleted file mode 100644 index 068f66b0c9827ec5037cd9cbc283a1e876db031a..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/ORBType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RemoteException.java b/fractalrmi/src/org/objectweb/fractal/rmi/RemoteException.java deleted file mode 100644 index b2fc81229a92bcc6fbb59aa0b3aee64c7fe6974b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RemoteException.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.rmi; - -/** - * Thrown when a remote method invocation fails for a "non functional" reason. - * This exception is a runtime exception, so that users do not need to declare - * it in every method of every Fractal interface that can be accessed remotely - * (such as the interfaces of the Fractal API). - */ - -public class RemoteException extends RuntimeException { - - /** - * The exception that caused the remote method invocation failure. - */ - - public final Exception exception; - - /** - * Constructs a new {@link RemoteException}. - * - * @param msg a detail message. - * @param exception the exception that caused the method invocation failure. - */ - - public RemoteException (final String msg, final Exception exception) { - super(msg + ": " + exception); - this.exception = exception; - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapter.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapter.fractal deleted file mode 100644 index a7986339f33f59211dd77c5879955d14e4d85c23..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapter.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapter.java b/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapter.java deleted file mode 100644 index 6274f43493dd0e6da9e707b5e96f3179fe552a31..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapter.java +++ /dev/null @@ -1,329 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.jonathan.libs.binding.moa.MinimalAdapter (author: B. Dumant) - * with some comments copied from: - * org.objectweb.jonathan.apis.binding.NamingContext (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.fractal.rmi.stub.SkeletonFactory; - -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; - -import org.objectweb.util.monolog.api.BasicLevel; -import org.objectweb.util.monolog.api.Logger; -import org.objectweb.util.monolog.api.LoggerFactory; - -import java.util.HashMap; - -/** - * Provides a very simple object adapter component. This naming context exports - * an object in the following way: - *

    - *
  • if the object has already been exported, the corresponding {@link - * Identifier} is returned directly.
  • - *
  • otherwise a skeleton is created to give access to the interface - * implemented by the object (the object must implement at least one interface. - * If it implements more than one, the first one is selected).
  • - *
  • a new identifier is created for this skeleton. This identifer is just - * an integer value.
  • - *
  • the skeleton is associated to this new identifier in an internal hash - * table.
  • - *
  • the identifier is returned to the caller.
  • - *
- */ - -public class RmiAdapter - implements NamingContext, Runnable, BindingController -{ - - /** - * The skeleton factory used to create skeletons for the exported objects. - */ - - protected SkeletonFactory skeletonFactory; - - /** - * The optional logger factory used to get a logger for this component. - */ - - protected LoggerFactory loggerFactory; - - /** - * The logger used to log messages. May be null. - */ - - protected Logger logger; - - /** - * A map associating skeletons to Integer objects, and Id to already exported - * objects. - */ - - private HashMap map; - - /** - * A counter used to generate unique object identifiers. - */ - - private int counter; - - /** - * The daemon thread used to keep the JVM process alive. - */ - - private Thread waiter; - - /** - * Constructs a new {@link RmiAdapter}. - */ - - public RmiAdapter () { - map = new HashMap(); - } - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc () { - return new String[] { "skeleton-factory", "logger-factory" }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("skeleton-factory")) { - return skeletonFactory; - } else if (clientItfName.equals("logger-factory")) { - return loggerFactory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("skeleton-factory")) { - skeletonFactory = (SkeletonFactory)serverItf; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = (LoggerFactory)serverItf; - logger = loggerFactory.getLogger(getClass().getName()); - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("skeleton-factory")) { - skeletonFactory = null; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = null; - logger = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the NamingContext interface - // -------------------------------------------------------------------------- - - /** - * Creates a new identifier for the object interface designated by the - * obj parameter. Note that calling the {@link Identifier#resolve() - * resolve} method on the returned identifier should return id. - * - * @param obj an object. - * @param hints additional information. - * @return an identifier managed by the target naming context. - * @throws JonathanException if something goes wrong. - */ - - public Identifier export (final Object obj, final Context hints) - throws JonathanException - { - synchronized (this) { - // checks if the object has already been exported - Id id = (Id)map.get(obj); - if (id == null) { - // if not, exports it - if (waiter == null) { - waiter = new Thread(this); - waiter.start(); - } - Integer key = null; - if (hints != null) { - key = (Integer)hints.getValue("key", (char)0); - if (key != null && key.intValue() >= 0) { - throw new JonathanException( - "Cannot export objects with positive user specified keys"); - } - if (key != null && map.get(key) != null) { - throw new JonathanException("Key " + key + " aleady used"); - } - } - if (key == null) { - key = new Integer(counter++); - } - id = new Id(key); - Object skel = skeletonFactory.newSkeleton(obj); - map.put(key, skel); - map.put(obj, id); - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log( - BasicLevel.INFO, "Object " + obj + " exported with key " + key); - } - } - return id; - } - } - - /** - * Decodes an identifier from a buffer portion. Since identifiers are likely - * to be transmitted on the net, they may have to be encoded and decoded. The - * {@link Identifier#encode() encoding} method is borne by the {@link - * Identifier} interface, but the decoding methods must be borne by - * each naming context. This method creates an identifier (associated - * with the target naming context), from the length bytes of - * data starting at offset offset. - * - * @param data the byte array to read the encoded identifier from. - * @param offset offset of the first byte of the encoding. - * @param length length of the encoding. - * @return a decoded identifier. - * @throws JonathanException if something goes wrong. - */ - - public Identifier decode ( - final byte[] data, - final int offset, - final int length) throws JonathanException - { - int key = - ((data[offset] & 0xFF) << 24) + - ((data[offset + 1] & 0xFF) << 16) + - ((data[offset + 2] & 0xFF) << 8) + - (data[offset + 3] & 0xFF); - return new Id(new Integer(key)); - } - - /** - * Decodes an identifier from the provided unmarshaller. - * - * @param u an unmarhaller; - * @return an identifier managed by the target naming context; - * @throws JonathanException if something goes wrong. - */ - - public Identifier decode (final UnMarshaller u) throws JonathanException { - return new Id(new Integer(u.readInt())); - } - - // -------------------------------------------------------------------------- - // Implementation of the Runnable interface - // -------------------------------------------------------------------------- - - /** - * Blocks the caller thread. This method is used to create a "daemon" thread - * when the {@link #export export} method is called for the time, in order to - * keep the JVM process alive, waiting for incoming remote method calls. - */ - - public void run () { - Object o = new Object(); - synchronized (o) { - try { - o.wait(); - } catch (Exception e) { - } - } - } - - // -------------------------------------------------------------------------- - // Utility class - // -------------------------------------------------------------------------- - - class Id implements Identifier { - - Integer key; - - public Id (final Integer key) { - this.key = key; - } - - public NamingContext getContext () { - return RmiAdapter.this; - } - - public Object bind (final Identifier[] ref, final Context hints) { - return map.get(key); - } - - public void unexport () { - map.remove(key); - } - - public boolean isValid () { - return map.containsKey(key); - } - - public Object resolve () { - Object o = map.get(key); - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.INFO, "Key " + key + " resolved to " + o); - } - return o; - } - - public byte[] encode () { - int key = this.key.intValue(); - return new byte[] { - (byte)((key >>> 24) & 0xFF), - (byte)((key >>> 16) & 0xFF), - (byte)((key >>> 8) & 0xFF), - (byte)(key & 0xFF) - }; - } - - public void encode (final Marshaller m) throws JonathanException { - m.writeInt(key.intValue()); - } - - public boolean equals (final Object o) { - if (o instanceof Id) { - return key.intValue() == ((Id)o).key.intValue(); - } - return false; - } - - public int hashCode () { - return key.intValue(); - } - - public String toString () { - return "Id[" + key.intValue() + "]"; - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapterType.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapterType.fractal deleted file mode 100644 index d3b1676430caf6307fc10e1b83d8e473b0789bb9..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiAdapterType.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinder.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinder.fractal deleted file mode 100644 index efd82f91f3339b100185f2f3eb3fcf43f56ebaa1..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinder.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinder.java b/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinder.java deleted file mode 100644 index e544316d9f71657a46399615ee64bd3db57c7ea3..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinder.java +++ /dev/null @@ -1,428 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.david.libs.binding.iiop.IIOPBinder (author: B. Dumant) - * with some comments copied from: - * org.objectweb.jonathan.apis.binding.NamingContext (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; -import org.objectweb.jonathan.apis.protocols.Protocol; -import org.objectweb.jonathan.apis.protocols.ProtocolGraph; -import org.objectweb.jonathan.apis.protocols.RequestSession; -import org.objectweb.jonathan.apis.protocols.SessionIdentifier; -import org.objectweb.jonathan.apis.stub_factories.StubFactory; - -import org.objectweb.util.monolog.api.BasicLevel; -import org.objectweb.util.monolog.api.Logger; -import org.objectweb.util.monolog.api.LoggerFactory; - -import java.util.Properties; -import java.util.HashMap; -import java.util.Map; - -/** - * Provides a very simple binder component to create distributed bindings. - *

- * To export an object, this naming context first exports it through an object - * adapter, whose role is to assign an object key to this object, and to return - * it in an {@link Identifier}. This identifier is then encapsulated, together - * with a host name and a port number, in a new {@link Identifier}, which is - * returned to the caller. - *

- * To create a binding to an object identified by such an identifier, this - * naming context creates a session identifier with the host name, the port - * number and the object key, by using the transport and invocation protocols. - * A stub is then created with the session and the object identifiers, by using - * the stub factory. Finally this stub is returned to the caller. - */ - -public class RmiBinder implements NamingContext, BindingController { - - /** - * The object adapter used to export objects before exporting them with this - * naming context. - */ - - protected NamingContext adapter; - - /** - * The factory used to create bindings to the objects identified by the names - * managed by this context. - */ - - protected StubFactory stubFactory; - - /** - * The context factory used to create hints for various methods. - */ - - protected ContextFactory contextFactory; - - /** - * The invocation protocol used to send invocation messages. - */ - - protected Protocol rmi; - - /** - * The transport protocol used by the invocation protocol to send its - * messages. - */ - - protected Protocol tcp; - - /** - * The optional logger factory used to get a logger for this component. - */ - - protected LoggerFactory loggerFactory; - - /** - * The logger used to log messages. May be null. - */ - - protected Logger logger; - - /** - * A map associating the identifiers of the available sessions to their TCP - * port number. - */ - - private Map sessionIdentifiers; - - /** - * Constructs a new {@link RmiBinder}. - */ - - public RmiBinder () { - sessionIdentifiers = new HashMap(); - } - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc () { - return new String[] { - "adapter", - "stub-factory", - "context-factory", - "rmi-protocol", - "tcp-protocol", - "logger-factory" - }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("adapter")) { - return adapter; - } else if (clientItfName.equals("stub-factory")) { - return stubFactory; - } else if (clientItfName.equals("context-factory")) { - return contextFactory; - } else if (clientItfName.equals("rmi-protocol")) { - return rmi; - } else if (clientItfName.equals("tcp-protocol")) { - return tcp; - } else if (clientItfName.equals("logger-factory")) { - return loggerFactory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("adapter")) { - adapter = (NamingContext)serverItf; - } else if (clientItfName.equals("stub-factory")) { - stubFactory = (StubFactory)serverItf; - } else if (clientItfName.equals("context-factory")) { - contextFactory = (ContextFactory)serverItf; - } else if (clientItfName.equals("rmi-protocol")) { - rmi = (Protocol)serverItf; - } else if (clientItfName.equals("tcp-protocol")) { - tcp = (Protocol)serverItf; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = (LoggerFactory)serverItf; - logger = loggerFactory.getLogger(getClass().getName()); - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("adapter")) { - adapter = null; - } else if (clientItfName.equals("stub-factory")) { - stubFactory = null; - } else if (clientItfName.equals("context-factory")) { - contextFactory = null; - } else if (clientItfName.equals("rmi-protocol")) { - rmi = null; - } else if (clientItfName.equals("tcp-protocol")) { - tcp = null; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = null; - logger = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the NamingContext interface - // -------------------------------------------------------------------------- - - /** - * Creates a new identifier for the object interface designated by the - * obj parameter. Note that calling the {@link Identifier#resolve() - * resolve} method on the returned identifier should return id. - * - * @param obj an object. - * @param hints additional information. - * @return an identifier managed by the target naming context. - * @throws JonathanException if something goes wrong. - */ - - public Identifier export ( - final Object obj, - final Context hints) throws JonathanException - { - int port = 0; - if (hints != null) { - Integer i = (Integer)hints.getValue("port", (char)0); - if (i != null) { - port = i.intValue(); - } - } - - SessionIdentifier sid = null; - - if (port == 0) { - // no port specified -> use the first available session id, if any - if (sessionIdentifiers.size() > 0) { - sid = (SessionIdentifier)sessionIdentifiers.values().iterator().next(); - } - } else { - // finds the session id corresponding to the specified port - sid = (SessionIdentifier)sessionIdentifiers.get(new Integer(port)); - } - - if (sid == null) { - Context phints = contextFactory.newContext(); - phints.addElement("port", Integer.class, new Integer(port), (char)0); - ProtocolGraph pgraph = rmi.createProtocolGraph( - new ProtocolGraph[] { - tcp.createProtocolGraph(new ProtocolGraph[0], phints) - }, - phints); - phints.release(); - sid = pgraph.export(null); - Context ctxt = sid.next()[0].getInfo(); - port = ((Integer)ctxt.getValue("port", (char)0)).intValue(); - sessionIdentifiers.put(new Integer(port), sid); - } - - Context ctxt = sid.next()[0].getInfo(); - String host = (String)ctxt.getValue("hostname", (char)0); - port = ((Integer)ctxt.getValue("port", (char)0)).intValue(); - - Identifier id = new Id(host, port, adapter.export(obj, hints)); - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.INFO, "Object " + obj + " exported with id " + id); - } - return id; - } - - /** - * Decodes an identifier from a buffer portion. Since identifiers are likely - * to be transmitted on the net, they may have to be encoded and decoded. The - * {@link Identifier#encode() encoding} method is borne by the {@link - * Identifier} interface, but the decoding methods must be borne by - * each naming context. This method creates an identifier (associated - * with the target naming context), from the length bytes of - * data starting at offset offset. - * - * @param data the byte array to read the encoded identifier from. - * @param offset offset of the first byte of the encoding. - * @param length length of the encoding. - * @return a decoded identifier. - * @throws JonathanException if something goes wrong. - */ - - public Identifier decode ( - final byte[] data, - final int offset, - final int length) throws JonathanException - { - int port = ((data[offset] & 0xFF) << 24) + - ((data[offset + 1] & 0xFF) << 16) + - ((data[offset + 2] & 0xFF) << 8) + - (data[offset + 3] & 0xFF); - int len = ((data[offset + 4] & 0xFF) << 8) + - (data[offset + 5] & 0xFF); - char[] host = new char[len]; - for (int i = 0; i < len; ++i) { - host[i] = (char)(data[offset + 6 + i] & 0xFF); - } - Identifier next = adapter.decode(data, offset + 6 + len, length - 6 - len); - return new Id(new String(host), port, next); - } - - /** - * Decodes an identifier from the provided unmarshaller. - * - * @param u an unmarhaller; - * @return an identifier managed by the target naming context; - * @throws JonathanException if something goes wrong. - */ - - public Identifier decode (final UnMarshaller u) throws JonathanException { - int port = u.readInt(); - int len = u.readShort(); - char[] host = new char[len]; - for (int i = 0; i < len; ++i) { - host[i] = (char)(u.readByte() & 0xFF); - } - Identifier next = adapter.decode(u); - return new Id(new String(host), port, next); - } - - // -------------------------------------------------------------------------- - // Utility class - // -------------------------------------------------------------------------- - - class Id implements Identifier { - - public String host; - - public int port; - - public Identifier next; - - public Id ( - final String host, - final int port, - final Identifier next) - { - this.host = host; - this.port = port; - this.next = next; - } - - public NamingContext getContext () { - return RmiBinder.this; - } - - public Object bind (final Identifier[] ref, final Context hints) - throws JonathanException - { - Properties p = new Properties(); - p.put("object_key", next.encode()); - p.put("hostname", host); - p.put("port", new Integer(port)); - SessionIdentifier sessionId = - rmi.createSessionIdentifier(p, new SessionIdentifier[] { - tcp.createSessionIdentifier(p, new SessionIdentifier[] {}) - }); - // local optimization - if (sessionId.isLocal()) { - RequestSession session = (RequestSession)next.bind(null, hints); - Object impl = session.getTarget(); - if (impl != null) { - return impl; - } - } - Object s = stubFactory.newStub(sessionId, new Identifier[] {this}, hints); - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.INFO, "Stub " + s + " bound to id " + ref[0]); - } - return s; - } - - public void unexport () { - } - - public boolean isValid () { - return true; - } - - public Object resolve () { - return null; - } - - public byte[] encode () throws JonathanException { - short len = (short)host.length(); - byte[] n = next.encode(); - byte[] b = new byte[n.length + 6 + len]; - // port - b[0] = (byte)((port >>> 24) & 0xFF); - b[1] = (byte)((port >>> 16) & 0xFF); - b[2] = (byte)((port >>> 8) & 0xFF); - b[3] = (byte)(port & 0xFF); - // host - b[4] = (byte)((len >>> 8) & 0xFF); - b[5] = (byte)(len & 0xFF); - for (int i = 0 ; i < len; ++i) { - b[i + 6] = (byte)host.charAt(i); - } - // next id - System.arraycopy(n, 0, b, 6 + len, n.length); - return b; - } - - public void encode (final Marshaller m) throws JonathanException { - short len = (short)host.length(); - m.writeInt(port); - m.writeShort(len); - for (int i = 0; i < len; ++i) { - m.writeByte((byte)host.charAt(i)); - } - next.encode(m); - } - - public boolean equals (final Object o) { - if (o instanceof Id) { - Id id = (Id)o; - if (host.equals(id.host) && port == id.port) { - return next.equals(id.next); - } - } - return false; - } - - public int hashCode () { - return host.hashCode()*port*(next.hashCode() + 17); - } - - public String toString () { - return "Id[" + host + "," + port + "," + next + "]"; - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinderType.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinderType.fractal deleted file mode 100644 index 1679cc61e8d1ca3f264b6026d976c766d1487446..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiBinderType.fractal +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocol.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocol.fractal deleted file mode 100644 index 9ba18a4d2d6171ec336667ecc176cd925964a8d7..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocol.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocol.java b/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocol.java deleted file mode 100644 index 04c2effa43e1aa041e232ae86ec0960b78f0589f..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocol.java +++ /dev/null @@ -1,796 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.david.libs.protocols.giop.GIOPProtocol - * (authors: B. Dumant, S. Chambon, H. Piccone, S. Thiebaud) - * with some comments copied from: - * org.objectweb.jonathan.apis.protocols.Protocol - * (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.jonathan.apis.binding.BindException; -import org.objectweb.jonathan.apis.binding.ExportException; -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.presentation.MarshallerFactory; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; -import org.objectweb.jonathan.apis.protocols.Protocol; -import org.objectweb.jonathan.apis.protocols.ProtocolGraph; -import org.objectweb.jonathan.apis.protocols.ReplyInterface; -import org.objectweb.jonathan.apis.protocols.ReplySession; -import org.objectweb.jonathan.apis.protocols.RequestSession; -import org.objectweb.jonathan.apis.protocols.ServerException; -import org.objectweb.jonathan.apis.protocols.SessionIdentifier; -import org.objectweb.jonathan.apis.protocols.Session_High; -import org.objectweb.jonathan.apis.protocols.Session_Low; -import org.objectweb.jonathan.apis.resources.Chunk; -import org.objectweb.jonathan.apis.resources.Scheduler; - -import org.objectweb.util.monolog.api.BasicLevel; -import org.objectweb.util.monolog.api.Logger; -import org.objectweb.util.monolog.api.LoggerFactory; - -import java.util.Properties; - -/** - * Provides a very simple invocation protocol component. This invocation - * protocol uses only two kinds of messages: - *

    - *
  • request messages: - * - * - * - * - * - * - * - * - * - * - * - *
    HEADER
    PAYLOAD
     request identifier (4 bytes) 
     object key length (4 bytes) 
     object key data (variable length) 
     payload (variable length) 
    - *
  • - *
  • reply messages: - * - * - * - * - * - * - * - * - * - * - *
    HEADER
    PAYLOAD
     request identifier (4 bytes) 
     exception flag (1 byte) 
     payload (variable length) 
    - *
  • - *
- * The request identifier is used to associate request and reply messages - * correctly. The object key identifies the remote object on which the - * invocation must be performed. The exception flag is used to indicate if a - * reply contains a normal result or an exception. - */ - -public class RmiProtocol implements Protocol, BindingController { - - /** - * The naming context used to decode the object key contained in request - * messages. - */ - - protected NamingContext adapter; - - /** - * The marshaller factory used to create request or reply messages. - */ - - protected MarshallerFactory marshallerFactory; - - /** - * The scheduler used to synchronized threads for waiting reply messages. - */ - - protected Scheduler scheduler; - - /** - * The optional logger factory used to get a logger for this component. - */ - - protected LoggerFactory loggerFactory; - - /** - * The logger used to log messages. May be null. - */ - - protected Logger logger; - - private ClientSession_Low clientSessionLow; - - private ServerSession_Low serverSessionLow; - - private ReplyHolder[] table; - - private ReplyHolder reusable; - - private int size; - - private int id; - - /** - * Constructs a new {@link RmiProtocol}. - */ - - public RmiProtocol () { - clientSessionLow = new ClientSession_Low(); - serverSessionLow = new ServerSession_Low(); - table = new ReplyHolder[17]; - } - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc () { - return new String[] { - "adapter", - "marshaller-factory", - "scheduler", - "logger-factory" - }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("adapter")) { - return adapter; - } else if (clientItfName.equals("marshaller-factory")) { - return marshallerFactory; - } else if (clientItfName.equals("scheduler")) { - return scheduler; - } else if (clientItfName.equals("logger-factory")) { - return loggerFactory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("adapter")) { - adapter = (NamingContext)serverItf; - } else if (clientItfName.equals("marshaller-factory")) { - marshallerFactory = (MarshallerFactory)serverItf; - } else if (clientItfName.equals("scheduler")) { - scheduler = (Scheduler)serverItf; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = (LoggerFactory)serverItf; - logger = loggerFactory.getLogger(getClass().getName()); - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("adapter")) { - adapter = null; - } else if (clientItfName.equals("marshaller-factory")) { - marshallerFactory = null; - } else if (clientItfName.equals("scheduler")) { - scheduler = null; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = null; - logger = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the Protocol interface - // -------------------------------------------------------------------------- - - /** - * Returns true if the target protocol is an invocation protocol. An - * invocation protocol is a protocol able to handle invocations, i.e., - * requests expecting a reply. In practice, this means that calls to the - * {@link Session_High#prepareInvocation(Marshaller) prepareInvocation} method - * on sessions obtained from the target protocol will not raise an - * {@link org.objectweb.jonathan.apis.kernel.InternalException}, but perform - * the appropriate work. - * - * @return true if the target protocol is an invocation protocol. - */ - - public boolean isAnInvocationProtocol () { - return true; - } - - /** - * Creates a new protocol graph with a number of given sub protocol graphs. - * - * @param subgraphs the lower-level graphs. - * @param hints the information required to build the graph. - * @return a new ProtocolGraph. - * @throws JonathanException if the hints or the subgraphs are invalid for - * this protocol. - */ - - public ProtocolGraph createProtocolGraph ( - final ProtocolGraph[] subgraphs, - final Context hints) throws JonathanException - { - if (subgraphs.length != 1) { - throw new JonathanException("Lower layers badly specified in RMIP"); - } - return new Graph(subgraphs[0]); - } - - /** - * Creates a new session identifier with the provided info. - */ - - public SessionIdentifier createSessionIdentifier ( - final Properties info, - final SessionIdentifier[] next) throws JonathanException - { - if (next.length != 1) { - throw new JonathanException("Lower layers badly specified in RMIP"); - } - byte[] key = (byte[])(info.get("object_key")); - return new CltSessionId(key, next[0]); - } - - // -------------------------------------------------------------------------- - // ProtocolGraph and Session identifiers - // -------------------------------------------------------------------------- - - class Graph implements ProtocolGraph { - - ProtocolGraph next; - - public Graph (final ProtocolGraph next) { - this.next = next; - } - - /* - public boolean equals (final Object o) { - if (o instanceof Graph) { - Graph pgraph = (Graph) o; - boolean one = false, two = false; - if (next != null) { - one = next.equals(pgraph.next); - } else { - one = pgraph.next == null; - } - return one; - } - return false; - } - - public int hashCode () { - if (next != null) { - return next.hashCode(); - } else { - return 0; - } - } - */ - - public SessionIdentifier export (final Session_Low ignored) - throws JonathanException - { - if (next == null) { - throw new ExportException("Badly specified participants"); - } - return new SrvSessionId(next.export(serverSessionLow)); - } - } - - class SrvSessionId implements SessionIdentifier { - - SessionIdentifier next; - - public SrvSessionId (final SessionIdentifier next) { - this.next = next; - } - - public Session_High bind (final Session_Low ignored) - throws JonathanException - { - throw new BindException("Bad session identifier type"); - } - - public void unexport () { - next.unexport(); - } - - public Protocol getProtocol () { - return RmiProtocol.this; - } - - public SessionIdentifier[] next () { - return new SessionIdentifier[] {next}; - } - - /* - public boolean equals (final Object o) { - if (o instanceof SrvSessionId) { - SrvSessionId sessionId = (SrvSessionId)o; - boolean one = false, two = false; - if (next != null) { - one = next.equals(sessionId.next); - } else { - one = sessionId.next == null; - } - return one; - - } - return false; - } - - public int hashCode () { - if (next != null) { - return next.hashCode(); - } else { - return 0; - } - } - */ - - public int getProtocolId () { - return 0; - } - - public Context getInfo () throws JonathanException { - throw new JonathanException("Not implemented"); - //return contextFactory.newContext(); - } - - public boolean isLocal () { - return false; // meaningless in this case - } - } - - class CltSessionId extends SrvSessionId { - - byte[] key; - - public CltSessionId ( - final byte[] key, - final SessionIdentifier next) - { - super(next); - this.key = key; - } - - public Session_High bind (final Session_Low ignored) - throws JonathanException - { - if (next == null) { - throw new BindException("Badly specified participants"); - } - return new ClientSession_High(key, next.bind(clientSessionLow)); - } - - public void unexport () {} - - /* - public boolean equals (final Object o) { - if (o instanceof CltSessionId) { - CltSessionId sessionId = (CltSessionId)o; - int len = key.length; - byte[] otherKey = sessionId.key; - if (otherKey.length == len) { - for (int i = 0; i < len; i++) { - if (otherKey[i] != key[i]) { - return false; - } - } - return super.equals(sessionId); - } - } - return false; - } - - public int hashCode () { - int hash = 0; - int len = key.length; - for (int i = 0; i < len; i++) { - hash += (key[i] << (i % 32)); - } - return hash + super.hashCode(); - } - - public String toString () { - String str = "CltSessionId[key["; - if (key.length > 0) { - str = str + key[0]; - } - for (int i = 1; i < key.length; i++) { - str = str + "," + key[i]; - } - return str; - } - */ - - public Context getInfo () throws JonathanException { - throw new JonathanException("Meaningless"); - } - - public boolean isLocal() { - return next.isLocal(); - } - } - - // -------------------------------------------------------------------------- - // SessionLow and SessionHigh interfaces - // -------------------------------------------------------------------------- - - class ClientSession_Low implements Session_Low { - - public void send ( - final UnMarshaller unmarshaller, - final Session_High sender) throws JonathanException - { - try { - int rqId = unmarshaller.readInt(); - ReplyHolder reply = getHolder(rqId); - if (reply == null) { - // we can't find the request: return silently - unmarshaller.close(); - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log( - BasicLevel.DEBUG, "RMIP Request #" + rqId + " not found"); - } - } else { - reply.sendReply(unmarshaller); - } - } catch (JonathanException e) { - unmarshaller.close(); - send(e, sender); - } - } - - public void send (final JonathanException e, final Session_High sender) { - forwardException(e, sender); - } - } - - class ServerSession_Low implements Session_Low { - - public void send ( - final UnMarshaller unmarshaller, - final Session_High sender) throws JonathanException - { - boolean unmarshallerOpened = true; - int rqId = unmarshaller.readInt(); - RequestSession requestSession = null; - try { - int len = unmarshaller.readInt(); - byte[] key = new byte[len]; - unmarshaller.readByteArray(key,0,len); - Identifier id = adapter.decode(key, 0, len); - requestSession = (RequestSession)id.bind(null, null); - if (requestSession != null) { - ServerSession_High replySession = - new ServerSession_High(sender, rqId); - requestSession.send(unmarshaller, replySession); - return; - } - unmarshallerOpened = false; - unmarshaller.close(); - } catch (Exception e) { - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.DEBUG, "Exception caught in RMIP", e); - } - if (unmarshallerOpened) { - unmarshaller.close(); - } - sendException(e, rqId, sender); - } - } - - public void send (final JonathanException e, final Session_High sender) { - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log( - BasicLevel.DEBUG, "Exception caught in RMIP related to " + sender, e); - } - sender.close(); - } - - void sendException ( - final Exception e, - final int rqId, - final Session_High session) - { - try { - Marshaller marshaller = prepareReplyMessage(rqId, true); - marshaller.writeValue(e); - sendMessage(marshaller, session); - } catch (Exception ignored) { - } finally { - session.close(); - } - } - } - - class RMIPSession_High { - - Session_High lower; - - public RMIPSession_High (final Session_High lower) { - this.lower = lower; - } - - public boolean direct () { - return false; - } - - public void send (final Marshaller marshaller) throws JonathanException { - sendMessage(marshaller, lower); - } - - public void close() { - lower.close(); - } - } - - class ClientSession_High extends RMIPSession_High implements Session_High { - - byte[] key; - - /** - * @param key the target object key. - * @param lower the lower protocol session. - */ - - public ClientSession_High (final byte[] key, final Session_High lower) { - super(lower); - this.key = key; - } - - public ReplyInterface prepareInvocation (final Marshaller marshaller) - throws JonathanException - { - ReplyHolder reply = registerHolder(lower); - marshaller.writeInt(reply.id); - int len = key.length; - marshaller.writeInt(len); - marshaller.writeByteArray(key, 0, len); - return reply; - } - - public void prepare (final Marshaller marshaller) throws JonathanException { - marshaller.writeInt(0); - int len = key.length; - marshaller.writeInt(len); - marshaller.writeByteArray(key, 0, len); - } - } - - class ServerSession_High extends RMIPSession_High implements ReplySession { - - int rqId; - - public ServerSession_High (final Session_High lower, final int rqId) { - super(lower); - this.rqId = rqId; - } - - public Marshaller prepareReply () throws JonathanException { - return prepareReplyMessage(rqId, false); - } - - public Marshaller prepareExceptionReply () throws JonathanException { - return prepareReplyMessage(rqId, true); - } - - public Marshaller prepareSystemExceptionReply () throws JonathanException { - return prepareReplyMessage(rqId, true); - } - - public Marshaller prepareLocationForwardReply () throws JonathanException { - return prepareReplyMessage(rqId, true); - } - } - - // utility methods ---------------------------------------------------------- - - void sendMessage (final Marshaller marshaller, final Session_High lower) - throws JonathanException - { - Chunk first = marshaller.getState(); - Chunk c = first; - int size = 0; - while (c != null) { - size += c.top - c.offset; - c = c.next; - } - if (lower.direct()) { - lower.send(marshaller); - } else { - Marshaller m = marshallerFactory.newMarshaller(); - lower.prepare(m); - m.write(marshaller.getState()); - marshaller.reset(); - lower.send(m); - } - } - - Marshaller prepareReplyMessage (final int rqId, final boolean isException) - throws JonathanException - { - Marshaller marshaller = marshallerFactory.newMarshaller(); - marshaller.writeInt(rqId); - marshaller.writeBoolean(isException); - return marshaller; - } - - synchronized void forwardException ( - final JonathanException e, - final Session_High lower) - { - int len = table.length; - ReplyHolder holder; - for (int i = 0; i < len; i++) { - holder = table[i]; - while (holder != null) { - if (holder.lower == lower) { - holder.sendReply(e); - } - holder = holder.next; - } - } - } - - // -------------------------------------------------------------------------- - // Reply holders management - // -------------------------------------------------------------------------- - - /** - * Returns the holder identified by id, or null if none exists. - * @param id a holder identifier. - * @return the corresponding holder. - */ - - synchronized ReplyHolder getHolder (final int id) { - int index = (id & 0x7FFFFFFF) % table.length; - ReplyHolder holder = table[index]; - while (! (holder == null || holder.id == id)) { - holder = holder.next; - } - return holder; - } - - synchronized ReplyHolder registerHolder (final Session_High lower) { - ReplyHolder holder; - if (reusable == null) { - holder = new ReplyHolder(lower); - id++; - holder.id = id; - } else { - holder = reusable; - holder.lower = lower; - reusable = reusable.next; - } - int len = table.length; - int index = (holder.id & 0x7FFFFFFF) % len; - holder.next = table[index]; - table[index] = holder; - size++; - if (size > len / 2) { - rehash(len); - } - return holder; - } - - /** - * Removes the holder identified by the provided id from the table. - * @param id the holder identifier. - */ - - synchronized void removeHolder (final int id) { - int index = (id & 0x7FFFFFFF) % table.length; - ReplyHolder first = table[index]; - ReplyHolder holder = first; - ReplyHolder prev = null; - while (holder.id != id) { - prev = holder; - holder = holder.next; - } - if (holder != null) { - size--; - if (prev != null) { - prev.next = holder.next; - } else { - table[index] = holder.next; - } - holder.next = reusable; - holder.lower = null; - reusable = holder; - } - } - - void rehash (final int len) { - int newLen = 2 * len + 1; - int index; - ReplyHolder holder, next_holder; - ReplyHolder[] newTable = new ReplyHolder[newLen]; - for (int i = 0; i < len; i++) { - holder = table[i]; - while (holder != null) { - next_holder = holder.next; - // rehashing - index = (holder.id & 0x7FFFFFFF) % newLen; - holder.next = newTable[index]; - newTable[index] = holder; - - holder = next_holder; - } - } - table = newTable; - } - - class ReplyHolder implements ReplyInterface { - - Object reply; - int id; - ReplyHolder next; - Session_High lower; - - public ReplyHolder (final Session_High lower) { - super(); - this.lower = lower; - } - - public synchronized UnMarshaller listen () throws JonathanException { - try { - while (reply == null) { - scheduler.wait(this); - } - UnMarshaller message = (UnMarshaller)reply; - boolean isException = message.readBoolean(); - if (isException) { - throw new ServerException(message); - } else { - return message; - } - } catch (InterruptedException e) { - throw new JonathanException(e); - } catch (ClassCastException e) { - throw (JonathanException)reply; - } finally { - reply = null; - removeHolder(id); - } - } - - public synchronized boolean available () { - return reply != null; - } - - final synchronized void sendReply (final Object reply) { - this.reply = reply; - scheduler.notify(this); - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocolType.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocolType.fractal deleted file mode 100644 index 80f372311c679618bd0f07eafd0ed6f2cd6b8783..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/RmiProtocolType.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/Ref.java b/fractalrmi/src/org/objectweb/fractal/rmi/io/Ref.java deleted file mode 100644 index 29b5093ea8c81187a69a303ae19b7f46890a60d0..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/Ref.java +++ /dev/null @@ -1,80 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.rmi.io; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; - -/** - * A typed encoded {@link org.objectweb.jonathan.apis.binding.Identifier} that - * can be sent over a network. - */ - -public class Ref implements Externalizable { - - /** - * The fully qualified name of the interface designated by {@link #id id}. - */ - - public String type; - - /** - * The encoded form of an {@link - * org.objectweb.jonathan.apis.binding.Identifier} designating a remote - * interface. - */ - - public byte[] id; - - /** - * Constructs an uninitialized {@link Ref} object. - */ - - public Ref () { - } - - /** - * Writes this object to the given output stream. - */ - - public void writeExternal (final ObjectOutput out) throws IOException { - out.writeUTF(type); - out.writeInt(id.length); - out.write(id); - } - - /** - * Reads this object from the given input stream. - */ - - public void readExternal (final ObjectInput in) - throws IOException, ClassNotFoundException - { - type = in.readUTF(); - id = new byte[in.readInt()]; - in.readFully(id); - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshaller.java b/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshaller.java deleted file mode 100644 index 4af5a3cebe05452ce1e35102b14b0005d010b427..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshaller.java +++ /dev/null @@ -1,700 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.jeremie.libs.presentation.StdMarshallerFactory - * (authors: B. Dumant, K. Milsted) - * with some comments copied from: - * org.objectweb.jonathan.apis.presentation.Marshaller - * (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi.io; - -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.kernel.InternalException; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.resources.Chunk; -import org.objectweb.jonathan.apis.resources.ChunkFactory; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * A {@link Marshaller} that uses an {@link RmiObjectOutputStream} to - * marshall object values. - */ - -public class RmiMarshaller extends OutputStream implements Marshaller { - - /** - * The domain used to instantiate {@link #os os}. - */ - - protected NamingContext domain; - - /** - * The chunk factory used to create new chunks to marshall data. - */ - - protected ChunkFactory chunkFactory; - - /** - * The context factory used to create the context associated with this - * marshaller. See {@link #getContext getContext}. - */ - - protected ContextFactory contextFactory; - - /** - * The object output stream used to marshall object values. This stream is - * lazily instantiated, i.e., it is instantiated at the first call to {@link - * #writeValue writeValue} or to {@link #writeReference writeReference}. - */ - - protected RmiObjectOutputStream os; - - private Chunk first; - - private Chunk current; - - private int offset; - - private int top; - - private Context context; - - // -------------------------------------------------------------------------- - // Constructors - // -------------------------------------------------------------------------- - - /** - * Constructs a new {@link RmiMarshaller}. - * - * @param domain the domain to be used to instantiate {@link #os os}. - * @param chunkFactory the chunk factory to be used to create new chunks to - * marshall data. - * @param contextFactory the context factory to be used to create the context - * associated with this marshaller. - */ - - public RmiMarshaller ( - final NamingContext domain, - final ChunkFactory chunkFactory, - final ContextFactory contextFactory) - { - super(); - this.domain = domain; - this.chunkFactory = chunkFactory; - this.contextFactory = contextFactory; - first = chunkFactory.newChunk(); - current = first; - top = current.data.length; - } - - // -------------------------------------------------------------------------- - // Implementation of the Marshaller interface - // -------------------------------------------------------------------------- - - /** - * Returns true if this marshaller is little-endian, false otherwise. - * - * @return true if this marshaller is little-endian, false otherwise. - */ - - public boolean isLittleEndian () { - return false; - } - - /** - * Returns a {@link Context} associated with this marshaller. - * - * @return a {@link Context} associated with this marshaller. - */ - - public Context getContext () { - if (context == null) { - try { - context = contextFactory.newContext(); - } catch (NullPointerException e) { - e.printStackTrace(System.err); - throw new InternalException("Context factory required."); - } - } - return context; - } - - /** - * Returns the state of the message as a (chain of) chunk(s). The returned - * chunk(s) are NOT duplicated. If the caller keeps a reference to them, it - * must {@link #reset() reset} the message, and not continue to use it. - * - * @return the state of the message as a (chain of) chunk(s). - */ - - public Chunk getState () { - if (current.next == null) { - current.top = offset; - } - return first; - } - - /** - * Returns the position in the message at which the next byte will be written. - * - * @return the current offset in the message. - * @see #setOffset - */ - - public int getOffset () { - Chunk c = first; - int size = 0; - while (c != current) { - size += c.top - c.offset; - c = c.next; - } - return size + offset - current.offset; - } - - /** - * Sets the offset in the message. This method may be used to override data - * already written into the message. - * - * @param off the new offset. - * @see #getOffset - */ - - public void setOffset (int off) { - if (current.next == null && offset > current.top) { - current.top = offset; - } - Chunk c = first; - int sz = c.top - c.offset; - while (off > sz) { - off -= sz; - c = c.next; - sz = c.top - c.offset; - } - offset = c.offset + off; - current = c; - if (current.next == null) { - top = current.data.length; - } else { - top = current.top; - } - } - - /** - * Checks if the given marshaller has the same content as this one. - * - * @param other a marshaller. - * @return true if the this marshaller and the given one have the same - * contents, i.e., contain the same bits, false otherwise. - */ - - public boolean sameContents (final Marshaller other) { - if (other == null) { - return false; - } else { - Chunk mine = getState(), yours = other.getState(); - if (mine == yours) { - return true; - } - - byte[] my_data = null, your_data = null; - int my_top = 0, my_offset = 0, your_top = 0, your_offset = 0; - if (mine != null) { - my_data = mine.data; - my_top = mine.top; - my_offset = mine.offset; - } - if (yours != null) { - your_data = yours.data; - your_top = yours.top; - your_offset = yours.offset; - } - while (mine != null && yours != null) { - if (your_top - your_offset > my_top - my_offset) { - while (my_offset < my_top && - my_data[my_offset] == your_data[your_offset++]) { - my_offset++; - } - if (my_offset < my_top) { - return false; - } else { - mine = mine.next; - if (mine != null) { - my_data = mine.data; - my_top = mine.top; - my_offset = mine.offset; - } - } - } else { - while (your_offset < your_top && - my_data[my_offset++] == your_data[your_offset]) { - your_offset++; - } - if (your_offset < your_top) { - return false; - } else { - yours = yours.next; - if (yours != null) { - your_data = yours.data; - your_top = yours.top; - your_offset = yours.offset; - } - } - } - } - if (yours == null) { - if (mine != null && mine.top == my_offset) { - mine = mine.next; - } - while (mine != null && mine.top == mine.offset) { - mine = mine.next; - } - return mine == null; - } else { - if (yours.top == your_offset) { - yours = yours.next; - } - while (yours != null && yours.top == yours.offset) { - yours = yours.next; - } - return yours == null; - } - } - } - - /** - * Resets this marshaller. This method causes the message to lose all its - * references to the underlying chunks, without {@link Chunk#release() - * releasing} them. This method must not be used if no reference to chunks - * present in the message is held by an entity in charge of their release. - * It also releases the context associated with the target marshaller. - */ - - public void reset () { - first = null; - current = null; - offset = 0; - top = 0; - context = null; - } - - /** - * Returns an output stream to write into the message. Closing the output - * stream has the same effect as closing the marshaller itself. - * - * @return an output stream to write into the message. - */ - - public OutputStream outputStream () { - return this; - } - - /** - * Writes a byte. - * - * @param v a byte. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeByte (final byte v) throws JonathanException { - if (offset >= top) { - prepare(); - } - current.data[offset++] = v; - } - - /** - * Writes a boolean. - * - * @param v a boolean. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeBoolean (final boolean v) throws JonathanException { - if (offset >= top) { - prepare(); - } - current.data[offset++] = (byte)(v ? 1 : 0); - } - - /** - * Writes an 8 bits char. The method used to translate the provided - * char into an 8 bits entity is not specified. - * - * @param v a char. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeChar8 (final char v) throws JonathanException { - if (offset >= top) { - prepare(); - } - current.data[offset++] = (byte)v; - } - - /** - * Writes a 16 bits char. - * - * @param v a char. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeChar16 (final char v) throws JonathanException { - if (top - offset < 2) { - prepare(); - } - byte[] data = current.data; - data[offset++] = (byte)(v >>> 8); - data[offset++] = (byte)v; - } - - /** - * Writes a short. - * - * @param v a short. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeShort (final short v) throws JonathanException { - if (top - offset < 2) { - prepare(); - } - byte[] data = current.data; - data[offset++] = (byte)(v >>> 8); - data[offset++] = (byte)v; - } - - /** - * Writes an int. - * - * @param v an int; - * @throws JonathanException if a marshal error occurred. - */ - - public void writeInt (final int v) throws JonathanException { - if (top - offset < 4) { - prepare(); - } - byte[] data = current.data; - data[offset++] = (byte)(v >>> 24); - data[offset++] = (byte)(v >>> 16); - data[offset++] = (byte)(v >>> 8); - data[offset++] = (byte)v; - } - - /** - * Writes a float. - * - * @param v a float. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeFloat (final float v) throws JonathanException { - int i = Float.floatToIntBits(v); - if (top - offset < 4) { - prepare(); - } - byte[] data = current.data; - data[offset++] = (byte)(i >>> 24); - data[offset++] = (byte)(i >>> 16); - data[offset++] = (byte)(i >>> 8); - data[offset++] = (byte)i; - } - - /** - * Writes a long. - * - * @param v a long. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeLong (final long v) throws JonathanException { - if (top - offset < 8) { - prepare(); - } - byte[] data = current.data; - data[offset++] = (byte)(v >>> 56); - data[offset++] = (byte)(v >>> 48); - data[offset++] = (byte)(v >>> 40); - data[offset++] = (byte)(v >>> 32); - data[offset++] = (byte)(v >>> 24); - data[offset++] = (byte)(v >>> 16); - data[offset++] = (byte)(v >>> 8); - data[offset++] = (byte)v; - } - - /** - * Writes a double. - * - * @param v a double. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeDouble (final double v) throws JonathanException { - long l = Double.doubleToLongBits(v); - if (top - offset < 8) { - prepare(); - } - byte[] data = current.data; - data[offset++] = (byte)(l >>> 56); - data[offset++] = (byte)(l >>> 48); - data[offset++] = (byte)(l >>> 40); - data[offset++] = (byte)(l >>> 32); - data[offset++] = (byte)(l >>> 24); - data[offset++] = (byte)(l >>> 16); - data[offset++] = (byte)(l >>> 8); - data[offset++] = (byte)l; - } - - /** - * Writes a string of 8 bits chars. - * - * @param v a string. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeString8 (final String v) throws JonathanException { - int len = v.length(); - writeInt(len + 1); - byte[] data = current.data; - int off = 0; - int max = top - offset; - while (max < len) { - while (off < max) { - data[offset++] = (byte)(v.charAt(off++)); - } - prepare(); - data = current.data; - max = top - offset + off; - } - while (off < len) { - data[offset++] = (byte)(v.charAt(off++)); - } - if (offset >= top) { - prepare(); - } - current.data[offset++] = (byte)0; - } - - /** - * Writes a string of 16 bits chars. - * - * @param v a string. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeString16 (final String v) throws JonathanException { - throw new InternalException("Not implemented"); - } - - /** - * Writes a chunk in the message. - * The target becomes the "owner" of the provided chunk, and therefore is not - * supposed to duplicate it. If the entity invoking this operation wants to - * keep a reference to the chunk, it must be duplicated. - * - * @param chunk the chunk to be written. - */ - - public void write (final Chunk chunk) { - if (current.next != null) { - throw new InternalException("Illicit operation"); - } - current.top = offset; - current.next = chunk; - Chunk c = chunk; - while (c != null) { - current = c; - c = c.next; - } - offset = current.top; - top = current.data.length; - } - - /** - * Writes an array of bytes. - * - * @param array an array of bytes. - * @param off index of the first byte of the array that must be written. - * @param len number of bytes of the array that must be written. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeByteArray (final byte[] array, int off, int len) - throws JonathanException - { - int max = top - offset; - while (max < len) { - if (max > 0) { - System.arraycopy(array, off, current.data, offset, max); - off += max; - len -= max; - offset = top; - } - prepare(); - max = top - offset; - } - System.arraycopy(array,off,current.data,offset,len); - offset += len; - } - - /** - * Writes an object reference in the marshaller. - * - * @param v an object reference. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeReference (final Object v) throws JonathanException { - try { - initObjectStream(); - os.writeObject(v); - os.drain(); - } catch (IOException e) { - throw new JonathanException(e); - } - } - - /** - * Writes a value in the marshaller. - * - * @param v an object. - * @throws JonathanException if a marshal error occurred. - */ - - public void writeValue (final Object v) throws JonathanException { - try { - initObjectStream(); - os.writeObject(v); - os.drain(); - } catch (IOException e) { - throw new JonathanException(e); - } - } - - // -------------------------------------------------------------------------- - // Overriden methods - // -------------------------------------------------------------------------- - - /** - * Writes the specified byte to this output stream. - */ - - public void write (final int b) throws IOException { - try { - if (top <= offset) { - prepare(); - } - current.data[offset++] = (byte)b; - } catch (JonathanException e) { - throw new IOException(e.getMessage()); - } - } - - /** - * Writes len bytes from the specified byte array - * starting at offset off to this output stream. - */ - - public void write (final byte[] b, final int off, final int len) - throws IOException - { - try { - writeByteArray(b, off, len); - } catch (JonathanException e) { - throw new IOException(e.getMessage()); - } - } - - /** - * Closes this marshaller. This method causes the message to lose all its - * references to the underlying chunks, and {@link Chunk#release() releases} - * each of them. It also releases the context. - */ - - public void close () { - Chunk cur = first; - Chunk next; - while (cur != null) { - next = cur.next; - cur.release(); - cur = next; - } - first = null; - current = null; - offset = 0; - top = 0; - if (context != null) { - context.release(); - context = null; - } - } - - // -------------------------------------------------------------------------- - // Utility methods - // -------------------------------------------------------------------------- - - /** - * Instantiates the delegate object output stream {@link #os os}. This - * method creates {@link RmiObjectOutputStream} stream. - * - * @throws IOException if the delegate object output stream cannot be created. - */ - - protected void initObjectStream () throws IOException { - if (os == null) { - os = new RmiObjectOutputStream(this, domain); - } - } - - private void prepare () throws JonathanException { - if (current == null) { - Chunk chunk = chunkFactory.newChunk(); - first = chunk; - current = chunk; - offset = 0; - top = current.data.length; - } else if (current.next == null) { - current.top = offset; - Chunk chunk = chunkFactory.newChunk(); - current.next = chunk; - current = chunk; - offset = 0; - top = current.data.length; - } else { - current = current.next; - offset = current.offset; - if (current.next != null) { - top = current.top; - } else { - top = current.data.length; - } - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactory.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactory.fractal deleted file mode 100644 index 3b2a740df2032d15ad7f214fa0a2296d5441de95..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactory.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactory.java b/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactory.java deleted file mode 100644 index 6675d2417e3d811bdcab17e8a1e2b424155c230b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactory.java +++ /dev/null @@ -1,162 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.jeremie.libs.presentation.StdMarshallerFactory - * (authors: B. Dumant, K. Milsted) - * with some comments copied from: - * org.objectweb.jonathan.apis.presentation.MarshallerFactory - * (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi.io; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.presentation.MarshallerFactory; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; -import org.objectweb.jonathan.apis.resources.Chunk; -import org.objectweb.jonathan.apis.resources.ChunkFactory; -import org.objectweb.jonathan.apis.resources.ChunkProvider; - -/** - * Provides a factory for creating marshallers and unmarshallers. - */ - -public class RmiMarshallerFactory - implements MarshallerFactory, BindingController -{ - - /** - * The domain to be used by the (un)marshallers created by this factory. - */ - - protected NamingContext domain; - - /** - * The chunk factory to be used by the (un)marshallers created by this - * factory. - */ - - protected ChunkFactory chunkFactory; - - /** - * The context factory to be used by the (un)marshallers created by this - * factory. - */ - - protected ContextFactory contextFactory; - - /** - * Constructs a new {@link RmiMarshallerFactory}. - */ - - public RmiMarshallerFactory () { - } - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc () { - return new String[] { - "domain", - "chunk-factory", - "context-factory" - }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("domain")) { - return domain; - } else if (clientItfName.equals("chunk-factory")) { - return chunkFactory; - } else if (clientItfName.equals("context-factory")) { - return contextFactory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("domain")) { - domain = (NamingContext)serverItf; - } else if (clientItfName.equals("chunk-factory")) { - chunkFactory = (ChunkFactory)serverItf; - } else if (clientItfName.equals("context-factory")) { - contextFactory = (ContextFactory)serverItf; - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("domain")) { - domain = null; - } else if (clientItfName.equals("chunk-factory")) { - chunkFactory = null; - } else if (clientItfName.equals("context-factory")) { - contextFactory = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the MarshallerFactory interface - // -------------------------------------------------------------------------- - - /** - * Returns a new marshaller. - * - * @return a new marshaller. - */ - - public Marshaller newMarshaller() { - return new RmiMarshaller(domain, chunkFactory, contextFactory); - } - - /** - * Returns a new unmarshaller, using the provided chunk provider as a data - * source. - * - * @param message a chunk provider. - * @return a new unmarshaller. - */ - - public UnMarshaller newUnMarshaller (final ChunkProvider message) { - return new RmiUnMarshaller(domain, contextFactory, message); - } - - /** - * Returns a new unmarshaller, using the provided chunk(s) as a data source. - * The read parameter is used to initialize the number of bytes - * read from the message. - * - * @param chunk a (chain of) chunk(s). - * @param read the number of bytes already read from the message. - * @return an unmarshaller. - */ - - public UnMarshaller newUnMarshaller (final Chunk chunk, final int read) { - return new RmiUnMarshaller(domain, contextFactory, chunk, read); - } -} - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactoryType.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactoryType.fractal deleted file mode 100644 index b6659b91657b9ab795f17df845acfad954b2fdd9..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiMarshallerFactoryType.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiObjectInputStream.java b/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiObjectInputStream.java deleted file mode 100644 index 0a8c62d4947e5bdc517ea31eff73886ff41aba97..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiObjectInputStream.java +++ /dev/null @@ -1,155 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.jeremie.libs.presentation.StdMarshallerFactory - * (authors: B. Dumant, K. Milsted) - */ - -package org.objectweb.fractal.rmi.io; - -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.ContextFactory; - -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectStreamClass; -import java.rmi.server.RMIClassLoader; - -/** - * An {@link ObjectInputStream} that replaces {@link Ref} objects with stubs. - */ - -public class RmiObjectInputStream extends ObjectInputStream { - - /** - * The naming context used to decode the identifiers contained in {@link Ref} - * objects. - */ - - protected NamingContext domain; - - /** - * The context factory used to create hints for the {@link Identifier#bind - * bind} method. - */ - - protected ContextFactory contextFactory; - - /** - * TODO. - */ - - protected String codeBase; - - /** - * Constructs a new {@link RmiObjectInputStream}. - * - * @param is the underlying input stream. - * @param domain the naming context to be used to decode the identifiers - * contained in {@link Ref} objects. - * @param contextFactory the context factory to be used to create hints for - * the {@link Identifier#bind bind} method. - * @throws IOException if the super constructor throws an exception. - */ - - public RmiObjectInputStream ( - final InputStream is, - final NamingContext domain, - final ContextFactory contextFactory) throws IOException - { - super(is); - enableResolveObject(true); - this.domain = domain; - this.contextFactory = contextFactory; - this.codeBase = readUTF(); - } - - /** - * Replaces {@link Ref} objects with corresponding stubs. This method uses - * the {@link #domain domain} to decode the identifier encoded in a {@link - * Ref} object, and then uses the {@link Identifier#bind bind} method of the - * decoded identifier to get a stub corresponding to this identifier. The - * type stored in the {@link Ref} object is passed as an hint to the - * {@link Identifier#bind bind} method. - * - * @param obj an object. - * @return a stub if obj is a {@link Ref} object, or obj - * otherwise. - * @throws IOException if a {@link Ref} object cannot be replaced with a - * stub. - */ - - protected Object resolveObject (final Object obj) throws IOException { - if (obj instanceof Ref) { - try { - ClassLoader l; - if (codeBase.length() == 0) { - l = getClass().getClassLoader(); - } else { - l = RMIClassLoader.getClassLoader(codeBase); - } - if (l != null) { - Thread.currentThread().setContextClassLoader(l); - } - Ref ref = (Ref)obj; - Identifier id = domain.decode(ref.id, 0, ref.id.length); - Context hints = contextFactory.newContext(); - hints.addElement("interface_type", String.class, ref.type, (char)0); - Object newObj = id.bind(new Identifier[] {id}, hints); - hints.release(); - return newObj; - } catch (Exception e) { - throw new IOException("cannot bind to object: " + e); - } - } else { - return obj; - } - } - - protected Class resolveClass (ObjectStreamClass desc) - throws IOException, ClassNotFoundException - { - try { - Class c; - try { - c = RMIClassLoader.loadClass((String)codeBase, desc.getName()); - } catch (ClassNotFoundException e) { - c = getClass().getClassLoader().loadClass(desc.getName()); - } - ClassLoader l = c.getClassLoader(); - if (l != null) { - Thread.currentThread().setContextClassLoader(l); - } - return c; - } catch (ClassNotFoundException e) { - System.err.println("WARNING: " + e.toString()); - throw e; - } catch (IOException e) { - System.err.println("WARNING: " + e.toString()); - throw e; - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiObjectOutputStream.java b/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiObjectOutputStream.java deleted file mode 100644 index b8c580d35d4adfdaf8bee507684d937db5d8b029..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiObjectOutputStream.java +++ /dev/null @@ -1,115 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.jeremie.libs.presentation.StdMarshallerFactory - * (authors: B. Dumant, K. Milsted) - */ - -package org.objectweb.fractal.rmi.io; - -import org.objectweb.fractal.api.Interface; - -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.binding.Reference; - -import java.io.IOException; -import java.io.ObjectOutputStream; -import java.io.OutputStream; - -/** - * An {@link ObjectOutputStream} that replaces interface references with {@link - * Ref} objects. - */ - -public class RmiObjectOutputStream extends ObjectOutputStream { - - /** - * The naming context used to export local interfaces, to make them - * remotely accessible. - */ - - protected NamingContext domain; - - /** - * Constructs a new {@link RmiObjectOutputStream}. - * - * @param os the underlying output stream. - * @param domain the naming context to be used to export local interface - * references, to make them remotely accessible. - * @throws IOException if the super constructor throws an exception. - */ - - public RmiObjectOutputStream ( - final OutputStream os, - final NamingContext domain) throws IOException - { - super(os); - enableReplaceObject(true); - this.domain = domain; - String codeBase = System.getProperty("java.rmi.server.codebase"); - writeUTF(codeBase == null ? "" : codeBase); - } - - /** - * Replaces component interfaces with {@link Ref} objects. If the given - * object is an {@link Interface}, two cases are possible. If the object is - * also a {@link Reference}, then it is replaced with a {@link Ref} object - * containing an encoded form of the identifier held by the {@link Reference}. - * If the object is not a {@link Reference}, then it is exported with {@link - * #domain domain}, and replaced with a {@link Ref} object containing an - * encoded form of the {@link org.objectweb.jonathan.apis.binding.Identifier} - * returned by {@link NamingContext#export export}. - * - * @param obj an object. - * @return a {@link Ref} object if obj is a component interface, - * or obj otherwise. - * @throws IOException if a component interface cannot be replaced with a - * {@link Ref} object. - */ - - protected Object replaceObject (final Object obj) throws IOException { - if (obj instanceof Interface) { - try { - Ref ref = new Ref(); - ref.type = obj.getClass().getInterfaces()[0].getName(); - if (obj instanceof Reference) { - ref.id = ((Reference)obj).getIdentifiers()[0].encode(); - } else { - ref.id = domain.export(obj, null).encode(); - } - return ref; - } catch (Exception e) { - throw new IOException("Cannot export object: " + e); - } - } - return obj; - } - - /** - * Drain any buffered data in this stream. - */ - - protected void drain () throws IOException { - super.drain(); - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiUnMarshaller.java b/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiUnMarshaller.java deleted file mode 100644 index c52bfbb8ee766eed4deeb433899a96b237967205..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/RmiUnMarshaller.java +++ /dev/null @@ -1,794 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * adapted from Jonathan: - * org.objectweb.jeremie.libs.presentation.StdMarshallerFactory - * (authors: B. Dumant, K. Milsted) - * with some comments copied from: - * org.objectweb.jonathan.apis.presentation.UnMarshaller - * (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi.io; - -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.kernel.InternalException; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.EndOfMessageException; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; -import org.objectweb.jonathan.apis.resources.Chunk; -import org.objectweb.jonathan.apis.resources.ChunkProvider; - -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; - -/** - * An {@link UnMarshaller} that uses an {@link RmiObjectInputStream} to - * unmarshall object values. - */ - -public class RmiUnMarshaller extends InputStream implements UnMarshaller { - - private final static Chunk EMPTY_CHUNK = new Chunk(new byte[0], 0, 0); - - /** - * The domain used to instantiate {@link #is is}. - */ - - protected NamingContext domain; - - /** - * The context factory used to create the context associated with this - * marshaller. See {@link #getContext getContext}. - */ - - protected ContextFactory contextFactory; - - /** - * The object input stream used to unmarshall object values. This stream is - * lazily instantiated, i.e., it is instantiated at the first call to {@link - * #readValue readValue} or to {@link #readReference readReference}. - */ - - protected ObjectInputStream is; - - private ChunkProvider provider; - - private Chunk first; - - private int offset; - - private int lastOffset; - - private Context context; - - // -------------------------------------------------------------------------- - // Constructors - // -------------------------------------------------------------------------- - - /** - * Constructs a new {@link RmiUnMarshaller}. - * - * @param domain the domain to be used to instantiate {@link #is is}. - * @param contextFactory the context factory to be used to create the context - * associated with this marshaller. - * @param chunk a (chain of) chunk(s). - * @param read the number of bytes already read from the message. - */ - - public RmiUnMarshaller ( - NamingContext domain, - ContextFactory contextFactory, - Chunk chunk, - int read) - { - super(); - this.domain = domain; - this.contextFactory = contextFactory; - this.first = chunk; - offset = chunk.offset; - lastOffset = read - offset; - context = null; - } - - /** - * Constructs a new {@link RmiUnMarshaller}. - * - * @param domain the domain to be used to instantiate {@link #is is}. - * @param contextFactory the context factory to be used to create the context - * associated with this marshaller. - * @param provider a chunk provider. - */ - - public RmiUnMarshaller ( - final NamingContext domain, - final ContextFactory contextFactory, - final ChunkProvider provider) - { - this(domain, contextFactory, EMPTY_CHUNK, 0); - this.provider = provider; - } - - // -------------------------------------------------------------------------- - // Implementation of the UnMarshaller interface - // -------------------------------------------------------------------------- - - /** - * Returns true if this unmarshaller is little-endian, false otherwise. - * - * @return true if this unmarshaller is little-endian, false otherwise. - */ - - public boolean isLittleEndian () { - return false; - } - - /** - * Sets the byte order of this unmarshaller. - * - * @param littleEndian the new byte order. - */ - - public void setByteOrder (final boolean littleEndian) { - throw new RuntimeException("Not implemented."); - } - - /** - * Returns a {@link Context} associated with this unmarshaller. - * - * @return a {@link Context} associated with this unmarshaller. - */ - - public final Context getContext () { - if (context == null) { - try { - context = contextFactory.newContext(); - } catch (NullPointerException e) { - e.printStackTrace(System.err); - throw new InternalException("Context factory required."); - } - } - return context; - } - - /** - * Returns the number of bytes read since the beginning. - * - * @return the number of bytes read since the beginning. - */ - - public int bytesRead () { - return lastOffset + offset; - } - - /** - * Sets the number of bytes readable from the unmarshaller. Once this method - * has been called, it won't be possible to read more than the - * size specified bytes from this unmarshaller. Knowing the exact - * number of readable bytes lets the unmarshaller free the resources (such as - * a chunk provider) that won't be used. This method may block until the - * expected number of bytes is readable. - * - * @param size the expected number of readable bytes. - * @throws JonathanException if something goes wrong. - */ - - public void setSize (int size) throws JonathanException { - boolean sz0 = (size == 0); - Chunk result = null, current = null; - int lastOff = lastOffset + offset; - int available = first.top - offset; - first.offset = offset; - while (size > available) { - if (available > 0) { - if (current == null) { - result = first.duplicate(); - current = result; - } else { - current.next = first.duplicate(); - current = current.next; - } - size -= available; - offset = first.top; - } - prepare(); - available = first.top - offset; - } - if (size > 0) { - if (current == null) { - result = first.duplicate(offset,offset + size); - } else { - current.next = first.duplicate(offset,offset + size); - } - offset += size; - } - Context thisContext = context; - if (context != null) { - context.acquire(); - } - close(); - context = thisContext; - if (sz0) { - first = EMPTY_CHUNK; - } else { - first = result; - } - offset = first.offset; - lastOffset = lastOff - offset; - } - - /** - * Returns an input stream to read data from the unmarshaller. Closing the - * returned input stream has the same effect as closing the actual - * unmarshaller. - * - * @return an input stream to read from the unmarshaller. - */ - - public InputStream inputStream () { - return this; - } - - /** - * Reads a byte. - * - * @return a byte. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public byte readByte () throws JonathanException { - if (first.top == offset) { - prepare(); - } - return first.data[offset++]; - } - - /** - * Reads a boolean. - * - * @return a boolean. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public boolean readBoolean () throws JonathanException { - if (first.top == offset) { - prepare(); - } - return first.data[offset++] != 0; - } - - /** - * Reads a 8 bits char. - * - * @return a char. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public char readChar8 () throws JonathanException { - if (first.top == offset) { - prepare(); - } - return (char) (first.data[offset++] & 0xFF); - } - - /** - * Reads a 16 bits char. - * - * @return a char. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public char readChar16 () throws JonathanException { - byte[] data = first.data; - int val = 0; - if (first.top - offset >= 2) { - val = ((data[offset] & 0xFF) << 8) + (data[offset + 1] & 0xFF); - offset += 2; - } else { - int m = 1, p; - while (m >= 0) { - p = Math.min(m + 1, first.top-offset); - if (p == 0) { - prepare(); - data = first.data; - } else { - while (--p >= 0) { - val += (data[offset++] & 0xFF) << (m-- * 8); - } - } - } - } - return (char) val; - } - - /** - * Reads a short. - * - * @return a short. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public short readShort () throws JonathanException { - byte[] data = first.data; - int val = 0; - if (first.top - offset >= 2) { - val = ((data[offset] & 0xFF) << 8) + (data[offset + 1] & 0xFF); - offset += 2; - } else { - int m = 1, p; - while (m >= 0) { - p = Math.min(m + 1, first.top-offset); - if (p == 0) { - prepare(); - data = first.data; - } else { - while (--p >= 0) { - val += (data[offset++] & 0xFF) << (m-- * 8); - } - } - } - } - return (short) val; - } - /** - * Reads an int. - * - * @return an int. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public int readInt () throws JonathanException { - byte[] data = first.data; - int val = 0; - if (first.top - offset >= 4) { - val = - ((data[offset] & 0xFF) << 24) + - ((data[offset + 1] & 0xFF) << 16) + - ((data[offset + 2] & 0xFF) << 8) + - (data[offset + 3] & 0xFF); - offset += 4; - } else { - int m = 3, p; - while (m >= 0) { - p = Math.min(m + 1, first.top-offset); - if (p == 0) { - prepare(); - data = first.data; - } else { - while (--p >= 0) { - val += (data[offset++] & 0xFF) << (m-- * 8); - } - } - } - } - return val; - } - - /** - * Reads a float. - * - * @return a float. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public float readFloat () throws JonathanException { - byte[] data = first.data; - int val = 0; - if (first.top - offset >= 4) { - val = - ((data[offset] & 0xFF) << 24) + - ((data[offset + 1] & 0xFF) << 16) + - ((data[offset + 2] & 0xFF) << 8) + - (data[offset + 3] & 0xFF); - offset += 4; - } else { - int m = 3, p; - while (m >= 0) { - p = Math.min(m + 1, first.top-offset); - if (p == 0) { - prepare(); - data = first.data; - } else { - while (--p >= 0) { - val += (data[offset++] & 0xFF) << (m-- * 8); - } - } - } - } - return Float.intBitsToFloat(val); - } - - /** - * Reads a long. - * - * @return a long. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public long readLong () throws JonathanException { - byte[] data = first.data; - long val = 0; - if (first.top - offset >= 8) { - val = - (((long)data[offset] & 0xFF) << 56) + - (((long)data[offset + 1] & 0xFF) << 48) + - (((long)data[offset + 2] & 0xFF) << 40) + - (((long)data[offset + 3] & 0xFF) << 32) + - (((long)data[offset + 4] & 0xFF) << 24) + - (((long)data[offset + 5] & 0xFF) << 16) + - (((long)data[offset + 6] & 0xFF) << 8) + - ((long)data[offset + 7] & 0xFF); - offset += 8; - } else { - int m = 7, p; - while (m >= 0) { - p = Math.min(m + 1,first.top-offset); - if (p == 0) { - prepare(); - data = first.data; - } else { - while (--p >= 0) { - val += (((long) data[offset++]) & 0xFF) << (m-- * 8); - } - - } - } - } - return val; - } - - /** - * Reads a double. - * - * @return a double. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public double readDouble () throws JonathanException { - byte[] data = first.data; - long val = 0; - if (first.top - offset >= 8) { - val = - (((long)data[offset] & 0xFF) << 56) + - (((long)data[offset + 1] & 0xFF) << 48) + - (((long)data[offset + 2] & 0xFF) << 40) + - (((long)data[offset + 3] & 0xFF) << 32) + - (((long)data[offset + 4] & 0xFF) << 24) + - (((long)data[offset + 5] & 0xFF) << 16) + - (((long)data[offset + 6] & 0xFF) << 8) + - ((long)data[offset + 7] & 0xFF); - offset += 8; - return Double.longBitsToDouble(val); - } else { - int m = 7, p; - while (m >= 0) { - p = Math.min(m + 1,first.top-offset); - if (p == 0) { - prepare(); - data = first.data; - } else { - while (--p >= 0) { - val += (((long) data[offset++]) & 0xFF) << (m-- * 8); - } - } - } - return Double.longBitsToDouble(val); - } - } - - /** - * Reads a string composed of 8 bits chars. - * - * @return a string. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public String readString8 () throws JonathanException { - int len = readInt() - 1; - char[] tab = new char[len]; - byte[] data = first.data; - int off = 0; - int max = first.top - offset; - // read the characters - while (max < len) { - while (off < max) { - tab[off++] = (char) (data[offset++] & 0xFF); - } - prepare(); - data = first.data; - max = first.top - offset + off; - } - while (off < len) { - tab[off++] = (char) (data[offset++] & 0xFF); - } - if (first.top == offset) { - prepare(); - offset++; - } else { - offset++; - } - return new String(tab); - } - - /** - * Reads a string composed of 16 bits chars. - * - * @return a string. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public String readString16 () throws JonathanException { - throw new InternalException("Not implemented."); - } - - /** - * Reads an array of bytes. - * - * @param array a byte array (of size >= offset + len). - * @param off the position (in array) of the first byte to write. - * @param len the total number of bytes to read. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public void readByteArray (final byte[] array, int off, int len) - throws JonathanException - { - byte[] data = first.data; - int max = first.top - offset; - while (max < len) { - System.arraycopy(data,offset,array,off,max); - offset += max; - off += max; - len -= max; - prepare(); - data = first.data; - max = first.top - offset; - } - System.arraycopy(data,offset,array,off,len); - offset += len; - } - - /** - * Reads a reference to an object. - * - * @return a reference to an object. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public Object readReference () throws JonathanException { - try { - initObjectStream(); - return is.readObject(); - } catch (Exception e) { - System.err.println(Thread.currentThread() + " Exception " + e); - throw new JonathanException(e); - } - } - - /** - * Reads a value. - * - * @return an object representing the read value. - * @throws JonathanException if the format of the data is incompatible with - * the request. - */ - - public Object readValue () throws JonathanException { - try { - initObjectStream(); - return is.readObject(); - } catch (Exception e) { - System.err.println(Thread.currentThread() + " Exception " + e); - throw new JonathanException(e); - } - } - - // -------------------------------------------------------------------------- - // Overriden methods - // -------------------------------------------------------------------------- - - /** - * Returns the number of bytes that can be read (or skipped over) from - * this input stream without blocking. - */ - - public int available () throws IOException { - Chunk chunk = first; - int size = chunk.top - offset; - chunk = chunk.next; - while (chunk != null) { - size += chunk.top - chunk.offset; - chunk = chunk.next; - } - return size; - } - - /** - * Reads the next byte of data from the input stream. - */ - - public int read () throws IOException { - try { - if (first.top == offset) { - prepare(); - } - return first.data[offset++] & 0xFF; - } catch (JonathanException e) { - Throwable f = e.represents(); - if (f instanceof EndOfMessageException) { - return -1; - } else if (f instanceof IOException) { - throw (IOException) f; - } else { - throw new IOException(f.getMessage()); - } - } - } - - /** - * Reads up to length bytes of data from the input stream into - * an array of bytes. - */ - - public int read (final byte[] array, int off, int length) throws IOException { - try { - if (array == null) { - return (int) skip(length); - } else { - int len = length, toCopy, available; - while(len > 0) { - available = first.top - offset; - if (available == 0) { - prepare(); - available = first.top - offset; - } - toCopy = Math.min(available,len); - System.arraycopy(first.data,offset,array,off,toCopy); - offset += toCopy; - off += toCopy; - len -= toCopy; - } - return length; - } - } catch (JonathanException e) { - Throwable f = e.represents(); - if (f instanceof EndOfMessageException) { - return -1; - } else if (f instanceof IOException) { - throw (IOException) f; - } else { - throw new IOException(f.getMessage()); - } - } - } - - /** - * Skips over and discards n bytes of data from this input - * stream. - */ - - public long skip (final long n) throws IOException { - try { - long len = n, toSkip; - int available; - while(len > 0) { - available = first.top - offset; - if (available == 0) { - prepare(); - available = first.top - offset; - } - toSkip = Math.min(available,len); - offset += toSkip; - len -= toSkip; - } - return n; - } catch (JonathanException e) { - Throwable f = e.represents(); - if (f instanceof EndOfMessageException) { - return -1; - } else if (f instanceof IOException) { - throw (IOException) f; - } else { - throw new IOException(f.getMessage()); - } - } - } - - /** - * Closes this input stream and releases any system resources associated - * with the stream. - */ - - public void close () { - if (first != null) { - first.offset = offset; - } - Chunk next; - while (first != null) { - next = first.next; - first.release(); - first = next; - } - if (provider != null) { - provider.close(); - provider = null; - } - if (context != null) { - context.release(); - context = null; - } - } - - // -------------------------------------------------------------------------- - // Utility methods - // -------------------------------------------------------------------------- - - /** - * Instantiates the delegate object input stream {@link #is is}. This - * method creates {@link RmiObjectInputStream} stream. - * - * @throws IOException if the delegate object input stream cannot be created. - */ - - protected void initObjectStream () throws IOException { - if (is == null) { - is = new RmiObjectInputStream(this, domain, contextFactory); - } - } - - private void prepare () throws JonathanException { - lastOffset += offset; - first.offset = offset; - Chunk prev; - while (first != null && first.top == first.offset) { - prev = first; - first = first.next; - prev.release(); - } - if (first != null) { - offset = first.offset; - lastOffset -= offset; - } else if (provider != null) { - first = provider.prepare(); - offset = first.offset; - lastOffset -= offset; - } else { - throw new EndOfMessageException(); - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/io/package.html b/fractalrmi/src/org/objectweb/fractal/rmi/io/package.html deleted file mode 100644 index c994d7a47b86b8c5599acc672f79df736c21e000..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/io/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -Provides a marshaller and unmarshaller factory component. - -@since Fractal 1.0.6 - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/overview.html b/fractalrmi/src/org/objectweb/fractal/rmi/overview.html deleted file mode 100644 index cfac84b11b77ebb42728143eb0df11f6be187fb8..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/overview.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -DO NOT REMOVE THIS LINE (will be automatically removed). - -Fractal RMI is a set of Fractal components that provide a binding factory to -create distributed bindings between Fractal components. These components are -based on the Jonathan framework. -They can be used with any Fractal implementation. - -

In order to provide distributed bindings between Fractal components, Java RMI -cannot be used, unless the Fractal Specification is changed to specify that -each interface provided or required by a component must extend the -java.rmi.Remote interface, and that all the methods of these interfaces -must declare a java.rmi.RemoteException exception. For the same reason, -the Jeremie personality of Jonathan cannot be used, since it is an RMI-like -personality. The David personality of Jonathan could perhaps have been used for -this purpose, but we found this solution too "heavy" (David requires many CORBA -classes) and not very practical (in particular because of the IDL compiler). -Note that these remarks apply to Jeremie too. - -

We therefore decided to implement our own "personality" on top of the -Jonathan framework alone, without its personalities. This new "personality" is -small and efficient. Moreover it does not need a static stub compiler, and does -not impose constraints on remote interfaces, unlike Java RMI (the -Interface interface plays the role of the -Remote interface: the objects that implement this interface, namely the -interfaces provided by Fractal components, are passed by reference, while all -other objects are passed by value). - -

The set of Fractal components provided by Fractal RMI is depicted in red in -the figure below (the black and gray components are provided by the core -Jonathan framework). This figure also shows how these components can be bound to -each other to get a functional Fractal RMI Binder component, which provides a -NamingContext interface. Note that this "flat" architecture can be made -more readable by using composite components and shared components. - -

-

-Figure 1: "flat" architecture of the Fractal RMI binder. -

- - - \ No newline at end of file diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/package.html b/fractalrmi/src/org/objectweb/fractal/rmi/package.html deleted file mode 100644 index 90dcd3dd3c358c275e4d32dbed3e1e4ae465c4a6..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - -Provides a protocol, an object adapter and a binder component. - -@since Fractal 1.0.6 - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingService.java b/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingService.java deleted file mode 100644 index 5f23fbd2203dfdbe3691251dc3ff9a0f29ffc425..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingService.java +++ /dev/null @@ -1,93 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Bruno Dillenseger - */ - -package org.objectweb.fractal.rmi.registry; - -import org.objectweb.fractal.api.Component; - -/** - * Typical naming service interface, inspired from Java RMI Registry's - * interface. Note: be careful with term "bind", which is not used here as - * Fractal's concept about linking interfaces, but as the basic naming service - * concept of associating a name with a server reference. - */ - -public interface NamingService { - - /** - * Interface name for naming service. - */ - - static final public String NAMING_SERVICE = "naming service"; - - /** - * Gets the list of names currently present in the naming service. - * - * @return an array of names. - */ - - String[] list (); - - /** - * Looks for a component. - * - * @param name the name to look for. - * @return the component associated to the given name. - */ - - Component lookup (String name); - - /** - * Associates the given name with the given component, if and only - * if the given name is not already in use in the naming service. - * - * @param name name to be associated to the component. - * @param comp component to be associated to the given name. - * @return true if the name has been added to the naming service, - * false otherwise. - */ - - boolean bind (String name, Component comp); - - /** - * Associates the given name with the given component, replacing - * any existing association using the same name. - * - * @param name name to be associated to the component. - * @param comp component to be associated to the given name. - * @return the component formerly associated to the given name, or - * null if the given name is new to the naming service. - */ - - Component rebind (String name, Component comp); - - /** - * Removes a name from the naming service. - * - * @param name to remove. - * @return the component that was associated to the name, or - * null if the name was not known by the naming service. - */ - - Component unbind (String name); -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingServiceAttributes.java b/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingServiceAttributes.java deleted file mode 100644 index c848bae39dd84137990ee0bb8afbd5f374210d3d..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingServiceAttributes.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Bruno Dillenseger - */ - -package org.objectweb.fractal.rmi.registry; - -import org.objectweb.fractal.api.control.AttributeController; - -/** - * Attribute controller of the {@link NamingService} component. - */ - -public interface NamingServiceAttributes - extends AttributeController -{ - - void setPersistenceMode (boolean on); - - boolean getPersistenceMode (); - - void setPersistenceFileName (String fileName); - - String getPersistenceFileName (); -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingServiceImpl.java b/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingServiceImpl.java deleted file mode 100644 index 241eb879df1517ab07da9da6f638fad3f3096af6..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/registry/NamingServiceImpl.java +++ /dev/null @@ -1,115 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Bruno Dillenseger - */ - -package org.objectweb.fractal.rmi.registry; - -import org.objectweb.fractal.api.Component; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -/** - * Vanilla implementation of a naming service component. - * Persistence is not implemented. - */ - -public class NamingServiceImpl - implements NamingService, NamingServiceAttributes -{ - - static final String defaultPersistenceFile = "namingServiceState.bytes"; - - private boolean isPersistent = false; - - private String persistenceFileName = null; - - private Map bindings = new HashMap(); - - // -------------------------------------------------------------------------- - // Implementation of the NamingService interface - // -------------------------------------------------------------------------- - - public synchronized String[] list () { - return (String[])bindings.keySet().toArray(new String[bindings.size()]); - } - - public synchronized Component lookup (final String name) { - return (Component)bindings.get(name); - } - - public synchronized boolean bind (final String name, final Component comp) { - if (! bindings.containsKey(name)) { - bindings.put(name, comp); - return true; - } else { - return false; - } - } - - public synchronized Component rebind (final String name, final Component comp) { - Component old = (Component)bindings.remove(name); - bindings.put(name, comp); - return old; - } - - public synchronized Component unbind (final String name) { - return (Component)bindings.remove(name); - } - - // -------------------------------------------------------------------------- - // Implementation of the NamingServiceAttributes interface - // -------------------------------------------------------------------------- - - public boolean getPersistenceMode () { - return isPersistent; - } - - public synchronized void setPersistenceMode (final boolean on) { - if (on) { - if (!isPersistent) { - isPersistent = true; - if (persistenceFileName == null) { - persistenceFileName = defaultPersistenceFile; - } - } - } - else if (isPersistent) { - isPersistent = false; - new File(persistenceFileName).delete(); - } - } - - public String getPersistenceFileName () { - //System.out.println("getPersistenceFile"); - return persistenceFileName; - } - - public synchronized void setPersistenceFileName (final String fileName) { - //System.out.println("setPersistenceFile"); - if (isPersistent && !fileName.equals(persistenceFileName)) { - new File(persistenceFileName).renameTo(new File(fileName)); - } - persistenceFileName = fileName; - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/registry/Registry.java b/fractalrmi/src/org/objectweb/fractal/rmi/registry/Registry.java deleted file mode 100644 index 5b898fa1ee8cfe497484ae0e9009dbc98ab4404c..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/registry/Registry.java +++ /dev/null @@ -1,266 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Bruno Dillenseger, Eric Bruneton - */ - -package org.objectweb.fractal.rmi.registry; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; - -import org.objectweb.fractal.util.Fractal; - -import org.objectweb.fractal.jonathan.JContextFactory; -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.binding.NamingContext; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.JonathanException; - -import java.net.InetAddress; - -/** - * Provides static methods to launch and get access to a Fractal registry. - */ - -public class Registry { - - /** - * The default port used to export the naming service interface. - */ - - public final static int DEFAULT_PORT = 1234; - - /** - * Private constructor (uninstantiable class). - */ - - private Registry () { - } - - /** - * Launches a Fractal registry on the local host. - * - * @param args a single argument setting the port number where to pick the - * naming service interface. - * @throws Exception if something goes wrong. - */ - - public static void main (final String[] args) - throws Exception - { - // port number to export the registry interface - int port = DEFAULT_PORT; - if (args.length == 1) { - try { - port = Integer.parseInt(args[0]); - } catch (NumberFormatException nfe) { - } - } - createRegistry(port); - } - - /** - * Creates {@link NamingService} component and exports its server interface. - * - * @param port the port number to be used to export the naming service - * interface. - * @throws Exception if something goes wrong. - */ - - public static void createRegistry (final int port) - throws Exception - { - // the RMI class loader does not work if there is no security manager - System.setSecurityManager(new SecurityManager()); - - // constructs the Fractal RMI binder - Factory f = FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component comp = - (Component)f.newComponent("org.objectweb.fractal.rmi.ORB", null); - Fractal.getLifeCycleController(comp).startFc(); - NamingContext binder = (NamingContext)comp.getFcInterface("context"); - - // creates the name service component - Component boot = Fractal.getBootstrapComponent(); - TypeFactory tf = Fractal.getTypeFactory(boot); - ComponentType nsType = tf.createFcType( - new InterfaceType[] { - tf.createFcItfType( - NamingService.NAMING_SERVICE, - "org.objectweb.fractal.rmi.registry.NamingService", - TypeFactory.SERVER, - TypeFactory.MANDATORY, - TypeFactory.SINGLE), - tf.createFcItfType( - "attribute-controller", - "org.objectweb.fractal.rmi.registry.NamingServiceAttributes", - TypeFactory.SERVER, - TypeFactory.MANDATORY, - TypeFactory.SINGLE)}); - GenericFactory cf = Fractal.getGenericFactory(boot); - Component nsId = cf.newFcInstance( - nsType, - "primitive", - "org.objectweb.fractal.rmi.registry.NamingServiceImpl"); - Fractal.getLifeCycleController(nsId).startFc(); - - // exports the NamingService interface of the naming service component - Context ctxt = new JContextFactory().newContext(); - ctxt.addElement("port", Integer.class, new Integer(port), (char)0); - ctxt.addElement("key", Integer.class, new Integer(-1), (char)0); - binder.export(nsId.getFcInterface(NamingService.NAMING_SERVICE), ctxt); - - System.out.println("Fractal registry is ready."); - } - - /** - * Returns a reference to the {@link NamingService} on the local host, for the - * default {@link #DEFAULT_PORT port}. - * - * @return a reference to the {@link NamingService} on the local host, for the - * default {@link #DEFAULT_PORT port}. - * @throws Exception if something goes wrong. - */ - - public static NamingService getRegistry () - throws Exception - { - String host = InetAddress.getLocalHost().getHostName(); - return getRegistry(host); - } - - /** - * Returns a reference to the {@link NamingService} on the given host, for the - * default {@link #DEFAULT_PORT port}. - * - * @param host the host where the naming service is located. - * @return a reference to the {@link NamingService} on the given host, for the - * default {@link #DEFAULT_PORT port}. - * @throws Exception if something goes wrong. - */ - - public static NamingService getRegistry (final String host) - throws Exception - { - return getRegistry(host, DEFAULT_PORT); - } - - /** - * Returns a reference to the {@link NamingService} on the given host and - * port. - * - * @param host the host where the naming service is located. - * @param port the port that was used to export the naming service on the - * given host. - * @return a reference to the {@link NamingService} on the given host and - * port. - * @throws Exception if something goes wrong. - */ - - public static NamingService getRegistry ( - final String host, - final int port) throws Exception - { - // constructs the Fractal RMI binder - Factory f = FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component comp = - (Component)f.newComponent("org.objectweb.fractal.rmi.ORB", null); - Fractal.getLifeCycleController(comp).startFc(); - NamingContext binder = (NamingContext)comp.getFcInterface("context"); - return getRegistry(host, port, binder); - } - - /** - * Returns a reference to the {@link NamingService} on the given host, for the - * default {@link #DEFAULT_PORT port}. - * - * @param host the host where the naming service is located. - * @param binder the binder to be used to create the binding to the naming - * service interface. - * @return a reference to the {@link NamingService} on the given host, for the - * default {@link #DEFAULT_PORT port}. - * @throws JonathanException if something goes wrong. - */ - - public static NamingService getRegistry ( - final String host, - final NamingContext binder) throws JonathanException - { - return getRegistry(host, DEFAULT_PORT, binder); - } - - /** - * Returns a reference to the {@link NamingService} on the given host and - * port. - * - * @param host the host where the naming service is located. - * @param port the port that was used to export the naming service on the - * given host. - * @param binder the binder to be used to create the binding to the naming - * service interface. - * @return a reference to the {@link NamingService} on the given host and - * port. - * @throws JonathanException if something goes wrong. - */ - - public static NamingService getRegistry ( - final String host, - final int port, - final NamingContext binder) throws JonathanException - { - short len = (short)host.length(); - byte[] b = new byte[len + 10]; - // port - b[0] = (byte)((port >>> 24) & 0xFF); - b[1] = (byte)((port >>> 16) & 0xFF); - b[2] = (byte)((port >>> 8) & 0xFF); - b[3] = (byte)(port & 0xFF); - // host - b[4] = (byte)((len >>> 8) & 0xFF); - b[5] = (byte)(len & 0xFF); - for (int i = 0 ; i < len; ++i) { - b[i + 6] = (byte)host.charAt(i); - } - // key - int key = -1; - b[len + 6] = (byte)((key >>> 24) & 0xFF); - b[len + 7] = (byte)((key >>> 16) & 0xFF); - b[len + 8] = (byte)((key >>> 8) & 0xFF); - b[len + 9] = (byte)(key & 0xFF); - - Identifier id = binder.decode(b, 0, b.length); - - Context hints = new JContextFactory().newContext(); - hints.addElement( - "interface_type", - String.class, - "org.objectweb.fractal.rmi.registry.NamingService", - (char)0); - - return (NamingService)id.bind(new Identifier[] {id}, hints); - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/registry/package.html b/fractalrmi/src/org/objectweb/fractal/rmi/registry/package.html deleted file mode 100644 index 75287dc6164eb76f356dcf519cf19b8214f27910..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/registry/package.html +++ /dev/null @@ -1,3 +0,0 @@ - -Provides a Fractal components registry component. - \ No newline at end of file diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactory.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactory.fractal deleted file mode 100644 index 396373d79f38f11096c0737c76be77fd9f2ac293..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactory.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactory.java b/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactory.java deleted file mode 100644 index 76d5cbf8a358846d3d8b37d481816c7f014b14e8..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactory.java +++ /dev/null @@ -1,1090 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * with some comments copied from Jonathan: - * org.objectweb.jonathan.apis.stub_factories.StubFactory (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi.stub; - -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; -import org.objectweb.asm.Type; - -import org.objectweb.jonathan.apis.binding.ExportException; -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.MarshallerFactory; -import org.objectweb.jonathan.apis.protocols.RequestSession; -import org.objectweb.jonathan.apis.protocols.SessionIdentifier; -import org.objectweb.jonathan.apis.stub_factories.StubFactory; - -import org.objectweb.util.monolog.api.BasicLevel; -import org.objectweb.util.monolog.api.Logger; -import org.objectweb.util.monolog.api.LoggerFactory; - -import java.lang.reflect.Method; -import java.util.HashMap; - -/** - * A stub and skeleton factory based on ASM. This factory generates the stub - * and skeleton classes dynamically, when they are needed. It is therefore not - * necessary for the user to statically generate these classes with a tool such - * as rmic or idlc. - *
- * The stubs and skeletons created by this factory marshall and unmarshall the - * method invocations by using the following format: a method invocation message - * contains a four bytes method index, which uniquely and unambiguously - * identifies a method among the methods provided by a Java interface, followed - * by the method's arguments, marshalled in the order of their declaration in - * the method's signature. - */ - -public class RmiStubFactory - implements Constants, StubFactory, SkeletonFactory, BindingController -{ - - /** - * A map associating {@link Loader loaders} to their parent class loader. - */ - - private final static HashMap LOADERS = new HashMap(); - - /** - * The marshaller factory to be used by the stubs created by this factory. - */ - - protected MarshallerFactory marshallerFactory; - - /** - * The optional logger factory used to get a logger for this component. - */ - - protected LoggerFactory loggerFactory; - - /** - * The logger used to log messages. May be null. - */ - - protected Logger logger; - - /** - * Constructs a new {@link RmiStubFactory}. - */ - - public RmiStubFactory () { - } - - // -------------------------------------------------------------------------- - // Implementation of the BindingController interface - // -------------------------------------------------------------------------- - - public String[] listFc () { - return new String[] { "marshaller-factory", "logger-factory" }; - } - - public Object lookupFc (final String clientItfName) { - if (clientItfName.equals("marshaller-factory")) { - return marshallerFactory; - } else if (clientItfName.equals("logger-factory")) { - return loggerFactory; - } - return null; - } - - public void bindFc (final String clientItfName, final Object serverItf) { - if (clientItfName.equals("marshaller-factory")) { - marshallerFactory = (MarshallerFactory)serverItf; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = (LoggerFactory)serverItf; - logger = loggerFactory.getLogger(getClass().getName()); - } - } - - public void unbindFc (final String clientItfName) { - if (clientItfName.equals("marshaller-factory")) { - marshallerFactory = null; - } else if (clientItfName.equals("logger-factory")) { - loggerFactory = null; - logger = null; - } - } - - // -------------------------------------------------------------------------- - // Implementation of the StubFactory interface - // -------------------------------------------------------------------------- - - /** - * Creates a new stub. A stub plays two roles: - *
    - *
  • It is the local representative of a (remote) object, and thus should - * bear a set of identifiers for that remote object;
  • - *
  • It is part of the binding between the client and the server, and is - * thus related to a given protocol. The session identifier provided as an - * argument is the manifestation of this relation. It can be used to - * obtain a session allowing the stub to send data to the remote object.
  • - *
- * - * @param sessionId a session identifier, to be used to send marshalled - * data to the object represented by the stub; - * @param ids the set of identifiers of the stub; - * @param hints other data possibly used to create the stub. This method - * requires the fully qualified name of the Java interface to which the - * stub will gives access. This name must be associated to the - * "interface_type" key. - * @return an instance of a sub class of the {@link Stub} class. - * @throws JonathanException if something goes wrong. - */ - - public Object newStub ( - final SessionIdentifier sessionId, - final Identifier[] ids, - final Context hints) throws JonathanException - { - try { - String implClassName = (String)hints.getValue("interface_type", (char)0); - Class implClass = - Thread.currentThread().getContextClassLoader().loadClass(implClassName); - Class stubClass = - getLoader(implClass).loadClass(getStubClassName(implClass.getName())); - if (ids.length != 1) { - throw new JonathanException(); - } - Stub stub = (Stub)stubClass.newInstance(); - stub.id = ids[0]; - stub.sessionId = sessionId; - stub.marshallerFactory = marshallerFactory; - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.INFO, "Stub created for id " + ids[0]); - } - return stub; - } catch (Exception e) { - throw new JonathanException(e); - } - } - - // -------------------------------------------------------------------------- - // Implementation of the StubFactory interface - // -------------------------------------------------------------------------- - - public RequestSession newSkeleton (final Object target) - throws JonathanException - { - try { - if (!(target instanceof Interface)) { - throw new Exception("target object must implement Interface"); - } - Class implClass = target.getClass(); - Class[] itfs = implClass.getInterfaces(); - if (itfs.length == 0) { - throw new Exception("target object must implement an interface"); - } - Class skelClass = - getLoader(implClass).loadClass(getSkelClassName(itfs[0].getName())); - Skeleton skel = (Skeleton)skelClass.newInstance(); - skel.target = target; - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.INFO, "Skeleton created for target " + target); - } - return skel; - } catch (Exception e) { - throw new ExportException(e); - } - } - - // -------------------------------------------------------------------------- - // Class loading - // -------------------------------------------------------------------------- - - /** - * Returns the {@link Loader} whose parent class loader is equal to the - * given one. - * - * @param context the parent class loader. More precisely a class, from which - * the parent class loader is computed (with the getClassLoader method). - * @return the {@link Loader} whose parent class loader is equal to the - * given one. - */ - - private Loader getLoader (final Class context) { - ClassLoader parent = context.getClassLoader(); - Loader instance = (Loader)LOADERS.get(parent); - if (instance == null) { - instance = new Loader(parent); - LOADERS.put(parent, instance); - } - return instance; - } - - /** - * A class loader that can generate stub and skeleton classes on the fly. - */ - - class Loader extends ClassLoader { - - /** - * Constructs a {@link Loader} with the given parent class loader. - * - * @param parent the parent class loader. - */ - - public Loader (final ClassLoader parent) { - super(parent); - } - - /** - * Finds the class whose name is given. If the given name is of the form - * prefix_Stub then this method calls the {@link - * #generateStubClass generateStubClass} method with the prefix class - * as parameter. If the given name is of the form - * prefix_Skel then this method calls the - * {@link #generateSkeletonClass generateSkeletonClass} method with the - * prefix class as parameter. In all other cases this method throws - * an exception. - * - * @param name the name of the class to be found. - * @return the specified class. - * @throws ClassNotFoundException if the class cannot be found. - */ - - protected Class findClass (final String name) - throws ClassNotFoundException - { - if (isStubClassName(name)) { - Class itf = loadClass(resolveStubClassName(name)); - ClassWriter cw = new ClassWriter(true); - generateStubClass(cw, itf); - byte[] b = cw.toByteArray(); - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.INFO, "Stub class generated: " + name); - } - /* - try { - java.io.OutputStream os; - os = new java.io.FileOutputStream(name + ".class"); - os.write(b); - os.close(); - } catch (Exception e) { - }*/ - return defineClass(name, b, 0, b.length); - } else if (isSkelClassName(name)) { - Class itf = loadClass(resolveSkelClassName(name)); - ClassWriter cw = new ClassWriter(true); - generateSkeletonClass(cw, itf); - byte[] b = cw.toByteArray(); - if (logger != null && logger.isLoggable(BasicLevel.INFO)) { - logger.log(BasicLevel.INFO, "Skeleton class generated: " + name); - } - /* - try { - java.io.OutputStream os; - os = new java.io.FileOutputStream(name + ".class"); - os.write(b); - os.close(); - } catch (Exception e) { - }*/ - return defineClass(name, b, 0, b.length); - } else { - throw new ClassNotFoundException(name); - } - } - } - - // -------------------------------------------------------------------------- - // Utility methods: class generation - // -------------------------------------------------------------------------- - - /** - * Generates a stub class for the given Java interface. This method generates - * a sub class of the {@link Stub} class that implements the given - * interface, by using the given class visitor. - * - * @param cv the class visitor to be used to generate the stub class. - * @param itf the Java interface that the stub class must implement. - */ - - protected void generateStubClass (final ClassVisitor cv, final Class itf) { - int access = ACC_PUBLIC; - String name = getStubClassName(itf.getName()).replace('.', '/'); - String superClass = "org/objectweb/fractal/rmi/stub/Stub"; - String[] itfs = new String[] { Type.getInternalName(itf) }; - cv.visit(access, name, superClass, itfs, null); - generateConstructor(cv, superClass); - Method[] meths = itf.getMethods(); - sort(meths); - for (int i = 0; i < meths.length; ++i) { - Method meth = meths[i]; - generateStubMethod(cv, name, meth, i); - } - } - - /** - * Generates a skeleton class for the given Java interface. This method - * generates a sub class of the {@link Skeleton} class whose {@link - * Skeleton#target target} is an object implementing the given interface, - * by using the given class visitor. - * - * @param cv the class visitor to be used to generate the stub class. - * @param itf the Java interface implemented by the skeleton's target. - */ - - protected void generateSkeletonClass (final ClassVisitor cv, final Class itf) { - int access = ACC_PUBLIC; - String name = getSkelClassName(itf.getName()).replace('.', '/'); - String superClass = "org/objectweb/fractal/rmi/stub/Skeleton"; - cv.visit(access, name, superClass, null, null); - generateConstructor(cv, superClass); - generateSkeletonMethod(cv, name, itf); - } - - /** - * Generates an empty constructor for the given class. - * - * @param cv the class visitor to be used to generate the constructor. - * @param superClass the internal name of the super class of the generated - * class. This name is used to generate a call to the super constructor. - */ - - protected void generateConstructor ( - final ClassVisitor cv, - final String superClass) - { - CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "", "()V", null, null); - // generates the bytecode corresponding to 'super(...);' - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, superClass, "", "()V"); - mv.visitInsn(RETURN); - mv.visitMaxs(1, 1); - } - - /** - * Generates a stub method. A stub method is of the following form: - *

- *

-   * public T m (T0 arg0, ...) throws E0, ... {
-   *   try {
-   *     Marshaller marshaller = request();
-   *     ReplyInterface reply = prepareInvocation(marshaller);
-   *     marshaller.writeInt(methodIndex);
-   *     marshaller.writeXXX(arg0);
-   *     ...
-   *     invoke(marshaller);
-   *     UnMarshaller unmarshaller = reply.listen();
-   *     T result = (T)unmarshaller.readXXX();
-   *     unmarshaller.close();
-   *     return result;
-   *   } catch (Exception e) {
-   *     e = handleException(e);
-   *     if (e instanceof E0) throw (E0)e;
-   *     ...
-   *     if (e instanceof RuntimeException) throw (RuntimeException)e;
-   *     throw new RemoteException("server side exception", e);
-   *   }
-   * }
-   * 
- * - * @param cv the class visitor to be used to generate the stub method. - * @param name the internal name of the generated stub class. - * @param m the signature of the method that must be generated. - * @param index the index of this method. This index will be marshalled by the - * generated stub method in each invocation message, to specify the - * method that must be called on the server side. This index is the index - * of the method in the {@link #sort sorted} array of all the - * methods implemented by the stub. - */ - - protected void generateStubMethod ( - final ClassVisitor cv, - final String name, - final Method m, - final int index) - { - // generate the method header - String itf = Type.getInternalName(m.getDeclaringClass()); - String mName = m.getName(); - String mDesc = Type.getMethodDescriptor(m); - Class[] params = m.getParameterTypes(); - int locals = 1; - for (int i = 0; i < params.length; ++i) { - locals += getSize(params[i]); - } - Class result = m.getReturnType(); - Class[] exceptions = m.getExceptionTypes(); - String[] excepts = new String[exceptions.length]; - for (int i = 0; i < exceptions.length; ++i) { - excepts[i] = Type.getInternalName(exceptions[i]); - } - CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, mName, mDesc, excepts, null); - - Label beginL = new Label(); - Label endL = new Label(); - - mv.visitLabel(beginL); - // generate "Marshaller marshaller = request();" - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEVIRTUAL, - name, - "request", - "()Lorg/objectweb/jonathan/apis/presentation/Marshaller;"); - mv.visitVarInsn(ASTORE, locals); - - // generate "ReplyInterface reply = prepareInvocation(marshaller);" - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, locals); - mv.visitMethodInsn( - INVOKEVIRTUAL, - name, - "prepareInvocation", - "(Lorg/objectweb/jonathan/apis/presentation/Marshaller;)Lorg/objectweb/jonathan/apis/protocols/ReplyInterface;"); - mv.visitVarInsn(ASTORE, locals + 1); - - // generate "marshaller.writeInt();" - mv.visitVarInsn(ALOAD, locals); - mv.visitIntInsn(SIPUSH, index); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/Marshaller", - "writeInt", - "(I)V"); - - // parameter marshalling - int offset = 1; - for (int i = 0; i < params.length; ++i) { - mv.visitVarInsn(ALOAD, locals); - mv.visitVarInsn(ILOAD + getOpcodeOffset(params[i]), offset); - if (params[i].isPrimitive()) { - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/Marshaller", - "write" + getMarshallerMethod(params[i]), - "(" + Type.getDescriptor(params[i]) + ")V"); - } else { - if (isClassParameter(m, i)) { - Label l1 = new Label(); - Label l2 = new Label(); - mv.visitInsn(DUP); - mv.visitJumpInsn(IFNULL, l1); - mv.visitTypeInsn(CHECKCAST, "java/lang/String");//TODO - mv.visitMethodInsn( - INVOKESTATIC, - "java/lang/Class", - "forName", - "(Ljava/lang/String;)Ljava/lang/Class;"); - mv.visitJumpInsn(GOTO, l2); - mv.visitLabel(l1); - mv.visitInsn(POP); - mv.visitInsn(ACONST_NULL); - mv.visitLabel(l2); - } - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/Marshaller", - "writeValue", - "(Ljava/lang/Object;)V"); - } - offset += getSize(params[i]); - } - - // generate "invoke(marshaller);" - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, locals); - mv.visitMethodInsn( - INVOKEVIRTUAL, - name, - "invoke", - "(Lorg/objectweb/jonathan/apis/presentation/Marshaller;)V"); - - // generate "UnMarshaller unmarshaller = reply.listen();" - mv.visitVarInsn(ALOAD, locals + 1); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/protocols/ReplyInterface", - "listen", - "()Lorg/objectweb/jonathan/apis/presentation/UnMarshaller;"); - mv.visitVarInsn(ASTORE, locals + 2); - - // return value unmarshalling - if (result != Void.TYPE) { - mv.visitVarInsn(ALOAD, locals + 2); - if (result.isPrimitive()) { - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/UnMarshaller", - "read" + getMarshallerMethod(result), - "()" + Type.getDescriptor(result)); - } else { - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/UnMarshaller", - "readValue", - "()Ljava/lang/Object;"); - if (isClassParameter(m, -1)) { - Label l1 = new Label(); - Label l2 = new Label(); - mv.visitInsn(DUP); - mv.visitJumpInsn(IFNULL, l1); - mv.visitTypeInsn(CHECKCAST, "java/lang/Class"); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "java/lang/Class", - "getName", - "()Ljava/lang/String;"); - mv.visitJumpInsn(GOTO, l2); - mv.visitLabel(l1); - mv.visitInsn(POP); - mv.visitInsn(ACONST_NULL); - mv.visitLabel(l2); - } else { - mv.visitTypeInsn(CHECKCAST, Type.getInternalName(result)); - } - } - mv.visitVarInsn(ISTORE + getOpcodeOffset(result), locals + 3); - } - - // generate "unmarshaller.close();" - mv.visitVarInsn(ALOAD, locals + 2); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/UnMarshaller", - "close", - "()V"); - - // generate "return result"; - if (result != Void.TYPE) { - mv.visitVarInsn(ILOAD + getOpcodeOffset(result), locals + 3); - mv.visitInsn(IRETURN + getOpcodeOffset(result)); - } else { - mv.visitInsn(RETURN); - } - mv.visitLabel(endL); - - mv.visitVarInsn(ASTORE, locals); - - // generate "e = handleException(e);" - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, locals); - mv.visitMethodInsn( - INVOKEVIRTUAL, - name, - "handleException", - "(Ljava/lang/Exception;)Ljava/lang/Exception;"); - mv.visitVarInsn(ASTORE, locals); - - // generate "if (e instanceof ) throw ()e;" - for (int i = 0; i < exceptions.length; ++i) { - String type = Type.getInternalName(exceptions[i]); - mv.visitVarInsn(ALOAD, locals); - mv.visitTypeInsn(INSTANCEOF, type); - Label next = new Label(); - mv.visitJumpInsn(IFEQ, next); - mv.visitVarInsn(ALOAD, locals); - mv.visitTypeInsn(CHECKCAST, type); - mv.visitInsn(ATHROW); - mv.visitLabel(next); - } - - // generate "if (e instanceof RuntimeException) throw (RuntimeException)e;" - mv.visitVarInsn(ALOAD, locals); - mv.visitTypeInsn(INSTANCEOF, "java/lang/RuntimeException"); - Label next = new Label(); - mv.visitJumpInsn(IFEQ, next); - mv.visitVarInsn(ALOAD, locals); - mv.visitTypeInsn(CHECKCAST, "java/lang/RuntimeException"); - mv.visitInsn(ATHROW); - mv.visitLabel(next); - - // generate "throw new RemoteException("server side exception", e);" - mv.visitTypeInsn(NEW, "org/objectweb/fractal/rmi/RemoteException"); - mv.visitInsn(DUP); - mv.visitLdcInsn("server side exception"); - mv.visitVarInsn(ALOAD, locals); - mv.visitMethodInsn( - INVOKESPECIAL, - "org/objectweb/fractal/rmi/RemoteException", - "", - "(Ljava/lang/String;Ljava/lang/Exception;)V"); - mv.visitInsn(ATHROW); - - // end method body - mv.visitTryCatchBlock(beginL, endL, endL, "java/lang/Exception"); - mv.visitMaxs(0, 0); - } - - /** - * Generates a skeleton's {@link Skeleton#send send} method. The generated - * method is of the following form: - *

- *

-   * public void send (UnMarshaller unmarshaller, ReplySession session)
-   *   throws JonathanException
-   * {
-   *   int methodIndex = unmarshaller.readInt();
-   *   try {
-   *     switch (methodIndex) {
-   *       case 0:
-   *         T0 arg0 = unmarshaller.readXXX();
-   *         ...
-   *         unmarshaller.close();
-   *         T result = ((I)target).m0(arg0, ... );
-   *         Marshaller marshaller = session.prepareReply();
-   *         marshaller.writeXXX(result);
-   *         session.send(marshaller);
-   *         session.close();
-   *         return;
-   *       ...
-   *       default:
-   *         handleInterfaceMethods(unmarshaller, session, methodIndex);
-   *     }
-   *   } catch (Exception e) {
-   *     handleException(e, session);
-   *   }
-   * }
-   * 
- * - * @param cv the class visitor to be used to generate the stub method. - * @param name the internal name of the generated stub class. - * @param itf the target object's interface that must be exported by the - * skeleton. - */ - - protected void generateSkeletonMethod ( - final ClassVisitor cv, - final String name, - final Class itf) - { - CodeVisitor mv = cv.visitMethod( - ACC_PUBLIC, - "send", - "(Lorg/objectweb/jonathan/apis/presentation/UnMarshaller;Lorg/objectweb/jonathan/apis/protocols/ReplySession;)V", - new String[] { "org/objectweb/jonathan/apis/kernel/JonathanException" }, - null); - - Label beginL = new Label(); - Label endL = new Label(); - Label defaultL = new Label(); - - // generate "int methodIndex = unmarshaller.readInt();" - mv.visitLabel(beginL); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/UnMarshaller", - "readInt", - "()I"); - mv.visitVarInsn(ISTORE, 3); - - // generate the "switch (methodIndex)" statement - Method[] meths = itf.getMethods(); - sort(meths); - Label[] cases = new Label[meths.length]; - for (int i = 0; i < cases.length; ++i) { - cases[i] = new Label(); - } - if (meths.length > 0) { - mv.visitVarInsn(ILOAD, 3); - mv.visitTableSwitchInsn(0, meths.length - 1, defaultL, cases); - } - - // generate the "case" blocks - for (int i = 0; i < meths.length; ++i) { - Method m = meths[i]; - String mName = m.getName(); - String mDesc = Type.getMethodDescriptor(m); - Class[] params = m.getParameterTypes(); - Class result = m.getReturnType(); - - mv.visitLabel(cases[i]); - - // generate " obj = ()target;" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "target", "Ljava/lang/Object;"); - mv.visitTypeInsn(CHECKCAST, Type.getInternalName(itf)); - - // parameter unmarshalling - for (int j = 0; j < params.length; ++j) { - mv.visitVarInsn(ALOAD, 1); - if (params[j].isPrimitive()) { - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/UnMarshaller", - "read" + getMarshallerMethod(params[j]), - "()" + Type.getDescriptor(params[j])); - } else { - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/UnMarshaller", - "readValue", - "()Ljava/lang/Object;"); - if (isClassParameter(m, j)) { - Label l1 = new Label(); - Label l2 = new Label(); - mv.visitInsn(DUP); - mv.visitJumpInsn(IFNULL, l1); - mv.visitTypeInsn(CHECKCAST, "java/lang/Class"); - mv.visitMethodInsn( - INVOKEVIRTUAL, - "java/lang/Class", - "getName", - "()Ljava/lang/String;"); - mv.visitJumpInsn(GOTO, l2); - mv.visitLabel(l1); - mv.visitInsn(POP); - mv.visitInsn(ACONST_NULL); - mv.visitLabel(l2); - } else { - mv.visitTypeInsn(CHECKCAST, Type.getInternalName(params[j])); - } - } - } - - // generate "unmarshaller.close();" - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/UnMarshaller", - "close", - "()V"); - - // generate code to call target method and store result - mv.visitMethodInsn(INVOKEINTERFACE, Type.getInternalName(itf), mName, mDesc); - if (result != Void.TYPE) { - mv.visitVarInsn(ISTORE + getOpcodeOffset(result), 5); - } - - // generate "Marshaller marshaller = session.prepareReply();" - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/protocols/ReplySession", - "prepareReply", - "()Lorg/objectweb/jonathan/apis/presentation/Marshaller;"); - mv.visitVarInsn(ASTORE, 4); - - // generate code to marshall result value - if (result != Void.TYPE) { - mv.visitVarInsn(ALOAD, 4); - mv.visitVarInsn(ILOAD + getOpcodeOffset(result), 5); - if (result.isPrimitive()) { - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/Marshaller", - "write" + getMarshallerMethod(result), - "(" + Type.getDescriptor(result)+ ")V"); - } else { - if (isClassParameter(m, -1)) { - Label l1 = new Label(); - Label l2 = new Label(); - mv.visitInsn(DUP); - mv.visitJumpInsn(IFNULL, l1); - mv.visitMethodInsn( - INVOKESTATIC, - "java/lang/Class", - "forName", - "(Ljava/lang/String;)Ljava/lang/Class;"); - mv.visitJumpInsn(GOTO, l2); - mv.visitLabel(l1); - mv.visitInsn(POP); - mv.visitInsn(ACONST_NULL); - mv.visitLabel(l2); - } - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/presentation/Marshaller", - "writeValue", - "(Ljava/lang/Object;)V"); - } - } - - // generate "session.send(marshaller);" - mv.visitVarInsn(ALOAD, 2); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/protocols/ReplySession", - "send", - "(Lorg/objectweb/jonathan/apis/presentation/Marshaller;)V"); - - // generate "session.close();" - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/jonathan/apis/protocols/ReplySession", - "close", - "()V"); - - // generate "return;" - mv.visitInsn(RETURN); - } - - // generate default block: - // "handleInterfaceMethods(unmarshaller, session, methodIndex);" - // "return;" - mv.visitLabel(defaultL); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitVarInsn(ALOAD, 2); - mv.visitVarInsn(ILOAD, 3); - mv.visitMethodInsn( - INVOKEVIRTUAL, - name, - "handleInterfaceMethods", - "(Lorg/objectweb/jonathan/apis/presentation/UnMarshaller;Lorg/objectweb/jonathan/apis/protocols/ReplySession;I)V"); - mv.visitInsn(RETURN); - - // generate "catch (Exception e) { handleException(e, session); }" - mv.visitLabel(endL); - mv.visitVarInsn(ASTORE, 3); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 3); - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn( - INVOKEVIRTUAL, - name, - "handleException", - "(Ljava/lang/Exception;Lorg/objectweb/jonathan/apis/protocols/ReplySession;)V"); - mv.visitInsn(RETURN); - - // end method code - mv.visitTryCatchBlock(beginL, endL, endL, "java/lang/Exception"); - mv.visitMaxs(0, 0); - } - - /** - * Returns true if the specified parameter contains the name of a - * class. This method is used to marshall a Class object, instead of - * a String, for parameters that contains class names, in order to - * enable these classes to be downloaded from the network if needed. The - * default implementation of this method returns true for: - *
    - *
  • the return value of Template.getFcContentDesc.
  • - *
  • the fourth parameter of TemplateFactory.createFcTemplate.
  • //TODO - *
  • the return value of InterfaceType.getFcItfSignature.
  • - *
  • the second parameter of TypeFactory.createFcItfType.
  • - *
- * - * @param m a method. - * @param p index of a parameter of this method, or -1 to designate - * the return value. - * @return true if the specified parameter contains the name of a - * class. - */ - - protected boolean isClassParameter (final Method m, final int p) { // TODO update spec v2 - String name = m.getName(); - if (name.equals("getFcContentDesc")) { - return p == -1; - } else if (name.equals("newFcInstance")) { - return p == 2; - } else if (name.equals("getFcItfSignature")) { - return p == -1; - } else if (name.equals("createFcItfType")) { - return p == 1; - } - return false; - } - - /** - * Sorts the given methods. This method is used to assign an unambiguous - * index to each method of an interface (the index of a method in - * the array returned by {@link Class#getMethods() getMethods} cannot directly - * be used for this purpose, since this method returns the methods in any - * order). - * - * @param methods the method array to be sorted. - */ - - protected static void sort (final Method[] methods) { - String[] descs = new String[methods.length]; - for (int i = 0; i < descs.length; ++i) { - descs[i] = methods[i].getName() + Type.getMethodDescriptor(methods[i]); - } - for (int i = 0; i < descs.length; ++i) { - for (int j = i + 1; j < descs.length; ++j) { - if (descs[j].compareTo(descs[i]) < 0) { - String s = descs[i]; - descs[i] = descs[j]; - descs[j] = s; - Method m = methods[i]; - methods[i] = methods[j]; - methods[j] = m; - } - } - } - } - - /** - * Returns the suffix of the (un)marshaller method corresponding to the given - * primitive type. - * - * @param type a primitive type. - * @return the suffix of the (un)marshaller method corresponding to the given - * primitive type (such as "Byte" for byte, or "Char16" for char). - */ - - private static String getMarshallerMethod (final Class type) { - if (type == Byte.TYPE) { - return "Byte"; - } else if (type == Integer.TYPE) { - return "Int"; - } else if (type == Boolean.TYPE) { - return "Boolean"; - } else if (type == Double.TYPE) { - return "Double"; - } else if (type == Float.TYPE) { - return "Float"; - } else if (type == Long.TYPE) { - return "Long"; - } else if (type == Character.TYPE) { - return "Char16"; - } else /*if (result == Short.TYPE)*/ { - return "Short"; - } - } - - /** - * Returns the offset which must be added to some opcodes to get an opcode of - * the given type. More precisely, returns the offset which must be added to - * an opc_iXXXX opcode to get the opc_YXXXX opcode corresponding to the given - * type. For example, if the given type is double the result is 3, which - * means that opc_dload, opc_dstore, opc_dreturn... opcodes are equal to - * opc_iload+3, opc_istore+3, opc_ireturn+3... - * - * @param type a Java class representing a Java type (primitive or not). - * @return the opcode offset of the corresponding to the given type. - */ - - private static int getOpcodeOffset (final Class type) { - if (type == Double.TYPE) { - return 3; - } else if (type == Float.TYPE) { - return 2; - } else if (type == Long.TYPE) { - return 1; - } else if (type.isPrimitive()) { - return 0; - } - return 4; - } - - /** - * Returns the size of the given type. This size is 2 for the double and long - * types, and 1 for the other types. - * - * @param type a Java class representing a Java type (primitive or not). - * @return the size of the given type. - */ - - private static int getSize (final Class type) { - return (type == Double.TYPE || type == Long.TYPE ? 2 : 1); - } - - /** - * Returns the name of the stub class for the given class. - * - * @param className a fully qualified class name. - * @return the name of the stub class for the given class. - */ - - private static String getStubClassName (final String className) { - if (className.startsWith("java.")) { - return "stub." + className + "_JavaStub"; - } else { - return className + "_Stub"; - } - } - - /** - * Returns true if the given name if the name of a stub class. - * - * @param className a fully qualified class name. - * @return true if the given name if the name of a stub class. - */ - - private static boolean isStubClassName (final String className) { - return className.endsWith("_JavaStub") || className.endsWith("_Stub"); - } - - /** - * Returns the class name corresponding to the given stub class name. - * - * @param stubClassName a fully qualified stub class name. - * @return the class name corresponding to the given stub class name. - */ - - private static String resolveStubClassName (final String stubClassName) { - if (stubClassName.endsWith("_JavaStub")) { - return stubClassName.substring(5, stubClassName.length() - 9); - } else { - return stubClassName.substring(0, stubClassName.length() - 5); - } - } - - /** - * Returns the name of the skeleton class for the given class. - * - * @param className a fully qualified class name. - * @return the name of the skeleton class for the given class. - */ - - private static String getSkelClassName (final String className) { - if (className.startsWith("java.")) { - return "skel." + className + "_JavaSkel"; - } else { - return className + "_Skel"; - } - } - - /** - * Returns true if the given name if the name of a skeleton class. - * - * @param className a fully qualified class name. - * @return true if the given name if the name of a skeleton class. - */ - - private static boolean isSkelClassName (final String className) { - return className.endsWith("_JavaSkel") || className.endsWith("_Skel"); - } - - /** - * Returns the class name corresponding to the given skeleton class name. - * - * @param skelClassName a fully qualified skeleton class name. - * @return the class name corresponding to the given skeleton class name. - */ - - private static String resolveSkelClassName (final String skelClassName) { - if (skelClassName.endsWith("_JavaSkel")) { - return skelClassName.substring(5, skelClassName.length() - 9); - } else { - return skelClassName.substring(0, skelClassName.length() - 5); - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactoryType.fractal b/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactoryType.fractal deleted file mode 100644 index 5710a3a94a6f7f06c91390e5806b3f76e26954fa..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/stub/RmiStubFactoryType.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/stub/Skeleton.java b/fractalrmi/src/org/objectweb/fractal/rmi/stub/Skeleton.java deleted file mode 100644 index 2f94934f44794f0afa03ccc53022906f90bcac77..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/stub/Skeleton.java +++ /dev/null @@ -1,180 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * with some comments copied from Jonathan: - * org.objectweb.jonathan.apis.protocols.RequestSession (author: B. Dumant) - */ - -package org.objectweb.fractal.rmi.stub; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.Type; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; -import org.objectweb.jonathan.apis.protocols.ReplySession; -import org.objectweb.jonathan.apis.protocols.RequestSession; - -/** - * Super class of the skeleton classes generated by the {@link RmiStubFactory}. - * A skeleton gives access to a local interface of a Fractal - * component. It unmarshalls invocation messages and calls the corresponding - * methods on the local interface to which it gives access. Like stubs, a - * skeleton gives access to the "functional" interface provided by a server - * interface, and also gives access to the methods of the {@link Interface} - * interface implemented by this server interface. - */ - -public abstract class Skeleton implements RequestSession { - - /** - * The local server interface to which this skeleton gives access. - */ - - protected Object target; - - /** - * Constructs a new {@link Skeleton}. - */ - - public Skeleton () { - } - - // -------------------------------------------------------------------------- - // Implementation of the RequestSession interface - // -------------------------------------------------------------------------- - - /** - * Returns the target object represented by this request session. - * - * @return the target object represented by this request session. - */ - - public Object getTarget () { - return target; - } - - /** - * Sends a message (a request) to its recipient. The unmarshaller representing - * the invocation is sent together with a reply session, to be used by the - * recipient to send the reply. The reply session may be null if no response - * is expected. It is the responsibility of the recipient to make sure that - * the unmarshaller will properly be {@link UnMarshaller#close() closed}. - * - * @param unmarshaller the unmarshaller representing the request. - * @param session the session to send the reply. - * @throws JonathanException if something goes wrong. - */ - - public abstract void send (UnMarshaller unmarshaller, ReplySession session) - throws JonathanException; - - // -------------------------------------------------------------------------- - // Utility methods - // -------------------------------------------------------------------------- - - /** - * Handles invocations messages corresponding to methods of the {@link - * Interface} interface. - * - * @param unmarshaller the unmarshaller representing the request. - * @param session the session to send the reply. - * @param methodIndex the index of the method to be called. - * @throws JonathanException if something goes wrong. - */ - - protected void handleInterfaceMethods ( - final UnMarshaller unmarshaller, - final ReplySession session, - final int methodIndex) throws JonathanException - { - Interface itf = (Interface)target; - Marshaller marshaller; - try { - switch (methodIndex) { - case -1: - unmarshaller.close(); - Component id = itf.getFcItfOwner(); - marshaller = session.prepareReply(); - marshaller.writeValue(id); - session.send(marshaller); - session.close(); - return; - case -2: - unmarshaller.close(); - String name = itf.getFcItfName(); - marshaller = session.prepareReply(); - marshaller.writeValue(name); - session.send(marshaller); - session.close(); - return; - case -3: - unmarshaller.close(); - Type type = itf.getFcItfType(); - marshaller = session.prepareReply(); - marshaller.writeValue(type); - session.send(marshaller); - session.close(); - return; - case -4: - unmarshaller.close(); - boolean internal = itf.isFcInternalItf(); - marshaller = session.prepareReply(); - marshaller.writeBoolean(internal); - session.send(marshaller); - session.close(); - return; - default: - throw new Exception("No such method"); - } - } catch (Exception e) { - handleException(e, session); - } - } - - /** - * Handles an exception that happened in this skeleton. This method sends the - * given exception to the caller by using the given reply session. - * - * @param e the exception that happened. - * @param session the session to send the reply. - * @throws JonathanException if the given exception cannot be sent back to the - * caller. - */ - - protected void handleException (final Exception e, final ReplySession session) - throws JonathanException - { - try { - Marshaller marshaller = session.prepareExceptionReply(); - marshaller.writeValue(e); - session.send(marshaller); - } catch (Exception f) { - f.printStackTrace(); - throw new JonathanException( - "error during marshalling of exception by skeleton"); - } - session.close(); - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/stub/SkeletonFactory.java b/fractalrmi/src/org/objectweb/fractal/rmi/stub/SkeletonFactory.java deleted file mode 100644 index 7ff5ce28f024769204e0d221e773d3e182c17fff..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/stub/SkeletonFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * inspired from Jonathan: - * org.objectweb.jeremie.apis.stub_factories.JRMIStubFactory - * (authors: B. Dumant, K. Milsted) - */ - -package org.objectweb.fractal.rmi.stub; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.protocols.RequestSession; - -/** - * A factory to create skeletons. - */ - -public interface SkeletonFactory { - - /** - * Creates a new skeleton implementing the {@link RequestSession} interface. - * - * @param target the remote object. - * @return the created skeleton. - * @throws JonathanException if something goes wrong. - */ - - RequestSession newSkeleton (Object target) throws JonathanException; -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/stub/Stub.java b/fractalrmi/src/org/objectweb/fractal/rmi/stub/Stub.java deleted file mode 100644 index 2c33a5287beb34468f9374927663755221830861..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/stub/Stub.java +++ /dev/null @@ -1,337 +0,0 @@ -/*** - * Fractal RMI: a binder for remote method calls between Fractal components. - * Copyright (C) 2003 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - * - * with some code fragments copied from Jonathan: - * org.objectweb.jeremie.libs.stub_factories.std.RefImpl - * (authors: B. Dumant, K. Milsted) - */ - -package org.objectweb.fractal.rmi.stub; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.Type; - -import org.objectweb.fractal.rmi.RemoteException; - -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.binding.Reference; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.MarshalException; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.presentation.MarshallerFactory; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; -import org.objectweb.jonathan.apis.protocols.ReplyInterface; -import org.objectweb.jonathan.apis.protocols.ServerException; -import org.objectweb.jonathan.apis.protocols.SessionIdentifier; -import org.objectweb.jonathan.apis.protocols.Session_High; - -/** - * Super class of the stub classes generated by the {@link RmiStubFactory}. - * A stub gives access to an interface of a Fractal component. - * More precisely, it gives access to the "functional" interface provided by - * a server interface, and also gives access to the {@link Interface} interface - * implemented by this server interface. The - * "functional" interface is implemented by a sub class of this class, while - * the {@link Interface} interface is implemented - * by this class once and for all. - */ - -public class Stub implements Reference, Interface { - - /** - * The identifier of the remote object to which this stub gives access. - */ - - protected Identifier id; - - /** - * The marshaller factory to be used to create new invocation messages. - */ - - protected MarshallerFactory marshallerFactory; - - /** - * The identifier of the session that gives access to the remote object. - */ - - protected SessionIdentifier sessionId; - - /** - * The session that gives access to the remote object. This session is used to - * send the invocation messages down the protocol stack. - */ - - protected Session_High session; - - /** - * Constructs a new {@link Stub}. - */ - - public Stub () { - } - - // -------------------------------------------------------------------------- - // Implementation of the Reference interface - // -------------------------------------------------------------------------- - - /** - * Returns the set of identifiers associated with this reference. - * - * @return the set of identifiers associated with this reference. - * @see #setIdentifiers - */ - - public Identifier[] getIdentifiers () { - return new Identifier[] { id }; - } - - /** - * Sets the set of identifiers associated with this reference. - * - * @param ids the set of identifiers to be associated with this reference. - * @see #getIdentifiers - */ - - public void setIdentifiers (Identifier[] ids) { - this.id = ids[0]; - } - - // -------------------------------------------------------------------------- - // Implementation of the Interface interface - // -------------------------------------------------------------------------- - - public Component getFcItfOwner () { - try { - Marshaller marshaller = request(); - ReplyInterface reply = prepareInvocation(marshaller); - marshaller.writeInt(-1); - invoke(marshaller); - UnMarshaller unmarshaller = reply.listen(); - Component result = (Component)unmarshaller.readValue(); - unmarshaller.close(); - return result; - } catch (Exception e) { - e = handleException(e); - if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } else { - throw new RemoteException("server side exception", e); - } - } - } - - public String getFcItfName () { - try { - Marshaller marshaller = request(); - ReplyInterface reply = prepareInvocation(marshaller); - marshaller.writeInt(-2); - invoke(marshaller); - UnMarshaller unmarshaller = reply.listen(); - String result = (String)unmarshaller.readValue(); - unmarshaller.close(); - return result; - } catch (Exception e) { - e = handleException(e); - if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } else { - throw new RemoteException("server side exception", e); - } - } - } - - public Type getFcItfType () { - try { - Marshaller marshaller = request(); - ReplyInterface reply = prepareInvocation(marshaller); - marshaller.writeInt(-3); - invoke(marshaller); - UnMarshaller unmarshaller = reply.listen(); - Type result = (Type)unmarshaller.readValue(); - unmarshaller.close(); - return result; - } catch (Exception e) { - e = handleException(e); - if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } else { - throw new RemoteException("server side exception", e); - } - } - } - - public boolean isFcInternalItf () { - try { - Marshaller marshaller = request(); - ReplyInterface reply = prepareInvocation(marshaller); - marshaller.writeInt(-4); - invoke(marshaller); - UnMarshaller unmarshaller = reply.listen(); - boolean result = unmarshaller.readBoolean(); - unmarshaller.close(); - return result; - } catch (Exception e) { - e = handleException(e); - if (e instanceof RuntimeException) { - throw (RuntimeException)e; - } else { - throw new RemoteException("server side exception", e); - } - } - } - - // -------------------------------------------------------------------------- - // Utility methods - // -------------------------------------------------------------------------- - - /** - * Obtains a marshaller for marshalling invocation data. - * - * @return a marshaller for marshalling invocation data. - * @throws MarshalException if something goes wrong. - */ - - protected Marshaller request () throws MarshalException { - if (marshallerFactory == null) { - throw new MarshalException("null marshaller factory"); - } - return marshallerFactory.newMarshaller(); - } - - /** - * Prepares the marshaller prior to marshalling invocation data. This - * preparation is protocol-specific and typically consists of adding headers - * to the marshaller. In line with Java method invocation semantics, a reply - * is expected after the remote invocation is executed; a reply interface - * is thus returned in order to listen for the reply. - * - * @param marshaller a marshaller to be used for the invocation data. - * @return a reply interface for listening for the reply. - * @throws MarshalException if something goes wrong. - */ - - protected ReplyInterface prepareInvocation (final Marshaller marshaller) - throws MarshalException - { - try { - synchronized(this) { - if (session == null) { - session = sessionId.bind(null); - } - } - return session.prepareInvocation(marshaller); - } catch (Exception e) { - throw new MarshalException("exception preparing marshaller: " + e); - } - } - - /** - * Sends the marshaller with the invocation data down the protocol stack. - * - * @param marshaller a marshaller with the invocation data. - * @throws MarshalException if something goes wrong. - */ - - protected void invoke (final Marshaller marshaller) throws MarshalException { - try { - synchronized(this) { - if (session == null) { - throw new MarshalException("null session"); - } - } - session.send(marshaller); - } catch (Exception e) { - throw new MarshalException("exception at invocation: " + e); - } - } - - /** - * Handles an exception that happen in this stub. - * - * @param e an exception. - * @return the exception encapsulated in the given exception (if it is a - * {@link ServerException}, i.e., an exception that was - * thrown by the remote object and sent back in a reply message), or a - * new {@link RemoteException} encaspulating the given - * exception in the other cases (case of an exception that was thrown - * locally by the stub itself). - */ - - protected Exception handleException (final Exception e) { - if (e instanceof ServerException) { - try { - UnMarshaller unmarshaller = ((ServerException)e).unmarshaller; - Exception f = (Exception)unmarshaller.readValue(); - unmarshaller.close(); - return f; - } catch (JonathanException je) { - return new RemoteException( - "error during exception unmarshalling by stub", je); - } - } else { - return new RemoteException( - "error during marshalling/unmarshalling by stub", e); - } - } - - // -------------------------------------------------------------------------- - // Overriden methods - // -------------------------------------------------------------------------- - - /** - * Tests if the given object is equal to this stub. - * - * @param o the object to be compared to this stub. - * @return true if the given object is a stub whose {@link #id id} is - * equal to the {@link #id id} of this stub, false otherwise. - */ - - public boolean equals (final Object o) { - if (o instanceof Stub) { - return id.equals(((Stub)o).id); - } - return false; - } - - /** - * Returns the hashcode of this stub. - * - * @return the hashcode of the {@link #id id} of this stub. - */ - - public int hashCode () { - return id.hashCode(); - } - - /** - * Finalizes this object. This method closes the {@link #session session} - * associated to this stub if it is not null. - */ - - protected void finalize () { - if (session != null) { - session.close(); - session = null; - } - } -} diff --git a/fractalrmi/src/org/objectweb/fractal/rmi/stub/package.html b/fractalrmi/src/org/objectweb/fractal/rmi/stub/package.html deleted file mode 100644 index 53abdd8c3784739cbd755c89c1a3df1f81273630..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/fractal/rmi/stub/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - -Provides a stub and skeleton factory component based on ASM. - -@since Fractal 1.0.6 - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/binding/BindException.java b/fractalrmi/src/org/objectweb/jonathan/apis/binding/BindException.java deleted file mode 100644 index dede369800173b92a638051d8d9a1d8cc1a9a1fc..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/binding/BindException.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.binding; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * BindException is a checked exception that indicates that an error occurred - * when trying to bind an interface. - */ -public class BindException extends JonathanException { - /** - * Constructs a new BindException with no detail message. - */ - public BindException() { super(); } - /** - * Builds a BindException with a detail message. - */ - public BindException(String s) { super(s); } - /** - * Builds a BindException that wraps another exception. - */ - public BindException(Exception exception) { super(exception); } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/binding/ExportException.java b/fractalrmi/src/org/objectweb/jonathan/apis/binding/ExportException.java deleted file mode 100644 index 0c5fe3012cc8aa8cf33de5d18858507720625836..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/binding/ExportException.java +++ /dev/null @@ -1,50 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.binding; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -/** - * ExportException is a checked exception that an interface could not be - * exported for some reason. - */ -public class ExportException extends JonathanException { - /** - * Constructs a new ExportException with no detail message. - */ - public ExportException() { super(); } - /** - * Builds an ExportException with a detail message. - */ - public ExportException(String s) { super(s); } - /** - * Builds a ExportException that wraps another exception. - */ - public ExportException(Exception exception) { super(exception); } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/binding/ForwardException.java b/fractalrmi/src/org/objectweb/jonathan/apis/binding/ForwardException.java deleted file mode 100644 index 03c99c90da4d8ff62b5b16ca5a1cd930f8c9796b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/binding/ForwardException.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.binding; - -/** - * ForwardException is a checked exception raised by - * {@link Identifier#bind(Identifier[],org.objectweb.jonathan.apis.kernel.Context) bind} or - * {@link org.objectweb.jonathan.apis.protocols.ReplyInterface#listen() listen} - * operations or to indicate that - * another reference should be used to designate the targeted object interface. - */ -public class ForwardException extends BindException { - - /** - * Another reference for the targeted object interface. Depending on the - * context, this object may be of type {@link Identifier Identifier}, - * {@link Reference Reference}, or of any other type, provided that it really - * designates the right interface, and that its type is clear from the context. - * @serial - */ - public Object reference; - - /** - * Constructs a new ForwardException with the given reference. - * @param reference an object identifying the targeted object interface. - */ - public ForwardException(Object reference) { - this.reference = reference; - } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/binding/Identifier.java b/fractalrmi/src/org/objectweb/jonathan/apis/binding/Identifier.java deleted file mode 100644 index d7d4e9b848e92343bdd381aad143ada880e75f18..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/binding/Identifier.java +++ /dev/null @@ -1,158 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.binding; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.presentation.Marshaller; - -/** - * An identifier uniquely identifies an applicative object interface in a given - * {@link NamingContext naming context}. It is a specific kind of - * {@link org.objectweb.jonathan.model.name name}. - */ -public interface Identifier { - /** - * Returns the naming context associated with the target identifier. - * - * An identifier is always associated the naming context that created it. - * - * @return the naming context associated with the target identifier. - */ - public NamingContext getContext(); - - /** - * The bind operation returns an object giving access to the object interface - * referenced by the target identifier. - *

- * The returned object may be a direct reference to the object interface that - * was used to create the identifier (at export-time), or it may be a surrogate - * (a proxy) for that object interface. - *

- * If this operation is implemented, it means that the related naming context - * is not only a - * {@link org.objectweb.jonathan.model.naming_context naming context} but - * also a {@link org.objectweb.jonathan.model.binder binder}. - *

- * This operation may in particular raise two types of exceptions: - *

    - *
  • {@link ForwardException ForwardExceptions} that indicate that the - * "real" target object interface should be bound using the - * {@link ForwardException#reference reference} - * contained in the exception. Note that in this case, calling the - * {@link #resolve() resolve} method should return the same reference. - * This facility may be used to handle mobility. - *
  • {@link BindException BindExceptions} that indicate that an error - * occurred in the binding process; - *
- *

- * All parameters are optional (they may be null). - *

    - *
  • The ref parameter - * is an array of identifiers, to which the target identifier should belong: - * Object interfaces may be identified by several identifiers, and it - * is useful to maintain this list of identifiers, even if only one - * identifier is used to actually give access to the designated object - * interface. This parameter has been added as a convenience to achieve - * this, but it may not be meaningfull in all cases. - *
  • The hints parameter contains information that may be required - * by naming contexts to build the returned object. Here again, it may not - * be meaningfull in all cases. - *
- * - * @param ref a set of identifiers of the seeked object interface; - * @param hints a context containing extra information that may be useful; - * @return a reference to the seeked interface. - * @exception ForwardException if the target has moved; - * @exception BindException if an error occurs in the binding process; - * @exception JonathanException if something else goes wrong. - * @see org.objectweb.jonathan.model.binder#bind(org.objectweb.jonathan.model.name) - */ - public Object bind(Identifier[] ref,Context hints) - throws ForwardException, BindException, JonathanException; - - - /** - * Unexporting an identifier means that the target identifier no longer - * designates the object interface it was created for (by some export - * method). An identifier must no longer be used after it has been "unexported". - */ - public void unexport(); - - /** - * Tests the validity of the target identifier. - * A false return means that a call to either - * {@link #bind(Identifier[],Context) bind} or {@link #resolve() resolve} will - * fail. If so, the target identifier must no longer be used. - * - * @return false if calls to either {@link #bind(Identifier[],Context) bind} or - * {@link #resolve() resolve} certainly fail. - */ - public boolean isValid(); - - /** - * Returns the next name in the referencing chain. - *

- * If the naming context that has built the target identifier is an intermediate - * naming context, this method should return the next "name" in the referencing - * chain, or null if no such name can be found or created. - *

- * Such a name may be of type {@link Identifier Identifier}, - * {@link Reference Reference}, or of any other type, provided that it really - * designates the right interface, and that its type is clear from the context. - * - * @return the next name in the referencing chain. - * @see org.objectweb.jonathan.model.naming_context#resolve(org.objectweb.jonathan.model.name) - */ - public Object resolve(); - - /** - * Encodes the target identifier in an array of bytes. - *

- * Since identifiers are likely to be transmitted on the net, they may have to be - * encoded and decoded. The corresponding - * {@link NamingContext#decode(byte[],int,int) decoding} method is borne - * by the {@link NamingContext NamingContext} interface. - * - * @return an array of bytes encoding the target identifier. - * @exception JonathanException if something goes wrong. - */ - public byte[] encode() throws JonathanException; - - - /** - * Encodes the target identifier in a marshaller. - * - * @param the marshaller to be used for encoding. - * @exception JonathanException if something goes wrong. - */ - public void encode(Marshaller m) throws JonathanException; - -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/binding/NamingContext.java b/fractalrmi/src/org/objectweb/jonathan/apis/binding/NamingContext.java deleted file mode 100644 index 40683fea096d9e3516af96150e48d6630ad01eae..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/binding/NamingContext.java +++ /dev/null @@ -1,93 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.binding; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; - -/** - * NamingContext is a specific sort of - * {@link org.objectweb.jonathan.model.naming_context naming context} used to - * create and manage names of type {@link Identifier Identifier}. - *

- * There is no generic - * {@link org.objectweb.jonathan.model.naming_context#export(org.objectweb.jonathan.model.name) export} - * method defined on NamingContext, and the - * {@link org.objectweb.jonathan.model.naming_context#resolve(org.objectweb.jonathan.model.name) resolve} - * method is defined on {@link Identifier Identifier}. - */ -public interface NamingContext { - - /** - * Creates a new identifier for the object interface designated by the - * itf parameter. Note that calling the - * {@link Identifier#resolve() resolve} method on the returned identifier should - * return tt>id. - * - * @param itf an interface reference - * @param hints additional information; - * @return an identifier managed by the target naming context. - * @exception ExportException if an error occurs in the export process; - * @exception JonathanException if something else goes wrong. - * @see org.objectweb.jonathan.model.naming_context#export(org.objectweb.jonathan.model.name) - */ - Identifier export(Object itf,Context hints) - throws ExportException, JonathanException ; - - /** - * Decodes an identifier from a buffer portion. - *

- * Since identifiers are likely to be transmitted on the net, they may have to be - * encoded and decoded. The {@link Identifier#encode() encoding} method is borne - * by the {@link Identifier Identifier} interface, but the decoding methods must - * be borne by each naming context. This method creates an identifier (associated - * with the target naming context), from the length bytes of - * data starting at offset offset. - * - * @param data the byte array to read the encoded identifier from; - * @param offset offset of the first byte of the encoding; - * @param length length of the encoding; - * @return a decoded identifier; - * @exception JonathanException if something goes wrong. - */ - Identifier decode(byte[] data,int offset,int length) - throws JonathanException; - - /** - * Decodes an identifier from the provided unmarshaller. - * - * @param u an unmarhaller; - * @return an identifier managed by the target naming context; - * @exception JonathanException if something goes wrong. - */ - Identifier decode(UnMarshaller u) throws JonathanException; -} - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/binding/Reference.java b/fractalrmi/src/org/objectweb/jonathan/apis/binding/Reference.java deleted file mode 100644 index c803084b08e1cf76a5719e7df85a213934c41a36..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/binding/Reference.java +++ /dev/null @@ -1,49 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.binding; - -/** - * A Reference simply holds a set of {@link Identifier identifiers}. - */ -public interface Reference { - - /** - * Returns the set of identifiers associated with the target reference. - * @return the set of identifiers associated with the target reference. - */ - Identifier[] getIdentifiers(); - - - /** - * Sets the set of identifiers associated with the target reference. - * @param ids the set of identifiers to be associated with the target reference. - */ - void setIdentifiers(Identifier[] ids); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/binding/package.html b/fractalrmi/src/org/objectweb/jonathan/apis/binding/package.html deleted file mode 100644 index 11fa07639c4bcb9c9b6cf6f62d76939dae0b28d9..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/binding/package.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -Provides a set of classes and interfaces for application level identifiers, -naming contexts and binders. - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Component.java b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Component.java deleted file mode 100644 index 46dc97c129ba6f8fc5cdd02688204e3613c12b05..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Component.java +++ /dev/null @@ -1,172 +0,0 @@ -/*** -v * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 2001 Kelua SA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - * -------------------------------------------------------------------------- - * $Id$ - * -------------------------------------------------------------------------- - * - */ - -package org.objectweb.jonathan.apis.kernel; - -/** - * The Component interface represents a component, with a value and a type. - */ -public interface Component { - - /** - * Returns the element in the target component identified by name, - * null if no element exists under name name. - * - * @param name the name of the element to be retrieved; - * @return the corresponding element, if any; null otherwise. - */ - Element getElement(Name name); - - /** - * Returns the component contained in the element registered in the target - * component under the name name. - * - * A call to getComponent(name) is equivalent to - * {@link #getElement(Name) getElement(name)}.{@link Element#getComponent() - * getComponent()} if the provided name actually - * corresponds to an element. If it is not the case, null is returned. - * - * @param name the name of the element whose component is seeked; - * @return the corresponding component, or null. - */ - Component getComponent(Name name); - - /** - * Returns the value of the element registered in the target context under - * the name name. - * - * A call to getValue(name) is equivalent to - * {@link #getElement(Name) getElement(name)}.{@link Element#getValue() - * getValue()} if the provided name actually - * corresponds to an element. If it is not the case, - * {@link Context#NO_VALUE NO_VALUE} is returned. - * - * @param name the name of the element whose value is seeked; - * @return the corresponding value, or {@link Context#NO_VALUE NO_VALUE}. - */ - Object getValue(Name name); - - /** - * Returns a distinguished element referencing the target component, if any, - * null otherwise. - * Implementations are not required to keep information about a given containing - * element. It is always legal to return null. - *

- * @return an element containing the target component, if any, null otherwise. - */ - Element getReference(); - - /** - * Sets an element containing the target component. The provided element should - * already be initialized as a container of the component. The returned element - * is the former container, if any. This method MUST be called when a component - * is referred to by an element. - * - * @param element the new element referencing the target component. - * @return the former element referencing the target component, if any, null - * otherwise. - */ - Element setReference(Element element); - - /** - * Returns the type of the target component, as a Class. - * @return the type of the target component, as a Class. - */ - Class getType(); - - /** - * Returns the value of the target component, if its type is an object reference - * type. - *

- * If the target component is of an integral type, - * {@link Context#NO_VALUE NO_VALUE}} is returned. - * - * @return the value of the target component. - */ - Object getValue(); - - /** - * Returns the value of the target component, if its class is an integer class. - *

- * If the target component has an object reference type, Integer.MAX_VALUE is - * returned. - * - * @return the value of the target component. - */ - int getIntValue(); - - /* - * Returns the value of a wrapper of the target component, if the component - * has factory alternatives. - * @return the value of factory. - * @throws JonathanException if the component has not factory alternatives. - */ - Object getFactoryValue() throws JonathanException; - - - /** - * "Forks" a copy of the target component. The returned component is a - * copy of the target component, sharing the same reference, but *NOT* - * referred to by this reference. - *

- * For basic components, this operation simply duplicates the component - * structure, but the value is still shared. - *

- * In the configuration framework, components contain a specification of - * their value (in the form of an assemblage, atom, alias... description). - * The fork() method is used to duplicate the specification, but not the - * value. It may thus be used to obtain several instances of a component, - * using getValue() on the returned component. - *

- * When the target component is a context, the returned component is - * a new context, roughly containing the forked versions of the target - * context's components. - *

- * If the target context contains an alias, and if the target T of this alias - * is in the scope of the context, then the target of the forked alias is a - * forked instance of T. But if the target is outside the scope of the - * context, then the target of the forked alias is T itself. The context - * thus defines a set of components that will be actually duplicated, all - * links outside the context being preserved. - *

- * The same rule applies for assemblages, and other "container" - * components. For instance, consider an assemblage 'A' made of factory 'F' and - * configuration 'C', 'C' containing an atom 'At', an alias 'In' to At, and - * an alias 'Out' to a component 'K' outside 'A'. Then the forked version of 'A' - * is a new assemblage made of a copy of 'F' and a new configuration - * containing a copy 'At2' of 'At', an alias 'In2' to 'At2', and an alias - * 'Out2' to 'K'. - *

- * Aliases are treated specifically. Calling the fork() method on an alias - * is like calling the same method on its target. - *

- * @return a forked instance of the target component. - */ - Component fork(); - -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Context.java b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Context.java deleted file mode 100644 index 4b6b88e03814d8b76a7c8ba945cd391f4b6c8f8d..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Context.java +++ /dev/null @@ -1,321 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 2000 France Telecom R&D - * Copyright (C) 2001 Kelua SA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: jonathan@objectweb.org - * - * Author: Fabien Delpiano, Bruno Dumant - * - */ - -package org.objectweb.jonathan.apis.kernel; - -import java.util.Enumeration; -import java.io.Serializable; - -/** - * A context represents a set of typed objects, each identified by a name. - */ -public interface Context extends Component { - - /** - * Adds an element in the target context. - * - * @param name the name of the object to be added; - * @param type the type of the object to be added; - * @param value the object to be added. - * @return the previous element, if any; null otherwise. - * @exception JonathanException if something goes wrong (usually, a type - * exception). - */ - Element addElement(Name name, Class type, Object value) - throws JonathanException; - - /** - * Adds an element to the target context. - * - * In this case, the value's type must be promotable to - * an integer. Class is one of int.class, short.class, char.class, - * or byte.class. - * - * @param name the name of the element to be added; - * @param value the integer value of the element to be added; - * @return the previous element, if any, null otherwise. - * @exception JonathanException if something goes wrong (usually, a type - * exception). - */ - Element addElement(Name name, Class type, int value) throws JonathanException; - - /** - * Adds an element in the target context. If the component is already attached to some element, - * this attachment will be lost in this operation. - * - * @param name the name of the element to be added; - * @param component the component to be added; - * @return the previous element, if any; null otherwise. - * @exception JonathanException if something goes wrong (usually, a type - * exception). - */ - Element addElement(Name name, Component component) - throws JonathanException; - - /** - * Adds an element to the target context. - * - * @param element the element to be added. - * @return the previous element, if any, null otherwise. - * @exception JonathanException if something goes wrong (usually, a type - * exception). - */ - //Element addElement(Element element) throws JonathanException; - - - /** - * Adds an element to the target context. - * - * This method is equivalent to {@link #addElement(Name,Class,Object) - * addElement(Name,Class,Object)}, except that the name to use - * is specified by a string and a separator separating the different elements of - * the name. - * - * If separator == 0, the name corresponds to an object - * local to the target context. - * If the name begins with the separator, the name is an absolute name (this - * only makes sense if the context has a tree structure); otherwise, the name is - * relative to the target context. - * - * @param name a string representing the name of the seeked element; - * @param type the type of the object to be added; - * @param value the object to be added; - * @param separator the separator character used to parse name; - * @return the previous element, if any; null otherwise. - * @exception JonathanException if something goes wrong (usually, a type - * exception). - */ - Element addElement(String name,Class type,Object value,char separator) - throws JonathanException; - - /** - * Adds an element to the target context. - * - * This method is equivalent to {@link #addElement(Name,Component) - * addElement(Name,Component)}, except that the name to use - * is specified by a string and a separator separating the different elements of - * the name. - * - * If separator == 0, the name corresponds to an object - * local to the target context. - * If the name begins with the separator, the name is an absolute name (this - * only makes sense if the context has a tree structure); otherwise, the name is - * relative to the target context. - * - * @param name a string representing the name of the added element; - * @param component the component to be added; - * @param separator the separator character used to parse name; - * @return the previous element, if any; null otherwise. - * @exception JonathanException if something goes wrong (usually, a type - * exception). - */ - Element addElement(String name,Component component,char separator) - throws JonathanException; - - - /** - * Adds an element to the target context. - * - * This method is equivalent to {@link #addElement(Name,Class,int) - * addElement(Name,Class,int)}, except that the name to use - * is specified by a string and a separator separating the different elements of - * the name. - * - * If separator == 0, the name corresponds to an object - * local to the target context. - * If the name begins with the separator, the name is an absolute name (this - * only makes sense if the context has a tree structure); otherwise, the name is - * relative to the target context. - * - * @param name a string representing the name of the seeked element; - * @param value the integer value of the element to be added; - * @param separator the separator character used to parse name; - * @return the previous element, if any; null otherwise. - * @exception JonathanException if something goes wrong (usually, a type - * exception). - */ - Element addElement(String name,Class type,int value,char separator) - throws JonathanException ; - - - public Context addOrGetContext(String _name,char _separator) throws JonathanException; - - public Context addOrGetContext(Name _name) throws JonathanException; - - /** - * Returns the element in the target context identified by name, - * null if no element is registered under name name. - * - * This method is equivalent to {@link #getElement(Name) - * getElement(Name)}, except that the name to use - * is specified by a string and a separator separating the different elements of - * the name. - * - * If separator == 0, the name corresponds to an object - * local to the target context. - * If the name begins with the separator, the name is an absolute name (this - * only makes sense if the context has a tree structure); otherwise, the name is - * relative to the target context. - * - * @param name a string representing the name of the seeked element; - * @param separator the separator character used to parse name; - * @return the corresponding element, if any; null otherwise. - */ - Element getElement(String name,char separator); - - /** - * Returns the component contained in the element registered in the target context under - * the name name. - * - * This method is equivalent to {@link #getComponent(Name) - * getComponent(Name)}, except that the name to use - * is specified by a string and a separator separating the different elements of - * the name. - * - * If separator == 0, the name corresponds to an object - * local to the target context. - * If the name begins with the separator, the name is an absolute name (this - * only makes sense if the context has a tree structure); otherwise, the name is - * relative to the target context. - * - * @param name the name of the element whose component is seeked; - * @param separator the separator character used to parse name; - * @return the corresponding component, or null. - */ - Component getComponent(String name,char separator); - - /** - * Returns the value of the element registered in the target context under - * the name name. - * - * This method is equivalent to {@link #getValue(Name) - * getValue(Name)}, except that the name to use - * is specified by a string and a separator separating the different elements of - * the name. - * - * If separator == 0, the name corresponds to an object - * local to the target context. - * If the name begins with the separator, the name is an absolute name (this - * only makes sense if the context has a tree structure); otherwise, the name is - * relative to the target context. - * - * @param name the name of the element whose value is seeked; - * @param separator the separator character used to parse name; - * @return the corresponding value, or {@link #NO_VALUE NO_VALUE}. - */ - Object getValue(String name,char separator); - - /** - * Returns the value of the element registered in the target context under - * the name name. - *

- * A call to getIntValue(name) is equivalent to - * {@link #getElement(Name) getElement(name)}.{@link Element#getIntValue() - * getIntValue()} if the provided name actually corresponds to an - * element. If it is not the case, - * Integer.MAX_VALUE is returned. - * - * @param name the name of the element whose value is seeked; - * @return the corresponding value, or Integer.MAX_VALUE - */ - int getIntValue(Name name); - - - /** - * Returns the value of the element registered in the target context under - * the name name. - * - * This method is equivalent to {@link #getIntValue(Name) - * getIntValue(Name)}, except that the name to use - * is specified by a string and a separator separating the different elements of - * the name. - * - * If separator == 0, the name corresponds to an object - * local to the target context. - * If the name begins with the separator, the name is an absolute name (this - * only makes sense if the context has a tree structure); otherwise, the name is - * relative to the target context. - * - * @param name the name of the element whose value is seeked; - * @param separator the separator character used to parse name; - * @return the corresponding value, or Integer.MAX_VALUE - */ - int getIntValue(String name,char separator); - - /** - * Returns an enumeration of the elements found in the target context. - * @return an enumeration of the elements found in the target context. - */ - Enumeration getElements(); - - /** - * Releases the target context, releasing all the resources it uses, if no one still - * uses it. - * The context should no longer - * be used once it has been released. - */ - void release(); - - - /** - * Acquires the target context. - */ - void acquire(); - - - /** - * Resets the target context, removing all its current elements. - */ - void reset(); - - - /** - * Sets the scope of the target context; - * @param scope the new scope of the target context; - * @return the previous scope of the target context; - */ - Context setScope(Context scope); - - /** - * Returns the scope of the target context; - * @return the scope of the target context; - */ - Context getScope(); - - /** - * The NO_VALUE object is returned by {@link #getValue(String,char) getValue} - * if no value corresponds to the provided name. - */ - Object NO_VALUE = new NO_VALUE(); - - final class NO_VALUE implements Serializable { - - private NO_VALUE(){} - - public String toString() { - return "NO VALUE"; - } - } -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/ContextFactory.java b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/ContextFactory.java deleted file mode 100644 index 8f47d999b156c98b1279124e365afef57d85d8ef..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/ContextFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 2000 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - -package org.objectweb.jonathan.apis.kernel; - -/** - * Interface for context factories. - */ -public interface ContextFactory { - - /** - * Returns a new {@link Context Context} instance. - * @return a new {@link Context Context} instance. - */ - Context newContext(); - - /** - * Returns a new {@link Context Context} instance with scope scope. - * - * @param scope the scope of the returned context instance; - * @return a new {@link Context Context} instance. - */ - Context newContext(Context scope); -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/ContextFactoryType.fractal b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/ContextFactoryType.fractal deleted file mode 100644 index 1a00550b95676a7ddcd59c33e12b155aa3c7d061..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/ContextFactoryType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Element.java b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Element.java deleted file mode 100644 index 24aaebed0d11074f5b28b0aac4d3c493e4ea1d54..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Element.java +++ /dev/null @@ -1,79 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 2000 France Telecom R&D - * Copyright (C) 2001 Kelua SA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Fabien Delpiano - * - */ - -package org.objectweb.jonathan.apis.kernel; - -/** - * The Element interface represents an element in a context. - */ -public interface Element { - - /** - * Returns the (local) name of the element, in the context it belongs to. - * @return the (local) name of the element, in the context it belongs to. - */ - String getName(); - - /** - * Returns the component contained in the target element. - * @return the component contained in the target element. - */ - Component getComponent(); - - /** - * Returns the type of the target element, as a Class. - * @return the type of the target element, as a Class. - */ - Class getType(); - - /** - * Returns the value of the target element, if its type is an object reference - * type. - *

- * If the target element is of an integral type, - * {@link Context#NO_VALUE NO_VALUE}} is returned. - * - * @return the value of the target element. - */ - Object getValue(); - - /** - * Returns the value of the target element, if its class is an integer class. - *

- * If the target element has an object reference type, Integer.MAX_VALUE is - * returned. - * - * @return the value of the target element. - */ - int getIntValue(); - - /** - * Returns the context containing the target element, if any, null otherwise. - * @return the context containing the target element, if any, null otherwise. - */ - Component getContainer(); -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/InternalException.java b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/InternalException.java deleted file mode 100644 index ad523a549a76ac0732b6e7856221365a36e91c1c..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/InternalException.java +++ /dev/null @@ -1,134 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * Copyright (C) 2001 Kelua SA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.kernel; - -import java.io.PrintStream; -import java.io.PrintWriter; - -/** - * InternalExceptions are unexpected exceptions that may occur e.g., when some - * entities (kernel, binders, stub factories, ...), are incompatible or badly used. - */ -public class InternalException extends RuntimeException { - /** @serial */ - Throwable actual; - - /** - * Constructs a new InternalException with no detail message. - */ - public InternalException() {} - /** - * Constructs a new InternalException with a detail message. - */ - public InternalException(String s) { super(s); } - - /** - * Builds an InternalException that wraps another exception. - */ - public InternalException(Throwable throwable) { - actual = (throwable instanceof InternalException) ? - ((InternalException) throwable).represents() : - ((throwable instanceof JonathanException) ? - ((JonathanException) throwable).represents() : - throwable); - } - - /** - * Returns the detail message of this InternalException. - *

- * If this exception represents another exception, the returned message is - * that of the represented exception. - * - * @return the detail message of this 'InternalException', - * or 'null' if this 'InternalException' does not - * have a detail message. - */ - public String getMessage() { - return (actual != null) ? actual.getMessage() : super.getMessage(); - } - - /** - * Returns a short description of this InternalException. - *

- * If this exception represents another exception, the returned description - * is that of the represented exception. - * - * @return a string representation of this 'InternalException'. - */ - public String toString() { - return (actual != null) ? actual.toString() : super.toString(); - } - - /** - * Prints this InternalException and its backtrace to the - * standard error stream. - *

- * If this exception represents another exception, the printed description - * and backtrace are that of the represented exception. - */ - public void printStackTrace() { - if (actual != null) actual.printStackTrace(); else super.printStackTrace(); - } - - /** - * Prints this InternalException and its backtrace to the - * specified print stream. - *

- * If this exception represents another exception, the printed description - * and backtrace are that of the represented exception. - * - * @param s the print stream. - */ - public void printStackTrace(PrintStream s) { - if (actual != null) actual.printStackTrace(s); else super.printStackTrace(s); - } - - /** - * Prints this 'Throwable' and its backtrace to the specified - * print writer. - *

- * If this exception represents another exception, the printed description - * and backtrace are that of the represented exception. - * - * @param s the print writer. - */ - public void printStackTrace(PrintWriter s) { - if (actual != null) actual.printStackTrace(s); else super.printStackTrace(s); - } - /** - * Returns the exception wrapped by this InternalException. - *

- * If this exception doesn't wrap any other exception, it returns itself. - * - * @return the represented exception. - */ - public Throwable represents() { - return (actual != null) ? actual : this; - } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/JonathanException.java b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/JonathanException.java deleted file mode 100644 index 0cd920fcad2592acbc5d698c50de7591b017c9cc..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/JonathanException.java +++ /dev/null @@ -1,139 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * Copyright (C) 2001 Kelua SA - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.kernel; - -import java.io.PrintStream; -import java.io.PrintWriter; - -/** - * JonathanException is the supertype of all Jonathan exceptions. It includes a - * mechanism to wrap exceptions of an other type so that the stack trace and - * the message returned by a Jonathan exception correspond to that of the wrapped - * exception. - */ -public class JonathanException extends Exception { - /** @serial */ - Exception actual; - - /** - * Constructs a new JonathanException with no detail message. - */ - public JonathanException() { - super(); - actual = null; - } - /** - * Builds a JonathanException with a detail message. - */ - public JonathanException(String s) { - super(s); - actual = null; - } - - /** - * Builds a JonathanException that wraps another exception. - */ - public JonathanException(Exception exception) { - actual = (exception instanceof JonathanException) ? - ((JonathanException) exception).represents() : - exception; - } - /** - * Returns the detail message of this JonathanException. - *

- * If this exception represents another exception, the returned message is - * that of the represented exception. - * - * @return the detail message of this 'JonathanException', - * or 'null' if this 'JonathanException' does not - * have a detail message. - */ - public String getMessage() { - return (actual != null) ? actual.getMessage() : super.getMessage(); - } - - /** - * Returns a short description of this JonathanException. - *

- * If this exception represents another exception, the returned description - * is that of the represented exception. - * - * @return a string representation of this 'JonathanException'. - */ - public String toString() { - return (actual != null) ? actual.toString() : super.toString(); - } - - /** - * Prints this JonathanException and its backtrace to the - * standard error stream. - *

- * If this exception represents another exception, the printed description - * and backtrace are that of the represented exception. - */ - public void printStackTrace() { - if (actual != null) actual.printStackTrace(); else super.printStackTrace(); - } - - /** - * Prints this JonathanException and its backtrace to the - * specified print stream. - *

- * If this exception represents another exception, the printed description - * and backtrace are that of the represented exception. - * - * @param s the print stream. - */ - public void printStackTrace(PrintStream s) { - if (actual != null) actual.printStackTrace(s); else super.printStackTrace(s); - } - - /** - * Prints this 'Throwable' and its backtrace to the specified - * print writer. - *

- * If this exception represents another exception, the printed description - * and backtrace are that of the represented exception. - * - * @param s the print writer. - */ - public void printStackTrace(PrintWriter s) { - if (actual != null) actual.printStackTrace(s); else super.printStackTrace(s); - } - /** - * Returns the exception wrapped by this JonathanException. - *

- * If this exception doesn't wrap any other exception, it returns itself. - * - * @return the represented exception. - */ - public Exception represents() { - return (actual != null) ? actual : this; - } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Name.java b/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Name.java deleted file mode 100644 index d1cb2e6cf80c9e1e7aa708038a16f695207d722c..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/kernel/Name.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 2000 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Fabien Delpiano, Bruno Dumant - * - */ - -package org.objectweb.jonathan.apis.kernel; - - -/** - * Names are non-mutable structures representing names used by contexts. - * A Name is a pair , where id is an identifier (represented as - * a String, and subname a (possibly null) Name. - * - * The "" identifier is reserved in contexts representing trees - * to represent the root of the tree. - */ -public interface Name { - - /** - * Returns the id of the target name. - * @return the id of the target name. - */ - String getId(); - - /** - * Returns the subname of the target name. - * @return the subname of the target name. - */ - Name getSubName(); -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/EndOfMessageException.java b/fractalrmi/src/org/objectweb/jonathan/apis/presentation/EndOfMessageException.java deleted file mode 100644 index de4bf9b9460b95458423a4cba935d38d3dc9dba1..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/EndOfMessageException.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.presentation; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * EndOfMessageException is a checked exception that indicates that the end of - * the message on which some operation is performed has been reached. - */ -public class EndOfMessageException extends JonathanException { - /** - * Constructs a new EndOfMessageException with no detail message. - */ - public EndOfMessageException() { super(); } - /** - * Builds a EndOfMessageException with a detail message. - */ - public EndOfMessageException(String s) { super(s); } - /** - * Builds a EndOfMessageException that wraps another exception. - */ - public EndOfMessageException(Exception exception) { super(exception); } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/MarshalException.java b/fractalrmi/src/org/objectweb/jonathan/apis/presentation/MarshalException.java deleted file mode 100644 index fedffc7af9624de0ef634edb220408cd800e106a..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/MarshalException.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.presentation; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * MarshalException is a checked exception that indicates that an error occured - * when marshalling data. - */ -public class MarshalException extends JonathanException { - /** - * Constructs a new MarshalException with no detail message. - */ - public MarshalException() { super(); } - /** - * Builds a MarshalException with a detail message. - */ - public MarshalException(String s) { super(s); } - /** - * Builds a MarshalException that wraps another exception. - */ - public MarshalException(Exception exception) { super(exception); } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/Marshaller.java b/fractalrmi/src/org/objectweb/jonathan/apis/presentation/Marshaller.java deleted file mode 100644 index 558740a1589b025b4d25e5afac9586dc6cc5e9c4..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/Marshaller.java +++ /dev/null @@ -1,266 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.presentation; - -import java.io.OutputStream; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.resources.Chunk; - -/** - * Marshaller is the type of basic types marshallers. They should be used - * by protocols. - */ -public interface Marshaller { - - /** - * Writes a chunk in the message. - *

- * The target becomes the "owner" of the provided chunk, and therefore is not - * supposed to duplicate it. If the entity invoking this operation wants to keep - * a reference to the chunk, it must be duplicated. - * - * @param chunk the chunk to be written. - */ - void write(Chunk chunk); - - - /** - * Writes a byte. - * - * @param b a byte; - * @exception JonathanException if a marshal error occurred. - */ - void writeByte(byte b) - throws JonathanException; - - /** - * Writes a boolean. - * - * @param b a boolean; - * @exception JonathanException if a marshal error occurred. - */ - void writeBoolean(boolean b) - throws JonathanException; - - /** - * Writes an 8 bits char. - *

- * The method used to translate the provided char into an 8 bits - * entity is not specified. - * - * @param i a char; - * @exception JonathanException if a marshal error occurred. - */ - void writeChar8(char i) - throws JonathanException; - - /** - * Writes a 16 bits char. - * - * @param i a char; - * @exception JonathanException if a marshal error occurred. - */ - void writeChar16(char i) - throws JonathanException; - - /** - * Writes a short. - * - * @param i a short; - * @exception JonathanException if a marshal error occurred. - */ - void writeShort(short i) - throws JonathanException; - - /** - * Writes an int. - * - * @param i an int; - * @exception JonathanException if a marshal error occurred. - */ - void writeInt(int i) - throws JonathanException; - - /** - * Writes a long. - * - * @param i a long; - * @exception JonathanException if a marshal error occurred. - */ - void writeLong(long i) - throws JonathanException; - - /** - * Writes a float. - * - * @param f a float; - * @exception JonathanException if a marshal error occurred. - */ - void writeFloat(float f) - throws JonathanException; - - /** - * Writes a double. - * - * @param d a double; - * @exception JonathanException if a marshal error occurred. - */ - void writeDouble(double d) - throws JonathanException; - - /** - * Writes a string of 8 bits chars. - * - * @param s a string; - * @exception JonathanException if a marshal error occurred. - */ - void writeString8(String s) - throws JonathanException; - - /** - * Writes a string of 16 bits chars. - * - * @param s a string; - * @exception JonathanException if a marshal error occurred. - */ - void writeString16(String s) - throws JonathanException; - - /** - * Writes an object reference in the marshaller. - * - * @param obj an object reference - * @exception JonathanException if a marshal error occurred. - */ - void writeReference(Object obj) throws JonathanException; - - /** - * Writes a value in the marshaller. - * - * @param obj an object - * @exception JonathanException if a marshal error occurred. - * @since 3.0 a2 - */ - void writeValue(Object obj) throws JonathanException; - - /** - * Writes an array of bytes. - * - * @param array an array of bytes; - * @exception JonathanException if a marshal error occurred. - */ - void writeByteArray(byte[] array, int offset, int length) - throws JonathanException; - - - /** - * Returns an output stream to write into the message. Closing the output stream - * has the same effect as closing the marshaller itself. - * - * @return an output stream to write into the message. - */ - OutputStream outputStream(); - - - /** - * Checks if the target marshaller and the provided one have the same contents, - * i.e., they contain the same bits. - * - * @param marshaller a marshaller; - * @return true if the target marshaller and the provided one have the same - * contents, false otherwise. - */ - boolean sameContents(Marshaller marshaller); - - - /** - * Returns true if this marshaller is little-endian, false otherwise. - * - * @return true if this marshaller is little-endian, false otherwise. - */ - boolean isLittleEndian(); - - /** - * Returns the state of the message as a (chain of) chunk(s). - *

- * The returned chunk(s) are NOT duplicated. If the caller keeps a - * reference to them, it must {@link #reset() reset} the message, and not - * continue to use it. - * - * @return the state of the message as a (chain of) chunk(s). - */ - Chunk getState(); - - /** - * Returns the current offset in the message, i.e., the position in the message - * at which the next byte will be written. - * - * @return the current offset in the message. - */ - int getOffset(); - - - /** - * Sets the offset in the message. - *

- * This method may be used to override data already written into the message. - * - * @param offset the new offset. - */ - void setOffset(int offset); - - /** - * Returns a {@link Context Context} associated with this marshaller. - * @return a {@link Context Context} associated with this marshaller. - */ - Context getContext(); - - /** - * This method causes the message to lose all its references to the underlying - * chunks, without - * {@link org.objectweb.jonathan.apis.resources.Chunk#release() releasing} - * them. This method must not be used if no reference to chunks present in the - * message is held by an entity in charge of their release. It also releases - * the context associated with the target marshaller. - */ - void reset(); - - - /** - * This method causes the message to lose all its references to the underlying - * chunks, and - * {@link org.objectweb.jonathan.apis.resources.Chunk#release() release} each - * of them. It also released the context. - */ - void close(); - -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/MarshallerFactory.java b/fractalrmi/src/org/objectweb/jonathan/apis/presentation/MarshallerFactory.java deleted file mode 100644 index 085655efd18e8dd6bc4e83e5f1c3dfd1d50133ed..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/MarshallerFactory.java +++ /dev/null @@ -1,67 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.presentation; - -import org.objectweb.jonathan.apis.resources.Chunk; -import org.objectweb.jonathan.apis.resources.ChunkProvider; - -/** - * a marshaller factory is a factory for marshallers and unmarshallers (...) - */ -public interface MarshallerFactory { - - /** - * Returns a new marshaller. - * - * @return a new marshaller. - */ - Marshaller newMarshaller(); - - /** - * Returns a new unmarshaller, using the provided chunk provider as a data - * source. - * - * @param provider a chunk provider. - * @return a new unmarshaller. - */ - UnMarshaller newUnMarshaller(ChunkProvider provider); - - - /** - * Returns a new unmarshaller, using the provided chunk(s) as a data source. - *

- * The read parameters is used to initialise the number of bytes - * read from the message. - * - * @param chunk a (chain of) chunk(s) - * @param read the number of bytes already read from the message. - * @return an unmarshaller. - */ - UnMarshaller newUnMarshaller(Chunk chunk, int read); -} - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/UnMarshalException.java b/fractalrmi/src/org/objectweb/jonathan/apis/presentation/UnMarshalException.java deleted file mode 100644 index 6bb6f091d0b07f9442ad657d872f08979fcb6289..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/UnMarshalException.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.presentation; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * UnMarshalException is a checked exception that indicates that an error occurred - * when unmarshalling data. - */ -public class UnMarshalException extends JonathanException { - /** - * Constructs a new UnMarshalException with no detail message. - */ - public UnMarshalException() { super(); } - /** - * Builds a UnMarshalException with a detail message. - */ - public UnMarshalException(String s) { super(s); } - /** - * Builds a UnMarshalException that wraps another exception. - */ - public UnMarshalException(Exception exception) { super(exception); } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/UnMarshaller.java b/fractalrmi/src/org/objectweb/jonathan/apis/presentation/UnMarshaller.java deleted file mode 100644 index ac7189b569c288f73a3a51a8e3abdf648322aa1e..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/UnMarshaller.java +++ /dev/null @@ -1,244 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.presentation; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.kernel.Context; -import java.io.InputStream; - -/** - * UnMarshaller is the type of basic types unmarshallers. It should be used - * by protocols. - */ -public interface UnMarshaller { - - /** - * Reads a byte. - * - * @return a byte. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - byte readByte() - throws JonathanException; - - /** - * Reads a boolean. - * - * @return a boolean. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - boolean readBoolean() - throws JonathanException; - - /** - * Reads a 8 bits char. - * - * @return a char. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - char readChar8() - throws JonathanException; - - /** - * Reads a 16 bits char. - * - * @return a char. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - char readChar16() - throws JonathanException; - - /** - * Reads a short. - * - * @return a short. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - short readShort() - throws JonathanException; - - /** - * Reads an int. - * - * @return an int. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - int readInt() - throws JonathanException; - - /** - * Reads a long. - * - * @return a long. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - long readLong() - throws JonathanException; - - /** - * Reads a float. - * - * @return a float. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - float readFloat() - throws JonathanException; - - /** - * Reads a double. - * - * @return a double. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - double readDouble() - throws JonathanException; - - /** - * Reads a string composed of 8 bits chars. - * - * @return a string. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - String readString8() - throws JonathanException; - - /** - * Reads a string composed of 16 bits chars. - * - * @return a string. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - String readString16() - throws JonathanException; - - - /** - * Reads a reference to an object. - * - * @return a reference to an object. - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - Object readReference() throws JonathanException; - - /** - * Reads a value - * - * @return an object representing the read value - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - Object readValue() throws JonathanException; - - /** - * Reads an array of bytes. - * - * @param array a byte array (of size >= offset + len) - * @param offset the position (in array) of the first byte to write - * @param len the total number of bytes to read; - * @exception JonathanException if the format of the data is incompatible - * with the request. - */ - void readByteArray(byte[] array, int offset, int len) - throws JonathanException; - - /** - * Returns an input stream to read data from the unmarshaller. - * - * Closing the returned input stream has the same effect as closing the actual - * unmarshaller. - * - * @return an input stream to read from the unmarshaller. - */ - InputStream inputStream(); - - - /** - * Returns true if this unmarshaller is little-endian, false otherwise. - * - * @return true if this unmarshaller is little-endian, false otherwise. - */ - boolean isLittleEndian(); - - - /** - * Sets the byte order (returned by {@link #isLittleEndian() isLittleEndian}) of - * the target unmarshaller - * - * @param little_endian the new byte order. - */ - void setByteOrder(boolean little_endian); - - - /** - * Returns the number of bytes read since the beginning. - * - * @return the number of bytes read since the beginning. - */ - int bytesRead(); - - /** - * Sets the number of bytes readable from the unmarshaller. - *

- * Once this method has been called, it won't be possible to read more than the - * size specified bytes from this unmarshaller. Knowing the exact - * number of readable bytes lets the unmarshaller free the resources (such as - * a chunk provider) that won't be used. This method may block until the - * expected number of bytes is readable. - * - * @param size the expected number of readable bytes. - * @exception JonathanException if something goes wrong. - */ - void setSize(int size) throws JonathanException; - - /** - * Closes the target unmarshaller, releasing all underlying resources - * (including a possible chunk provider). - */ - void close(); - - /** - * Returns a {@link Context Context} associated with this unmarshaller. - * @return a {@link Context Context} associated with this unmarshaller. - */ - Context getContext(); -} - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/package.html b/fractalrmi/src/org/objectweb/jonathan/apis/presentation/package.html deleted file mode 100644 index 85f853ccc016c3150a2cdce65e1a82c737615db7..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/presentation/package.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -Provides a set of classes and interfaces for presentation protocols -(marshallers and unmarshallers). - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/CommunicationException.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/CommunicationException.java deleted file mode 100644 index b838fe3e3fd52693ae0edc88347b3f161b088d1c..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/CommunicationException.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * CommunicationException is a checked exception that indicates that an error - * occurred when trying to communicate with a remote object interface. - */ -public class CommunicationException extends JonathanException { - /** - * Constructs a new CommunicationException with no detail message. - */ - public CommunicationException() { super(); } - /** - * Builds a CommunicationException with a detail message. - */ - public CommunicationException(String s) { super(s); } - /** - * Builds a CommunicationException that wraps another exception. - */ - public CommunicationException(Exception exception) { super(exception); } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Protocol.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Protocol.java deleted file mode 100644 index 74bddcc69909a0829fa2a8bf11269850b75ed6d2..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Protocol.java +++ /dev/null @@ -1,123 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import java.util.Properties; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.protocols.ProtocolGraph; - -/** - * The protocol abstraction represents protocols like TCP, IP or - * GIOP. A protocol is a - * {@link org.objectweb.jonathan.model.naming_context naming context} - * that only deals with a specific family of interfaces -- called - * {@link Session_Low sessions} --, and - * manages names -- called {@link SessionIdentifier session identifiers} -- to - * designate these interfaces. A protocol is actually a - * {@link org.objectweb.jonathan.model.binder binder}, - * since it may give access to the interfaces it identifies. - *

- * The {@link Protocol Protocol}, and {@link ProtocolGraph ProtocolGraph} - * abstractions have been designed in Jonathan to allow the creation of - * arbitrary protocol stacks, or even graphs. - *

- * The first step in this process is the creation of a protocol graph that will - * represent the expected protocol structure. Methods to create such graphs - * must be provided by protocols. A protocol graph is a directed (acyclic) - * graph composed of protocol-specific nodes, and describing a path to be - * followed by messages when they are sent over the net, or received. Each node - * has a protocol-specific arity. - *

- * Imagine for instance that you want to build a stack with - * the GIOP protocol on top of TCP/IP. You need first to create a graph reduced - * to one TCP/IP node (by calling the appropriate method on the TCP/IP - * protocol), and then to extend it with a GIOP node pointing to the TCP/IP node - * you have just obtained: The GIOP layer - * is not designed to issue requests over a network, and thus expects to issue its - * requests to a lower layer. The GIOP nodes are built using a protocol graph - * representing that lower layer. Note that nothing would forbid a different - * architecture, with possibly two graphs representing two different lower - * layers, one used to issue one-way requests, and the other for two way - * requests. - *

- * When graphs are created, it is also possible to specify additional - * information: for instance, the TCP/IP protocol lets you specify a preferred - * port number. That's why there is no generic newProtocolGraph - * operation: the structure of a node and the information to store in it are - * very dependent on the specific protocol used. - *

- * Once you have obtained a specific protocol graph, you - * can use it to {@link ProtocolGraph#export(Session_Low) export} an interface of a - * specific type: {@link Session_Low Session_Low}. This provides you with a - * session identifier, which is a - * {@link org.objectweb.jonathan.model.name name} for the exported - * interface. You only need to call the export method on the root of - * the protocol graph: The appropriate calls will be recursively issued on its - * sub-graphs. - *

- * Information contained in this session identifier may be tranmitted over the - * network, and a copy of the session identifier re-constructed on a different - * machine (using the appropriate methods provided by protocols). To be able to - * access the exported interface, you will have to call the - * {@link SessionIdentifier#bind(Session_Low) bind} operation to obtain a - * session of type {@link Session_High Session_High}, that will let you send - * messages to the exported session. - */ -public interface Protocol { - /** - * Returns true if the target protocol is an invocation protocol. - *

- * An invocation protocol is a protocol able to handle invocations, i.e., - * requests expecting a reply. In practice, this means that calls to the - * {@link Session_High#prepareInvocation(Marshaller) prepareInvocation} method - * on sessions obtained from the target protocol will not raise an - * {@link org.objectweb.jonathan.apis.kernel.InternalException - * InternalException}, but perform the appropriate work. - * - * @return true if the target protocol is an invocation protocol. - */ - public boolean isAnInvocationProtocol(); - - /** - * Creates a new protocol graph with a number of given sub - * protocol graphs. - * @param subgraphs the lower-level graphs - * @param hints the information req'd to build the graph - * @return a new ProtocolGraph - * @exception JonathanException if the hints or the subgraphs are - * invalid for this protocol - */ - ProtocolGraph createProtocolGraph(ProtocolGraph[] subgraphs, Context hints) throws JonathanException; - - /** - * Creates a new session identifier with the provided info - */ - SessionIdentifier createSessionIdentifier(Properties info, SessionIdentifier[] next) throws JonathanException; -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolGraph.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolGraph.java deleted file mode 100644 index 5398e65f0d6a92c95d45f272c0865d75b0b6a4d4..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolGraph.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.binding.ExportException; - -/** - * @see Protocol - */ -public interface ProtocolGraph { - - /** - * Exports a session using the graph represented by the target object. - *

- * This method informs the protocol that the provided session - * is willing to accept messages. The returned session identifier is a - * specific name - * for the exported session. For a more general explanation, see - * {@link Protocol here}. - * - * @param hls a session to export; - * @return an identifier for the exported session. - * @exception ExportException if the export process fails; - * @exception JonathanException if another error occurs. - * @see org.objectweb.jonathan.model.naming_context#export(org.objectweb.jonathan.model.name) - */ - public SessionIdentifier export(Session_Low hls) - throws ExportException, JonathanException; -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolIdentifiers.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolIdentifiers.java deleted file mode 100644 index ec88aa716d09c9deccb67220196aa5f154defa42..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolIdentifiers.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.objectweb.jonathan.apis.protocols; - -/** - * Simply, a list of the protocol identifiers used in the exotic - * protocol graph thingy. - */ -public interface ProtocolIdentifiers { - static final int GIOP = 0; - static final int TCPIP = 1; - static final int HTTP = 2; - static final int RTP = 3; - static final int MULTICASTIP = 4; - static final int MULTIPLEX = 5; -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolInfo.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolInfo.java deleted file mode 100644 index 817447b9ec94997510cae825dfe5029d36e667d4..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolInfo.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.Context; - -/** - * Tree-like structure to hold the protocol stack info at - * configuration time. This will be used in the Binder to instanciate - * server side protocol graphs. - */ -public class ProtocolInfo { - - Protocol current; - ProtocolInfo[] lower; - Context hints = null; // optional! - - /** - * Create a leaf ProtocolInfo node - */ - public ProtocolInfo(Protocol current) { - this.current = current; - lower = new ProtocolInfo[0]; - } - - /** - * Create a non-leaf ProtocolInfo node - */ - public ProtocolInfo(Protocol current, ProtocolInfo[] lower) { - this.current = current; - this.lower = lower; - } - - /** - * Set the hints that may help things to happen smoothly - * (e.g. configure the port in TCP/IP, ...) - */ - public void setHints(Context hints) { - this.hints = hints; - } - - /** - * Get the lower nodes - */ - public ProtocolInfo[] getLower() { - return lower; - } - - /** - * Get the protocol id of this node - */ - public Protocol getProtocol() { - return current; - } - - public Context getHints() { - return hints; - } - - public String toString() { - return "ProtocolInfo [ " + current.toString() + ", [ " +lower + " ]]"; - } -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolType.fractal b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolType.fractal deleted file mode 100644 index 83d5541bdf794c8b5571de084d550f2a7cc6a268..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ProtocolType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ReplyInterface.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ReplyInterface.java deleted file mode 100644 index cf77ddf2351ada55f5d364ce7ffb44382fbd7a8f..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ReplyInterface.java +++ /dev/null @@ -1,70 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; -import org.objectweb.jonathan.apis.binding.ForwardException; - -/** - * A ReplyInterface holds the reply to a request. Reply interfaces are created - * two-ways invocations are performed. - */ -public interface ReplyInterface { - /** - * Returns a message containing the reply to the request. - *

- * This method blocks until the reply is available. It is the responsibility of - * the caller to make sure that the returned message will be properly - * {@ UnMarshaller#close() closed}. - * - * @return a message containing the reply to the request. - * @exception ServerException if the server has thrown an application level - * exception; - * @exception ForwardException if the server has moved; - * @exception JonathanException if another exception has been raised. - */ - public UnMarshaller listen() - throws ServerException, ForwardException, JonathanException; - - - /** - * Returns true if a (possibly exceptional) reply has arrived. - *

- * If available returns true, a call to - * {@link #listen() listen} is non-blocking. - * - * @return true if a (possibly exceptional) reply has arrived. - */ - public boolean available(); -} - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ReplySession.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ReplySession.java deleted file mode 100644 index 1663ee93fea0a9fb181c97f51edae94b98205590..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ReplySession.java +++ /dev/null @@ -1,151 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * With contributions from: - * H. Piccione & S. Thiebaud - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.Marshaller; - -/** - * A reply session is used by a server to send a reply back to a client. - */ -public interface ReplySession { - - /** - * Lets the target session write its own headers into a newly created message - * and returns it (standard reply case) - *

- * An entity wishing to send a message as a reply to an invocation must not - * create a marshaller on its own and directly - * {@link #send(Marshaller) send} it down the protocol stack. Instead, it must - * ask the session for a marshaller, into which the session will usually - * already have written its specific headers. - *

- * The prepareException method must only be used to prepare - * messages corresponding to a non-exceptional reply from the server. If the - * reply corresponds to an exception raised by the server, use - * {@link #prepareExceptionReply() prepareExceptionReply} instead. - * - * @return a marshaller to write the reply into; - * @exception JonathanException if something goes wrong. - */ - public Marshaller prepareReply() throws JonathanException; - - /** - * Lets the target session write its own headers into a newly created message - * and returns it (exception case) - *

- * An entity wishing to send a message as a reply to an invocation must not - * create a marshaller on its own and directly - * {@link #send(Marshaller) send} it down the protocol stack. Instead, it must - * ask the session for a marshaller, into which the session will usually - * already have written its specific headers. - *

- * The prepareExceptionReply method must only be used to prepare - * messages - * corresponding to an exception raised by the server. - * - * @return a marshaller to write the reply into; - * @exception JonathanException if something goes wrong. - */ - public Marshaller prepareExceptionReply() throws JonathanException; - - - - /** - * Lets the target session write its own headers into a newly created message - * and returns it (system exception case) - *

- * An entity wishing to send a message as a reply to an invocation must not - * create a marshaller on its own and directly - * {@link #send(Marshaller) send} it down the protocol stack. Instead, it must - * ask the session for a marshaller, into which the session will usually - * already have written its specific headers. - *

- * The prepareSystemExceptionReply method must only be used to prepare - * messages - * corresponding to an system exception raised by the server. - * - * @return a marshaller to write the reply into; - * @exception JonathanException if something goes wrong. - */ - public Marshaller prepareSystemExceptionReply() throws JonathanException; - - - - /** - * Lets the target session write its own headers into a newly created message - * and returns it (location forward case) - *

- * An entity wishing to send a message as a reply to an invocation must not - * create a marshaller on its own and directly - * {@link #send(Marshaller) send} it down the protocol stack. Instead, it must - * ask the session for a marshaller, into which the session will usually - * already have written its specific headers. - *

- * The prepareLocationForwardReply method must only be used to prepare - * messages corresponding to an location forward message raised by the server. - * - * @return a marshaller to write the reply into; - * @exception JonathanException if something goes wrong. - */ - public Marshaller prepareLocationForwardReply() throws JonathanException; - - - - /** - * Sends the reply down the protocol stack. - *

- * The sent message must have been obtained by calling the - * {@link #prepareReply() prepareReply} or - * {@link #prepareExceptionReply() prepareExceptionReply} method. - *

- * It is the responsibility of the recipient of the message to - * {@link Marshaller#close() close} it. - * - * @param m the message to send; - * @exception JonathanException if something goes wrong. - */ - public void send(Marshaller m) throws JonathanException; - - /** - * Closes the session, letting the associated resources be released or - * reused. - *

- * Sessions may have an exclusive access to a communication resource. It is - * thus very important to ensure that they are properly closed if they are no - * longer in use. - */ - public void close(); -} - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/RequestSession.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/RequestSession.java deleted file mode 100644 index a614c58cfa0508da8447e005b7a9ecb807b065c1..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/RequestSession.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; - -/** - * Request sessions represent the recipient of an invocation for an invocation - * protocol. - */ -public interface RequestSession { - - /** - * Sends a message (a request) to its recipient. - *

- * The unmarshaller representing the invocation is sent together with a - * reply session, to be used by the recipient to send the reply. The reply - * session may be null if no response is expected. - *

- * It is the responsibility of the recipient to make sure that the unmarshaller - * will properly be {@ UnMarshaller#close() closed}. - * - * @param message the unmarshaller representing the request; - * @param session the session to send the reply; - * @exception JonathanException if something goes wrong. - */ - void send(UnMarshaller message,ReplySession session) - throws JonathanException; - - /** - * Returns the target object represented by this request session. - * @return the target object represented by this request session. - */ - Object getTarget(); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ServerException.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ServerException.java deleted file mode 100644 index 0a618eabbf2ac156869170fdebefafc73c8d4d36..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ServerException.java +++ /dev/null @@ -1,55 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; - -/** - * ServerException is a checked exception encapsulating an applicative exception - * raised by a remote object. - */ -public class ServerException extends JonathanException { - - /** - * An unmarshaller encoding the exception raised by the remote object. - * @serial - */ - public UnMarshaller unmarshaller; - - /** - * Constructs a new ServerException with an unmarshaller encoding the - * exception raised by the remote object. - * @param unmarshaller an unmarshaller. - */ - public ServerException(UnMarshaller unmarshaller) { - this.unmarshaller = unmarshaller; - } -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/SessionIdentifier.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/SessionIdentifier.java deleted file mode 100644 index fb6cfb88bde9b88948de8bfb61732f4bbea5ca7f..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/SessionIdentifier.java +++ /dev/null @@ -1,106 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.binding.BindException; - -/** - * A session identifier represents an exported session. In other words, it is a - * {@link org.objectweb.jonathan.model.name name}, managed by a specific - * {@link org.objectweb.jonathan.model.naming_context naming context} of type - * {@link Protocol Protocol}, and representing a {@link Session_Low session}. - *

- * The internal structure of a session identifier - * is protocol specific: each protocol may define its own SessionIdentifier type - * so that it can contain protocol specific information: host name, port... - *

- * Session identifiers are created when "server" objects are exported, and - * can typically be encoded in - * {@link org.objectweb.jonathan.apis.binding.Identifier identifiers}. On the - * "client" side, they can be decoded and used to establish communication channels. - * - * @see Protocol - */ -public interface SessionIdentifier { - - /** - * Returns the protocol that created this session identifier. - * - * @return the protocol that created this session identifier. - */ - Protocol getProtocol(); - - /** - * Unexporting a session identifier means that the target session identifier - * no longer designates the session it was created for. A session - * identifier must no longer be used after it has been "unexported". - */ - void unexport(); - - /** - * Returns a local session representing the session designated by the provided - * lower session interface. - *

- * This operation is used by a protocol to establish a communication channel - * to the session specified by the target session identifier. The provided lower - * session interface is used to receive messages using the opened channel. - * - * @param hls a session to receive messages on the opened communication channel; - * @return a session to send messages to the remote session. - * @exception BindException if the bind process fails. - * @exception JonathanException if something else goes wrong. - * @see org.objectweb.jonathan.model.binder#bind(org.objectweb.jonathan.model.name) - */ - Session_High bind(Session_Low hls) - throws BindException, JonathanException; - - - /** - * Return the session identifiers corresponding to the lower level - * protocol layers, if any - */ - SessionIdentifier[] next() throws JonathanException; - - - /** - * What kind of protocol does this session identifier relate to? - */ - int getProtocolId(); - - /** - * Yield info about this session, as a Context. - */ - Context getInfo() throws JonathanException; - - /** - * Return true if the target identifier corresponds to a local - * connection - */ - boolean isLocal(); -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Session_High.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Session_High.java deleted file mode 100644 index 4a7313a90091c2e062c9047aa0c0563d69c17a9e..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Session_High.java +++ /dev/null @@ -1,143 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.Marshaller; - -/** - * Session_High is the type of sessions used to send messages down - * to the network; A Session_High is usually a surrogate for - * a session of type {@link Session_Low Session_Low} exported to a protocol and - * represented by an {@link SessionIdentifier session identifier}. - *

- * Sessions represent handles on particular communication channels: A session - * object is dynamically created by a protocol, and lets messages be sent and - * received through the communication channel it represents, using that - * protocol. Sessions have {@link Session_High higher} and {@link Session_Low lower} - * interfaces, respectively used to send messages down and up a protocol stack. - *

- * Usually, a Session_High instance is obtained using the - * {@link SessionIdentifier#bind(Session_Low) bind} operation on a session - * identifier representing a {@link Session_Low Session_Low} interface: it is - * thus a surrogate, or a proxy, for that interface. - */ -public interface Session_High { - - /** - * Lets the target session write its own headers into the provided message - * (one-way case). - *

- * Protocols usually need to add headers in the front of messages before - * sending them down the net. It may be much more efficient to add these headers - * before the actual message is written. The prepare (and - * {@link #prepareInvocation(Marshaller) prepareInvocation} methods are - * provided for this purpose. Therefore, an entity wishing to send a message - * down a protocol stack must first prepare that message by invoking the - * appropriate method (unless a call to {@link #direct() direct} returns true), - * and then write its own data to the message. - *

- * The prepare method must only be used to prepare messages with a - * one-way semantics (no reply expected); If a reply is expected, use - * {@link #prepareInvocation(Marshaller) prepareInvocation} instead. - * - * @param m a marshaller representing the message - * @exception JonathanException if something goes wrong. - */ - public void prepare(Marshaller m) throws JonathanException; - - /** - * Return false if the {@link #prepare(Marshaller) prepare} or - * {@link #prepareInvocation(Marshaller) prepareInvocation} must be used, true - * otherwise. - *

- * A true return means that the target protocols headers are added when the - * message is sent, and not before. Invoking one of the prepare - * methods would in that case return without having changed anything to the - * provided marshaler. - * - * @return true if the prepare methods need not be used. - */ - public boolean direct(); - - /* - * Lets the target session write its own headers into the provided message - * (two-way case). - *

- * Protocols usually need to add headers in the front of messages before - * sending them down the net. It may be much more efficient to add these headers - * before the actual message is written. The - * prepareInvocation - * (and {@link #prepare(Marshaller) prepare} methods are - * provided for this purpose. Therefore, an entity wishing to send a message - * down a protocol stack must first prepare that message by invoking the - * appropriate method (unless a call to {@link #direct() direct} returns true), - * and then write its own data to the message. - *

- * The prepareInvocation method must only be used to prepare - * messages with a two-ways semantics (a reply is expected); If no reply is - * expected, use {@link #prepare(Marshaller) prepare} instead. - * This method returns - * a {@link ReplyInterface ReplyInterface} that must be used to decode the - * reply. - * - * @param m a marshaller representing the message; - * @return a reply interface. - * @exception JonathanException if something goes wrong. - */ - public ReplyInterface prepareInvocation(Marshaller m) - throws JonathanException; - - - /** - * Sends the message down the protocol stack. - *

- * The sent message must have been prepared first, unless a call to - * {@link #direct() direct} returns true. - *

- * It is the responsibility of the recipient of the message to - * {@link Marshaller#close() close} it. - * - * @param m the message to send; - * @exception JonathanException if something goes wrong. - * @see #prepareInvocation(Marshaller) - * @see #prepare(Marshaller) - */ - public void send(Marshaller m) - throws JonathanException; - - /** - * Closes the session, letting the associated resources be released or - * reused. - *

- * Sessions may have an exclusive access to a communication resource. It is - * thus very important to ensure that they are properly closed if they are no - * longer in use. - */ - public void close(); -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Session_Low.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Session_Low.java deleted file mode 100644 index fe51ed59ae272d623e8a19736d1c545ec86fb890..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/Session_Low.java +++ /dev/null @@ -1,87 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.UnMarshaller; - -/** - * Session_Low is the type of sessions used to forward messages - * coming from the network to their actual recipient; Session_Low is - * also the type of interfaces represented by {@link SessionIdentifier session - * identifiers}. - *

- * Sessions represent handles on particular communication channels: A session - * object is dynamically created by a protocol, and lets messages be sent and - * received through the communication channel it represents, using that - * protocol. Sessions have {@link Session_High higher} and {@link Session_Low lower} - * interfaces, respectively used to send messages down and up a protocol stack. - *

- * Session_Low is also the type of interfaces - * {@link ProtocolGraph#export(Session_Low) exported} to protocols, and - * designated by {@link SessionIdentifier session identifiers}. - */ -public interface Session_Low { - /** - * Sends a message up a protocol stack. - *

- * This method is used to send an incoming message to its recipient. The - * provided session parameter represents the sender, and may - * possibly be used to send a reply if necessary. This session - * parameter may be null. - *

- * When this method is used, the target object must make sure that the provided - * message will be {@link UnMarshaller#close() closed}, as well as and the - * {@link Session_High#close() session} (if not null). - * - * @param message the message to send up; - * @param session the sending session. - * @exception org.objectweb.jonathan.exceptions.JonathanException if the sending fails. - */ - public void send(UnMarshaller message,Session_High session) - throws JonathanException; - - /** - * Sends an exception up a protocol stack. - *

- * This method is used to warn the target session that an exception - * has occurred on an incoming message. The - * provided session parameter represents the sender, and may - * possibly be used to send a reply if necessary. This session - * parameter may be null. - *

- * When this method is used, the target object must make sure that the provided - * session will be {@link Session_High#close() closed}(if not null). - * - * @param exception the exception that occurred; - * @param session the sending session. - */ - public void send(JonathanException exception,Session_High session); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpConnection.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpConnection.java deleted file mode 100644 index 61127a81dcebdb33651bb119cccb0f46a91ed708..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpConnection.java +++ /dev/null @@ -1,82 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - */ - - -package org.objectweb.jonathan.apis.protocols.ip; - -import org.objectweb.jonathan.apis.resources.Chunk; -import java.io.IOException; - -/** - * A IpConnection represents a communication resource. It encapsulates a socket. - * A connection may always be related to a given session, i.e., a communication - * channel. - */ -public interface IpConnection { - - /** - * Returns the session attached to this connection. - * @return the session attached to this connection. - */ - IpSession getSession(); - - /** - * Attaches a new session to this connection. - * @param session the session to be attached to the target connection. - */ - void setSession(IpSession session); - - void receive(Chunk chunk,int sz) throws IOException; - - int available() throws IOException; - - void emit(Chunk chunk) throws IOException; - - /** - * Returns the port number of the underlying socket. - * @return the port number of the underlying socket. - */ - int getPort(); - - /** - * Returns the host name of the underlying socket. - * @return the host name of the underlying socket. - */ - String getHostName(); - - /** - * Releases this connection. This is to indicate to the connection manager that - * this connection is no longer used. - */ - void release(); - - /** - * Deletes this connection, removing it from the connection manager, and - * closing the socket. This method should not be used a a socket user unless - * a problem occurs on the connection, like an exception when trying to read - * or to write data. - */ - void delete(); -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpSession.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpSession.java deleted file mode 100644 index 92cc2ec5890ca350ad7fcf5ebd21127a3f79a005..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpSession.java +++ /dev/null @@ -1,46 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - */ - - -package org.objectweb.jonathan.apis.protocols.ip; - -import org.objectweb.jonathan.apis.protocols.Session_High; -import org.objectweb.jonathan.apis.protocols.Session_Low; - -/** - * {@link org.objectweb.jonathan.apis.protocols.Session_High Session} type for - * Tcp/Ip protocols. - */ -public interface IpSession extends Session_High { - /** - * Returns the Higher Level Session associated with the target session, i.e., - * the session to which the data read from the Tcp/Ip connection will be sent. - * - * @return the Higher Level Session associated with the target session - */ - public Session_Low getHls(); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpSessionIdentifier.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpSessionIdentifier.java deleted file mode 100644 index 1c673674b6c383db2cb4bc657ace7a8b29fc715b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/IpSessionIdentifier.java +++ /dev/null @@ -1,120 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - */ - - -package org.objectweb.jonathan.apis.protocols.ip; - -import org.objectweb.jonathan.apis.protocols.SessionIdentifier; -import org.objectweb.jonathan.apis.protocols.ProtocolIdentifiers; - - -/** - * IpSessionIdentifier is a specific - * {@link org.objectweb.jonathan.apis.protocols.SessionIdentifier - * SessionIdentifier} type for IP protocols. An IP session identifier contains - * a host name, and a port - * number. - */ -abstract public class IpSessionIdentifier implements SessionIdentifier, ProtocolIdentifiers { - - /** Hostname of this session identifier. */ - public String hostname; - - /** Port number of this session identifier. */ - public int port; - - /** - * Constructs a new IpSessionIdentifier with the specified host name and port - * number. - * - * @param hostname a host name; - * @param port a port number; - * @return an IP session identifier. - */ - public IpSessionIdentifier(String hostname, int port) { - this.hostname = hostname; - this.port = port; - } - - /** - * Constructs a new empty IpSessionIdentifier. - */ - public IpSessionIdentifier() { - this.port = 0; - } - - /** - * Returns a hash code value for this IpSessionIdentifier. - * - * @return a hash code value for this object. - */ - public int hashCode() { - if (hostname == null) { - return port; - } else { - return hostname.hashCode() + port; - } - } - - /** - * Compares this object to the specified object. - *

- * The result is true if and only if the argument is not null and is a - * IpSessionIdentifier object that has the same host name and port number. - * - * @param obj the object to compare with. - * @return true if the objects are the same; false otherwise. - */ - public boolean equals(Object o) { - if (o != null && o instanceof IpSessionIdentifier) { - IpSessionIdentifier k = (IpSessionIdentifier)o; - return port == k.port && hostname.equals(k.hostname); - } else { - return false; - } - } - - /** - * Returns a string representation of this session identifier. - * - * @return a string representation of this session identifier. - */ - public String toString() { - return "IpSessionIdentifier["+hostname+","+port+"]"; - } - - /** - * Return an empty array: this is a leaf protocol in the protocol - * tree. - */ - public SessionIdentifier[] next() { - return new SessionIdentifier[0]; - } - - public final int getProtocolId() { - return ProtocolIdentifiers.TCPIP; - } - -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/TcpIpConnectionMgr.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/TcpIpConnectionMgr.java deleted file mode 100644 index e89f14e67d83df7b640535dc4023c1e16570ec3f..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/TcpIpConnectionMgr.java +++ /dev/null @@ -1,82 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols.ip; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * This interface defines a type for Tcp/Ip connection managers. - */ -public interface TcpIpConnectionMgr { - - /** - * Returns a new client connection. - *

- * This method is called by a protocol. - * The protocol provides a session (i.e. an object - * representing an abstract communication channel) and expects a connection - * (i.e. a communication resource). The returned connection must have been - * built using the provided session, or be a connection associated with a - * session having the same destination as the provided session. - * - * @param host the host name of the distant server; - * @param port the port number of a server socket on that host; - * @param session a TcpIp session - * @return a connection for that session. - * @exception JonathanException if an error occurs. - */ - IpConnection newCltConnection(String host, int port,IpSession session) - throws JonathanException; - - /** - * Returns a new server connection factory encapsulating a server socket on the - * provided port. If port = 0, an anonymous server socket is opened. - * - * @param port the expected port of the server socket; - * @return a server connection factory. - * @exception JonathanException if an error occurs. - */ - TcpIpSrvConnectionFactory newSrvConnectionFactory(int port) - throws JonathanException; - - /** - * Returns the canonical host name of the provided host. - * - * The purpose of this method is to help checking the equality of two host - * names. Two names corresponding to the same host should have the same - * (the "sameness" being defined by the equals method on type String) - * canonical names. - * - * @param hostname a host name - * @return the corresponding canonical host name. - */ - String getCanonicalHostName(String hostname); - -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/TcpIpSrvConnectionFactory.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/TcpIpSrvConnectionFactory.java deleted file mode 100644 index 332676905c03fb4fd891ce089fb39e0721ed074e..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/TcpIpSrvConnectionFactory.java +++ /dev/null @@ -1,69 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols.ip; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * TcpIpSrvConnectionFactory encapsulates a server socket. - */ -public interface TcpIpSrvConnectionFactory { - - /** - * Returns a new connection for the provided session, obtained from the - * encapuslated server socket. - * - * @param session an IpSession. - * @return a new IpConnection. - * @exception JonathanException if an error occurs. - */ - IpConnection newSrvConnection(IpSession session) - throws JonathanException; - - - /** - * Returns the local port of the encapsulated socket. - * @return the local port of the encapsulated socket. - */ - int getPort(); - - - /** - * Returns the host name of the encapsulated socket. - * @return the host name of the encapsulated socket. - */ - String getHostName(); - - - /** - * Tells the factory to release the server socket. - */ - void close(); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/UdpConnectionMgr.java b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/UdpConnectionMgr.java deleted file mode 100644 index 30139fcdad04b5046dd2df507c795820c266313d..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/UdpConnectionMgr.java +++ /dev/null @@ -1,41 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.protocols.ip; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * This interface defines a type for UDP connection managers. - */ -public interface UdpConnectionMgr { - - IpConnection newConnection(String host,int port,IpSession session) - throws JonathanException; -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/package.html b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/package.html deleted file mode 100644 index 4857c8581c9b9096123c7760e04cd462357850f4..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/ip/package.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -Provides a set of classes and interfaces refining the binding abstractions in -the case of IP protocols, and introduces some connection management abstractions. - - - \ No newline at end of file diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/package.html b/fractalrmi/src/org/objectweb/jonathan/apis/protocols/package.html deleted file mode 100644 index e0169837abe7d04137e5a4b15e156b2df225d96c..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/protocols/package.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -Provides a set of classes and interfaces for communication protocols. - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/Chunk.java b/fractalrmi/src/org/objectweb/jonathan/apis/resources/Chunk.java deleted file mode 100644 index 9f8898c24cf9391cc05b192cf522a10a83b43fb5..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/Chunk.java +++ /dev/null @@ -1,127 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.resources; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - - -/** - * A chunk represents a part of an array of bytes. Chunks are linked to form - * messages that may be sent from an adress space to another. Their use avoids - * unnecessarily copying arrays of bytes, and helps recovering these arrays - * without resorting to garbage collection (thanks to - * {@link ChunkFactory chunk factories}). - *

- * Chunks should not be used concurrently. - */ -public class Chunk { - /** The associated array of bytes. */ - public byte[] data; - - /** Index of the last valid (written) byte in this chunk + 1. */ - public int top; - - /** The index of the first valid (written) byte in this chunk. */ - public int offset; - - /** The next chunk in the chain */ - public Chunk next; - - /** - * Constructs a new chunk with the specified data and offsets. - * - * @param data the byte array containing the data. - * @param offset the offset of the first valid byte in the chunk. - * @param top offset + the number of valid bytes in the chunk. - */ - public Chunk (byte[] data,int offset,int top) { - this.data = data; - this.offset = offset; - this.top = top; - } - - /** - * Duplicates the whole chunk. - *

- * The default implementation copies the buffer, - * and creates a new chunk with it. - * - * @return a copy of this chunk. - * @exception org.objectweb.jonathan.exceptions.JonathanException if an IO error - * occurs. - */ - public Chunk duplicate() throws JonathanException { - int len = top - offset; - byte[] ndata = new byte[len]; - System.arraycopy(data,offset,ndata,0,len); - return new Chunk(ndata,0,len); - } - - /** - * Partially duplicates this chunk. 'offset' must be greater than - * the target chunk's offset, 'top' must be less or equal than the target's top. - *

- * The default implementation copies the appropriate portion of the buffer, - * and creates a new chunk with it. - * - * @param offset the offset of the chunk copy. - * @param top the top of the chunk copy. - * @return a chunk containing the specified part of the target chunk. - * @exception org.objectweb.jonathan.exceptions.JonathanException if an error occurs. - */ - public Chunk duplicate(int offset,int top) throws JonathanException { - int len = top - offset; - byte[] ndata = new byte[len]; - System.arraycopy(data,offset,ndata,0,len); - return new Chunk(ndata,0,len); - } - - - /** - * Releases the chunk. The data of a chunk may be obtained from managed - * buffers. It may thus be necessary to tell when the data encapsulated by a - * chunk may be reused. - *

- * The default implementation resets offset and top to 0. - */ - public void release() { - top = 0; - offset = 0; - next = null; - } - - /** - * Returns a string representation of the target chunk. - * - * @return a string representation of the target chunk. - */ - public String toString() { - return "Chunk[data: " + data + " offset: " + offset + " top: " + top + "]"; - } -} - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkFactory.java b/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkFactory.java deleted file mode 100644 index df0ff156975c23a6901896ef3a5b437acc1d1f70..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkFactory.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.resources; - - -/** - * A chunk factory builds chunks, possibly implementing a specific chunk - * management policy. - */ -public interface ChunkFactory { - - /** - * Returns a chunk. The offset and top of this chunk are 0. - * @return a chunk. - */ - public Chunk newChunk(); - - - /** - * Returns a chunk whose associated array of bytes is (at least) of size - * size. Its offset and top are always 0. - * @param size the size of the expected chunk. - * @return a chunk. - */ - public Chunk newChunk(int size); -} - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkFactoryType.fractal b/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkFactoryType.fractal deleted file mode 100644 index 990b86bbbaad4f948a61a8fde02b638554e9e8b1..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkFactoryType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkProvider.java b/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkProvider.java deleted file mode 100644 index 4ae44378eb265475437e3c873648f97df09ed710..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/ChunkProvider.java +++ /dev/null @@ -1,62 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.resources; - -import org.objectweb.jonathan.apis.kernel.JonathanException; - -/** - * Chunk providers are used to wrap input streams (like, e.g., socket input streams) - * in unmarshallers. - * - * @see org.objectweb.jonathan.apis.presentation.MarshallerFactory - */ -public interface ChunkProvider { - - /** - * Returns a chunk to read data from. - *

- * When done with the chunk, its user must update its - * {@link Chunk#offset offset} and {@link Chunk#top top} members and - * {@link Chunk#release() release} it. - *

- * ChunkProviders should not be used concurrently. - * - * @return a chunk; - * @exception JonathanException if no chunk can be provided. - */ - public Chunk prepare() throws JonathanException; - - - /** - * Closes the chunk provider. This method must be called if the target provider - * is no longer used. - */ - public void close(); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/Job.java b/fractalrmi/src/org/objectweb/jonathan/apis/resources/Job.java deleted file mode 100644 index 4406236e2d844cbba5c5cfe8315ef139d31ad197..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/Job.java +++ /dev/null @@ -1,53 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.resources; - -import org.objectweb.jonathan.apis.kernel.Context; - -/** - * A Job is the abstraction of an activity in the system. Jobs are created and - * managed by {@link Scheduler schedulers}. The role of a job is to - * {@link #run execute} code. - */ -public interface Job { - - /** - * Tells the target job to execute the code manifested by the message - * argument. - * @param message code to be executed. - */ - public void run(Runnable message); - - /** - * Returns a context associated with the target Job. - * @return a context associated with the target Job. - */ - public Context getContext(); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/Scheduler.java b/fractalrmi/src/org/objectweb/jonathan/apis/resources/Scheduler.java deleted file mode 100644 index 8e396d3dffbaf0692d588f9ba5ef0131b927668a..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/Scheduler.java +++ /dev/null @@ -1,116 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.resources; - -/** - * Schedulers are used to create and schedule Jobs. - *

- * To allow application programmers to change the default scheduling used by Java, - * and to implement some resource management policy on activity resources - * (threads), Jonathan introduces abstractions to represent activities - * (interface {@link Job Job}) and schedulers - * (interface {@link Scheduler Scheduler}). - *

- * A Job is the abstraction of an activity in the system. When this activity - * is sequential - * (the usual case), it may be thought of as a thread. The role of a scheduler is - * to create Jobs (a scheduler is a job factory), and to manage them according to - * their properties (a priority, a deadline, ...). A scheduler has thus the - * responsibility to associate a Job with some processing resource (which may be - * a processor, or more simply a Java thread) when it is entitled to run. - */ -public interface Scheduler { - - - /** - * Returns a new job created by the scheduler. - * @return a new job created by the scheduler. - */ - public Job newJob(); - - - /** - * Returns the currently executing job (the job performing the call). - * @return the currently executing job. - */ - public Job getCurrent(); - - - /** - * Calling this method gives the opportunity to the scheduler to re-schedule - * the currently executing jobs. - */ - public void yield(); - - /** - * Blocks the calling job until the {@link #notify(Object) notify} or - * {@link #notifyAll(Object) notifyAll} method is called providing the - * same lock identifier. - * @param lock the lock identifier. - * @exception InterruptedException - */ - public void wait(Object lock) throws InterruptedException; - - /** - * Blocks the calling job until the {@link #notify(Object) notify} or - * {@link #notifyAll(Object) notifyAll} method is called providing the - * same lock identifier. - * @param lock the lock identifier. - * @exception InterruptedException - */ - public void wait(Object lock,long millis) throws InterruptedException; - - /** - * Unblocks a job {@link #wait(Object) waiting} on the lock. - * @param lock the lock identifier. - */ - public void notify(Object lock); - - - /** - * Unblocks all jobs {@link #wait(Object) waiting} on the lock. - * @param lock the lock identifier. - */ - public void notifyAll(Object lock); - - - /** - * Causes the calling job to be removed from the set of jobs managed by the - * target scheduler. It is necessary to call this method before every possibly - * blocking method so that the scheduler can give a chance to run to another job. - */ - public void escape(); - - /** - * Causes a job {@link #escape() "escaped"} from the scheduler to be re-admitted - * in the set of jobs managed by the target scheduler. - */ - public void enter(); -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/SchedulerType.fractal b/fractalrmi/src/org/objectweb/jonathan/apis/resources/SchedulerType.fractal deleted file mode 100644 index 00f373a0ef28b4992a51ad003acf8bcec7bf27a8..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/SchedulerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/resources/package.html b/fractalrmi/src/org/objectweb/jonathan/apis/resources/package.html deleted file mode 100644 index b0772ce6187bff9a6d46e11839a4d0aec2545fe3..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/resources/package.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - -Provides a set of classes and interfaces dealing with resource -management. Jonathan proposes abstractions to deal with buffers -(Chunk, ChunkProvider and ChunkFactory) -and activity (Job and -Scheduler). - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/stub_factories/StubFactory.java b/fractalrmi/src/org/objectweb/jonathan/apis/stub_factories/StubFactory.java deleted file mode 100644 index 7d50f2fc82582d71c291343c1760f3b18f15120c..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/stub_factories/StubFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 2.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.apis.stub_factories; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.binding.Identifier; -import org.objectweb.jonathan.apis.protocols.SessionIdentifier; - -/** - * A Stub factory is a factory for stubs... - */ -public interface StubFactory { - - - /** - * Creates a new stub. - *

- * A stub plays two roles: - *

    - *
  • It is the local representative of a (remote) object, and thus should - * bear a set of identifiers for that remote object; - *
  • It is part of the binding between the client and the server, and is - * thus related to a given protocol. The session identifier provided as an - * argument is the manifestation of this relation. It can be used to - * obtain a session allowing the stub to send data to the remote object. - *
- * - * @param session_id a session identifier, to be used to send marshalled - * data to the object represented by the stub; - * @param ids the set of identifiers of the stub; - * @param hints other data possibly used to create the stub. - * @return a stub - * @exception JonathanException if something goes wrong. - */ - Object newStub(SessionIdentifier session_id, Identifier[] ids,Context hints) - throws JonathanException; -} diff --git a/fractalrmi/src/org/objectweb/jonathan/apis/stub_factories/package.html b/fractalrmi/src/org/objectweb/jonathan/apis/stub_factories/package.html deleted file mode 100644 index 1ead25a11ceaf348eab94be4b1231d221440fcde..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/apis/stub_factories/package.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - -Provides an interface for stub factories. - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/helpers/LogConfiguration.java b/fractalrmi/src/org/objectweb/jonathan/libs/helpers/LogConfiguration.java deleted file mode 100644 index aec6fc90bd02cb0e171637b97d12eec83aa2a60e..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/helpers/LogConfiguration.java +++ /dev/null @@ -1,8 +0,0 @@ -package org.objectweb.jonathan.libs.helpers; - -public class LogConfiguration { - - public static org.objectweb.jonathan.apis.kernel.Context newConfiguration (Class c) { - return null; - } -} diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/kernel/JContextFactory.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/kernel/JContextFactory.fractal deleted file mode 100644 index 0bd1f57f7f930159182188af2c3d2fb3e53ab6c6..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/kernel/JContextFactory.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/LoggerProvider.java b/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/LoggerProvider.java deleted file mode 100644 index de225f7f7013d8e2d8f677a24ada04376bd2bcf5..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/LoggerProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.objectweb.jonathan.libs.protocols.tcpip; - -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.libs.helpers.LogConfiguration; -import org.objectweb.util.monolog.api.Logger; - -class LoggerProvider { - static Logger logger = null; - static Logger bind_logger = null; - static Logger export_logger = null; - static Logger send_logger = null; - static Logger receive_logger = null; - - static { - try { - Context trace_context = LogConfiguration.newConfiguration(LoggerProvider.class); - String package_name = "org.objectweb.jonathan.libs.protocols.tcpip"; - Object component = trace_context.getValue("packages." + package_name + ".generic logger",'.'); - if (component instanceof Logger) logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".bind logger",'.'); - if (component instanceof Logger) bind_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".export logger",'.'); - if (component instanceof Logger) export_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".send logger",'.'); - if (component instanceof Logger) send_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".receive logger",'.'); - if (component instanceof Logger) receive_logger = (Logger) component; - } catch (Exception e) {} - } -} diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocol.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocol.fractal deleted file mode 100644 index 3bff4b9e131fb91a877bd977979c7c632510c404..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocol.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocol.java b/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocol.java deleted file mode 100644 index 4c0b79a5005447fdccf6005d0afa034ffc826292..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocol.java +++ /dev/null @@ -1,801 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999-2000 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - -package org.objectweb.jonathan.libs.protocols.tcpip; - -import java.io.IOException; -import java.util.Properties; - -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.kernel.InternalException; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.presentation.EndOfMessageException; -import org.objectweb.jonathan.apis.presentation.Marshaller; -import org.objectweb.jonathan.apis.presentation.MarshallerFactory; -import org.objectweb.jonathan.apis.protocols.CommunicationException; -import org.objectweb.jonathan.apis.protocols.Protocol; -import org.objectweb.jonathan.apis.protocols.ProtocolGraph; -import org.objectweb.jonathan.apis.protocols.ReplyInterface; -import org.objectweb.jonathan.apis.protocols.SessionIdentifier; -import org.objectweb.jonathan.apis.protocols.Session_High; -import org.objectweb.jonathan.apis.protocols.Session_Low; -import org.objectweb.jonathan.apis.protocols.ip.IpConnection; -import org.objectweb.jonathan.apis.protocols.ip.IpSession; -import org.objectweb.jonathan.apis.protocols.ip.IpSessionIdentifier; -import org.objectweb.jonathan.apis.protocols.ip.TcpIpConnectionMgr; -import org.objectweb.jonathan.apis.protocols.ip.TcpIpSrvConnectionFactory; -import org.objectweb.jonathan.apis.resources.Chunk; -import org.objectweb.jonathan.apis.resources.ChunkFactory; -import org.objectweb.jonathan.apis.resources.ChunkProvider; -import org.objectweb.jonathan.apis.resources.Scheduler; - -import org.objectweb.util.monolog.api.BasicLevel; - -/** - * This is an implementation of the - * {@link org.objectweb.jonathan.apis.protocols.Protocol Protocol} - * interface representing the TCP/IP stack. - */ -public class TcpIpProtocol implements Protocol { - protected Scheduler scheduler; - protected ChunkFactory chunk_factory; - protected MarshallerFactory marshaller_factory; - protected ContextFactory context_factory; - - /** - * Indicates whether warning messages should be printed to stderr. - * This constant is defined under the name /jonathan/tcpip/verbose - * in the {@link org.objectweb.jonathan.apis.kernel.Kernel#newConfiguration(Class) - * bootstrap context}. - */ - public boolean verbose; - - /** SrvSocket factories */ - SrvSessionFactory[] srv_session_factories = new SrvSessionFactory[4]; - int num_srv_sessions = 0; - - /** connection manager */ - protected TcpIpConnectionMgr connection_mgr; - - /** - * Constructs a new instance of TcpIpProtocol. - * - * @param connection_mgr a connection manager for this protocol; - * @param scheduler the kernel's scheduler; - * @param chunk_factory a chunk factory; - * @param mf a marshaller factory; - * @param context_factory a context factory - * @exception JonathanException if something goes wrong. - */ - public TcpIpProtocol(TcpIpConnectionMgr connection_mgr, Scheduler scheduler, - ChunkFactory chunk_factory, MarshallerFactory mf, - ContextFactory context_factory) { - this.scheduler = scheduler; - this.chunk_factory = chunk_factory; - this.connection_mgr = connection_mgr; - this.marshaller_factory = mf; - this.context_factory = context_factory; - verbose = false; - } - - /** - * Used to set the verbiage level. - * @param verbose if true, turn on verbosity - */ - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - - /** - * Returns false: TcpIpProtocol cannot deal with invocations. - * @return false. - */ - public boolean isAnInvocationProtocol() { - return false; - } - - /** - * Creates a new ProtocolGraph - * @param lower lower-level protocol graphs. Ignored as TCP/IP is a leaf. - * @param hints may contain a "port" key/value pair. - * @return a new ProtocolGraph - */ - public ProtocolGraph createProtocolGraph(ProtocolGraph[] lower, Context hints) { - try { - int port = ((Integer)hints.getValue("port", (char)0)).intValue(); - return new TcpIpProtocolGraph(port); - } catch (ClassCastException cce) { - return new TcpIpProtocolGraph(); - } - } - - /** - * Creates a new TcpIpSessionIdentifier. - * @param host a port number; - * @param port an host name; - * @return a new TcpIpSessionIdentifier. - */ - public IpSessionIdentifier newSessionIdentifier(String host, - int port) { - return new CltSessionIdentifier(host,port); - } - - public SessionIdentifier createSessionIdentifier(Properties info, SessionIdentifier[] next) throws JonathanException { - String host = ""; - int port = 0; - try { - host = (String)info.get("hostname"); - port = ((Integer)info.get("port")).intValue() & 0xFFFF; - } catch (ClassCastException cce) { - throw new JonathanException("Unable to find relevant TCP/IP information (host, port)"); - } - - return new CltSessionIdentifier(host, port); - } - - /** - * Returns true if the provided session identifier corresponds to a local - * connection managed by this protocol. - * - * @param tcp_session_id a TcpIpSessionIdentifier. - * @return true if the provided session identifier corresponds to a local - * connection managed by this protocol, otherwise false. - */ - public boolean isLocal(IpSessionIdentifier tcp_session_id) { - String hostname = - connection_mgr.getCanonicalHostName(tcp_session_id.hostname); - tcp_session_id.hostname = hostname; - return isLocal(hostname,tcp_session_id.port); - } - - /** - * Returns true if the provided host and port correspond to a local connection - * managed by this protocol. - * @param host a host name; - * @param port a port number. - * @return true if the provided host and port correspond to a local connection - * managed by this protocol, otherwise false. - */ - boolean isLocal(String host,int port) { - synchronized(srv_session_factories) { - for (int i = 0; i < num_srv_sessions; i++) { - if (srv_session_factories[i].session_id.port == port && - srv_session_factories[i].session_id.hostname.equals(host)) { - return true; - } - } - return false; - } - } - - /** removes a server socket factory */ - void remove(SrvSessionFactory factory) { - int i = 0; - while(i < num_srv_sessions && srv_session_factories[i] != factory) { - i++; - } - if (i < num_srv_sessions) { - num_srv_sessions--; - System.arraycopy(srv_session_factories,i+1, - srv_session_factories,i,num_srv_sessions - i); - srv_session_factories[num_srv_sessions] = null; - } - } - - void send(Marshaller message,IpConnection connection) - throws IOException { - Chunk first = message.getState(), portion = null; - int size = 0, len; - boolean onechunk = true; - Chunk c = first; - - while (c != null) { - len = c.top - c.offset; - if (len != 0) { - if (size != 0) { - onechunk = false; - } else { - portion = c; - } - size += len; - } - c = c.next; - } - if (onechunk) { - if (portion != null) { - //begin log - if ((LoggerProvider.send_logger != null) - &&(LoggerProvider.send_logger.isLoggable(BasicLevel.DEBUG))) { - String str = "TCP a: "; - for (int i = 0; i < portion.top - portion.offset; i++) { - str = str + portion.data[i] + " "; - } - LoggerProvider.send_logger.log(BasicLevel.DEBUG,str); - } - //end log - connection.emit(portion); - } - message.close(); - } else { - try { - portion = chunk_factory.newChunk(size); - int off = portion.offset; - c = first; - while (c != null) { - if ((len = c.top - c.offset) > 0) { - System.arraycopy(c.data,c.offset,portion.data,off,len); - off += len; - } - c = c.next; - } - portion.top = off; - //begin log - if ((LoggerProvider.send_logger != null) - &&(LoggerProvider.send_logger.isLoggable(BasicLevel.DEBUG))) { - String str = "TCP b: "; - for (int i = 0; i < size; i++) { - str = portion.data[i] + " "; - } - // System.out.println(str); - LoggerProvider.send_logger.log(BasicLevel.DEBUG,str); - } - //end log - connection.emit(portion); - message.close(); - } finally { - portion.release(); - } - } - } - - final class TcpIpProtocolGraph implements ProtocolGraph { - - int port; - - TcpIpProtocolGraph(int port) { - this.port = port; - } - - TcpIpProtocolGraph() { - this(0); - } - - public SessionIdentifier export(Session_Low hls) - throws JonathanException { - SrvSessionId session_id; - synchronized (srv_session_factories) { - // try to reuse an existing server socket factory. - for (int i = 0; i < num_srv_sessions; i++) { - if ((session_id = - srv_session_factories[i].register(hls,this)) != null) { - return session_id; - } - } - // it has not been possible to reuse an existing server socket - // factory. create a new session identifier and srv session factory. - TcpIpSrvConnectionFactory srv_connection_factory = - connection_mgr.newSrvConnectionFactory(port); - session_id = new SrvSessionId(srv_connection_factory); - SrvSessionFactory srv_fac = - new SrvSessionFactory(session_id,hls,TcpIpProtocol.this); - scheduler.newJob().run(srv_fac); - int len = srv_session_factories.length; - if (num_srv_sessions == len) { - SrvSessionFactory[] new_srv_session_factories = - new SrvSessionFactory[len + 4]; - System.arraycopy(srv_session_factories,0,new_srv_session_factories, - 0,len); - srv_session_factories = new_srv_session_factories; - } - srv_session_factories[num_srv_sessions++] = srv_fac; - return session_id; - } - } - } - - final class CltSessionIdentifier extends IpSessionIdentifier { - - CltSessionIdentifier(String hostname, int port) { - super(hostname,port); - } - - public Protocol getProtocol() { - return TcpIpProtocol.this; - } - - public void unexport() {} - - public Session_High bind(Session_Low hls) - throws JonathanException { - CltSession session = new CltSession(hls,this); - IpConnection connection = - connection_mgr.newCltConnection(hostname,port,session); - session = (CltSession) connection.getSession(); - session.acquire(); - session.connect(connection); - return session; - } - - public Context getInfo() throws JonathanException { - Context c = context_factory.newContext(); - c.addElement("hostname", String.class, hostname, (char)0); - c.addElement("port", Integer.class, new Integer(port), (char)0); - return c; - } - - public boolean isLocal() { - return TcpIpProtocol.this.isLocal(this); - } - } - - final class SrvSessionId extends IpSessionIdentifier { - - TcpIpSrvConnectionFactory connection_factory; - - SrvSessionId(TcpIpSrvConnectionFactory connection_factory) { - super(connection_factory.getHostName(), - connection_factory.getPort()); - this.connection_factory = connection_factory; - } - - public Protocol getProtocol() { - return TcpIpProtocol.this; - } - - public void unexport() { - connection_factory.close(); - } - - public Session_High bind(Session_Low hls) - throws JonathanException { - throw new InternalException("Meaningless operation"); - } - - public Context getInfo() throws JonathanException { - Context c = context_factory.newContext(); - c.addElement("hostname", String.class, hostname, (char)0); - c.addElement("port", Integer.class, new Integer(port), (char)0); - return c; - } - - public boolean isLocal() { - return TcpIpProtocol.this.isLocal(this); - } - } - - abstract class Session implements IpSession, Runnable { - /** - * The current connection in use. If no connection is in use, connection = - * null. - */ - IpConnection connection; - /** The corresponding message */ - TcpIpChunkProvider tcp_message; - /** The higher level session */ - Session_Low hls; - - Session(Session_Low hls) { - super(); - this.hls = hls; - } - - final public void prepare(Marshaller m) {} - - final public ReplyInterface prepareInvocation(Marshaller m) - throws JonathanException { - throw new InternalException("TCP session don't handle invocations."); - } - - final public boolean direct() { - return true; - } - - public final Session_Low getHls() { - return hls; - } - - public synchronized void connect(IpConnection connection) - throws JonathanException { - if (this.connection != null) { - return; - } - this.connection = connection; - if (tcp_message == null) { - // If tcp_message != null, a thread should already be started and - // running. - tcp_message = new TcpIpChunkProvider(this); - scheduler.newJob().run(this); - } - } - - - public final IpConnection getConnection() { - return connection; - } - - /** Runnable method */ - final public void run() { - TcpIpChunkProvider message = null; - IpConnection connection = null; - try { - synchronized (this) { - if (this.connection != null) { - message = tcp_message; - connection = this.connection; - } else { - return; - } - } - hls.send(marshaller_factory.newUnMarshaller(message),this); - } catch (JonathanException e) { - // begin log - if ((LoggerProvider.receive_logger != null) - &&(LoggerProvider.receive_logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.receive_logger.log(BasicLevel.INFO,"Exception caught by TcpIpProtocol."); - } - //end log - Throwable f = e.represents(); - if (f instanceof IOException || f instanceof EndOfMessageException) { - synchronized (this) { - if (connection == this.connection) { - unbind(); - return; - } else { - message.delete(); - } - } - } - hls.send(e,this); - } - } - - /** used by TcpIpChunkProvider */ - final synchronized void closeNotify(TcpIpChunkProvider message) { - if (connection != null && message == tcp_message) { - tcp_message = new TcpIpChunkProvider(message); - scheduler.newJob().run(this); - } else { - System.out.println("connection " + connection + - " " + message + " " + tcp_message); - message.delete(); - } - } - - /** used by TcpIpChunkProvider */ - final synchronized void deleteNotify(TcpIpChunkProvider message) { - if (message == tcp_message) { - tcp_message = null; // rebinding should work better now - } - } - - /** always called in a synchronized context */ - void unbind() { - if (connection != null) { - connection.delete(); - connection = null; - } - } - - TcpIpProtocol getProtocol() { - return TcpIpProtocol.this; - } - } - - final class SrvSession extends Session { - SrvSession(Session_Low hls) { - super(hls); - } - - final public void close() {} - - /** Session_High method */ - public final void send(Marshaller message) - throws JonathanException { - try { - TcpIpProtocol.this.send(message,connection); - } catch (IOException e) { - try { - synchronized (this) { - if (connection == null) { - throw new CommunicationException("Session is closed"); - } - unbind(); - throw new CommunicationException(e); - } - } finally { - message.close(); - } - } - } - } - - final class CltSession extends Session { - IpSessionIdentifier session_id; - int acquired; - - - CltSession(Session_Low hls,IpSessionIdentifier session_id) - throws JonathanException { - super(hls); - this.session_id = session_id; - acquired = 0; - } - - /** Session_High method */ - public final void send(Marshaller message) - throws JonathanException { - try { - TcpIpProtocol.this.send(message,connection); - } catch (IOException e) { - try { - synchronized (this) { - if (connection == null) { - throw new CommunicationException("Session is closed"); - } - try { - rebind(); - } catch (JonathanException g) { - throw new org.objectweb.jonathan.apis.binding.BindException("Can't rebind TCP session"); - } - try { - TcpIpProtocol.this.send(message,connection); - } catch (IOException f) { - unbind(); - throw new CommunicationException(f); - } - } - } finally { - message.close(); - } - } - } - - /** always called in a synchronized context and after an IO Exception */ - void rebind() throws JonathanException { - connection.delete(); - connection = null; - String hostname = session_id.hostname; - int port = session_id.port; - IpConnection new_connection = - connection_mgr.newCltConnection(hostname,port,this); - connect(new_connection); - } - - /** - * Closes this session. - */ - final public synchronized void close() { - acquired--; - if (acquired == 0 && connection != null) { - connection.release(); - connection = null; - } - } - - final synchronized void acquire() { - acquired++; - } - - public boolean equals(Object object) { - if (object instanceof CltSession) { - CltSession other = (CltSession) object; - return other.session_id.equals(session_id) && other.hls.equals(hls); - } - return false; - } - - public int hashCode() { - return session_id.hashCode() + hls.hashCode(); - } - } - - /** - * This class listens on accept() calls on a server connection - */ - final class SrvSessionFactory implements Runnable { - SrvSessionId session_id; - Session_Low hls; - boolean cont; - TcpIpProtocol protocol; - Thread runner; - - /** - * Creates a factory by creating a new SrvSocket on an anonymous port - * and start waiting for accepts. - */ - SrvSessionFactory(SrvSessionId session_id, Session_Low hls, - TcpIpProtocol protocol) { - this.hls = hls; - this.session_id = session_id; - this.protocol = protocol; - cont = true; - } - - SrvSessionId register(Session_Low hls, - TcpIpProtocolGraph protocol_graph) { - int port = protocol_graph.port; - if ((port == 0 || port == session_id.port) && this.hls.equals(hls)) { - return session_id; - } else { - return null; - } - } - - public void run() { - runner = Thread.currentThread(); - TcpIpSrvConnectionFactory connection_factory = - session_id.connection_factory; - while (cont) { - try { - SrvSession session = new SrvSession(hls); - IpConnection connection = - connection_factory.newSrvConnection(session); - session.connect(connection); - } catch (JonathanException e) { - if (cont) { - if (verbose) { - System.err.println("Stopping server socket on exception."); - e.printStackTrace(); - } - // begin log - if ((LoggerProvider.bind_logger != null) - &&(LoggerProvider.bind_logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.bind_logger.log(BasicLevel.INFO,"Stopping server socket on exception.",e); - } - // end log - session_id.unexport(); - remove(this); - cont = false; - } - } - } - } - - void release() { - cont = false; - runner.interrupt(); - session_id.unexport(); - remove(this); - } - } -} - - -/** - * TcpIpChunkProvider is a ChunkProvider implementation encapsulating a socket input - * stream. - */ -final class TcpIpChunkProvider extends Chunk implements ChunkProvider { - static final byte[] empty_data = new byte[0]; - static final Chunk empty_chunk = new Chunk(empty_data,0,0); - - /** Reader associated with the chunk */ - TcpIpProtocol.Session session; - /** The network connection */ - IpConnection connection; - int max; - - /** the data of this chunk provider are the cache data. */ - Chunk cache; - - TcpIpChunkProvider(TcpIpProtocol.Session session) { - super(empty_data,0,0); - max = 0; - this.session = session; - connection = session.connection; - cache = empty_chunk; - } - - TcpIpChunkProvider(TcpIpChunkProvider message) { - super(message.data,message.offset,message.top); - cache = message.cache; - max = message.max; - session = message.session; - connection = message.connection; - message.cache = null; - } - - public Chunk prepare() throws JonathanException { - TcpIpProtocol protocol = session.getProtocol(); - if (top == offset) { - // there is nothing left to read from this message - try { - int to_read = connection.available(); - if (to_read > 1) { - if (to_read > max - top) { - cache.release(); - cache = protocol.chunk_factory.newChunk(to_read); - data = cache.data; - offset = cache.offset; - top = cache.top; - max = data.length; - } - connection.receive(this,to_read); - return this; - } else { - if (max - top == 0) { - cache.release(); - cache = protocol.chunk_factory.newChunk(); - data = cache.data; - offset = cache.offset; - top = cache.top; - max = data.length; - } - connection.receive(this,1); - return this; - } - } catch (IOException e) { - delete(); - connection.delete(); - connection = null; - throw new JonathanException(e); - } - } else { - return this; - } - } - - public void close() { - if (cache != null) { - session.closeNotify(this); - } - } - - protected void finalize() { - if (cache != null) { - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.ERROR))) { - LoggerProvider.logger.log(BasicLevel.ERROR, - "Resource management error. Message has not been properly closed."); - } - // end log - delete(); - } - } - - final void delete() { - if (cache != null) { - cache.release(); - cache = null; - } - - session.deleteNotify(this); - } - - public Chunk duplicate() throws JonathanException { - cache.top = top; - return cache.duplicate(offset,top); - } - - public Chunk duplicate(int off,int t) throws JonathanException { - cache.top = top; - return cache.duplicate(off,t); - } - - public void release() {} -} diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocolType.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocolType.fractal deleted file mode 100644 index 67d59cef0f8eb294e1fe27659667e340dd0cf667..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/TcpIpProtocolType.fractal +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/package.html b/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/package.html deleted file mode 100644 index c78fdf4c19d66007ba59e6208a6ffaf163e60ebd..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/protocols/tcpip/package.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -Provides a set of classes giving access to the TCP/IP protocol stack. - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JChunkFactory.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/JChunkFactory.fractal deleted file mode 100644 index 2ffa13fe5c6eb31968815cd92bd11858d537d675..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JChunkFactory.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JChunkFactory.java b/fractalrmi/src/org/objectweb/jonathan/libs/resources/JChunkFactory.java deleted file mode 100644 index 6dbbbfb81515acd4e45c31779a5a4ea1878eadaf..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JChunkFactory.java +++ /dev/null @@ -1,322 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999-2000 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.libs.resources; - -import org.objectweb.jonathan.apis.resources.Chunk; -import org.objectweb.jonathan.apis.resources.ChunkFactory; - -import org.objectweb.util.monolog.api.BasicLevel; - -/** - * A Chunk Factory implementation. - *

- * A chunk factory creates and manages chunks. This chunk factory manages two - * pools of chunks of different sizes, so that a released chunk may be reused - * in a different context, saving the time for allocating and collecting the - * associated memory. The sizes of the chunks used, and of the preallocated - * pools may be changed. - */ -public class JChunkFactory implements ChunkFactory { - - /** a pool of chunks. */ - BigPoolChunk[] big_pool; - - /** Number of chunks in the big pool. */ - int big_pool_size; - - /** index of first free chunk */ - int big_free; - - /** Size of chunks in the big pool. */ - int big_size; - - /** a pool of chunks. */ - SmallPoolChunk[] small_pool; - - /** Number of chunks in the small pool. */ - int small_pool_size; - - /** index of first free small chunk */ - int small_free; - - /** Size of chunks in the small pool. */ - int small_size; - - /** - * Indicates whether warning message should be printed to stderr. - *

- * In particular, if verbose is true, and if all the chunks in a pool are used, - * a warning will be emitted. This may be useful to tune the pool sizes. - *

- * This value is defined under the name "/jonathan/JChunkFactory/verbose" - * in the {@link org.objectweb.jonathan.apis.kernel.Kernel#newConfiguration(Class) - * bootstrap context}. - - */ - public boolean verbose; - - /** - * Returns a new chunk factory - */ - public JChunkFactory() { - this(5,32768,10,8192,false); - } - - /** - * Returns a new chunk factory - * @param big_pool_size size of the big chunks pool - * @param big_size size of the big chunks - * @param small_pool_size size of the small chunks pool - * @param small_size size of the small chunks - * @param verbose indicates whether warning messages should be printed to - * stderr. - * @see verbose - * - */ - public JChunkFactory(int big_pool_size,int big_size, - int small_pool_size, int small_size, - boolean verbose) { - this.big_pool_size = big_pool_size; - this.big_size = big_size; - this.small_pool_size = small_pool_size; - this.small_size = small_size; - this.verbose = verbose; - - big_free = big_pool_size; - big_pool = new BigPoolChunk[big_free]; - for (int i = 0; i < big_free; i++) { - big_pool[i] = new BigPoolChunk(); - } - small_free = small_pool_size; - small_pool = new SmallPoolChunk[small_free]; - for (int i = 0; i < small_free; i++) { - small_pool[i] = new SmallPoolChunk(); - } - } - - /** - * Returns a chunk of a default (small) size. - * - * @return a chunk - */ - public Chunk newChunk() { - synchronized(small_pool) { - PoolChunk chunk = null; - if (small_free > 0) { - chunk = small_pool[--small_free]; - small_pool[small_free] = null; - } else { - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.logger.log(BasicLevel.INFO,"Allocating chunk outside small pool"); - } - // end log - chunk = new SmallPoolChunk(); - } - return chunk; - } - } - - /** - * Returns a chunk of (at least) the specified size. - *

- * This method may return a larger chunk than expected. - * - * @param size the expected size of the chunk. - * @return a chunk - */ - public Chunk newChunk(int size) { - if (size <= small_size) { - return newSmallChunk(); - } else if (size <= big_size) { - return newBigChunk(); - } else { - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.logger.log(BasicLevel.INFO,"Chunk of size " + size + " requested."); - } - // end log - Chunk c = new Chunk(new byte[size],0,0); - //System.out.println("Non pool Chunk " + c + " returned."); - return c; - } - } - - - /** - * @return a big chunk - */ - Chunk newBigChunk() { - synchronized(big_pool) { - BigPoolChunk chunk = null; - if (big_free > 0) { - chunk = big_pool[--big_free]; - big_pool[big_free] = null; - } else { - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.logger.log(BasicLevel.INFO,"Allocating chunk outside big pool"); - } - // end log - // if (verbose) { - // System.err.println("Allocating chunk outside big pool"); - // } - chunk = new BigPoolChunk(); - } - return chunk; - } - } - - /** - * @return a small chunk - */ - Chunk newSmallChunk() { - synchronized(small_pool) { - SmallPoolChunk chunk = null; - if (small_free > 0) { - chunk = small_pool[--small_free]; - small_pool[small_free] = null; - } else { - // if (verbose) { - // System.err.println("Allocating chunk outside small pool"); - // } - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.logger.log(BasicLevel.INFO,"Allocating chunk outside small pool"); - } - // end log - chunk = new SmallPoolChunk(); - } - return chunk; - } - } - - - /** Adds a chunk to the big pool */ - void addToBigPool(BigPoolChunk resource) { - synchronized(big_pool) { - if (big_free < big_pool.length) { - big_pool[big_free++] = resource; - } - } - } - - /** Adds a chunk to the small pool */ - void addToSmallPool(SmallPoolChunk resource) { - synchronized(small_pool) { - if (small_free < small_pool.length) { - small_pool[small_free++] = resource; - } - } - } - - /** Extension of Chunk as a controlled resource. */ - static class PoolChunk extends Chunk { - /** count of acquired references to the associated chunk. */ - protected int acquired; - - PoolChunk(int size) { - super(new byte[size],0,0); - acquired = 1; - } - - public Chunk duplicate() { - return new Duplicate(this,offset,top); - } - - public Chunk duplicate(int offset, int top) { - return new Duplicate(this,offset,top); - } - - synchronized void acquire() { - acquired++; - } - } - - final class SmallPoolChunk extends PoolChunk { - - SmallPoolChunk () { - super(JChunkFactory.this.small_size); - } - - public synchronized void release() { - if (acquired == 1) { - next = null; - super.release(); - addToSmallPool(this); - } else { - acquired--; - } - } - } - - final class BigPoolChunk extends PoolChunk { - - BigPoolChunk () { - super(JChunkFactory.this.big_size); - } - - public synchronized void release() { - if (acquired == 1) { - next = null; - super.release(); - addToBigPool(this); - } else { - acquired--; - } - } - } - - static final class Duplicate extends Chunk { - PoolChunk target; - - Duplicate(PoolChunk chunk,int offset, int top) { - super(chunk.data,offset,top); - this.target = chunk; - chunk.acquire(); - } - - public Chunk duplicate() { - return new Duplicate(target,offset,top); - } - - public Chunk duplicate(int offset, int top) { - return new Duplicate(target,offset,top); - } - - public void release() { - next = null; - target.release(); - target = null; - } - } -} diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JScheduler.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/JScheduler.fractal deleted file mode 100644 index 383a0e2acf0f22f8704efa54191c747a3722578b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JScheduler.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JScheduler.java b/fractalrmi/src/org/objectweb/jonathan/libs/resources/JScheduler.java deleted file mode 100644 index 9ce15a4feb19080d6b1b38e6f9f0d01e3e7ca0cf..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JScheduler.java +++ /dev/null @@ -1,338 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999-2000 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.libs.resources; - -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.apis.kernel.ContextFactory; -import org.objectweb.jonathan.apis.kernel.InternalException; -import org.objectweb.jonathan.apis.resources.Scheduler; -import org.objectweb.jonathan.apis.resources.Job; - -import org.objectweb.util.monolog.api.BasicLevel; - -/** - * Default {@link org.objectweb.jonathan.apis.resources.Scheduler scheduler} - * implementation. - *

- * This implementation has exactly the same behaviour as the default Java - * scheduling. - *

- * This scheduler manages a pool of re-usable threads. The size of this pool may - * be customized in the - * {@link org.objectweb.jonathan.apis.kernel.Kernel#newConfiguration(Class) - * bootstrap context}. - */ -public class JScheduler implements Scheduler { - - static int sched_nb = 0; - - String sched_name; - int id = 0; - - /** Max number of idle threads in the thread pool. */ - int max_waiting; - - /** - * Indicates whether warning message should be printed to stderr. - *

- * This value is defined under the name "/jonathan/JScheduler/verbose" - * in the {@link org.objectweb.jonathan.apis.kernel.Kernel#newConfiguration(Class) - * bootstrap context}. - *

- * This variable is not used in the current implementation. - */ - public boolean verbose; - - /** the pool of waiting jobs */ - JJob[] pool; - - /** number of threads waiting for a task. */ - int waiting; - - protected ContextFactory context_factory; - - /** - * Returns a new scheduler. - * @param context_factory a {@link ContextFactory context factory}. - */ - public JScheduler(ContextFactory context_factory) { - this(5,false,context_factory); - } - - /** - * Returns a new scheduler. - * @param max_waiting maximum number of idle threads - * @param verbose indicates whether warning messsages should be output on - stderr. - * @param context_factory a {@link ContextFactory context factory}. - */ - public JScheduler(int max_waiting,boolean verbose, - ContextFactory context_factory) { - this.max_waiting = max_waiting; - this.verbose = verbose; - this.context_factory = context_factory; - sched_name = "p" + (sched_nb++) + "."; - pool = new JJob[max_waiting]; - waiting = 0; - } - - /** - * Returns a new job created by the scheduler. - * @return a new job created by the scheduler. - */ - public synchronized Job newJob() { - JJob job = null; - if (waiting == 0) { - // add a means to know whether there are more threads running than the - // pool size - job = new JJob(sched_name + (id++)); - } else { - job = pool[--waiting]; - } - return job; - } - - /** - * Returns the currently executing job (the job performing the call). - * @return the currently executing job. - */ - public Job getCurrent() { - if (Thread.currentThread() instanceof Job) - return (Job) Thread.currentThread(); - else - return new KJob(); - } - - /** - * Calling this method gives the opportunity to the scheduler to re-schedule - * the currently executing jobs. - *

- * This implementation calls the static yield() method - * on the Thread class. - */ - public void yield() { - Thread.yield(); - } - - /** - * Blocks the calling job until the {@link #notify(Object) notify} or - * {@link #notifyAll(Object) notifyAll} method is called providing the - * same lock identifier. - *

- * This implementation calls the standard wait() method - * on the provided lock. - * - * @param lock the lock identifier. - * @exception InterruptedException - */ - public void wait(Object lock) throws InterruptedException { - lock.wait(); - } - - /** - * Blocks the calling job until the {@link #notify(Object) notify} or - * {@link #notifyAll(Object) notifyAll} method is called providing the - * same lock identifier. - *

- * This implementation calls the standard wait() method - * on the provided lock. - * - * @param lock the lock identifier. - * @exception InterruptedException - */ - public void wait(Object lock,long millis) throws InterruptedException { - lock.wait(millis); - } - - /** - * Unblocks a job {@link #wait(Object) waiting} on the lock. - *

- * This implementation calls the standard notify() method - * on the provided lock. - * - * @param lock the lock identifier. - */ - public void notify(Object lock) { - lock.notify(); - } - - /** - * Unblocks all jobs {@link #wait(Object) waiting} on the lock. - *

- * This implementation calls the standard notifyAll() method - * on the provided lock. - * - * @param lock the lock identifier. - */ - public void notifyAll(Object lock) { - lock.notifyAll(); - } - - /** - * Causes the calling job to be removed from the set of jobs managed by the - * target scheduler. It is necessary to call this method before every possibly - * blocking method so that the scheduler can give a chance to run to another job. - *

- * This implementation has nothing to do. - */ - public void escape() {} - - /** - * Causes a job {@link #escape() "escaped"} from the scheduler to be re-admitted - * in the set of jobs managed by the target scheduler. - *

- * This implementation has nothing to do. - */ - public void enter() {} - - boolean register(JJob job) { - if (waiting < pool.length) { - pool[waiting++] = job; - return true; - } else { - return false; - } - } - - class JJob extends Thread implements Job { - Runnable task; - Context context; - - JJob(String name) { - super(name); - setDaemon(true); - task = null; - context = null; - super.start(); - } - - /** Runs the task. */ - public final void run() { - try { - synchronized (this) { - while (task == null) { - this.wait(); - } - } - while (true) { - //System.err.println(this + " running"); - task.run(); - if (context != null) { - context.release(); - context = null; - } - //System.err.println(this + " done"); - synchronized(JScheduler.this) { - if (register(this)) { - task = null; - } else { - return; - } - } - if (task == null) { - synchronized (this) { - while (task == null) { - this.wait(); - } - } - } - } - } catch (InterruptedException e) {} - } - - public synchronized void run(Runnable message) { - if (task != null) { - throw new InternalException("Can't use this job more than once"); - } else { - task = message; - this.notify(); - } - } - - public Context getContext() { - if (context == null) { - context = context_factory.newContext(); - } - return context; - } - - public String toString() { - return getName(); - } - } - - private static ThreadLocal threadLocalContext = new ThreadLocal(); - - /** - * SylvainHack alert! - * - * In the case of servlet-driven communication the current thread - * is not a Job managed by this scheduler. In this case trying to - * get the current job context necessarily fails. - * - * This simply encapsulates an existing Thread into a Job. Thus, - * trying to access methods such as getCurrent() in JScheduler - * will simply create this Job... - * - * Note: set the context to be ThreadLocal or something... - */ - class KJob implements Job { - - public KJob() { - } - - /** - * This is invalid. By definition a KJob encapsulates an - * already running thread, and should not be reused. - */ - public void run(Runnable m) { - // System.err.println("KJob being asked to run a new task... Alert!"); - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.WARN))) { - LoggerProvider.logger.log(BasicLevel.WARN,"KJob being asked to run a new task... Alert!"); - } - // end log - // sadly we can't throw an exception without changing the - // api... - } - - public Context getContext() { - if (threadLocalContext.get() == null) { - threadLocalContext.set(context_factory.newContext()); - } - - return (Context)threadLocalContext.get(); - } - } - - - -} - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JSchedulerType.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/JSchedulerType.fractal deleted file mode 100644 index 31c905c9ff0d05386ce9d3ace228e69aa70bad65..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/JSchedulerType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/LoggerProvider.java b/fractalrmi/src/org/objectweb/jonathan/libs/resources/LoggerProvider.java deleted file mode 100644 index ae13b9a8a5f007d4df3dba6c143ad1f4c956a08c..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/LoggerProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.objectweb.jonathan.libs.resources; - -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.libs.helpers.LogConfiguration; -import org.objectweb.util.monolog.api.Logger; - -class LoggerProvider { - static Logger logger = null; - static Logger bind_logger = null; - static Logger export_logger = null; - static Logger send_logger = null; - static Logger receive_logger = null; - - static { - try { - Context trace_context = LogConfiguration.newConfiguration(LoggerProvider.class); - String package_name = "org.objectweb.jonathan.libs.resources"; - Object component = trace_context.getValue("packages." + package_name + ".generic logger",'.'); - if (component instanceof Logger) logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".bind logger",'.'); - if (component instanceof Logger) bind_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".export logger",'.'); - if (component instanceof Logger) export_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".send logger",'.'); - if (component instanceof Logger) send_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".receive logger",'.'); - if (component instanceof Logger) receive_logger = (Logger) component; - } catch (Exception e) {} - } -} diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/package.html b/fractalrmi/src/org/objectweb/jonathan/libs/resources/package.html deleted file mode 100644 index 02d5ea6f99e251f0920e87a28fe9c6d236b551c0..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/package.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -Provides implementations for various resources and managers. - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/ConnectionFactoryType.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/ConnectionFactoryType.fractal deleted file mode 100644 index 77c0c3a5e59f095a170a7e4018f85c2babe4b28e..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/ConnectionFactoryType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/DefaultConnectionFactory.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/DefaultConnectionFactory.fractal deleted file mode 100644 index 5f592b0c49c8a7fc036edd9c8ae1e6ddff97c007..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/DefaultConnectionFactory.fractal +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/DelegateConnectionFactoryType.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/DelegateConnectionFactoryType.fractal deleted file mode 100644 index e455186426fb459783247d51d45aa34aa0573b17..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/DelegateConnectionFactoryType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/IPv4ConnectionFactory.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/IPv4ConnectionFactory.fractal deleted file mode 100644 index 2f4b593caeb17de4ec3ffe1c92f079a69b1ea5ac..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/IPv4ConnectionFactory.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/IPv4ConnectionFactory.java b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/IPv4ConnectionFactory.java deleted file mode 100644 index e54a74c5afbe3bc2d16e516eea3453f89b9a6b3e..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/IPv4ConnectionFactory.java +++ /dev/null @@ -1,623 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999-2000 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - - -package org.objectweb.jonathan.libs.resources.tcpip; - -import java.io.EOFException; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.ConnectException; -import java.net.InetAddress; -import java.net.ServerSocket; -import java.net.Socket; -import java.net.UnknownHostException; - -import org.objectweb.jonathan.apis.binding.ExportException; -import org.objectweb.jonathan.apis.kernel.InternalException; -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.protocols.ip.IpConnection; -import org.objectweb.jonathan.apis.protocols.ip.IpSession; -import org.objectweb.jonathan.apis.protocols.ip.TcpIpConnectionMgr; -import org.objectweb.jonathan.apis.protocols.ip.TcpIpSrvConnectionFactory; -import org.objectweb.jonathan.apis.resources.Chunk; - -import org.objectweb.util.monolog.api.BasicLevel; - -/** - * Implementation of an IP V4 connection factory. - */ -public class IPv4ConnectionFactory implements TcpIpConnectionMgr { - - static String default_localhost_name; - static String default_localhost_address; - static InetAddress default_localhost; - - static { - try { - default_localhost = InetAddress.getLocalHost(); - } catch (Exception ignored) { - try { - default_localhost = InetAddress.getByName("127.0.0.1"); - } catch (Exception _) { -// System.err.println("Warning: could not determine local host address."); - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.WARN))) { - LoggerProvider.logger.log(BasicLevel.WARN,"Could not determine local host address."); - } - // end log - } - } - if (default_localhost != null) { - default_localhost_name = default_localhost.getHostName(); - default_localhost_address = default_localhost.getHostAddress(); - } - } - - InetAddress localhost; - public String localhost_name; - - /** - * Indicates whether warning messages should be printed to stderr. - */ - public boolean verbose; - - /** - * Indicates whether the names used to identify endpoints should be - * host names or host addresses. - */ - public boolean use_address_as_name; - - /** - * If >= 0, enables the SO_LINGER option with the specified linger time. - */ - public int SO_LINGER; - - /** - * If >= 0, enables the SO_TIMEOUT option with the specified timeout (in - * ms). 0 means infinity (no timeout). - */ - public int SO_TIMEOUT; - - /** - * If true, enables the TCP_NODELAY option. - */ - public boolean TCP_NODELAY; - - /** - * Maximum length of the queue on incoming connect requests. - */ - public int backlog; - - int max_retries; - - - - /** - * Returns a new IPv4ConnectionFactory with default parameters - */ - public IPv4ConnectionFactory() throws JonathanException { - this(null,false,100,0,true,50,10,true); - } - - - /** - * Returns a new IPv4 connection factory - * @param localhost_value string representing the local machine (may be null) - * @param verbose indicates whether warning messages should be output on stderr - * @param SO_LINGER SO_LINGER parameter used to create sockets - * @param SO_TIMEOUT SO_TIMEOUT parameter used to create sockets - * @param TCP_NODELAY TCP_NODELAY parameter used to create sockets - * @param backlog backlog parameter used to create sockets - * @param max_retries maximum number of retries when creating a socket - * @param use_address_as_name use a.b.c.d adresses instead of DNS names - * @exception JonathanException if something goes wrong - */ - public IPv4ConnectionFactory(String localhost_value, - boolean verbose, - int SO_LINGER, int SO_TIMEOUT, - boolean TCP_NODELAY, int backlog, - int max_retries, boolean use_address_as_name) - throws JonathanException { - - this.verbose = verbose; - this.SO_LINGER = SO_LINGER; - this.SO_TIMEOUT = SO_TIMEOUT; - this.TCP_NODELAY = TCP_NODELAY; - this.backlog = backlog; - this.max_retries = max_retries; - if (max_retries <= 0) { - this.max_retries = 1; - } - this.use_address_as_name = use_address_as_name; - - try{ - if (localhost_value != null && - (localhost_value.equals("localhost") || - localhost_value.equals("127.0.0.1"))) { - localhost_value = null; - } - if (localhost_value != null) { - localhost = InetAddress.getByName(localhost_value); - if (use_address_as_name) { - localhost_name = localhost.getHostAddress(); - } else { - localhost_name = localhost.getHostName(); - } - } else { - localhost = default_localhost; - if (use_address_as_name) { - localhost_name = default_localhost_address; - } else { - localhost_name = default_localhost_name; - } - } - } catch(UnknownHostException e){ - throw new JonathanException(e); - } - } - - public void setVerbose(boolean verbose) { - this.verbose = verbose; - } - - /** - * Builds a new client-side connection with the provided parameters. - * - * @param host a host name; - * @param port a port number; - * @param session a TCP/IP session; - * @return a new client-side connection. - * @exception JonathanException if something goes wrong. - */ - public IpConnection newCltConnection(String host,int port, - IpSession session) - throws JonathanException { - try { - if (host == null || host.equals("localhost") || host.equals("127.0.0.1")) { - host = default_localhost_name; - } -// if (verbose) { -// System.err.println("Trying to connect to " + host + -// " on port " + (port & 0xFFFF) + "."); -// } - // begin log - if ((LoggerProvider.bind_logger != null) - &&(LoggerProvider.bind_logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.bind_logger.log(BasicLevel.INFO,"Trying to connect to " + host + - " on port " + (port & 0xFFFF) + "."); - } - // end log - Socket socket = null; - for (int i = 0; i < max_retries; i++) { - try { - socket = new Socket(host,port & 0xFFFF); - break; - } catch (ConnectException e) { - if (i == (max_retries - 1)) { - throw new JonathanException(e); -// } else if (verbose) { -// System.err.println("Re-trying to connect to " + host + -// " on port " + (port & 0xFFFF) + "."); -// } - // begin log - } else if ((LoggerProvider.bind_logger != null) - &&(LoggerProvider.bind_logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.bind_logger.log(BasicLevel.INFO,"Re-trying to connect to " + host + - " on port " + (port & 0xFFFF) + "."); - } - // end log - } - } - if (SO_LINGER >= 0) { - socket.setSoLinger(true,SO_LINGER); - } - if (SO_TIMEOUT >= 0) { - socket.setSoTimeout(SO_TIMEOUT); - } - socket.setTcpNoDelay(TCP_NODELAY); -// port = (short) socket.getPort(); - port = socket.getPort() & 0xFFFF ; - -// if (verbose) { -// System.err.println("Connected to " + socket); -// } - // begin log - if ((LoggerProvider.bind_logger != null) - &&(LoggerProvider.bind_logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.bind_logger.log(BasicLevel.INFO,"Connected to " + socket); - } - // end log - return new Connection(socket,session,host,port); - } catch (IOException e) { - throw new JonathanException(e); - } - } - - /** - * Returns a new server connection factory encapsulating a server socket on the - * provided port. If port = 0, an anonymous server socket is opened. - * @param port the expected port of the server socket; - * @return a server connection factory. - * @exception JonathanException if an error occurs. - */ - public TcpIpSrvConnectionFactory newSrvConnectionFactory(int port) - throws JonathanException { - return new SrvConnectionFactory(localhost,port,backlog); - } - - /** - * Returns the canonical host name corresponding to hostname. - * - * If use_address_as_name is true, the canonical host name is the - * string corresponding to the IP address, else it is the machine name. - * - * @param hostname a host name. - * @return the canonical host name corresponding to hostname. - */ - public String getCanonicalHostName(String hostname) { - if (hostname != null && hostname.length() > 0) { - if (use_address_as_name) { - if (! Character.isDigit(hostname.charAt(0))) { - if (hostname.equals("localhost")) { - return default_localhost_address; - } else { - try { - return InetAddress.getByName(hostname).getHostAddress(); - } catch (Exception ignored) { - } - } - } else if (hostname.equals("127.0.0.1")) { - return default_localhost_address; - } - } else { - if (Character.isDigit(hostname.charAt(0))) { - if (hostname.equals("127.0.0.1")) { - return default_localhost_name; - } else { - try { - return InetAddress.getByName(hostname).getHostName(); - } catch (Exception ignored) { - } - } - } else if (hostname.equals("localhost")) { - return default_localhost_name; - } - } - } - return hostname; - } - - /** - * Builds a new server-side connection with the provided parameters. - * - * @param socket a TCP/IP socket; - * @param session a TCP/IP session; - * @param host a host name; - * @param port a port number; - * @return a new server-side connection. - * @exception JonathanException if something goes wrong. - */ - protected Connection newSrvConnection(Socket socket,IpSession session, - String host, int port) - - throws JonathanException { - return new Connection(socket,session,host,port); - } - - /** - * Implementation of TcpIpConnection. - */ - class Connection implements IpConnection { - - /** The encapsulated socket. */ - Socket socket; - String host; - int port; - InputStream is; - OutputStream os; - - /** The related session. */ - IpSession session; - - /** - * Builds a new connection. - * - * @param socket a socket; - * @param session a session; - * @exception JonathanException if something goes wrong. - */ - protected Connection(Socket socket, IpSession session, - String host, int port) - - throws JonathanException { - if (socket != null) { - try { - is = socket.getInputStream(); - os = socket.getOutputStream(); - } catch (IOException e) { - try { - socket.close(); - } catch (IOException ignored) { - } - throw new JonathanException(e); - } - } else { - throw new InternalException("Null socket to create connection"); - } - this.socket = socket; - this.session = session; - this.host = host; - this.port = port; - } - - public int available() throws IOException { - return is.available(); - } - - public void emit(Chunk c) throws IOException { - synchronized (os) { -// byte[] data = c.data; -// int len = c.top - c.offset; -// String str = "OUT: "; -// for (int i = c.offset; i < len; i++) { -// str = str + data[i] + " "; -// } -// System.out.println(str); - // begin log - if ((LoggerProvider.send_logger != null) - &&(LoggerProvider.send_logger.isLoggable(BasicLevel.DEBUG))) { - byte[] data = c.data; - int len = c.top - c.offset; - String str = "OUT: "; - for (int i = c.offset; i < len; i++) { - str = str + data[i] + " "; - } - LoggerProvider.send_logger.log(BasicLevel.DEBUG,str); - } - // end log - os.write(c.data,c.offset,c.top); - } - } - - public void receive(Chunk c,int sz) throws IOException { - byte[] data = c.data; - int top = c.top; -// System.err.println(Thread.currentThread() + -// " trying to read " + sz + " bytes from " + -// socket.getPort()); - while (sz > 0) { - int a = is.read(data,top,sz); -// String str = "IN: "; -// for (int i = top; i < top + sz; i++) { -// str = str + data[i] + " "; -// } -// System.out.println(str); - // begin log - if ((LoggerProvider.receive_logger != null) - &&(LoggerProvider.receive_logger.isLoggable(BasicLevel.DEBUG))) { - String str = "IN: "; - for (int i = top; i < top + sz; i++) { - str = str + data[i] + " "; - } - LoggerProvider.receive_logger.log(BasicLevel.DEBUG,str); - } - // end log - if (a > 0) { - top += a; - sz -= a; - } else { - throw new EOFException(); - } - } -// System.err.println(Thread.currentThread() + -// " read " + (top - c.top) + " bytes from " + -// socket.getPort()); - - c.top = top; - } - - - /** - * Returns the port number of the underlying socket. - * @return the port number of the underlying socket. - */ - public int getPort() { - return port; - } - - /** - * Returns the host name of the underlying socket. - * @return the host name of the underlying socket. - */ - public String getHostName() { - return host; - } - - /** - * Returns the session attached to this connection. - * @return the session attached to this connection. - */ - public IpSession getSession() { - return session; - } - - /** - * Attaches a new session to this connection. - * @param session the session to be attached to the target connection. - */ - public void setSession(IpSession session) { - this.session = session; - } - - /** - * Deletes this connection, removing it from the connection manager, and - * closing the socket. This method should not be used by a socket user unless - * a problem occurs on the connection, like an exception when trying to read - * or to write data. - */ - public synchronized void delete() { - if (socket != null) { - try { -// if (verbose) { -// System.err.println("Connection with host " + host + -// " on port " + -// (port & 0xFFFF) + " closed."); -// } - // begin log - if ((LoggerProvider.logger != null) - &&(LoggerProvider.logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.logger.log(BasicLevel.INFO,"Connection with host " + host + - " on port " + - (port & 0xFFFF) + " closed."); - } - // end log - socket.close(); - } catch (IOException ignored) {} - socket = null; - session = null; - } - } - - /** - * Releases this connection. This is to indicate to the connection manager - * that the target connection is no longer used. - */ - public void release() { - delete(); - } - - public String toString() { - return "IPv4Connection[" + socket + "]"; - } - - } - - class SrvConnectionFactory implements TcpIpSrvConnectionFactory { - int port; - String hostname; - ServerSocket server_socket; - - SrvConnectionFactory(InetAddress localhost,int port,int backlog) - throws JonathanException { - if (use_address_as_name) { - this.hostname = localhost.getHostAddress(); - } else { - this.hostname = localhost.getHostName(); - } - try { - server_socket = new ServerSocket(port & 0xFFFF,backlog,localhost); - if (server_socket != null) { - this.port = server_socket.getLocalPort() & 0xFFFF; -// if (verbose) { -// System.err.println("Opened a server connection on host " + -// hostname + -// "\n on port " + -// (this.port & 0xFFFF)); -// } - // begin log - if ((LoggerProvider.export_logger != null) - &&(LoggerProvider.export_logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.export_logger.log(BasicLevel.INFO,"Opened a server connection on host " + - hostname + " on port " + - (this.port & 0xFFFF)); - } - // end log - } else { - throw new ExportException("Can't create server socket."); - } - } catch (IOException e) { - throw new ExportException(e); - } - } - - public IpConnection newSrvConnection(IpSession session) - throws JonathanException { - try { - ServerSocket current = null; - synchronized (this) { - if (server_socket != null) { - current = server_socket; - } else { - throw new ExportException("Server Connection Factory has been closed"); - } - } - - Socket socket = current.accept(); - if (SO_LINGER >= 0) { - socket.setSoLinger(true,SO_LINGER); - } - if (SO_TIMEOUT >= 0) { - socket.setSoTimeout(SO_TIMEOUT); - } - socket.setTcpNoDelay(TCP_NODELAY); - int port = socket.getPort() & 0xFFFF; - String hostname = socket.getInetAddress().getHostName(); -// if (verbose) { -// System.err.println("Accepted connection with host: " + -// hostname + -// "\n on port: " + -// port); -// } - // begin log - if ((LoggerProvider.bind_logger != null) - &&(LoggerProvider.bind_logger.isLoggable(BasicLevel.INFO))) { - LoggerProvider.bind_logger.log(BasicLevel.INFO,"Accepted connection with host: " + - hostname + " on port: " + port); - } - // end log - return - IPv4ConnectionFactory.this.newSrvConnection(socket,session,hostname, - port); - } catch (IOException e) { - throw new ExportException(e); - } - } - - public int getPort() { - return port; - } - - public String getHostName() { - return hostname; - } - - public synchronized void close() { - if (server_socket != null) { - try { - server_socket.close(); - } catch (IOException ignored) {} - server_socket = null; - } - } - } -} - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/JConnectionMgr.fractal b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/JConnectionMgr.fractal deleted file mode 100644 index 0da6bb0ad027d772f21fb44d4d01def040b1e8b3..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/JConnectionMgr.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/JConnectionMgr.java b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/JConnectionMgr.java deleted file mode 100644 index 2670200e29b686f8adfaeac103d91d57d6a9294b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/JConnectionMgr.java +++ /dev/null @@ -1,445 +0,0 @@ -/*** - * Jonathan: an Open Distributed Processing Environment - * Copyright (C) 1999-2000 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Release: 3.0 - * - * Contact: jonathan@objectweb.org - * - * Author: Bruno Dumant - * - */ - -package org.objectweb.jonathan.libs.resources.tcpip; - -import java.io.IOException; - -import org.objectweb.jonathan.apis.kernel.JonathanException; -import org.objectweb.jonathan.apis.protocols.ip.IpConnection; -import org.objectweb.jonathan.apis.protocols.ip.IpSession; -import org.objectweb.jonathan.apis.protocols.ip.TcpIpConnectionMgr; -import org.objectweb.jonathan.apis.protocols.ip.TcpIpSrvConnectionFactory; -import org.objectweb.jonathan.apis.resources.Chunk; - -/** - * Default implementation of a connection manager and factory. - */ -public class JConnectionMgr implements TcpIpConnectionMgr { - - Connection[] connections = new Connection[101]; - int connects; - SrvConnectionFactory server_connection_factories; - - Connection first_idle; - Connection last_idle; - int idle; - - protected TcpIpConnectionMgr factory; - - /** - * Maximum number of idle connections kept by this manager. - * This constant is defined under the name /jonathan/tcpip/max_idle - * in the bootstrap context. - */ - public int max_idle; - - /** - * Returns a new connection manager - * @param max_idle maximum number of idle connections - * @param connection_factory a factory to actually create connections - */ - public JConnectionMgr(int max_idle,TcpIpConnectionMgr connection_factory) { - connects = 0; - this.max_idle = max_idle; - this.factory = connection_factory; - } - - /** - * Returns the canonical host name of the provided host. - * @param hostname a host name - * @return the corresponding canonical host name. - */ - public String getCanonicalHostName(String hostname) { - return factory.getCanonicalHostName(hostname); - } - - /** - * Returns a new client connection. - *

- * This method is called by a protocol. - * The protocol provides a session (i.e. an object - * representing an abstract communication channel) and expects a connection - * (i.e. a communication resource). The returned connection must have been - * built using the provided session, or be a connection associated with a - * session having the same destination as the provided session. - * @param host the host name of the distant server; - * @param port the port number of a server socket on that host; - * @param session a TcpIp session - * @return a connection for that session. - * @exception JonathanException if an error occurs. - */ - public synchronized IpConnection newCltConnection(String host, int port, - IpSession session) - throws JonathanException { - host = getCanonicalHostName(host); - int hash = host.hashCode() + port; - int len = connections.length; - int index = (hash & 0x7FFFFFFF) % len; - Connection connection = connections[index]; - while (connection != null) { - if (connection.getPort() == port && - connection.getHostName().equals(host)) { - if (connection.getSession() == null) { - connection.acquire(); - connection.setSession(session); - return connection; - } else if (connection.getSession().equals(session)) { - connection.acquire(); - return connection; - } - } - connection = connection.next; - } - connection = - newCltConnection(factory.newCltConnection(host,port,session)); - Connection first = connections[index]; - connections[index] = connection; - connection.next = first; - connects++; - if (connects > len / 2) { - rehash(len); - } - return connection; - } - - /** - * Returns a new server connection factory encapsulating a server socket on the - * provided port. If port = 0, an anonymous server socket is opened. - * @param port the expected port of the server socket; - * @return a server connection factory. - * @exception JonathanException if an error occurs. - */ - public TcpIpSrvConnectionFactory newSrvConnectionFactory(int port) - throws JonathanException { - SrvConnectionFactory fac = server_connection_factories; - while (fac != null) { - if (fac.getPort() == port) { - break; - } - fac = fac.next; - } - if (fac == null) { - fac = server_connection_factories; - server_connection_factories = - new SrvConnectionFactory(factory.newSrvConnectionFactory(port)); - server_connection_factories.next = fac; - return server_connection_factories; - } else { - return fac; - } - } - - /** - * Builds a new client-side connection encapsulating the provided connection. - * - * @param connection a tcpip connection. - * @return a new client-side connection. - * @exception JonathanException JonathanException if something goes wrong. - */ - protected Connection newCltConnection(IpConnection connection) - throws JonathanException { - return new Connection(connection); - } - - /** - * Removes the connection from the set of managed connections. - * @param connection the connection to remove. - */ - void remove(Connection connection) { - int hash = connection.hashCode(); - int len = connections.length; - int index = (hash & 0x7FFFFFFF) % len; - Connection current = connections[index]; - Connection prev = null; - while (current != null) { - if (connection == current) { - if (prev == null) { - connections[index] = current.next; - } else { - prev.next = current.next; - } - return; - } else { - current = current.next; - } - } - } - - void add(Connection connection) { - int hash = connection.hashCode(); - int len = connections.length; - int index = (hash & 0x7FFFFFFF) % len; - Connection first = connections[index]; - connections[index] = connection; - connection.next = first; - connects++; - if (connects > len / 2) { - rehash(len); - } - } - - void removeConnectionFactory(SrvConnectionFactory factory) { - SrvConnectionFactory connection_factory = - server_connection_factories, prev = null; - while (connection_factory != null) { - if (connection_factory == factory) { - if (prev != null) { - prev.next = connection_factory.next; - } else { - server_connection_factories = connection_factory.next; - } - return; - } - prev = connection_factory; - connection_factory = connection_factory.next; - } - } - - - /** rehashes the hash table, if necessary. */ - void rehash(int len) { - Connection entry, next_entry, first_entry; - int index; - int new_len = 2 * len + 1; - Connection[] new_table = new Connection[new_len]; - - for (int i = 0; i < len; i++) { - entry = connections[i]; - while (entry != null) { - next_entry = entry.next; - // rehashing - index = (entry.hashCode() & 0x7FFFFFFF) % new_len; - first_entry = new_table[index]; - new_table[index] = entry; - entry.next = first_entry; - // - entry = next_entry; - } - } - connections = new_table; - } - - /** - * Implementation of TcpIpConnection. - */ - public class Connection implements IpConnection { - /** Next connection in the idle list (null if connection is active) */ - Connection next_idle; - /** Previous connection in the idle list (null if connection is active) */ - Connection prev_idle; - /** Number of objects using that connection. */ - int acquired; - /** The next connection in a collision list */ - Connection next; - - IpConnection delegate; - - /** - * Builds a new connection. - */ - protected Connection(IpConnection delegate) - throws JonathanException { - this.delegate = delegate; - acquired = 1; - } - - public int available() throws IOException { - return delegate.available(); - } - - public void receive(Chunk chunk,int to_read) throws IOException { - delegate.receive(chunk,to_read); - } - - public void emit(Chunk chunk) throws IOException { - delegate.emit(chunk); - } - - /** - * Returns the port number of the underlying socket. - * @return the port number of the underlying socket. - */ - public int getPort() { - return delegate.getPort(); - } - - /** - * Returns the host name of the underlying socket. - * @return the host name of the underlying socket. - */ - public String getHostName() { - return delegate.getHostName(); - } - - /** - * Returns the session attached to this connection. - * @return the session attached to this connection. - */ - public IpSession getSession() { - return delegate.getSession(); - } - - - /** - * Attaches a new session to this connection. - * @param session the session to be attached to the target connection. - */ - public void setSession(IpSession session) { - delegate.setSession(session); - } - - /** - * Deletes this connection, removing it from the connection manager, and - * closing the socket. This method should not be used a a socket user unless - * a problem occurs on the connection, like an exception when trying to read - * or to write data. - */ - public void delete() { - synchronized(JConnectionMgr.this) { - delegate.delete(); - withdraw(); - } - } - - /** - * Returns when the socket is acquired. This information is taken into - * account by the connection manager to avoid closing connections still in - * use. - */ - public void acquire() { - synchronized(JConnectionMgr.this) { - acquired++; - if (acquired == 1) { - if (prev_idle != null) { - prev_idle.next_idle = next_idle; - } else { - first_idle = next_idle; - } - if (next_idle != null) { - next_idle.prev_idle = prev_idle; - } else { - last_idle = prev_idle; - } - prev_idle = next_idle = null; - idle--; - } - } - } - - /** - * Releases this connection. This is to indicate to the connection manager - * that the target connection is no longer used. - */ - public void release() { - synchronized(JConnectionMgr.this) { - acquired--; - if (acquired == 0) { - if (last_idle != null) { - last_idle.next_idle = this; - last_idle = this; - } else { - last_idle = first_idle = this; - } - if (idle >= max_idle) { - first_idle.delegate.release(); - first_idle.withdraw(); - } - idle++; - } - } - } - - void withdraw() { - remove(this); - if (next_idle != null) { - if (prev_idle != null) { - prev_idle.next_idle = next_idle; - next_idle.prev_idle = prev_idle; - } else { - first_idle = next_idle; - next_idle.prev_idle = null; - } - idle--; - } else if (prev_idle != null) { - last_idle = prev_idle; - prev_idle.next_idle = null; - idle--; - } else if (last_idle == this) { - // may occur if max_idle <= 0 - last_idle = null; - prev_idle = null; - idle--; - } - } - - public String toString() { - return "JConnectionMgr.Connection" + System.identityHashCode(this) - + "[" + delegate + "]"; - } - - public int hashCode() { - int hashcode = delegate.getPort() + delegate.getHostName().hashCode(); - return hashcode; - } - } - - class SrvConnectionFactory implements TcpIpSrvConnectionFactory { - - TcpIpSrvConnectionFactory delegate; - SrvConnectionFactory next; - - SrvConnectionFactory(TcpIpSrvConnectionFactory delegate) - throws JonathanException { - this.delegate = delegate; - } - - public IpConnection newSrvConnection(IpSession session) - throws JonathanException { - return delegate.newSrvConnection(session); - } - - public int getPort() { - return delegate.getPort(); - } - - public String getHostName() { - return delegate.getHostName(); - } - - public void close() { - synchronized(JConnectionMgr.this) { - delegate.close(); - removeConnectionFactory(this); - } - } - } -} - - - - - diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/LoggerProvider.java b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/LoggerProvider.java deleted file mode 100644 index 0a4dcc34d3dec2eeed6fcc502396a306f928bdff..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/LoggerProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.objectweb.jonathan.libs.resources.tcpip; - -import org.objectweb.jonathan.apis.kernel.Context; -import org.objectweb.jonathan.libs.helpers.LogConfiguration; -import org.objectweb.util.monolog.api.Logger; - -class LoggerProvider { - static Logger logger = null; - static Logger bind_logger = null; - static Logger export_logger = null; - static Logger send_logger = null; - static Logger receive_logger = null; - - static { - try { - Context trace_context = LogConfiguration.newConfiguration(LoggerProvider.class); - String package_name = "org.objectweb.jonathan.libs.resources.tcpip"; - Object component = trace_context.getValue("packages." + package_name + ".generic logger",'.'); - if (component instanceof Logger) logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".bind logger",'.'); - if (component instanceof Logger) bind_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".export logger",'.'); - if (component instanceof Logger) export_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".send logger",'.'); - if (component instanceof Logger) send_logger = (Logger) component; - component = trace_context.getValue("packages." + package_name + ".receive logger",'.'); - if (component instanceof Logger) receive_logger = (Logger) component; - } catch (Exception e) {} - } -} diff --git a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/package.html b/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/package.html deleted file mode 100644 index 4e169d47c3890dc2ec169de4e22bf58531f0ea1b..0000000000000000000000000000000000000000 --- a/fractalrmi/src/org/objectweb/jonathan/libs/resources/tcpip/package.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -Provides a default implementation for TCP/IP connection management. - - - diff --git a/fractalswing/README.txt b/fractalswing/README.txt deleted file mode 100644 index e2338b0f6f242af515583694eb101ee2ff749c44..0000000000000000000000000000000000000000 --- a/fractalswing/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -This directory is the base directory of the product. -It contains(*) the following items: - -- archive: ant files to build the jar(s) of the product, -- build.properties: properties to configure the build process, -- build.xml: main ant file to build the product, -- config: external libraries required only for building the product, -- doc: documentation of the product, -- etc: scripts to run the product, -- examples: examples of use of the product, -- externals: external libraires required for running the product, -- jdoc: ant files to build the javadoc documentation(s) of the product, -- sr': sources of the product, -- test: tests of the product, -- web: source of the web site of the product. - -(*) some items may not be present, depending on the product. diff --git a/fractalswing/archive/README.txt b/fractalswing/archive/README.txt deleted file mode 100644 index e0d72a77eeab2c75774e256e42b338274737fa5d..0000000000000000000000000000000000000000 --- a/fractalswing/archive/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory contains ant files to build the jars of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one jar file. - -- The name of the ant file must be the name of the jar it builds: - org-foo-bar.xml must build org-foo-bar.jar. - -- Among the elements which are included into a jar, you must specify - a manifest. It is adviced to store the manifest file in this directory. - The manifest file can be shared by several jars. The name of the manifest - file must be similar to the name of the jar file. - -- Only the default task is called on each ant file. - -- The jar file must be produced into the ${dist.lib} directory. - -Sample ant file: - - - - - - ... - - - - diff --git a/fractalswing/archive/fractal-swing-tmpl.mf b/fractalswing/archive/fractal-swing-tmpl.mf deleted file mode 100644 index 6906d2ccba7eae5d67457942c3ae2a21cd9482ad..0000000000000000000000000000000000000000 --- a/fractalswing/archive/fractal-swing-tmpl.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Fractal ADL template definitions for Fractal Swing Components" -Implementation-Version: "2.0" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractalswing/archive/fractal-swing-tmpl.xml b/fractalswing/archive/fractal-swing-tmpl.xml deleted file mode 100644 index 57c6b76b9348d4a70e5e8dd2eadf64dec14e3d44..0000000000000000000000000000000000000000 --- a/fractalswing/archive/fractal-swing-tmpl.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/fractalswing/archive/fractal-swing.mf b/fractalswing/archive/fractal-swing.mf deleted file mode 100644 index f36717273cde637c81fc8cb1a0dd92ae910ae2dd..0000000000000000000000000000000000000000 --- a/fractalswing/archive/fractal-swing.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Fractal Swing Components" -Implementation-Version: "2.0" -Implementation-Vendor: "France Telecom R&D" diff --git a/fractalswing/archive/fractal-swing.xml b/fractalswing/archive/fractal-swing.xml deleted file mode 100644 index 4ebdefdaf5955a728ebd25c0f80c035f2bd38f5c..0000000000000000000000000000000000000000 --- a/fractalswing/archive/fractal-swing.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - diff --git a/fractalswing/build.config b/fractalswing/build.config deleted file mode 100644 index fe5058da9ee58d6d37ee24d3388aac92004df1e4..0000000000000000000000000000000000000000 --- a/fractalswing/build.config +++ /dev/null @@ -1,6 +0,0 @@ -# Defines values for the 'build.properties' build properties -# This file is used to build the project in the case of bundled external jars - -objectweb.ant.tasks.path config/ow_util_ant_tasks.jar - -fractal.path externals/fractal.jar diff --git a/fractalswing/build.properties b/fractalswing/build.properties deleted file mode 100644 index 9cf09abcb1f4dbe90de4a79e57c296e366ea86d7..0000000000000000000000000000000000000000 --- a/fractalswing/build.properties +++ /dev/null @@ -1,46 +0,0 @@ -############################################################################### -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################### - -# Some information about the product - -product.name fractalswing -product.version 0.2 - -############################################################################### -# BUILD -############################################################################### - -# Wich compiler do you want to use ? -# jikes is faster than javac but keeps line numbers in compiled classes, even -# with the -O option (javac removes line numbers and local variable names with -# this option, resulting in smaller classes) - -# build.compiler jikes - -# Build class path (classes needed to build the project) -# Classpath for the ObjectWeb utility Ant tasks (OWANTTASK_1_1) -# See http://forge.objectweb.org/projects/monolog - -# objectweb.ant.tasks.path ow_util_ant_tasks.jar - -############################################################################### -# EXTERNAL LIBRARIES -############################################################################### - -# Class path for the Fractal API (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -# fractal.path fractal.jar diff --git a/fractalswing/build.xml b/fractalswing/build.xml deleted file mode 100644 index e54ad78e42682492cd4cb47c8249349a478c3785..0000000000000000000000000000000000000000 --- a/fractalswing/build.xml +++ /dev/null @@ -1,275 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fractalswing/config/README.txt b/fractalswing/config/README.txt deleted file mode 100644 index 4978babb44fb4f93c7d819e50bedad09c7086b79..0000000000000000000000000000000000000000 --- a/fractalswing/config/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains the external libraries required for building the -product, but which are not necessary to use it. diff --git a/fractalswing/config/ow_util_ant_tasks.jar b/fractalswing/config/ow_util_ant_tasks.jar deleted file mode 100644 index 4a502465e2d690a80931068d96563d895d9cb5b5..0000000000000000000000000000000000000000 Binary files a/fractalswing/config/ow_util_ant_tasks.jar and /dev/null differ diff --git a/fractalswing/doc/README.txt b/fractalswing/doc/README.txt deleted file mode 100644 index 84303fee616679f69995c94e1dd7d4198b338d64..0000000000000000000000000000000000000000 --- a/fractalswing/doc/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the documentation of the product. diff --git a/fractalswing/externals/README.txt b/fractalswing/externals/README.txt deleted file mode 100644 index 336e5a5f98d9fbe884814c08329ea286ea55a00a..0000000000000000000000000000000000000000 --- a/fractalswing/externals/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the external libraries required for running the product. diff --git a/fractalswing/externals/fractal.jar b/fractalswing/externals/fractal.jar deleted file mode 100644 index 6bf74c05aaf416490008ba43dce643df09adbbd5..0000000000000000000000000000000000000000 Binary files a/fractalswing/externals/fractal.jar and /dev/null differ diff --git a/fractalswing/jdoc/README.txt b/fractalswing/jdoc/README.txt deleted file mode 100644 index a78cb67fa8d1679fe5fd3fe8efc3aab86e5b6db8..0000000000000000000000000000000000000000 --- a/fractalswing/jdoc/README.txt +++ /dev/null @@ -1,39 +0,0 @@ -This directory contains ant files to build the javadocs of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one javadoc. - -- As there may exist several javadocs, all javadocs must be produced - in a sub dir of ${out.dist.jdoc}. For example the user javadoc could be - produced into the ${out.dist.jdoc}/user directory - -- The name of the ant file must be the name of the destination directory of the - javadoc it builds. - -- Only the default task is called on an xml file. - -Sample ant file: - - - - - - - - - - - - - - - - - - ... - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/AbstractAction.java b/fractalswing/src/org/objectweb/fractal/swing/AbstractAction.java deleted file mode 100644 index f914b3f007d2f795ff28c1826058be958b8d06c7..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/AbstractAction.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * copyright area - */ - -package org.objectweb.fractal.swing; - -import java.awt.event.ActionEvent; - -import javax.swing.ImageIcon; - -public class AbstractAction extends javax.swing.AbstractAction - implements ActionAttributes -{ - - private String iconURL; - - public String getName () { - return (String)getValue(NAME); - } - - public void setName (String name) { - putValue(NAME, name); - } - - public String getIconURL () { - return iconURL; - } - - public void setIconURL (String iconURL) { - this.iconURL = iconURL; - putValue(SMALL_ICON, new ImageIcon(getClass().getResource(iconURL))); - } - - public String getToolTipText () { - return (String)getValue(SHORT_DESCRIPTION); - } - - public void setToolTipText (String toolTipText) { - putValue(SHORT_DESCRIPTION, toolTipText); - } - - public String getAcceleratorKey () { - return (String)getValue(ACCELERATOR_KEY); - } - - public void setAcceleratorKey (String acceleratorKey) { - putValue(ACCELERATOR_KEY, acceleratorKey); - } - - public void actionPerformed (ActionEvent e) { - } -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonAttributes.java deleted file mode 100644 index ac086b689133e10c1d49273eb8f65112b5b0cf40..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonAttributes.java +++ /dev/null @@ -1,45 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface AbstractButtonAttributes extends JComponentAttributes { - String getLabel (); - String getActionCommand (); - String getText (); - void setLabel (String arg0); - void setActionCommand (String arg0); - void setUI (javax.swing.plaf.ButtonUI arg0); - javax.swing.plaf.ButtonUI getUI (); - void setMargin (java.awt.Insets arg0); - java.awt.Insets getMargin (); - void setAction (javax.swing.Action arg0); - void setHorizontalTextPosition (int arg0); - void setVerticalTextPosition (int arg0); - void setModel (javax.swing.ButtonModel arg0); - void setText (String arg0); - void setIcon (javax.swing.Icon arg0); - javax.swing.Icon getIcon (); - javax.swing.Icon getPressedIcon (); - void setPressedIcon (javax.swing.Icon arg0); - javax.swing.Icon getSelectedIcon (); - void setSelectedIcon (javax.swing.Icon arg0); - javax.swing.Icon getRolloverIcon (); - void setRolloverIcon (javax.swing.Icon arg0); - javax.swing.Icon getRolloverSelectedIcon (); - void setRolloverSelectedIcon (javax.swing.Icon arg0); - javax.swing.Icon getDisabledIcon (); - void setDisabledIcon (javax.swing.Icon arg0); - javax.swing.Icon getDisabledSelectedIcon (); - void setDisabledSelectedIcon (javax.swing.Icon arg0); - int getVerticalAlignment (); - void setVerticalAlignment (int arg0); - int getHorizontalAlignment (); - void setHorizontalAlignment (int arg0); - int getVerticalTextPosition (); - int getHorizontalTextPosition (); - javax.swing.Action getAction (); - int getMnemonic (); - void setMnemonic (int arg0); - javax.swing.ButtonModel getModel (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonItf.java b/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonItf.java deleted file mode 100644 index f8a51e934ccbf0b7d7ea8ce0011d7e2a5371b152..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonItf.java +++ /dev/null @@ -1,65 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface AbstractButtonItf extends JComponentItf { - String getLabel (); - String getActionCommand (); - String getText (); - void setLabel (String arg0); - void setActionCommand (String arg0); - void addActionListener (java.awt.event.ActionListener arg0); - void removeActionListener (java.awt.event.ActionListener arg0); - void setUI (javax.swing.plaf.ButtonUI arg0); - javax.swing.plaf.ButtonUI getUI (); - void setMargin (java.awt.Insets arg0); - java.awt.Insets getMargin (); - boolean isBorderPainted (); - void setBorderPainted (boolean arg0); - void setAction (javax.swing.Action arg0); - void setHorizontalTextPosition (int arg0); - void setVerticalTextPosition (int arg0); - void setModel (javax.swing.ButtonModel arg0); - void setText (String arg0); - void setIcon (javax.swing.Icon arg0); - boolean isSelected (); - void setSelected (boolean arg0); - void doClick (); - void doClick (int arg0); - javax.swing.Icon getIcon (); - javax.swing.Icon getPressedIcon (); - void setPressedIcon (javax.swing.Icon arg0); - javax.swing.Icon getSelectedIcon (); - void setSelectedIcon (javax.swing.Icon arg0); - javax.swing.Icon getRolloverIcon (); - void setRolloverIcon (javax.swing.Icon arg0); - javax.swing.Icon getRolloverSelectedIcon (); - void setRolloverSelectedIcon (javax.swing.Icon arg0); - javax.swing.Icon getDisabledIcon (); - void setDisabledIcon (javax.swing.Icon arg0); - javax.swing.Icon getDisabledSelectedIcon (); - void setDisabledSelectedIcon (javax.swing.Icon arg0); - int getVerticalAlignment (); - void setVerticalAlignment (int arg0); - int getHorizontalAlignment (); - void setHorizontalAlignment (int arg0); - int getVerticalTextPosition (); - int getHorizontalTextPosition (); - javax.swing.Action getAction (); - boolean isFocusPainted (); - void setFocusPainted (boolean arg0); - boolean isContentAreaFilled (); - void setContentAreaFilled (boolean arg0); - boolean isRolloverEnabled (); - void setRolloverEnabled (boolean arg0); - int getMnemonic (); - void setMnemonic (int arg0); - void setMnemonic (char arg0); - javax.swing.ButtonModel getModel (); - void addChangeListener (javax.swing.event.ChangeListener arg0); - void removeChangeListener (javax.swing.event.ChangeListener arg0); - void addItemListener (java.awt.event.ItemListener arg0); - void removeItemListener (java.awt.event.ItemListener arg0); - Object[] getSelectedObjects (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonType.fractal b/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonType.fractal deleted file mode 100644 index dee243a845700efdceb7346499aa4309e5680485..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/AbstractButtonType.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/ActionAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/ActionAttributes.java deleted file mode 100644 index 7b5d8ed78f90e6ee0b85ff4a65f3d264993ba044..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ActionAttributes.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * copyright area - */ - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.AttributeController; - -public interface ActionAttributes extends AttributeController { - - String getName (); - - void setName (String name); - - String getIconURL (); - - void setIconURL (String iconURL); - - String getToolTipText (); - - void setToolTipText (String toolTipText); - - String getAcceleratorKey (); - - void setAcceleratorKey (String acceleratorKey); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutAttributes.java deleted file mode 100644 index 4a53ffd86b393809701017b1c5da23c76e5cc598..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutAttributes.java +++ /dev/null @@ -1,10 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface BorderLayoutAttributes extends org.objectweb.fractal.api.control.AttributeController { - int getHgap (); - void setHgap (int arg0); - int getVgap (); - void setVgap (int arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutImpl.fractal deleted file mode 100644 index 55d476e66182669a7a8a4ecedb1f0d23434b877d..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutImpl.java b/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutImpl.java deleted file mode 100644 index 4039142a4e4a65d000050f3f5a30d6bba75e50ec..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -public class BorderLayoutImpl - extends java.awt.BorderLayout - implements BorderLayoutItf, BorderLayoutAttributes, BindingController -{ - - public BorderLayoutImpl () { - super(); - } - public BorderLayoutImpl (int arg0, int arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - // put your own code here - return new String[0]; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - } - - public void unbindFc (String clientItfName) { - // put your own code here - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutItf.java b/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutItf.java deleted file mode 100644 index 8259b01335f9051e988dd50b069c2e3d3773745e..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutItf.java +++ /dev/null @@ -1,20 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface BorderLayoutItf { - void addLayoutComponent (java.awt.Component arg0, Object arg1); - void addLayoutComponent (String arg0, java.awt.Component arg1); - void removeLayoutComponent (java.awt.Component arg0); - void layoutContainer (java.awt.Container arg0); - void invalidateLayout (java.awt.Container arg0); - java.awt.Dimension preferredLayoutSize (java.awt.Container arg0); - java.awt.Dimension minimumLayoutSize (java.awt.Container arg0); - java.awt.Dimension maximumLayoutSize (java.awt.Container arg0); - float getLayoutAlignmentX (java.awt.Container arg0); - float getLayoutAlignmentY (java.awt.Container arg0); - int getHgap (); - void setHgap (int arg0); - int getVgap (); - void setVgap (int arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutType.fractal b/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutType.fractal deleted file mode 100644 index b5eb6e83a3790e376d386450a5be55e83cb2ef07..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/BorderLayoutType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/ComponentAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/ComponentAttributes.java deleted file mode 100644 index 3d4c0111241493cd67f46ce79cba77acaade315b..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ComponentAttributes.java +++ /dev/null @@ -1,28 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface ComponentAttributes extends org.objectweb.fractal.api.control.AttributeController { - String getName (); - void setName (String arg0); - void setSize (java.awt.Dimension arg0); - java.awt.Point getLocation (); - void setDropTarget (java.awt.dnd.DropTarget arg0); - java.awt.dnd.DropTarget getDropTarget (); - java.awt.Color getForeground (); - void setForeground (java.awt.Color arg0); - java.awt.Color getBackground (); - void setBackground (java.awt.Color arg0); - java.awt.Font getFont (); - void setFont (java.awt.Font arg0); - java.util.Locale getLocale (); - void setLocale (java.util.Locale arg0); - void setLocation (java.awt.Point arg0); - java.awt.Dimension getSize (); - java.awt.Rectangle getBounds (); - void setBounds (java.awt.Rectangle arg0); - void setCursor (java.awt.Cursor arg0); - java.awt.Cursor getCursor (); - void setComponentOrientation (java.awt.ComponentOrientation arg0); - java.awt.ComponentOrientation getComponentOrientation (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/ComponentItf.java b/fractalswing/src/org/objectweb/fractal/swing/ComponentItf.java deleted file mode 100644 index aaf478f40317de57460d16efe031ebca4227607e..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ComponentItf.java +++ /dev/null @@ -1,155 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface ComponentItf { - String getName (); - void add (java.awt.PopupMenu arg0); - java.awt.Container getParent (); - java.awt.Dimension size (); - boolean contains (int arg0, int arg1); - boolean contains (java.awt.Point arg0); - void print (java.awt.Graphics arg0); - void remove (java.awt.MenuComponent arg0); - void setName (String arg0); - void list (); - void list (java.io.PrintStream arg0); - void list (java.io.PrintStream arg0, int arg1); - void list (java.io.PrintWriter arg0); - void list (java.io.PrintWriter arg0, int arg1); - void setSize (int arg0, int arg1); - void setSize (java.awt.Dimension arg0); - void enable (); - void enable (boolean arg0); - void disable (); - java.awt.Point getLocation (); - java.awt.Point getLocation (java.awt.Point arg0); - java.awt.Point location (); - boolean action (java.awt.Event arg0, Object arg1); - boolean hasFocus (); - java.awt.peer.ComponentPeer getPeer (); - void setDropTarget (java.awt.dnd.DropTarget arg0); - java.awt.dnd.DropTarget getDropTarget (); - java.awt.GraphicsConfiguration getGraphicsConfiguration (); - java.awt.Toolkit getToolkit (); - boolean isValid (); - boolean isDisplayable (); - boolean isVisible (); - boolean isShowing (); - boolean isEnabled (); - void setEnabled (boolean arg0); - boolean isDoubleBuffered (); - void enableInputMethods (boolean arg0); - void setVisible (boolean arg0); - void show (); - void show (boolean arg0); - void hide (); - java.awt.Color getForeground (); - void setForeground (java.awt.Color arg0); - java.awt.Color getBackground (); - void setBackground (java.awt.Color arg0); - java.awt.Font getFont (); - void setFont (java.awt.Font arg0); - java.util.Locale getLocale (); - void setLocale (java.util.Locale arg0); - java.awt.image.ColorModel getColorModel (); - java.awt.Point getLocationOnScreen (); - void setLocation (int arg0, int arg1); - void setLocation (java.awt.Point arg0); - void move (int arg0, int arg1); - java.awt.Dimension getSize (); - java.awt.Dimension getSize (java.awt.Dimension arg0); - void resize (int arg0, int arg1); - void resize (java.awt.Dimension arg0); - java.awt.Rectangle getBounds (); - java.awt.Rectangle getBounds (java.awt.Rectangle arg0); - java.awt.Rectangle bounds (); - void setBounds (int arg0, int arg1, int arg2, int arg3); - void setBounds (java.awt.Rectangle arg0); - void reshape (int arg0, int arg1, int arg2, int arg3); - int getX (); - int getY (); - int getWidth (); - int getHeight (); - boolean isOpaque (); - boolean isLightweight (); - java.awt.Dimension getPreferredSize (); - java.awt.Dimension preferredSize (); - java.awt.Dimension getMinimumSize (); - java.awt.Dimension minimumSize (); - java.awt.Dimension getMaximumSize (); - float getAlignmentX (); - float getAlignmentY (); - void doLayout (); - void layout (); - void validate (); - void invalidate (); - java.awt.Graphics getGraphics (); - java.awt.FontMetrics getFontMetrics (java.awt.Font arg0); - void setCursor (java.awt.Cursor arg0); - java.awt.Cursor getCursor (); - void paint (java.awt.Graphics arg0); - void update (java.awt.Graphics arg0); - void paintAll (java.awt.Graphics arg0); - void repaint (); - void repaint (long arg0); - void repaint (int arg0, int arg1, int arg2, int arg3); - void repaint (long arg0, int arg1, int arg2, int arg3, int arg4); - void printAll (java.awt.Graphics arg0); - boolean imageUpdate (java.awt.Image arg0, int arg1, int arg2, int arg3, int arg4, int arg5); - java.awt.Image createImage (java.awt.image.ImageProducer arg0); - java.awt.Image createImage (int arg0, int arg1); - boolean prepareImage (java.awt.Image arg0, java.awt.image.ImageObserver arg1); - boolean prepareImage (java.awt.Image arg0, int arg1, int arg2, java.awt.image.ImageObserver arg3); - int checkImage (java.awt.Image arg0, java.awt.image.ImageObserver arg1); - int checkImage (java.awt.Image arg0, int arg1, int arg2, java.awt.image.ImageObserver arg3); - boolean inside (int arg0, int arg1); - java.awt.Component getComponentAt (int arg0, int arg1); - java.awt.Component getComponentAt (java.awt.Point arg0); - java.awt.Component locate (int arg0, int arg1); - void deliverEvent (java.awt.Event arg0); - boolean postEvent (java.awt.Event arg0); - void addComponentListener (java.awt.event.ComponentListener arg0); - void removeComponentListener (java.awt.event.ComponentListener arg0); - void addFocusListener (java.awt.event.FocusListener arg0); - void removeFocusListener (java.awt.event.FocusListener arg0); - void addHierarchyListener (java.awt.event.HierarchyListener arg0); - void removeHierarchyListener (java.awt.event.HierarchyListener arg0); - void addHierarchyBoundsListener (java.awt.event.HierarchyBoundsListener arg0); - void removeHierarchyBoundsListener (java.awt.event.HierarchyBoundsListener arg0); - void addKeyListener (java.awt.event.KeyListener arg0); - void removeKeyListener (java.awt.event.KeyListener arg0); - void addMouseListener (java.awt.event.MouseListener arg0); - void removeMouseListener (java.awt.event.MouseListener arg0); - void addMouseMotionListener (java.awt.event.MouseMotionListener arg0); - void removeMouseMotionListener (java.awt.event.MouseMotionListener arg0); - void addInputMethodListener (java.awt.event.InputMethodListener arg0); - void removeInputMethodListener (java.awt.event.InputMethodListener arg0); - java.util.EventListener[] getListeners (Class arg0); - java.awt.im.InputMethodRequests getInputMethodRequests (); - java.awt.im.InputContext getInputContext (); - boolean handleEvent (java.awt.Event arg0); - boolean mouseDown (java.awt.Event arg0, int arg1, int arg2); - boolean mouseDrag (java.awt.Event arg0, int arg1, int arg2); - boolean mouseUp (java.awt.Event arg0, int arg1, int arg2); - boolean mouseMove (java.awt.Event arg0, int arg1, int arg2); - boolean mouseEnter (java.awt.Event arg0, int arg1, int arg2); - boolean mouseExit (java.awt.Event arg0, int arg1, int arg2); - boolean keyDown (java.awt.Event arg0, int arg1); - boolean keyUp (java.awt.Event arg0, int arg1); - void addNotify (); - void removeNotify (); - boolean gotFocus (java.awt.Event arg0, Object arg1); - boolean lostFocus (java.awt.Event arg0, Object arg1); - boolean isFocusTraversable (); - void requestFocus (); - void transferFocus (); - void nextFocus (); - void addPropertyChangeListener (java.beans.PropertyChangeListener arg0); - void addPropertyChangeListener (String arg0, java.beans.PropertyChangeListener arg1); - void removePropertyChangeListener (java.beans.PropertyChangeListener arg0); - void removePropertyChangeListener (String arg0, java.beans.PropertyChangeListener arg1); - void setComponentOrientation (java.awt.ComponentOrientation arg0); - java.awt.ComponentOrientation getComponentOrientation (); - javax.accessibility.AccessibleContext getAccessibleContext (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/ComponentType.fractal b/fractalswing/src/org/objectweb/fractal/swing/ComponentType.fractal deleted file mode 100644 index f517c005652eb842f9054c6d2241736db6e024bd..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ComponentType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/ContainerAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/ContainerAttributes.java deleted file mode 100644 index cd3b6403d1652ab175be320ae9131e563b34ef40..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ContainerAttributes.java +++ /dev/null @@ -1,9 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface ContainerAttributes extends ComponentAttributes { - java.awt.LayoutManager getLayout (); - void setLayout (java.awt.LayoutManager arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/ContainerImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/ContainerImpl.fractal deleted file mode 100644 index 139652f618efcf6ed92097867cf05099799e8dc0..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ContainerImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/ContainerImpl.java b/fractalswing/src/org/objectweb/fractal/swing/ContainerImpl.java deleted file mode 100644 index 1aa61a8e4275e0a26877b4537707e5e513b96d9e..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ContainerImpl.java +++ /dev/null @@ -1,143 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.HashMap; -import java.util.Map; -import java.awt.Component; - -import javax.swing.JComponent; - -public class ContainerImpl - extends java.awt.Container - implements ContainerItf, ContainerAttributes, BindingController -{ - - // fields manually added - public final static String LEFT_COMPONENT_BINDING = "left-component"; - public final static String TOP_COMPONENT_BINDING = "top-component"; - public final static String RIGHT_COMPONENT_BINDING = "right-component"; - public final static String BOTTOM_COMPONENT_BINDING = "bottom-component"; - public final static String CENTER_COMPONENT_BINDING = "center-component"; - public final static String COMPONENTS_BINDING = "components"; - public final static String LAYOUT_BINDING = "layout"; - private JComponent left, top, right, bottom, center; - private Map components = new HashMap(); - private java.awt.LayoutManager layout; - - public ContainerImpl () { - super(); - } - - public String[] listFc () { - int s = components.size(); - String[] result = (String[])components.keySet().toArray(new String[s + 6]); - result[s] = LEFT_COMPONENT_BINDING; - result[s+1] = TOP_COMPONENT_BINDING; - result[s+2] = RIGHT_COMPONENT_BINDING; - result[s+3] = BOTTOM_COMPONENT_BINDING; - result[s+4] = CENTER_COMPONENT_BINDING; - result[s+5] = LAYOUT_BINDING; - return result; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - return left; - } if (clientItfName.equals(TOP_COMPONENT_BINDING)) { - return top; - } if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - return right; - } if (clientItfName.equals(BOTTOM_COMPONENT_BINDING)) { - return bottom; - } if (clientItfName.equals(CENTER_COMPONENT_BINDING)) { - return center; - } else if (clientItfName.startsWith(COMPONENTS_BINDING)) { - return components.get(clientItfName); - } else if (clientItfName.equals(LAYOUT_BINDING)) { - return layout; - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - left = (JComponent)serverItf; - super.add(left, "West"); - validate(); - repaint(); - } if (clientItfName.equals(TOP_COMPONENT_BINDING)) { - top = (JComponent)serverItf; - super.add(top, "North"); - validate(); - repaint(); - } if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - right = (JComponent)serverItf; - super.add(right, "East"); - validate(); - repaint(); - } if (clientItfName.equals(BOTTOM_COMPONENT_BINDING)) { - bottom = (JComponent)serverItf; - super.add(bottom, "South"); - validate(); - repaint(); - } if (clientItfName.equals(CENTER_COMPONENT_BINDING)) { - center = (JComponent)serverItf; - super.add(center, "Center"); - validate(); - repaint(); - } else if (clientItfName.startsWith(COMPONENTS_BINDING)) { - components.put(clientItfName, serverItf); - super.add((java.awt.Component)serverItf); - validate(); - repaint(); - } else if (clientItfName.equals(LAYOUT_BINDING)) { - layout = (java.awt.LayoutManager)serverItf; - super.setLayout(layout); - validate(); - repaint(); - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - super.remove(left); - validate(); - repaint(); - left = null; - } if (clientItfName.equals(TOP_COMPONENT_BINDING)) { - super.remove(top); - validate(); - repaint(); - top = null; - } if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - super.remove(right); - validate(); - repaint(); - right = null; - } if (clientItfName.equals(BOTTOM_COMPONENT_BINDING)) { - super.remove(bottom); - validate(); - repaint(); - bottom = null; - } if (clientItfName.equals(CENTER_COMPONENT_BINDING)) { - super.remove(center); - validate(); - repaint(); - center = null; - } else if (clientItfName.startsWith(COMPONENTS_BINDING)) { - Component c = (Component)components.get(clientItfName); - super.remove(c); - validate(); - repaint(); - } else if (clientItfName.equals(LAYOUT_BINDING)) { - layout = null; - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/ContainerItf.java b/fractalswing/src/org/objectweb/fractal/swing/ContainerItf.java deleted file mode 100644 index effdd26dcb8eb1882a89202714d336e4589b2d39..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ContainerItf.java +++ /dev/null @@ -1,30 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface ContainerItf extends ComponentItf { - java.awt.Component add (java.awt.Component arg0); - java.awt.Component add (String arg0, java.awt.Component arg1); - java.awt.Component add (java.awt.Component arg0, int arg1); - void add (java.awt.Component arg0, Object arg1); - void add (java.awt.Component arg0, Object arg1, int arg2); - void remove (int arg0); - void remove (java.awt.Component arg0); - void removeAll (); - java.awt.Component[] getComponents (); - int getComponentCount (); - int countComponents (); - java.awt.Component getComponent (int arg0); - java.awt.Insets getInsets (); - java.awt.Insets insets (); - java.awt.LayoutManager getLayout (); - void setLayout (java.awt.LayoutManager arg0); - void paintComponents (java.awt.Graphics arg0); - void printComponents (java.awt.Graphics arg0); - void addContainerListener (java.awt.event.ContainerListener arg0); - void removeContainerListener (java.awt.event.ContainerListener arg0); - java.awt.Component findComponentAt (int arg0, int arg1); - java.awt.Component findComponentAt (java.awt.Point arg0); - boolean isAncestorOf (java.awt.Component arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/ContainerType.fractal b/fractalswing/src/org/objectweb/fractal/swing/ContainerType.fractal deleted file mode 100644 index bd93ea75bc3490e76d0d6ae7b6b335141488af95..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/ContainerType.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutAttributes.java deleted file mode 100644 index 69ddff7923d7ffc6312b76f226dccc64b25217c3..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutAttributes.java +++ /dev/null @@ -1,12 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface FlowLayoutAttributes extends org.objectweb.fractal.api.control.AttributeController { - int getAlignment (); - void setAlignment (int arg0); - int getHgap (); - void setHgap (int arg0); - int getVgap (); - void setVgap (int arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutImpl.fractal deleted file mode 100644 index da96792bdadab371920db1cea9068480bd745bcf..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutImpl.java b/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutImpl.java deleted file mode 100644 index 0cf22724586b83e3eb1bed3bd0ed166ee3488b0b..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -public class FlowLayoutImpl - extends java.awt.FlowLayout - implements FlowLayoutItf, FlowLayoutAttributes, BindingController -{ - - public FlowLayoutImpl () { - super(); - } - public FlowLayoutImpl (int arg0) { - super(arg0); - } - public FlowLayoutImpl (int arg0, int arg1, int arg2) { - super(arg0,arg1,arg2); - } - - public String[] listFc () { - // put your own code here - return new String[0]; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - } - - public void unbindFc (String clientItfName) { - // put your own code here - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutItf.java b/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutItf.java deleted file mode 100644 index d9858c5138aabecc2ae02b052c93c8abfd211e27..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutItf.java +++ /dev/null @@ -1,17 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface FlowLayoutItf { - void addLayoutComponent (String arg0, java.awt.Component arg1); - void removeLayoutComponent (java.awt.Component arg0); - void layoutContainer (java.awt.Container arg0); - java.awt.Dimension preferredLayoutSize (java.awt.Container arg0); - java.awt.Dimension minimumLayoutSize (java.awt.Container arg0); - int getAlignment (); - void setAlignment (int arg0); - int getHgap (); - void setHgap (int arg0); - int getVgap (); - void setVgap (int arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutType.fractal b/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutType.fractal deleted file mode 100644 index cdfa494f4c37be13ef1024cd7ba06d36179f8836..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FlowLayoutType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/FrameAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/FrameAttributes.java deleted file mode 100644 index 2dd8d15bb1a052013f9a42982673ea23ac7adbf0..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FrameAttributes.java +++ /dev/null @@ -1,15 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface FrameAttributes extends WindowAttributes { - void setMenuBar (java.awt.MenuBar arg0); - java.awt.MenuBar getMenuBar (); - String getTitle (); - void setTitle (String arg0); - java.awt.Image getIconImage (); - void setIconImage (java.awt.Image arg0); - void setState (int arg0); - int getState (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/FrameImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/FrameImpl.fractal deleted file mode 100644 index 7b6c1ce69da620ddabe54cade8cd91459c279867..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FrameImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/FrameImpl.java b/fractalswing/src/org/objectweb/fractal/swing/FrameImpl.java deleted file mode 100644 index 280363f9ac348dbfb7b28e39989afad7e40c2489..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FrameImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -public class FrameImpl - extends java.awt.Frame - implements FrameItf, FrameAttributes, BindingController -{ - - public FrameImpl () { - super(); - } - public FrameImpl (java.awt.GraphicsConfiguration arg0) { - super(arg0); - } - public FrameImpl (String arg0) { - super(arg0); - } - public FrameImpl (String arg0, java.awt.GraphicsConfiguration arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - // put your own code here - return new String[0]; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - } - - public void unbindFc (String clientItfName) { - // put your own code here - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/FrameItf.java b/fractalswing/src/org/objectweb/fractal/swing/FrameItf.java deleted file mode 100644 index c3d8e4578d2b7de9b1a48f0ff052e99fc0991dc6..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FrameItf.java +++ /dev/null @@ -1,19 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface FrameItf extends WindowItf { - void setCursor (int arg0); - void setMenuBar (java.awt.MenuBar arg0); - java.awt.MenuBar getMenuBar (); - String getTitle (); - void setTitle (String arg0); - java.awt.Image getIconImage (); - void setIconImage (java.awt.Image arg0); - boolean isResizable (); - void setResizable (boolean arg0); - void setState (int arg0); - int getState (); - int getCursorType (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/FrameType.fractal b/fractalswing/src/org/objectweb/fractal/swing/FrameType.fractal deleted file mode 100644 index 1e1594a2baf2f73bd0148938aa41764ec356dad5..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/FrameType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JButtonAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JButtonAttributes.java deleted file mode 100644 index a995f3a890855f0894b9839bf4118fd4640a9e98..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JButtonAttributes.java +++ /dev/null @@ -1,7 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JButtonAttributes extends AbstractButtonAttributes { -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JButtonImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JButtonImpl.fractal deleted file mode 100644 index cd02892816f00ea339735ebdf1c73fe429d3e528..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JButtonImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JButtonImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JButtonImpl.java deleted file mode 100644 index c963c3d21e7547bf0b390b8cc21af4ec88b5a4a5..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JButtonImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.HashMap; -import java.util.Map; -import java.awt.event.ActionListener; - -public class JButtonImpl - extends javax.swing.JButton - implements JButtonItf, JButtonAttributes, BindingController -{ - - // fields manually added - public final static String ACTION_LISTENERS_BINDING = "action-listeners"; - private Map actionListeners = new HashMap(); - - public JButtonImpl () { - super(); - } - public JButtonImpl (javax.swing.Icon arg0) { - super(arg0); - } - public JButtonImpl (String arg0) { - super(arg0); - } - public JButtonImpl (javax.swing.Action arg0) { - super(arg0); - } - public JButtonImpl (String arg0, javax.swing.Icon arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - // put your own code here - int size = actionListeners.size(); - return (String[])actionListeners.keySet().toArray(new String[size]); - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(ACTION_LISTENERS_BINDING)) { - return actionListeners.get(clientItfName); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.startsWith(ACTION_LISTENERS_BINDING)) { - actionListeners.put(clientItfName, serverItf); - super.addActionListener((java.awt.event.ActionListener)serverItf); - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(ACTION_LISTENERS_BINDING)) { - ActionListener a = (ActionListener)actionListeners.get(clientItfName); - super.removeActionListener(a); - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JButtonItf.java b/fractalswing/src/org/objectweb/fractal/swing/JButtonItf.java deleted file mode 100644 index ca080aa0adba276d7f2645dd923021cca96a9c83..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JButtonItf.java +++ /dev/null @@ -1,10 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JButtonItf extends AbstractButtonItf { - void setDefaultCapable (boolean arg0); - boolean isDefaultButton (); - boolean isDefaultCapable (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JButtonType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JButtonType.fractal deleted file mode 100644 index 5a360fe6935c6d047e8bc1db9e4781e1870148ec..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JButtonType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JComponentAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JComponentAttributes.java deleted file mode 100644 index 00356f24bd3209b5bf8d795fd0563afd4712d123..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JComponentAttributes.java +++ /dev/null @@ -1,31 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JComponentAttributes extends ContainerAttributes { - java.awt.Dimension getPreferredSize (); - java.awt.Dimension getMinimumSize (); - java.awt.Dimension getMaximumSize (); - float getAlignmentX (); - float getAlignmentY (); - void setNextFocusableComponent (java.awt.Component arg0); - java.awt.Component getNextFocusableComponent (); - void setVerifyInputWhenFocusTarget (boolean arg0); - boolean getVerifyInputWhenFocusTarget (); - void setPreferredSize (java.awt.Dimension arg0); - void setMaximumSize (java.awt.Dimension arg0); - void setMinimumSize (java.awt.Dimension arg0); - void setBorder (javax.swing.border.Border arg0); - javax.swing.border.Border getBorder (); - void setAlignmentY (float arg0); - void setAlignmentX (float arg0); - void setInputVerifier (javax.swing.InputVerifier arg0); - javax.swing.InputVerifier getInputVerifier (); - void setDebugGraphicsOptions (int arg0); - int getDebugGraphicsOptions (); - void setToolTipText (String arg0); - String getToolTipText (); - void setAutoscrolls (boolean arg0); - boolean getAutoscrolls (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JComponentItf.java b/fractalswing/src/org/objectweb/fractal/swing/JComponentItf.java deleted file mode 100644 index 53664b945283695f53228a88622f4c6dc65fe5f7..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JComponentItf.java +++ /dev/null @@ -1,74 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JComponentItf extends ContainerItf { - void repaint (java.awt.Rectangle arg0); - void firePropertyChange (String arg0, byte arg1, byte arg2); - void firePropertyChange (String arg0, char arg1, char arg2); - void firePropertyChange (String arg0, short arg1, short arg2); - void firePropertyChange (String arg0, int arg1, int arg2); - void firePropertyChange (String arg0, long arg1, long arg2); - void firePropertyChange (String arg0, float arg1, float arg2); - void firePropertyChange (String arg0, double arg1, double arg2); - void firePropertyChange (String arg0, boolean arg1, boolean arg2); - java.awt.Insets getInsets (java.awt.Insets arg0); - void updateUI (); - String getUIClassID (); - boolean isPaintingTile (); - boolean isFocusCycleRoot (); - boolean isManagingFocus (); - void setNextFocusableComponent (java.awt.Component arg0); - java.awt.Component getNextFocusableComponent (); - void setRequestFocusEnabled (boolean arg0); - boolean isRequestFocusEnabled (); - void grabFocus (); - void setVerifyInputWhenFocusTarget (boolean arg0); - boolean getVerifyInputWhenFocusTarget (); - void setPreferredSize (java.awt.Dimension arg0); - void setMaximumSize (java.awt.Dimension arg0); - void setMinimumSize (java.awt.Dimension arg0); - boolean isMinimumSizeSet (); - boolean isPreferredSizeSet (); - boolean isMaximumSizeSet (); - void setBorder (javax.swing.border.Border arg0); - javax.swing.border.Border getBorder (); - void setAlignmentY (float arg0); - void setAlignmentX (float arg0); - void setInputVerifier (javax.swing.InputVerifier arg0); - javax.swing.InputVerifier getInputVerifier (); - void setDebugGraphicsOptions (int arg0); - int getDebugGraphicsOptions (); - void registerKeyboardAction (java.awt.event.ActionListener arg0, String arg1, javax.swing.KeyStroke arg2, int arg3); - void registerKeyboardAction (java.awt.event.ActionListener arg0, javax.swing.KeyStroke arg1, int arg2); - void unregisterKeyboardAction (javax.swing.KeyStroke arg0); - javax.swing.KeyStroke[] getRegisteredKeyStrokes (); - int getConditionForKeyStroke (javax.swing.KeyStroke arg0); - java.awt.event.ActionListener getActionForKeyStroke (javax.swing.KeyStroke arg0); - void resetKeyboardActions (); - boolean requestDefaultFocus (); - void setToolTipText (String arg0); - String getToolTipText (); - String getToolTipText (java.awt.event.MouseEvent arg0); - java.awt.Point getToolTipLocation (java.awt.event.MouseEvent arg0); - javax.swing.JToolTip createToolTip (); - void scrollRectToVisible (java.awt.Rectangle arg0); - void setAutoscrolls (boolean arg0); - boolean getAutoscrolls (); - void setOpaque (boolean arg0); - void computeVisibleRect (java.awt.Rectangle arg0); - java.awt.Rectangle getVisibleRect (); - void addVetoableChangeListener (java.beans.VetoableChangeListener arg0); - void removeVetoableChangeListener (java.beans.VetoableChangeListener arg0); - java.awt.Container getTopLevelAncestor (); - void addAncestorListener (javax.swing.event.AncestorListener arg0); - void removeAncestorListener (javax.swing.event.AncestorListener arg0); - void revalidate (); - boolean isValidateRoot (); - boolean isOptimizedDrawingEnabled (); - void paintImmediately (int arg0, int arg1, int arg2, int arg3); - void paintImmediately (java.awt.Rectangle arg0); - void setDoubleBuffered (boolean arg0); - javax.swing.JRootPane getRootPane (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JComponentType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JComponentType.fractal deleted file mode 100644 index 644c620b856332a9e3210085c72098845b94588a..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JComponentType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JFrameAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JFrameAttributes.java deleted file mode 100644 index 128d07b20a9bf100176a0105f42e2491fc2a483b..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JFrameAttributes.java +++ /dev/null @@ -1,22 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JFrameAttributes extends FrameAttributes { - java.awt.Component getGlassPane (); - void setJMenuBar (javax.swing.JMenuBar arg0); - javax.swing.JMenuBar getJMenuBar (); - void setContentPane (java.awt.Container arg0); - java.awt.Container getContentPane (); - void setLayeredPane (javax.swing.JLayeredPane arg0); - javax.swing.JLayeredPane getLayeredPane (); - void setGlassPane (java.awt.Component arg0); - void setDefaultCloseOperation (int arg0); - int getDefaultCloseOperation (); - // manually added - int getWidth (); - void setWidth (int width); - int getHeight (); - void setHeight (int height); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JFrameImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JFrameImpl.fractal deleted file mode 100644 index aea22ba7d24801953907c6280ef4a35cb6cf90e6..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JFrameImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JFrameImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JFrameImpl.java deleted file mode 100644 index 66f42eef49adf23f27cd29a4d3bb08ee81dee44f..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JFrameImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.BindingController; - -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; - -import javax.swing.JMenuBar; - -public class JFrameImpl - extends javax.swing.JFrame - implements JFrameItf, JFrameAttributes, BindingController, LifeCycleController -{ - - // fields manually added - public final static String CONTENT_PANE_BINDING = "content-pane"; - public final static String MENU_BAR_BINDING = "menu-bar"; - private java.awt.Container contentPane; - - public JFrameImpl () { - super(); - // manually added - addWindowListener( - new WindowAdapter() { - public void windowClosing (WindowEvent e) { - System.exit(0); - } - }); - } - public JFrameImpl (java.awt.GraphicsConfiguration arg0) { - super(arg0); - } - public JFrameImpl (String arg0) { - super(arg0); - } - public JFrameImpl (String arg0, java.awt.GraphicsConfiguration arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - // put your own code here - return new String[] { - CONTENT_PANE_BINDING, - MENU_BAR_BINDING - }; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(CONTENT_PANE_BINDING)) { - return contentPane; - } else if (clientItfName.equals(MENU_BAR_BINDING)) { - return getJMenuBar(); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.equals(CONTENT_PANE_BINDING)) { - contentPane = (java.awt.Container)serverItf; - super.setContentPane(contentPane); - } else if (clientItfName.equals(MENU_BAR_BINDING)) { - super.setJMenuBar((JMenuBar)serverItf); - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(CONTENT_PANE_BINDING)) { - contentPane = null; - super.setContentPane(new java.awt.Container()); - } else if (clientItfName.equals(MENU_BAR_BINDING)) { - super.setJMenuBar(null); - } - } - - // methods manually added - - public void setWidth (int width) { - setSize(width, getHeight()); - } - - public void setHeight (int height) { - setSize(getWidth(), height); - } - - public String getFcState () { - return null; - } - - public void startFc () { - show(); - } - - public void stopFc () { - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JFrameItf.java b/fractalswing/src/org/objectweb/fractal/swing/JFrameItf.java deleted file mode 100644 index 4fb66a1fab9321c299ba5898a4949085b2dc4b39..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JFrameItf.java +++ /dev/null @@ -1,18 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JFrameItf extends FrameItf { - java.awt.Component getGlassPane (); - javax.swing.JRootPane getRootPane (); - void setJMenuBar (javax.swing.JMenuBar arg0); - javax.swing.JMenuBar getJMenuBar (); - void setContentPane (java.awt.Container arg0); - java.awt.Container getContentPane (); - void setLayeredPane (javax.swing.JLayeredPane arg0); - javax.swing.JLayeredPane getLayeredPane (); - void setGlassPane (java.awt.Component arg0); - void setDefaultCloseOperation (int arg0); - int getDefaultCloseOperation (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JFrameType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JFrameType.fractal deleted file mode 100644 index 4b6e2987104fac6d8526b01c896f78990b6af6e7..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JFrameType.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JLabelAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JLabelAttributes.java deleted file mode 100644 index 6d24d744f167b2606ef15725f252702853e33b2e..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JLabelAttributes.java +++ /dev/null @@ -1,29 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JLabelAttributes extends JComponentAttributes { - String getText (); - void setUI (javax.swing.plaf.LabelUI arg0); - javax.swing.plaf.LabelUI getUI (); - void setHorizontalTextPosition (int arg0); - void setVerticalTextPosition (int arg0); - void setText (String arg0); - void setIcon (javax.swing.Icon arg0); - javax.swing.Icon getIcon (); - javax.swing.Icon getDisabledIcon (); - void setDisabledIcon (javax.swing.Icon arg0); - int getVerticalAlignment (); - void setVerticalAlignment (int arg0); - int getHorizontalAlignment (); - void setHorizontalAlignment (int arg0); - int getVerticalTextPosition (); - int getHorizontalTextPosition (); - void setDisplayedMnemonic (int arg0); - int getDisplayedMnemonic (); - int getIconTextGap (); - void setIconTextGap (int arg0); - java.awt.Component getLabelFor (); - void setLabelFor (java.awt.Component arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JLabelImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JLabelImpl.fractal deleted file mode 100644 index c32a05bfdc17c072f1f3e2439aa82b192501bf94..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JLabelImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JLabelImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JLabelImpl.java deleted file mode 100644 index e7d08cd2912050fbe237dd605bdd97ad51a6ef66..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JLabelImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -public class JLabelImpl - extends javax.swing.JLabel - implements JLabelItf, JLabelAttributes, BindingController -{ - - public JLabelImpl (String arg0, javax.swing.Icon arg1, int arg2) { - super(arg0,arg1,arg2); - } - public JLabelImpl (String arg0, int arg1) { - super(arg0,arg1); - } - public JLabelImpl (String arg0) { - super(arg0); - } - public JLabelImpl (javax.swing.Icon arg0, int arg1) { - super(arg0,arg1); - } - public JLabelImpl (javax.swing.Icon arg0) { - super(arg0); - } - public JLabelImpl () { - super(); - } - - public String[] listFc () { - // put your own code here - return new String[0]; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - } - - public void unbindFc (String clientItfName) { - // put your own code here - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JLabelItf.java b/fractalswing/src/org/objectweb/fractal/swing/JLabelItf.java deleted file mode 100644 index bee41e51d911884d71f07bc95f90813ac0a2e41d..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JLabelItf.java +++ /dev/null @@ -1,30 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JLabelItf extends JComponentItf { - String getText (); - void setUI (javax.swing.plaf.LabelUI arg0); - javax.swing.plaf.LabelUI getUI (); - void setHorizontalTextPosition (int arg0); - void setVerticalTextPosition (int arg0); - void setText (String arg0); - void setIcon (javax.swing.Icon arg0); - javax.swing.Icon getIcon (); - javax.swing.Icon getDisabledIcon (); - void setDisabledIcon (javax.swing.Icon arg0); - int getVerticalAlignment (); - void setVerticalAlignment (int arg0); - int getHorizontalAlignment (); - void setHorizontalAlignment (int arg0); - int getVerticalTextPosition (); - int getHorizontalTextPosition (); - void setDisplayedMnemonic (int arg0); - void setDisplayedMnemonic (char arg0); - int getDisplayedMnemonic (); - int getIconTextGap (); - void setIconTextGap (int arg0); - java.awt.Component getLabelFor (); - void setLabelFor (java.awt.Component arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JLabelType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JLabelType.fractal deleted file mode 100644 index a5f7da92f6a0f0d2755a10870f420a9d4e358725..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JLabelType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuAttributes.java deleted file mode 100644 index bd185c523c06dbcfd37c43c5c23fa709addaaf5a..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuAttributes.java +++ /dev/null @@ -1,8 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JMenuAttributes extends JMenuItemAttributes { - void setDelay (int arg0); - int getDelay (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuBarAttributes.java deleted file mode 100644 index 0f9b9eb64679cc1ae0dec69da292c045a3128559..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarAttributes.java +++ /dev/null @@ -1,14 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JMenuBarAttributes extends JComponentAttributes { - void setUI (javax.swing.plaf.MenuBarUI arg0); - javax.swing.plaf.MenuBarUI getUI (); - void setMargin (java.awt.Insets arg0); - java.awt.Insets getMargin (); - javax.swing.SingleSelectionModel getSelectionModel (); - void setSelectionModel (javax.swing.SingleSelectionModel arg0); - void setHelpMenu (javax.swing.JMenu arg0); - javax.swing.JMenu getHelpMenu (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JMenuBarImpl.fractal deleted file mode 100644 index a00a47a4eff7436142e3f7734415530322aa6088..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuBarImpl.java deleted file mode 100644 index 3f7f114125e5e432c243f1ca9120ae916e816ca5..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarImpl.java +++ /dev/null @@ -1,62 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.Map; -import java.util.TreeMap; -import java.util.Iterator; - -import javax.swing.JMenu; - -public class JMenuBarImpl - extends javax.swing.JMenuBar - implements JMenuBarItf, JMenuBarAttributes, BindingController -{ - - // fields manually added - private final static String MENUS_BINDING = "menus"; - private final Map menus = new TreeMap(); - - public JMenuBarImpl () { - super(); - } - - public String[] listFc () { - // put your own code here - return (String[])menus.keySet().toArray(new String[menus.size()]); - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(MENUS_BINDING)) { - return menus.get(clientItfName); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.startsWith(MENUS_BINDING)) { - menus.put(clientItfName, serverItf); - Iterator i = menus.values().iterator(); - while (i.hasNext()) { - super.remove((JMenu)i.next()); - } - i = menus.values().iterator(); - while (i.hasNext()) { - super.add((JMenu)i.next()); - } - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(MENUS_BINDING)) { - Object serverItf = menus.remove(clientItfName); - super.remove((JMenu)serverItf); - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarItf.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuBarItf.java deleted file mode 100644 index e49a03fe722bac480114aec4038ec5506eacfd47..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarItf.java +++ /dev/null @@ -1,28 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JMenuBarItf extends JComponentItf { - javax.swing.JMenu add (javax.swing.JMenu arg0); - void processKeyEvent (java.awt.event.KeyEvent arg0, javax.swing.MenuElement[] arg1, javax.swing.MenuSelectionManager arg2); - void processMouseEvent (java.awt.event.MouseEvent arg0, javax.swing.MenuElement[] arg1, javax.swing.MenuSelectionManager arg2); - java.awt.Component getComponent (); - boolean isSelected (); - void setUI (javax.swing.plaf.MenuBarUI arg0); - javax.swing.plaf.MenuBarUI getUI (); - int getComponentIndex (java.awt.Component arg0); - java.awt.Component getComponentAtIndex (int arg0); - void setMargin (java.awt.Insets arg0); - java.awt.Insets getMargin (); - boolean isBorderPainted (); - void setBorderPainted (boolean arg0); - void setSelected (java.awt.Component arg0); - javax.swing.SingleSelectionModel getSelectionModel (); - void setSelectionModel (javax.swing.SingleSelectionModel arg0); - javax.swing.JMenu getMenu (int arg0); - int getMenuCount (); - void setHelpMenu (javax.swing.JMenu arg0); - javax.swing.JMenu getHelpMenu (); - void menuSelectionChanged (boolean arg0); - javax.swing.MenuElement[] getSubElements (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JMenuBarType.fractal deleted file mode 100644 index bb89aaf642ff4b12c69a4bd065407bbc3fe135b3..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuBarType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JMenuImpl.fractal deleted file mode 100644 index 3feee4d90ec21cf8f4a1f6c92392bb39103011a8..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuImpl.java deleted file mode 100644 index 8d185d421dec509c9c7c1a9a016236e1483bccb9..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.HashMap; -import java.util.Map; -import java.util.TreeMap; -import java.util.Iterator; - -import javax.swing.JMenuItem; -import javax.swing.Action; -import javax.swing.KeyStroke; - -public class JMenuImpl - extends javax.swing.JMenu - implements JMenuItf, JMenuAttributes, BindingController -{ - - // fields manually added - public final static String ITEMS_BINDING = "items"; - private Map actions = new TreeMap(); - private Map items = new HashMap(); - - public JMenuImpl () { - super(); - } - public JMenuImpl (java.lang.String arg0) { - super(arg0); - } - public JMenuImpl (javax.swing.Action arg0) { - super(arg0); - } - public JMenuImpl (java.lang.String arg0, boolean arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - return (String[])actions.keySet().toArray(new String[actions.size()]); - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(ITEMS_BINDING)) { - return actions.get(clientItfName); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.startsWith(ITEMS_BINDING)) { - removeAll(); - actions.put(clientItfName, serverItf); - Iterator i = actions.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry e = (Map.Entry)i.next(); - Object o = e.getValue(); - if (o instanceof JSeparatorItf) { - addSeparator(); - } else { - add((Action)o); - } - items.put((String)e.getKey(), getItem(getItemCount()-1)); - } - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(ITEMS_BINDING)) { - actions.remove(clientItfName); - remove((JMenuItem)items.remove(clientItfName)); - } - } - - // manually added - public JMenuItem add (Action a) { - JMenuItem item = super.add(a); - KeyStroke stroke = (KeyStroke)a.getValue(Action.ACCELERATOR_KEY); - if (stroke != null) { - item.setAccelerator(stroke); - } - return item; - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuItemAttributes.java deleted file mode 100644 index 3f2c7c7609a136af2743c4df4dc0882edfb2a3d8..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemAttributes.java +++ /dev/null @@ -1,8 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JMenuItemAttributes extends AbstractButtonAttributes { - void setAccelerator (javax.swing.KeyStroke arg0); - javax.swing.KeyStroke getAccelerator (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JMenuItemImpl.fractal deleted file mode 100644 index a8522009ab9af6537c7cd9a68c67e95f4d770181..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuItemImpl.java deleted file mode 100644 index 89f9faadc9f7050eb0b0a9f42abeb7fed2f67363..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -public class JMenuItemImpl - extends javax.swing.JMenuItem - implements JMenuItemItf, JMenuItemAttributes, BindingController -{ - - public JMenuItemImpl () { - super(); - } - public JMenuItemImpl (javax.swing.Icon arg0) { - super(arg0); - } - public JMenuItemImpl (java.lang.String arg0) { - super(arg0); - } - public JMenuItemImpl (javax.swing.Action arg0) { - super(arg0); - } - public JMenuItemImpl (java.lang.String arg0, javax.swing.Icon arg1) { - super(arg0,arg1); - } - public JMenuItemImpl (java.lang.String arg0, int arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - // put your own code here - return new String[0]; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - } - - public void unbindFc (String clientItfName) { - // put your own code here - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemItf.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuItemItf.java deleted file mode 100644 index fae843029bf3c0856b71bf293bc876774e4a7f29..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemItf.java +++ /dev/null @@ -1,22 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JMenuItemItf extends AbstractButtonItf { - void processKeyEvent (java.awt.event.KeyEvent arg0, javax.swing.MenuElement[] arg1, javax.swing.MenuSelectionManager arg2); - void processMouseEvent (java.awt.event.MouseEvent arg0, javax.swing.MenuElement[] arg1, javax.swing.MenuSelectionManager arg2); - java.awt.Component getComponent (); - void setUI (javax.swing.plaf.MenuItemUI arg0); - void setArmed (boolean arg0); - void menuSelectionChanged (boolean arg0); - javax.swing.MenuElement[] getSubElements (); - void setAccelerator (javax.swing.KeyStroke arg0); - boolean isArmed (); - javax.swing.KeyStroke getAccelerator (); - void processMenuDragMouseEvent (javax.swing.event.MenuDragMouseEvent arg0); - void processMenuKeyEvent (javax.swing.event.MenuKeyEvent arg0); - void addMenuDragMouseListener (javax.swing.event.MenuDragMouseListener arg0); - void removeMenuDragMouseListener (javax.swing.event.MenuDragMouseListener arg0); - void addMenuKeyListener (javax.swing.event.MenuKeyListener arg0); - void removeMenuKeyListener (javax.swing.event.MenuKeyListener arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JMenuItemType.fractal deleted file mode 100644 index b91762dca7d08fa75b99afb0875cfdb4bb8ae0b0..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuItemType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuItf.java b/fractalswing/src/org/objectweb/fractal/swing/JMenuItf.java deleted file mode 100644 index 99e70928993a84cc421938dc89a96a18b164aeae..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuItf.java +++ /dev/null @@ -1,31 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JMenuItf extends JMenuItemItf { - javax.swing.JMenuItem add (javax.swing.JMenuItem arg0); - javax.swing.JMenuItem add (java.lang.String arg0); - javax.swing.JMenuItem add (javax.swing.Action arg0); - void remove (javax.swing.JMenuItem arg0); - void insert (java.lang.String arg0, int arg1); - javax.swing.JMenuItem insert (javax.swing.JMenuItem arg0, int arg1); - javax.swing.JMenuItem insert (javax.swing.Action arg0, int arg1); - void setDelay (int arg0); - javax.swing.JMenuItem getItem (int arg0); - int getItemCount (); - boolean isTearOff (); - void addSeparator (); - void insertSeparator (int arg0); - java.awt.Component[] getMenuComponents (); - boolean isPopupMenuVisible (); - void setPopupMenuVisible (boolean arg0); - int getDelay (); - void setMenuLocation (int arg0, int arg1); - int getMenuComponentCount (); - java.awt.Component getMenuComponent (int arg0); - boolean isTopLevelMenu (); - boolean isMenuComponent (java.awt.Component arg0); - javax.swing.JPopupMenu getPopupMenu (); - void addMenuListener (javax.swing.event.MenuListener arg0); - void removeMenuListener (javax.swing.event.MenuListener arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JMenuType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JMenuType.fractal deleted file mode 100644 index f9c7304b064bb351d88ed48f94c9f26130bcd084..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JMenuType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JPanelAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JPanelAttributes.java deleted file mode 100644 index 1321e0908df119f015f6be78231523dbd4b248c9..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JPanelAttributes.java +++ /dev/null @@ -1,7 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JPanelAttributes extends JComponentAttributes { -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JPanelImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JPanelImpl.fractal deleted file mode 100644 index ac066b4bd490824cda128339b6d26e30af3e4332..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JPanelImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JPanelImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JPanelImpl.java deleted file mode 100644 index d02e21a2b8a7ca57ee242634fc4762c8b6c991be..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JPanelImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.HashMap; -import java.util.Map; -import java.awt.Component; - -import javax.swing.JComponent; - -public class JPanelImpl - extends javax.swing.JPanel - implements JPanelItf, JPanelAttributes, BindingController -{ - - // fields manually added - public final static String LEFT_COMPONENT_BINDING = "left-component"; - public final static String TOP_COMPONENT_BINDING = "top-component"; - public final static String RIGHT_COMPONENT_BINDING = "right-component"; - public final static String BOTTOM_COMPONENT_BINDING = "bottom-component"; - public final static String CENTER_COMPONENT_BINDING = "center-component"; - public final static String COMPONENTS_BINDING = "components"; - public final static String LAYOUT_BINDING = "layout"; - private JComponent left, top, right, bottom, center; - private Map components = new HashMap(); - private java.awt.LayoutManager layout; - - public JPanelImpl (java.awt.LayoutManager arg0, boolean arg1) { - super(arg0,arg1); - } - public JPanelImpl (java.awt.LayoutManager arg0) { - super(arg0); - } - public JPanelImpl (boolean arg0) { - super(arg0); - } - public JPanelImpl () { - super(); - } - - public String[] listFc () { - int s = components.size(); - String[] result = (String[])components.keySet().toArray(new String[s + 6]); - result[s] = LEFT_COMPONENT_BINDING; - result[s+1] = TOP_COMPONENT_BINDING; - result[s+2] = RIGHT_COMPONENT_BINDING; - result[s+3] = BOTTOM_COMPONENT_BINDING; - result[s+4] = CENTER_COMPONENT_BINDING; - result[s+5] = LAYOUT_BINDING; - return result; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - return left; - } if (clientItfName.equals(TOP_COMPONENT_BINDING)) { - return top; - } if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - return right; - } if (clientItfName.equals(BOTTOM_COMPONENT_BINDING)) { - return bottom; - } if (clientItfName.equals(CENTER_COMPONENT_BINDING)) { - return center; - } else if (clientItfName.startsWith(COMPONENTS_BINDING)) { - return components.get(clientItfName); - } else if (clientItfName.equals(LAYOUT_BINDING)) { - return layout; - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - left = (JComponent)serverItf; - super.add(left, "West"); - validate(); - repaint(); - } if (clientItfName.equals(TOP_COMPONENT_BINDING)) { - top = (JComponent)serverItf; - super.add(top, "North"); - validate(); - repaint(); - } if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - right = (JComponent)serverItf; - super.add(right, "East"); - validate(); - repaint(); - } if (clientItfName.equals(BOTTOM_COMPONENT_BINDING)) { - bottom = (JComponent)serverItf; - super.add(bottom, "South"); - validate(); - repaint(); - } if (clientItfName.equals(CENTER_COMPONENT_BINDING)) { - center = (JComponent)serverItf; - super.add(center, "Center"); - validate(); - repaint(); - } else if (clientItfName.startsWith(COMPONENTS_BINDING)) { - components.put(clientItfName, serverItf); - super.add((java.awt.Component)serverItf); - validate(); - repaint(); - } else if (clientItfName.equals(LAYOUT_BINDING)) { - layout = (java.awt.LayoutManager)serverItf; - super.setLayout(layout); - validate(); - repaint(); - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - super.remove(left); - validate(); - repaint(); - left = null; - } if (clientItfName.equals(TOP_COMPONENT_BINDING)) { - super.remove(top); - validate(); - repaint(); - top = null; - } if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - super.remove(right); - validate(); - repaint(); - right = null; - } if (clientItfName.equals(BOTTOM_COMPONENT_BINDING)) { - super.remove(bottom); - validate(); - repaint(); - bottom = null; - } if (clientItfName.equals(CENTER_COMPONENT_BINDING)) { - super.remove(center); - validate(); - repaint(); - center = null; - } else if (clientItfName.startsWith(COMPONENTS_BINDING)) { - Component c = (Component)components.get(clientItfName); - super.remove(c); - validate(); - repaint(); - } else if (clientItfName.equals(LAYOUT_BINDING)) { - layout = null; - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JPanelItf.java b/fractalswing/src/org/objectweb/fractal/swing/JPanelItf.java deleted file mode 100644 index dda8208331097187aa3f0b866b8c1adf9728258c..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JPanelItf.java +++ /dev/null @@ -1,7 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JPanelItf extends JComponentItf { -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JPanelType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JPanelType.fractal deleted file mode 100644 index ba963ff740e372f5c3bc917599e88dc6719df9d2..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JPanelType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneAttributes.java deleted file mode 100644 index debc6d3cd2ed650ec3f3c2d3ee7b56e0854edb18..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneAttributes.java +++ /dev/null @@ -1,24 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JScrollPaneAttributes extends JComponentAttributes { - void setUI (javax.swing.plaf.ScrollPaneUI arg0); - javax.swing.plaf.ScrollPaneUI getUI (); - int getVerticalScrollBarPolicy (); - void setVerticalScrollBarPolicy (int arg0); - int getHorizontalScrollBarPolicy (); - void setHorizontalScrollBarPolicy (int arg0); - javax.swing.border.Border getViewportBorder (); - void setViewportBorder (javax.swing.border.Border arg0); - javax.swing.JScrollBar getHorizontalScrollBar (); - void setHorizontalScrollBar (javax.swing.JScrollBar arg0); - javax.swing.JScrollBar getVerticalScrollBar (); - void setVerticalScrollBar (javax.swing.JScrollBar arg0); - javax.swing.JViewport getViewport (); - void setViewport (javax.swing.JViewport arg0); - javax.swing.JViewport getRowHeader (); - void setRowHeader (javax.swing.JViewport arg0); - javax.swing.JViewport getColumnHeader (); - void setColumnHeader (javax.swing.JViewport arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneImpl.fractal deleted file mode 100644 index 682de6393ab083d9dfa4a1390635b5c86e4fe7c6..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneImpl.java deleted file mode 100644 index 896ff5ab906bc0b03b1abb6ea47b6e33975e3749..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import javax.swing.JComponent; - -public class JScrollPaneImpl - extends javax.swing.JScrollPane - implements JScrollPaneItf, JScrollPaneAttributes, BindingController -{ - - public final static String VIEW_BINDING = "view"; - private JComponent view; - - public JScrollPaneImpl (java.awt.Component arg0, int arg1, int arg2) { - super(arg0,arg1,arg2); - } - public JScrollPaneImpl (java.awt.Component arg0) { - super(arg0); - } - public JScrollPaneImpl (int arg0, int arg1) { - super(arg0,arg1); - } - public JScrollPaneImpl () { - super(); - } - - public String[] listFc () { - // put your own code here - return new String[] { VIEW_BINDING }; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(VIEW_BINDING)) { - return view; - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.equals(VIEW_BINDING)) { - this.view = (JComponent)serverItf; - setViewportView(view); - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(VIEW_BINDING)) { - this.view = null; - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneItf.java b/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneItf.java deleted file mode 100644 index 5b32abd10c744e17374569ecea13933fe890e1ad..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneItf.java +++ /dev/null @@ -1,32 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JScrollPaneItf extends JComponentItf { - void setUI (javax.swing.plaf.ScrollPaneUI arg0); - javax.swing.plaf.ScrollPaneUI getUI (); - int getVerticalScrollBarPolicy (); - void setVerticalScrollBarPolicy (int arg0); - int getHorizontalScrollBarPolicy (); - void setHorizontalScrollBarPolicy (int arg0); - javax.swing.border.Border getViewportBorder (); - void setViewportBorder (javax.swing.border.Border arg0); - java.awt.Rectangle getViewportBorderBounds (); - javax.swing.JScrollBar createHorizontalScrollBar (); - javax.swing.JScrollBar getHorizontalScrollBar (); - void setHorizontalScrollBar (javax.swing.JScrollBar arg0); - javax.swing.JScrollBar createVerticalScrollBar (); - javax.swing.JScrollBar getVerticalScrollBar (); - void setVerticalScrollBar (javax.swing.JScrollBar arg0); - javax.swing.JViewport getViewport (); - void setViewport (javax.swing.JViewport arg0); - void setViewportView (java.awt.Component arg0); - javax.swing.JViewport getRowHeader (); - void setRowHeader (javax.swing.JViewport arg0); - void setRowHeaderView (java.awt.Component arg0); - javax.swing.JViewport getColumnHeader (); - void setColumnHeader (javax.swing.JViewport arg0); - void setColumnHeaderView (java.awt.Component arg0); - java.awt.Component getCorner (java.lang.String arg0); - void setCorner (java.lang.String arg0, java.awt.Component arg1); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneType.fractal deleted file mode 100644 index 7307984e041412d72887d5594654861ce4c0a00d..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JScrollPaneType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JSeparatorImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JSeparatorImpl.java deleted file mode 100644 index f1b9d9bc7c336510864c0887419d66078346da9d..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JSeparatorImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * copyright area - */ - -package org.objectweb.fractal.swing; - -import java.beans.PropertyChangeListener; -import java.awt.event.ActionEvent; - -public class JSeparatorImpl implements JSeparatorItf { - - public Object getValue (String key) { - return null; - } - - public void putValue (String key, Object value) { - } - - public void setEnabled (boolean b) { - } - - public boolean isEnabled () { - return false; - } - - public void addPropertyChangeListener (PropertyChangeListener listener) { - } - - public void removePropertyChangeListener (PropertyChangeListener listener) { - } - - public void actionPerformed (ActionEvent e) { - } -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JSeparatorItf.java b/fractalswing/src/org/objectweb/fractal/swing/JSeparatorItf.java deleted file mode 100644 index 63d40529bc5bffa5eebf68ff85219355a59618ce..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JSeparatorItf.java +++ /dev/null @@ -1,11 +0,0 @@ -/** - * copyright area - */ - -package org.objectweb.fractal.swing; - -import javax.swing.Action; - -public interface JSeparatorItf extends Action { - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneAttributes.java deleted file mode 100644 index 0c3db1e0c468ab0fa6fb0d8ce53d0df8ea2955c8..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneAttributes.java +++ /dev/null @@ -1,31 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JSplitPaneAttributes extends JComponentAttributes { - int getOrientation (); - void setUI (javax.swing.plaf.SplitPaneUI arg0); - javax.swing.plaf.SplitPaneUI getUI (); - void setDividerSize (int arg0); - int getDividerSize (); - void setLeftComponent (java.awt.Component arg0); - java.awt.Component getLeftComponent (); - void setTopComponent (java.awt.Component arg0); - java.awt.Component getTopComponent (); - void setRightComponent (java.awt.Component arg0); - java.awt.Component getRightComponent (); - void setBottomComponent (java.awt.Component arg0); - java.awt.Component getBottomComponent (); - void setLastDividerLocation (int arg0); - int getLastDividerLocation (); - void setOrientation (int arg0); - void setResizeWeight (double arg0); - double getResizeWeight (); - void setDividerLocation (int arg0); - int getDividerLocation (); - - // manually added - boolean getOneTouchExpandable (); - void setOneTouchExpandable (boolean arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneImpl.fractal deleted file mode 100644 index 49a4ea35ab88d1e4bc31d167311a12cb63044a0d..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneImpl.java deleted file mode 100644 index 3574d5da212549cc11969585f46244f1c36a596c..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneImpl.java +++ /dev/null @@ -1,73 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -public class JSplitPaneImpl - extends javax.swing.JSplitPane - implements JSplitPaneItf, JSplitPaneAttributes, BindingController -{ - - // fields manually added - public final static String LEFT_COMPONENT_BINDING = "left-component"; - public final static String RIGHT_COMPONENT_BINDING = "right-component"; - - public JSplitPaneImpl () { - super(); - } - public JSplitPaneImpl (int arg0) { - super(arg0); - } - public JSplitPaneImpl (int arg0, boolean arg1) { - super(arg0,arg1); - } - public JSplitPaneImpl (int arg0, java.awt.Component arg1, java.awt.Component arg2) { - super(arg0,arg1,arg2); - } - public JSplitPaneImpl (int arg0, boolean arg1, java.awt.Component arg2, java.awt.Component arg3) { - super(arg0,arg1,arg2,arg3); - } - - public String[] listFc () { - // put your own code here - return new String[] { - LEFT_COMPONENT_BINDING, - RIGHT_COMPONENT_BINDING - }; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - return super.getLeftComponent(); - } else if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - return super.getRightComponent(); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - super.setLeftComponent((java.awt.Component)serverItf); - } else if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - super.setRightComponent((java.awt.Component)serverItf); - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(LEFT_COMPONENT_BINDING)) { - super.setLeftComponent(null); - } else if (clientItfName.equals(RIGHT_COMPONENT_BINDING)) { - super.setRightComponent(null); - } - } - - // manually added - public boolean getOneTouchExpandable () { - return isOneTouchExpandable(); - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneItf.java b/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneItf.java deleted file mode 100644 index 1f4c06461f00af2bdd1d725335ef82d357f70e2b..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneItf.java +++ /dev/null @@ -1,35 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JSplitPaneItf extends JComponentItf { - int getOrientation (); - void setUI (javax.swing.plaf.SplitPaneUI arg0); - javax.swing.plaf.SplitPaneUI getUI (); - void setDividerSize (int arg0); - int getDividerSize (); - void setLeftComponent (java.awt.Component arg0); - java.awt.Component getLeftComponent (); - void setTopComponent (java.awt.Component arg0); - java.awt.Component getTopComponent (); - void setRightComponent (java.awt.Component arg0); - java.awt.Component getRightComponent (); - void setBottomComponent (java.awt.Component arg0); - java.awt.Component getBottomComponent (); - void setOneTouchExpandable (boolean arg0); - boolean isOneTouchExpandable (); - void setLastDividerLocation (int arg0); - int getLastDividerLocation (); - void setOrientation (int arg0); - void setContinuousLayout (boolean arg0); - boolean isContinuousLayout (); - void setResizeWeight (double arg0); - double getResizeWeight (); - void resetToPreferredSizes (); - void setDividerLocation (double arg0); - void setDividerLocation (int arg0); - int getDividerLocation (); - int getMinimumDividerLocation (); - int getMaximumDividerLocation (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneType.fractal deleted file mode 100644 index a427e9b21dd627a5d591e9ecd00a4bde8b8276f0..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JSplitPaneType.fractal +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneAttributes.java deleted file mode 100644 index 5794a2eb24b26cfbd6a31704e51c8b6993cb1673..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneAttributes.java +++ /dev/null @@ -1,16 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JTabbedPaneAttributes extends JComponentAttributes { - void setUI (javax.swing.plaf.TabbedPaneUI arg0); - javax.swing.plaf.TabbedPaneUI getUI (); - javax.swing.SingleSelectionModel getModel (); - void setModel (javax.swing.SingleSelectionModel arg0); - int getTabPlacement (); - void setTabPlacement (int arg0); - int getSelectedIndex (); - void setSelectedIndex (int arg0); - java.awt.Component getSelectedComponent (); - void setSelectedComponent (java.awt.Component arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneImpl.fractal deleted file mode 100644 index 43b8c54e60fc1502c0c6ef83d0555874ed56ac19..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneImpl.java deleted file mode 100644 index b867b38004e9399cddca8562a0ebe67237952e38..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.Map; -import java.util.TreeMap; -import java.util.Iterator; - -import javax.swing.JComponent; - -public class JTabbedPaneImpl - extends javax.swing.JTabbedPane - implements JTabbedPaneItf, JTabbedPaneAttributes, BindingController -{ - - // fields manually added - public final static String TABS_BINDING = "tabs"; - private Map tabs = new TreeMap(); - - public JTabbedPaneImpl () { - super(); - } - public JTabbedPaneImpl (int arg0) { - super(arg0); - } - - public String[] listFc () { - // put your own code here - return (String[])tabs.keySet().toArray(new String[tabs.size()]); - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(TABS_BINDING)) { - return tabs.get(clientItfName); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.startsWith(TABS_BINDING)) { - tabs.put(clientItfName, serverItf); - Iterator i = tabs.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry e = (Map.Entry)i.next(); - remove((java.awt.Component)e.getValue()); - } - i = tabs.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry e = (Map.Entry)i.next(); - JComponent comp = (JComponent)e.getValue(); - addTab(comp.getName(), comp); - } - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(TABS_BINDING)) { - Object tab = tabs.remove(clientItfName); - remove((java.awt.Component)tab); - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneItf.java b/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneItf.java deleted file mode 100644 index 522ec98808e2bd0ca8bb134c633e918aeb722736..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneItf.java +++ /dev/null @@ -1,45 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - -public interface JTabbedPaneItf extends JComponentItf { - java.awt.Component getComponentAt (int arg0); - void setUI (javax.swing.plaf.TabbedPaneUI arg0); - javax.swing.plaf.TabbedPaneUI getUI (); - void addChangeListener (javax.swing.event.ChangeListener arg0); - void removeChangeListener (javax.swing.event.ChangeListener arg0); - javax.swing.SingleSelectionModel getModel (); - void setModel (javax.swing.SingleSelectionModel arg0); - int getTabPlacement (); - void setTabPlacement (int arg0); - int getSelectedIndex (); - void setSelectedIndex (int arg0); - java.awt.Component getSelectedComponent (); - void setSelectedComponent (java.awt.Component arg0); - void insertTab (java.lang.String arg0, javax.swing.Icon arg1, java.awt.Component arg2, java.lang.String arg3, int arg4); - void addTab (java.lang.String arg0, javax.swing.Icon arg1, java.awt.Component arg2, java.lang.String arg3); - void addTab (java.lang.String arg0, javax.swing.Icon arg1, java.awt.Component arg2); - void addTab (java.lang.String arg0, java.awt.Component arg1); - void removeTabAt (int arg0); - int getTabCount (); - int getTabRunCount (); - java.lang.String getTitleAt (int arg0); - javax.swing.Icon getIconAt (int arg0); - javax.swing.Icon getDisabledIconAt (int arg0); - java.lang.String getToolTipTextAt (int arg0); - java.awt.Color getBackgroundAt (int arg0); - java.awt.Color getForegroundAt (int arg0); - boolean isEnabledAt (int arg0); - java.awt.Rectangle getBoundsAt (int arg0); - void setTitleAt (int arg0, java.lang.String arg1); - void setIconAt (int arg0, javax.swing.Icon arg1); - void setDisabledIconAt (int arg0, javax.swing.Icon arg1); - void setToolTipTextAt (int arg0, java.lang.String arg1); - void setBackgroundAt (int arg0, java.awt.Color arg1); - void setForegroundAt (int arg0, java.awt.Color arg1); - void setEnabledAt (int arg0, boolean arg1); - void setComponentAt (int arg0, java.awt.Component arg1); - int indexOfTab (java.lang.String arg0); - int indexOfTab (javax.swing.Icon arg0); - int indexOfComponent (java.awt.Component arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneType.fractal deleted file mode 100644 index 3d109104c016f8c52305d56bd75b67ce771bf6fd..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTabbedPaneType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JToolBarAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JToolBarAttributes.java deleted file mode 100644 index f8ea38cc1349fd92d1c47e6dac6a19a6278ef1b3..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JToolBarAttributes.java +++ /dev/null @@ -1,13 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JToolBarAttributes extends JComponentAttributes { - int getOrientation (); - void setUI (javax.swing.plaf.ToolBarUI arg0); - javax.swing.plaf.ToolBarUI getUI (); - void setOrientation (int arg0); - void setMargin (java.awt.Insets arg0); - java.awt.Insets getMargin (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JToolBarImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JToolBarImpl.fractal deleted file mode 100644 index fb477a8706d64abb3502a3bf446bd56f4345cf2b..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JToolBarImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JToolBarImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JToolBarImpl.java deleted file mode 100644 index 5222272e20ce19d50d0eb59174ef46992b03b4e8..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JToolBarImpl.java +++ /dev/null @@ -1,79 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.Map; -import java.util.HashMap; -import java.util.TreeMap; -import java.util.Iterator; - -import javax.swing.Action; -import javax.swing.JComponent; - -public class JToolBarImpl - extends javax.swing.JToolBar - implements JToolBarItf, JToolBarAttributes, BindingController -{ - - // fields manually added - public final static String ACTIONS_BINDING = "actions"; - private Map actions = new TreeMap(); - private Map components = new HashMap(); - - public JToolBarImpl () { - super(); - } - public JToolBarImpl (int arg0) { - super(arg0); - } - public JToolBarImpl (String arg0) { - super(arg0); - } - public JToolBarImpl (String arg0, int arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - return (String[])actions.keySet().toArray(new String[actions.size()]); - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(ACTIONS_BINDING)) { - return actions.get(clientItfName); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.startsWith(ACTIONS_BINDING)) { - removeAll(); - actions.put(clientItfName, serverItf); - Iterator i = actions.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry e = (Map.Entry)i.next(); - Object o = e.getValue(); - if (o instanceof JSeparatorItf) { - addSeparator(); - } else if (o instanceof JComponent) { - add((JComponent)o); - } else { - add((Action)o); - } - components.put((String)e.getKey(), getComponent(getComponentCount()-1)); - } - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.startsWith(ACTIONS_BINDING)) { - actions.remove(clientItfName); - remove((java.awt.Component)components.remove(clientItfName)); - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JToolBarItf.java b/fractalswing/src/org/objectweb/fractal/swing/JToolBarItf.java deleted file mode 100644 index 74b23234a06c0c0b3a3c1a52405bfb16a667c6bd..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JToolBarItf.java +++ /dev/null @@ -1,22 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JToolBarItf extends JComponentItf { - javax.swing.JButton add (javax.swing.Action arg0); - int getOrientation (); - void addSeparator (); - void addSeparator (java.awt.Dimension arg0); - void setUI (javax.swing.plaf.ToolBarUI arg0); - javax.swing.plaf.ToolBarUI getUI (); - void setOrientation (int arg0); - int getComponentIndex (java.awt.Component arg0); - java.awt.Component getComponentAtIndex (int arg0); - void setMargin (java.awt.Insets arg0); - java.awt.Insets getMargin (); - boolean isBorderPainted (); - void setBorderPainted (boolean arg0); - boolean isFloatable (); - void setFloatable (boolean arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JToolBarType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JToolBarType.fractal deleted file mode 100644 index 7bb97f2e61dbb38ab1fb2537b539927f052870e1..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JToolBarType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTreeAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/JTreeAttributes.java deleted file mode 100644 index b3403a79dd093a6ad93119714b2a1301f2f3e8e0..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTreeAttributes.java +++ /dev/null @@ -1,41 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JTreeAttributes extends JComponentAttributes { - void setUI (javax.swing.plaf.TreeUI arg0); - javax.swing.plaf.TreeUI getUI (); - void setModel (javax.swing.tree.TreeModel arg0); - javax.swing.tree.TreeModel getModel (); - javax.swing.tree.TreeCellRenderer getCellRenderer (); - void setCellRenderer (javax.swing.tree.TreeCellRenderer arg0); - void setCellEditor (javax.swing.tree.TreeCellEditor arg0); - javax.swing.tree.TreeCellEditor getCellEditor (); - void setShowsRootHandles (boolean arg0); - boolean getShowsRootHandles (); - void setRowHeight (int arg0); - int getRowHeight (); - void setInvokesStopCellEditing (boolean arg0); - boolean getInvokesStopCellEditing (); - void setScrollsOnExpand (boolean arg0); - boolean getScrollsOnExpand (); - void setToggleClickCount (int arg0); - int getToggleClickCount (); - void setExpandsSelectedPaths (boolean arg0); - boolean getExpandsSelectedPaths (); - void setSelectionPath (javax.swing.tree.TreePath arg0); - void setSelectionPaths (javax.swing.tree.TreePath[] arg0); - void setLeadSelectionPath (javax.swing.tree.TreePath arg0); - void setAnchorSelectionPath (javax.swing.tree.TreePath arg0); - void setSelectionRows (int[] arg0); - javax.swing.tree.TreePath getLeadSelectionPath (); - javax.swing.tree.TreePath getAnchorSelectionPath (); - javax.swing.tree.TreePath getSelectionPath (); - javax.swing.tree.TreePath[] getSelectionPaths (); - int[] getSelectionRows (); - void setSelectionModel (javax.swing.tree.TreeSelectionModel arg0); - javax.swing.tree.TreeSelectionModel getSelectionModel (); - void setVisibleRowCount (int arg0); - int getVisibleRowCount (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTreeImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/JTreeImpl.fractal deleted file mode 100644 index 6b519256ab9cdac66445333ec55ed6988b7ca02f..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTreeImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTreeImpl.java b/fractalswing/src/org/objectweb/fractal/swing/JTreeImpl.java deleted file mode 100644 index 71986fd6549953ff929ca7aa5b561fa80045bb33..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTreeImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -import javax.swing.tree.TreeModel; -import javax.swing.tree.TreeSelectionModel; -import javax.swing.tree.TreeCellRenderer; - -public class JTreeImpl - extends javax.swing.JTree - implements JTreeItf, JTreeAttributes, BindingController -{ - - // fields manually added - public final static String TREE_MODEL_BINDING = "tree-model"; - public final static String TREE_SELECTION_MODEL_BINDING = "tree-selection-model"; - public final static String TREE_CELL_RENDERER_BINDING = "tree-cell-renderer"; - - public JTreeImpl () { - super(); - } - public JTreeImpl (Object[] arg0) { - super(arg0); - } - public JTreeImpl (java.util.Vector arg0) { - super(arg0); - } - public JTreeImpl (java.util.Hashtable arg0) { - super(arg0); - } - public JTreeImpl (javax.swing.tree.TreeNode arg0) { - super(arg0); - } - public JTreeImpl (javax.swing.tree.TreeNode arg0, boolean arg1) { - super(arg0,arg1); - } - public JTreeImpl (javax.swing.tree.TreeModel arg0) { - super(arg0); - } - - public String[] listFc () { - // put your own code here - return new String[] { - TREE_MODEL_BINDING, - TREE_SELECTION_MODEL_BINDING, - TREE_CELL_RENDERER_BINDING - }; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(TREE_MODEL_BINDING)) { - return getModel(); - } else if (clientItfName.equals(TREE_SELECTION_MODEL_BINDING)) { - return getSelectionModel(); - } else if (clientItfName.equals(TREE_CELL_RENDERER_BINDING)) { - return getCellRenderer(); - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - if (clientItfName.equals(TREE_MODEL_BINDING)) { - setModel((TreeModel)serverItf); - } else if (clientItfName.equals(TREE_SELECTION_MODEL_BINDING)) { - setSelectionModel((TreeSelectionModel)serverItf); - } else if (clientItfName.equals(TREE_CELL_RENDERER_BINDING)) { - setCellRenderer((TreeCellRenderer)serverItf); - } - } - - public void unbindFc (String clientItfName) { - // put your own code here - if (clientItfName.equals(TREE_MODEL_BINDING)) { - setModel(null); - } else if (clientItfName.equals(TREE_SELECTION_MODEL_BINDING)) { - setSelectionModel(null); - } else if (clientItfName.equals(TREE_CELL_RENDERER_BINDING)) { - setCellRenderer(null); - } - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTreeItf.java b/fractalswing/src/org/objectweb/fractal/swing/JTreeItf.java deleted file mode 100644 index b93a8a85ddb7713bfc100cf1ec5eb24c8a6fd3b7..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTreeItf.java +++ /dev/null @@ -1,115 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface JTreeItf extends JComponentItf { - boolean isVisible (javax.swing.tree.TreePath arg0); - void setUI (javax.swing.plaf.TreeUI arg0); - javax.swing.plaf.TreeUI getUI (); - void setModel (javax.swing.tree.TreeModel arg0); - javax.swing.tree.TreeModel getModel (); - javax.swing.tree.TreeCellRenderer getCellRenderer (); - void setCellRenderer (javax.swing.tree.TreeCellRenderer arg0); - void setEditable (boolean arg0); - boolean isEditable (); - void setCellEditor (javax.swing.tree.TreeCellEditor arg0); - javax.swing.tree.TreeCellEditor getCellEditor (); - boolean isRootVisible (); - void setRootVisible (boolean arg0); - void setShowsRootHandles (boolean arg0); - boolean getShowsRootHandles (); - void setRowHeight (int arg0); - int getRowHeight (); - boolean isFixedRowHeight (); - void setLargeModel (boolean arg0); - boolean isLargeModel (); - void setInvokesStopCellEditing (boolean arg0); - boolean getInvokesStopCellEditing (); - void setScrollsOnExpand (boolean arg0); - boolean getScrollsOnExpand (); - void setToggleClickCount (int arg0); - int getToggleClickCount (); - void setExpandsSelectedPaths (boolean arg0); - boolean getExpandsSelectedPaths (); - boolean isPathEditable (javax.swing.tree.TreePath arg0); - String convertValueToText (Object arg0, boolean arg1, boolean arg2, boolean arg3, int arg4, boolean arg5); - int getRowCount (); - void setSelectionPath (javax.swing.tree.TreePath arg0); - void setSelectionPaths (javax.swing.tree.TreePath[] arg0); - void setLeadSelectionPath (javax.swing.tree.TreePath arg0); - void setAnchorSelectionPath (javax.swing.tree.TreePath arg0); - void setSelectionRow (int arg0); - void setSelectionRows (int[] arg0); - void addSelectionPath (javax.swing.tree.TreePath arg0); - void addSelectionPaths (javax.swing.tree.TreePath[] arg0); - void addSelectionRow (int arg0); - void addSelectionRows (int[] arg0); - Object getLastSelectedPathComponent (); - javax.swing.tree.TreePath getLeadSelectionPath (); - javax.swing.tree.TreePath getAnchorSelectionPath (); - javax.swing.tree.TreePath getSelectionPath (); - javax.swing.tree.TreePath[] getSelectionPaths (); - int[] getSelectionRows (); - int getSelectionCount (); - int getMinSelectionRow (); - int getMaxSelectionRow (); - int getLeadSelectionRow (); - boolean isPathSelected (javax.swing.tree.TreePath arg0); - boolean isRowSelected (int arg0); - java.util.Enumeration getExpandedDescendants (javax.swing.tree.TreePath arg0); - boolean hasBeenExpanded (javax.swing.tree.TreePath arg0); - boolean isExpanded (javax.swing.tree.TreePath arg0); - boolean isExpanded (int arg0); - boolean isCollapsed (javax.swing.tree.TreePath arg0); - boolean isCollapsed (int arg0); - void makeVisible (javax.swing.tree.TreePath arg0); - java.awt.Rectangle getPathBounds (javax.swing.tree.TreePath arg0); - java.awt.Rectangle getRowBounds (int arg0); - void scrollPathToVisible (javax.swing.tree.TreePath arg0); - void scrollRowToVisible (int arg0); - javax.swing.tree.TreePath getPathForRow (int arg0); - int getRowForPath (javax.swing.tree.TreePath arg0); - void expandPath (javax.swing.tree.TreePath arg0); - void expandRow (int arg0); - void collapsePath (javax.swing.tree.TreePath arg0); - void collapseRow (int arg0); - javax.swing.tree.TreePath getPathForLocation (int arg0, int arg1); - int getRowForLocation (int arg0, int arg1); - javax.swing.tree.TreePath getClosestPathForLocation (int arg0, int arg1); - int getClosestRowForLocation (int arg0, int arg1); - boolean isEditing (); - boolean stopEditing (); - void cancelEditing (); - void startEditingAtPath (javax.swing.tree.TreePath arg0); - javax.swing.tree.TreePath getEditingPath (); - void setSelectionModel (javax.swing.tree.TreeSelectionModel arg0); - javax.swing.tree.TreeSelectionModel getSelectionModel (); - void setSelectionInterval (int arg0, int arg1); - void addSelectionInterval (int arg0, int arg1); - void removeSelectionInterval (int arg0, int arg1); - void removeSelectionPath (javax.swing.tree.TreePath arg0); - void removeSelectionPaths (javax.swing.tree.TreePath[] arg0); - void removeSelectionRow (int arg0); - void removeSelectionRows (int[] arg0); - void clearSelection (); - boolean isSelectionEmpty (); - void addTreeExpansionListener (javax.swing.event.TreeExpansionListener arg0); - void removeTreeExpansionListener (javax.swing.event.TreeExpansionListener arg0); - void addTreeWillExpandListener (javax.swing.event.TreeWillExpandListener arg0); - void removeTreeWillExpandListener (javax.swing.event.TreeWillExpandListener arg0); - void fireTreeExpanded (javax.swing.tree.TreePath arg0); - void fireTreeCollapsed (javax.swing.tree.TreePath arg0); - void fireTreeWillExpand (javax.swing.tree.TreePath arg0) throws javax.swing.tree.ExpandVetoException; - void fireTreeWillCollapse (javax.swing.tree.TreePath arg0) throws javax.swing.tree.ExpandVetoException; - void addTreeSelectionListener (javax.swing.event.TreeSelectionListener arg0); - void removeTreeSelectionListener (javax.swing.event.TreeSelectionListener arg0); - void treeDidChange (); - void setVisibleRowCount (int arg0); - int getVisibleRowCount (); - java.awt.Dimension getPreferredScrollableViewportSize (); - int getScrollableUnitIncrement (java.awt.Rectangle arg0, int arg1, int arg2); - int getScrollableBlockIncrement (java.awt.Rectangle arg0, int arg1, int arg2); - boolean getScrollableTracksViewportWidth (); - boolean getScrollableTracksViewportHeight (); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/JTreeType.fractal b/fractalswing/src/org/objectweb/fractal/swing/JTreeType.fractal deleted file mode 100644 index d78785b6928bf8cd3aa3c27a9407d1f6f637fef5..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/JTreeType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/WaitGlassPane.java b/fractalswing/src/org/objectweb/fractal/swing/WaitGlassPane.java deleted file mode 100644 index 6e8220a86ab7fdfb2f427e86ba3b41d83ba5a7af..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/WaitGlassPane.java +++ /dev/null @@ -1,22 +0,0 @@ -/** - * copyright area - */ - -package org.objectweb.fractal.swing; - -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.Cursor; - -import javax.swing.JComponent; - -public class WaitGlassPane extends JComponent { - - public WaitGlassPane () { - addMouseListener(new MouseAdapter() { - public void mouseEntered (MouseEvent e) { - setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); - } - }); - } -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/WindowAttributes.java b/fractalswing/src/org/objectweb/fractal/swing/WindowAttributes.java deleted file mode 100644 index 5c317621d97a86c216ff2894e2a78b44c26305e2..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/WindowAttributes.java +++ /dev/null @@ -1,7 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface WindowAttributes extends ContainerAttributes { -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/WindowImpl.fractal b/fractalswing/src/org/objectweb/fractal/swing/WindowImpl.fractal deleted file mode 100644 index 408466dde322bb6f5185fdf6259237803c5fae00..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/WindowImpl.fractal +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/WindowImpl.java b/fractalswing/src/org/objectweb/fractal/swing/WindowImpl.java deleted file mode 100644 index cfdfbeaffd08612c530fa5391e9d07780b70af8c..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/WindowImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// skeleton class automatically generated - -package org.objectweb.fractal.swing; - -import org.objectweb.fractal.api.control.BindingController; - -public class WindowImpl - extends java.awt.Window - implements WindowItf, WindowAttributes, BindingController -{ - - public WindowImpl (java.awt.Frame arg0) { - super(arg0); - } - public WindowImpl (java.awt.Window arg0) { - super(arg0); - } - public WindowImpl (java.awt.Window arg0, java.awt.GraphicsConfiguration arg1) { - super(arg0,arg1); - } - - public String[] listFc () { - // put your own code here - return new String[0]; - } - - public Object lookupFc (String clientItfName) { - // put your own code here - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - // put your own code here - } - - public void unbindFc (String clientItfName) { - // put your own code here - } - -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/WindowItf.java b/fractalswing/src/org/objectweb/fractal/swing/WindowItf.java deleted file mode 100644 index 031ee4d33869269982f203ce4b9c6acb1b75e987..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/WindowItf.java +++ /dev/null @@ -1,18 +0,0 @@ -// automatically generated - -package org.objectweb.fractal.swing; - - -public interface WindowItf extends ContainerItf { - void dispose (); - java.awt.Component getFocusOwner (); - void pack (); - void toFront (); - void toBack (); - java.awt.Window getOwner (); - java.awt.Window[] getOwnedWindows (); - void addWindowListener (java.awt.event.WindowListener arg0); - void removeWindowListener (java.awt.event.WindowListener arg0); - void applyResourceBundle (java.util.ResourceBundle arg0); - void applyResourceBundle (String arg0); -} diff --git a/fractalswing/src/org/objectweb/fractal/swing/WindowType.fractal b/fractalswing/src/org/objectweb/fractal/swing/WindowType.fractal deleted file mode 100644 index 25aadff2a96b2524d12af9ab1f8073b0a1395bbd..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/WindowType.fractal +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/fractalswing/src/org/objectweb/fractal/swing/package.html b/fractalswing/src/org/objectweb/fractal/swing/package.html deleted file mode 100644 index d4650a566925334d4312fe0f15c666f6c7517f27..0000000000000000000000000000000000000000 --- a/fractalswing/src/org/objectweb/fractal/swing/package.html +++ /dev/null @@ -1,4 +0,0 @@ - -Provides Fractal Swing components. -@since Fractal 1.1 - \ No newline at end of file diff --git a/fractalswing/tools/SwingComponentGenerator.java b/fractalswing/tools/SwingComponentGenerator.java deleted file mode 100644 index ce88a744e52adb71b12676a3f90b13697e3a2c00..0000000000000000000000000000000000000000 --- a/fractalswing/tools/SwingComponentGenerator.java +++ /dev/null @@ -1,328 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -import java.lang.reflect.*; -import java.io.*; - -public class SwingComponentGenerator { - - private static PrintStream out = System.out; - private static String packageName; - - public static void main (String[] args) throws Exception { - packageName = args[0]; - for (int i = 1; i < args.length; ++i) { - Class c = Class.forName(args[i]); - out = new PrintStream( - new FileOutputStream("generated/"+getName(c)+"Itf.java")); - generateInterface(c); - out.close(); - out = new PrintStream( - new FileOutputStream("generated/"+getName(c)+".fractal")); - generateTypeDescriptor(c); - if (!Modifier.isAbstract(c.getModifiers())) { - out.println(); - generateTemplateDescriptor(c); - } - out.close(); - out = new PrintStream( - new FileOutputStream("generated/"+getName(c)+"Attributes.java")); - generateAttributes(c); - out.close(); - if (!Modifier.isAbstract(c.getModifiers())) { - out = new PrintStream( - new FileOutputStream("generated/"+getName(c)+"Impl.java")); - generateImplementation(c); - out.close(); - } - } - } - - private static void generateInterface (Class c) { - String name = getName(c); - out.println("// automatically generated"); - out.println(); - out.println("package "+packageName+";\n"); - out.print("public interface " + name + "Itf "); - if (c.getSuperclass().equals(Object.class)) { - out.println("{"); - } else { - out.println("extends " + getName(c.getSuperclass()) + "Itf {"); - } - Method[] methods = c.getDeclaredMethods(); - Class d = c.getSuperclass(); - for (int i = 0; i < methods.length; ++i) { - if (Modifier.isPublic(methods[i].getModifiers())) { - if (!Modifier.isFinal(methods[i].getModifiers())) { - if (!Modifier.isStatic(methods[i].getModifiers())) { - try { - d.getMethod(methods[i].getName(),methods[i].getParameterTypes()); - } catch (NoSuchMethodException e) { - generateMethodHeader(methods[i]); - out.println(";"); - } - } - } - } - } - out.println("}"); - } - - private static void generateTypeDescriptor (Class c) { - String name = getName(c); - String fullName = packageName + "." + name; - out.println("\n"); - out.print(""); - } else { - String superFullName = packageName + "." + getName(c.getSuperclass()); - out.println(" extends=\"" + superFullName + "Type\">"); - } - out.println(" "); - out.println(" "); - out.println(""); - } - - private static void generateTemplateDescriptor (Class c) { - String name = getName(c); - String fullName = packageName + "." + name; - out.println("\n"); - out.print(""); - out.println(" "); - out.println(" "); - out.println(" "); - out.println(" "); - out.println(" "); - out.println(" "); - out.println(""); - } - - private static void generateAttributes (Class c) { - String name = getName(c); - out.println("// automatically generated"); - out.println(); - out.println("package "+packageName+";\n"); - out.print("public interface " + name + "Attributes "); - if (c.getSuperclass().equals(Object.class)) { - out.println("extends org.objectweb.fractal.api.control.AttributeController {"); - } else { - out.println("extends " + getName(c.getSuperclass()) + "Attributes {"); - } - Method[] methods = c.getDeclaredMethods(); - //Class d = c.getSuperclass(); - for (int i = 0; i < methods.length; ++i) { - String mname = methods[i].getName(); - Class type; - if ((mname.startsWith("get") || mname.startsWith("set")) - && Modifier.isPublic(methods[i].getModifiers()) - && !Modifier.isFinal(methods[i].getModifiers()) - && !Modifier.isStatic(methods[i].getModifiers())) - { - type = null; - if (mname.startsWith("get")) { - if (methods[i].getParameterTypes().length != 0) { - continue; - } - type = methods[i].getReturnType(); - } - if (mname.startsWith("set")) { - if (methods[i].getReturnType() != Void.TYPE || - methods[i].getParameterTypes().length != 1) - { - continue; - } - type = methods[i].getParameterTypes()[0]; - } - mname = (mname.charAt(0) == 'g' ? 's' : 'g') + mname.substring(1); - boolean ok = false; - for (int j = 0; j < methods.length; ++j) { - if (methods[j].getName().equals(mname)) { - if (Modifier.isPublic(methods[j].getModifiers())) { - if (!Modifier.isFinal(methods[j].getModifiers())) { - if (!Modifier.isStatic(methods[j].getModifiers())) { - Class otherType = null; - if (mname.charAt(0) == 'g') { - if (methods[j].getParameterTypes().length == 0) { - otherType = methods[j].getReturnType(); - } - } else if (methods[j].getParameterTypes().length == 1 && methods[j].getReturnType() == Void.TYPE) { - otherType = methods[j].getParameterTypes()[0]; - } - if (type == otherType) { - ok = true; - break; - } - } - } - } - } - } - if (ok && Modifier.isPublic(methods[i].getModifiers())) { - if (!Modifier.isFinal(methods[i].getModifiers())) { - if (!Modifier.isStatic(methods[i].getModifiers())) { - /*try { - d.getMethod(methods[i].getName(),methods[i].getParameterTypes()); - } catch (NoSuchMethodException e) {*/ - generateMethodHeader(methods[i]); - out.println(";"); - //} - } - } - } - } - } - out.println("}"); - } - - private static void generateImplementation (Class c) { - String name = getName(c); - out.println("// skeleton class automatically generated"); - out.println(); - out.println("package "+packageName+";\n"); - out.println("import org.objectweb.fractal.api.control.BindingController;\n"); - out.println("public class " + name + "Impl"); - out.println(" extends " + c.getName()); - out.print(" implements " + name + "Itf, " + name); - out.println("Attributes, BindingController"); - out.println("{\n"); - Constructor[] cons = c.getConstructors(); - for (int i = 0; i < cons.length; ++i) { - generateConstructor(cons[i]); - } - out.println(); - out.println(" public String listFc () {"); - out.println(" // put your own code here"); - out.println(" return new String[0];"); - out.println(" }\n"); - out.println(" public Object lookupFc (String clientItfName) {"); - out.println(" // put your own code here"); - out.println(" return null;"); - out.println(" }\n"); - out.println(" public void bindFc (String clientItfName, Object serverItf) {"); - out.println(" // put your own code here"); - out.println(" }\n"); - out.println(" public void unbindFc (String clientItfName) {"); - out.println(" // put your own code here"); - out.println(" }\n"); - out.println("}"); - } - - private static void generateMethodHeader (Method m) { - out.print(" "); - generateType(m.getReturnType()); - out.print(" "); - out.print(m.getName()); - out.print(" ("); - generateFormals(m.getParameterTypes()); - generateExceptions(m.getExceptionTypes()); - } - - private static void generateConstructor (Constructor c) { - out.print(" public "); - out.print(getName(c.getDeclaringClass()) + "Impl"); - out.print(" ("); - generateFormals(c.getParameterTypes()); - generateExceptions(c.getExceptionTypes()); - out.println(" {"); - out.print(" super("); - generateActuals(c.getParameterTypes()); - out.println(");"); - out.println(" }"); - } - - private static void generateFormals (Class[] formals) { - for (int i = 0; i < formals.length; ++i) { - generateType(formals[i]); - out.print(" arg" + i); - if (i < formals.length - 1) { - out.print(", "); - } - } - out.print(")"); - } - - private static void generateActuals (Class[] actuals) { - for (int i = 0; i < actuals.length; ++i) { - out.print("arg" + i); - if (i < actuals.length - 1) { - out.print(","); - } - } - } - - private static void generateExceptions (Class[] exceptions) { - if (exceptions.length > 0) { - out.print(" throws "); - for (int i = 0; i < exceptions.length; ++i) { - generateType(exceptions[i]); - if (i < exceptions.length - 1) { - out.print(", "); - } - } - } - } - - private static void generateType (Class c) { - if (c.isArray()) { - generateType(c.getComponentType()); - out.print("[]"); - } else if (c.isPrimitive()) { - if (c.equals(Boolean.TYPE)) { - out.print("boolean"); - } else if (c.equals(Character.TYPE)) { - out.print("char"); - } else if (c.equals(Byte.TYPE)) { - out.print("byte"); - } else if (c.equals(Short.TYPE)) { - out.print("short"); - } else if (c.equals(Integer.TYPE)) { - out.print("int"); - } else if (c.equals(Long.TYPE)) { - out.print("long"); - } else if (c.equals(Float.TYPE)) { - out.print("float"); - } else if (c.equals(Double.TYPE)) { - out.print("double"); - } else if (c.equals(Void.TYPE)) { - out.print("void"); - } - } else { - out.print(c.getName()); - } - } - - private static String getName (Class c) { - String name = c.getName(); - if (name.lastIndexOf('.') > 0) { - name = name.substring(name.lastIndexOf('.') + 1); - } - return name; - } -} diff --git a/fractalswing/tools/build.xml b/fractalswing/tools/build.xml deleted file mode 100644 index e119d78081b5011302a07ef47be657f1fe2644e7..0000000000000000000000000000000000000000 --- a/fractalswing/tools/build.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/README.txt b/julia/README.txt deleted file mode 100644 index e2338b0f6f242af515583694eb101ee2ff749c44..0000000000000000000000000000000000000000 --- a/julia/README.txt +++ /dev/null @@ -1,17 +0,0 @@ -This directory is the base directory of the product. -It contains(*) the following items: - -- archive: ant files to build the jar(s) of the product, -- build.properties: properties to configure the build process, -- build.xml: main ant file to build the product, -- config: external libraries required only for building the product, -- doc: documentation of the product, -- etc: scripts to run the product, -- examples: examples of use of the product, -- externals: external libraires required for running the product, -- jdoc: ant files to build the javadoc documentation(s) of the product, -- sr': sources of the product, -- test: tests of the product, -- web: source of the web site of the product. - -(*) some items may not be present, depending on the product. diff --git a/julia/archive/README.txt b/julia/archive/README.txt deleted file mode 100644 index e0d72a77eeab2c75774e256e42b338274737fa5d..0000000000000000000000000000000000000000 --- a/julia/archive/README.txt +++ /dev/null @@ -1,30 +0,0 @@ -This directory contains ant files to build the jars of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one jar file. - -- The name of the ant file must be the name of the jar it builds: - org-foo-bar.xml must build org-foo-bar.jar. - -- Among the elements which are included into a jar, you must specify - a manifest. It is adviced to store the manifest file in this directory. - The manifest file can be shared by several jars. The name of the manifest - file must be similar to the name of the jar file. - -- Only the default task is called on each ant file. - -- The jar file must be produced into the ${dist.lib} directory. - -Sample ant file: - - - - - - ... - - - - diff --git a/julia/archive/julia-asm.mf b/julia/archive/julia-asm.mf deleted file mode 100644 index b31fe9ecbdea6cb3551af3dcba11b777e7fa4e72..0000000000000000000000000000000000000000 --- a/julia/archive/julia-asm.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Julia class generators" -Implementation-Version: "2.0" -Implementation-Vendor: "France Telecom R&D" - diff --git a/julia/archive/julia-asm.xml b/julia/archive/julia-asm.xml deleted file mode 100644 index c64f66a78e27f65a91398d9100f4221924359ff2..0000000000000000000000000000000000000000 --- a/julia/archive/julia-asm.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/julia/archive/julia-mixins.mf b/julia/archive/julia-mixins.mf deleted file mode 100644 index d4285a361f496d7200b8caf9dd89cc2617c5e681..0000000000000000000000000000000000000000 --- a/julia/archive/julia-mixins.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Julia mixins" -Implementation-Version: "2.0" -Implementation-Vendor: "France Telecom R&D" - diff --git a/julia/archive/julia-mixins.xml b/julia/archive/julia-mixins.xml deleted file mode 100644 index 5f91b448836d63c2f142934010ee386f6d250d52..0000000000000000000000000000000000000000 --- a/julia/archive/julia-mixins.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/julia/archive/julia-runtime-j2me.mf b/julia/archive/julia-runtime-j2me.mf deleted file mode 100644 index 4f7a798105db91382023644b1ea1f784260dc762..0000000000000000000000000000000000000000 --- a/julia/archive/julia-runtime-j2me.mf +++ /dev/null @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Julia runtime for J2ME" -Implementation-Version: "2.0" -Implementation-Vendor: "France Telecom R&D" diff --git a/julia/archive/julia-runtime-j2me.xml b/julia/archive/julia-runtime-j2me.xml deleted file mode 100644 index 5a1e4ea74a82603c01f7b4fefb0398d607e694fc..0000000000000000000000000000000000000000 --- a/julia/archive/julia-runtime-j2me.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/julia/archive/julia-runtime.mf b/julia/archive/julia-runtime.mf deleted file mode 100644 index 7d08efbfce588f7680c01fe9ebfea54dac40451b..0000000000000000000000000000000000000000 --- a/julia/archive/julia-runtime.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Julia runtime" -Implementation-Version: "2.0" -Implementation-Vendor: "France Telecom R&D" - diff --git a/julia/archive/julia-runtime.xml b/julia/archive/julia-runtime.xml deleted file mode 100644 index b591671164737edf5c12616b808104fc9f553514..0000000000000000000000000000000000000000 --- a/julia/archive/julia-runtime.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/julia/build.config b/julia/build.config deleted file mode 100644 index 1e23b4d7d7e4ed7c3b32995ed534d2e19a557aeb..0000000000000000000000000000000000000000 --- a/julia/build.config +++ /dev/null @@ -1,14 +0,0 @@ -# Defines values for the 'build.properties' build properties -# This file is used to build the project in the case of bundled external jars - -objectweb.ant.tasks.path config/ow_util_ant_tasks.jar - -cldc.path config/cldc.jar - -asm.path externals/asm.jar - -fractal.path externals/fractal.jar - -monolog.path externals/ow_monolog.jar - -junit.path test/lib/junit.jar diff --git a/julia/build.properties b/julia/build.properties deleted file mode 100644 index 8f35c7266eed43f7bdb9835e3e186c59e8a5bb72..0000000000000000000000000000000000000000 --- a/julia/build.properties +++ /dev/null @@ -1,82 +0,0 @@ -############################################################################### -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################### - -# Some information about the product - -product.name julia -product.version 2.0 - -############################################################################### -# BUILD -############################################################################### - -# Wich compiler do you want to use ? -# jikes is faster than javac but keeps line numbers in compiled classes, even -# with the -O option (javac removes line numbers and local variable names with -# this option, resulting in smaller classes) - -# build.compiler jikes - -# Build class path (classes needed to build the project) -# Classpath for the ObjectWeb utility Ant tasks (OWANTTASK_1_1) -# See http://forge.objectweb.org/projects/monolog - -# objectweb.ant.tasks.path ow_util_ant_tasks.jar - -# Class path for the CLDC API (version 1.1) -# This API is not strictly necessary to build the product -# See http://java.sun.com - -# cldc.path cldc.jar - -############################################################################### -# EXTERNAL LIBRARIES -############################################################################### - -# Class path for the ASM library (ASM_1_4_2) -# See http://asm.objectweb.org - -# asm.path asm.jar - -# Class path for the Fractal API (FRACTAL_API_2_0) -# See http://fractal.objectweb.org - -# fractal.path fractal.jar - -# Class path for the Monolog library (MONOLOG_1_7) -# See http://monolog.objectweb.org - -# monolog.path ow_monolog.jar - -############################################################################### -# TESTS -############################################################################### - -# Class path for the JUnit library (version 3.7) -# See http://www.junit.org - -# junit.path junit.jar - -############################################################################### -# DOCUMENTATION -############################################################################### - -# URLs of external Javadocs - -monolog.url http://www.objectweb.org/monolog/jdoc/ow_util_log_api -fractal.url http://www.objectweb.org/fractal/current/doc/javadoc/fractal -asm.url http://www.objectweb.org/asm/current/doc/javadoc/user -jdk.url http://java.sun.com/j2se/1.3/docs/api diff --git a/julia/build.xml b/julia/build.xml deleted file mode 100644 index 4b3d0b1e8ad509a7a49717b803e3f75a7dec88c1..0000000000000000000000000000000000000000 --- a/julia/build.xml +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/config/README.txt b/julia/config/README.txt deleted file mode 100644 index 4978babb44fb4f93c7d819e50bedad09c7086b79..0000000000000000000000000000000000000000 --- a/julia/config/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains the external libraries required for building the -product, but which are not necessary to use it. diff --git a/julia/config/cldc.jar b/julia/config/cldc.jar deleted file mode 100644 index 15892663c62b8a25ca32d977f7ae66d23a32e9ae..0000000000000000000000000000000000000000 Binary files a/julia/config/cldc.jar and /dev/null differ diff --git a/julia/config/ow_util_ant_tasks.jar b/julia/config/ow_util_ant_tasks.jar deleted file mode 100644 index 4a502465e2d690a80931068d96563d895d9cb5b5..0000000000000000000000000000000000000000 Binary files a/julia/config/ow_util_ant_tasks.jar and /dev/null differ diff --git a/julia/doc/README.txt b/julia/doc/README.txt deleted file mode 100644 index 84303fee616679f69995c94e1dd7d4198b338d64..0000000000000000000000000000000000000000 --- a/julia/doc/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the documentation of the product. diff --git a/julia/doc/javadoc/figures/bindingcontroller-mixins.fig b/julia/doc/javadoc/figures/bindingcontroller-mixins.fig deleted file mode 100644 index 2034b60a98c5266ac51b35dc6c69d15b5402acae..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/bindingcontroller-mixins.fig +++ /dev/null @@ -1,111 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4950 2430 4950 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4950 4230 7785 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 7155 4230 7965 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5400 6075 8010 5490 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 8010 3420 8010 2070 5130 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 5220 6075 8190 4545 8190 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 8325 5175 8325 1890 5355 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 8820 6975 8820 1710 5625 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 7065 7875 8190 7290 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3510 7875 8010 7290 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 3375 7875 8415 5760 8415 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6930 7875 5040 4590 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 4680 8010 5715 8010 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2115 1575 4815 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2025 4230 7515 3690 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 3465 1755 3915 1755 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2115 2475 2115 1935 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1935 4230 1935 1935 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 10080 4320 10080 3735 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 9990 4320 8775 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 10080 3420 10080 1665 5715 900 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 4815 4230 3600 3780 3600 1845 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 7020 4230 3690 3690 3690 1845 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 9855 4320 3780 3600 3780 1845 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3240 7875 4410 4590 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 7200 7875 8595 7515 8595 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4815 2430 4815 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 5085 6075 3510 3915 3510 1845 -4 0 0 50 0 0 12 0.0000 4 120 1545 4050 900 BasicControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 2115 4050 1800 BasicBindingControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1755 4050 2700 TypeBasicBindingMixin\001 -4 0 0 50 0 0 12 0.0000 4 165 1545 7200 3600 UseComponentMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1455 6300 4500 CheckBindingMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1365 4050 4500 TypeBindingMixin\001 -4 0 0 50 0 0 12 0.0000 4 165 1860 7200 5400 UseSuperControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1560 4050 6300 ContentBindingMixin\001 -4 0 0 50 0 0 12 0.0000 4 120 1995 7200 7200 UseContentControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1770 2700 8100 CompositeBindingMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 2505 5850 8100 OptimizedCompositeBindingMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1770 900 4500 InterceptorBindingMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 2430 900 2700 OptimizedContainerBindingMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 2415 900 1800 ContainerBindingControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1695 9405 4500 LifeCycleBindingMixin\001 -4 0 0 50 0 0 12 0.0000 4 165 2130 9360 3645 UseLifeCycleControllerMixin\001 diff --git a/julia/doc/javadoc/figures/bindingcontroller-mixins.gif b/julia/doc/javadoc/figures/bindingcontroller-mixins.gif deleted file mode 100644 index c6c58b3bc7f02b83e78ce4201bfa09ef03f4ef43..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/bindingcontroller-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/component-mixins.fig b/julia/doc/javadoc/figures/component-mixins.fig deleted file mode 100644 index 10af093c720ba63e275bd65cc6655ae8f8301622..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/component-mixins.fig +++ /dev/null @@ -1,18 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1665 1575 1665 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1665 2520 1665 1935 -4 0 4 50 0 0 12 0.0000 4 165 1650 900 1800 BasicComponentMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1620 900 2700 TypeComponentMixin\001 -4 0 0 50 0 0 12 0.0000 4 120 1545 900 900 BasicControllerMixin\001 diff --git a/julia/doc/javadoc/figures/component-mixins.gif b/julia/doc/javadoc/figures/component-mixins.gif deleted file mode 100644 index 654472d3f77904fb8b7d07d1f1e179392d540896..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/component-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/contentcontroller-mixins.fig b/julia/doc/javadoc/figures/contentcontroller-mixins.fig deleted file mode 100644 index bf95296bbcba22eed66a6fac84263bad1275204b..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/contentcontroller-mixins.fig +++ /dev/null @@ -1,63 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5265 1575 5265 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5265 2520 5265 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1890 3420 4860 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3825 3420 5130 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 7470 3375 5535 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 9540 3375 5760 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5265 4230 5265 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1755 3420 4725 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3690 3420 4815 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 7605 3375 5805 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 9675 3375 5895 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5400 4230 5400 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5535 2520 5535 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 9765 2475 5940 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 9810 3375 9810 2790 -4 0 0 50 0 0 12 0.0000 4 120 1545 4500 900 BasicControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 120 2100 4500 2700 BasicContentControllerMixin\001 -4 0 0 50 0 0 12 0.0000 4 165 1545 4500 1800 UseComponentMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1410 4500 4500 SuperContentMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1350 2970 3600 TypeContentMixin\001 -4 0 4 50 0 0 12 0.0000 4 120 1440 990 3600 CheckContentMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1560 6615 3600 BindingContentMixin\001 -4 0 4 5 0 0 12 0.0000 4 165 1680 8865 3600 LifeCycleContentMixin\001 -4 0 0 5 0 0 12 0.0000 4 165 2130 8865 2700 UseLifeCycleControllerMixin\001 diff --git a/julia/doc/javadoc/figures/contentcontroller-mixins.gif b/julia/doc/javadoc/figures/contentcontroller-mixins.gif deleted file mode 100644 index 387867d7b6cf33dc38c93de7b0571eca7d2108aa..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/contentcontroller-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/data_struct.fig b/julia/doc/javadoc/figures/data_struct.fig deleted file mode 100644 index 6d1311f35b559317585e538e05a574441b68856a..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/data_struct.fig +++ /dev/null @@ -1,134 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 1485 2430 1620 2700 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 2475 1530 2655 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 2565 1575 2565 --6 -6 1935 2475 1980 2655 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1980 2475 1980 2655 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1980 2565 1935 2565 --6 -6 6435 2385 6570 2655 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 6480 2430 6480 2610 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6480 2520 6525 2520 --6 -6 6435 3285 6570 3555 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6480 3330 6480 3510 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6480 3420 6525 3420 --6 -6 6885 3330 6930 3510 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6930 3330 6930 3510 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6930 3420 6885 3420 --6 -6 6885 2430 6930 2610 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6930 2520 6885 2520 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6930 2430 6930 2610 --6 -1 2 0 1 4 7 50 0 -1 0.000 1 0.0000 6030 8370 135 135 5895 8370 6165 8370 -1 2 0 1 4 7 50 0 -1 0.000 1 0.0000 6030 7470 135 135 5895 7470 6165 7470 -1 2 0 1 0 7 50 0 -1 0.000 1 0.0000 6120 6030 135 135 5985 5895 6255 6165 -1 2 0 1 0 7 50 0 -1 0.000 1 0.0000 4275 6030 135 135 4140 5895 4410 6165 -1 2 0 1 0 7 50 0 -1 0.000 1 0.0000 3285 6030 135 135 3150 5895 3420 6165 -1 2 0 2 4 7 50 0 -1 0.000 1 0.0000 2430 5490 135 135 2295 5490 2565 5490 -1 2 0 1 4 7 50 0 -1 0.000 1 0.0000 4275 5490 135 135 4140 5490 4410 5490 -1 2 0 1 4 7 50 0 -1 0.000 1 0.0000 6120 5490 135 135 5985 5490 6255 5490 -1 2 0 1 4 -1 50 0 -1 0.000 1 0.0000 1080 7515 135 135 945 7515 1215 7515 -1 2 0 2 0 7 50 0 -1 0.000 1 0.0000 2430 6030 135 135 2295 6030 2565 6030 -1 2 0 1 24 26 50 0 20 0.000 1 0.0000 1755 7515 135 135 1620 7380 1890 7650 -1 2 0 1 24 26 50 0 20 0.000 1 0.0000 6705 7470 135 135 6570 7335 6840 7605 -1 2 0 1 24 26 50 0 20 0.000 1 0.0000 6705 8370 135 135 6570 8235 6840 8505 -1 2 0 1 4 7 49 0 -1 0.000 1 0.0000 5265 5490 135 135 5130 5490 5400 5490 -1 2 0 1 12 -1 50 0 -1 0.000 1 0.0000 2430 7515 135 135 2295 7515 2565 7515 -1 2 0 1 12 -1 50 0 -1 0.000 1 0.0000 7380 7470 135 135 7245 7470 7515 7470 -1 2 0 1 12 -1 50 0 -1 0.000 1 0.0000 7380 8370 135 135 7245 8370 7515 8370 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 1935 1260 6525 1260 6525 4500 1935 4500 1935 1260 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2520 855 2340 855 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 2430 855 2430 900 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4365 855 4185 855 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4275 855 4275 900 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6210 855 6030 855 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 6120 855 6120 900 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 1575 5850 6885 5850 6885 9810 1575 9810 1575 5850 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1215 7515 1620 7515 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2430 5625 2430 5895 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4275 5625 4275 5895 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6120 5625 6120 5895 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6165 7470 6570 7470 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6165 8370 6570 8370 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5355 5535 6030 5940 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 1935 6210 6525 6210 6525 9450 1935 9450 1935 6210 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 1575 900 6885 900 6885 4860 1575 4860 1575 900 -3 2 0 1 0 7 50 0 -1 0.000 0 1 0 3 - 0 0 1.00 60.00 120.00 - 6120 6165 4365 6525 2475 6120 - 0.000 -1.000 0.000 -3 2 0 1 0 7 50 0 -1 0.000 0 1 0 3 - 0 0 1.00 60.00 120.00 - 4275 6165 3555 6345 2475 6120 - 0.000 -1.000 0.000 -3 4 0 1 0 7 50 -1 -1 0.000 0 1 0 4 - 0 0 1.00 60.00 120.00 - 1890 7515 2655 6750 5670 6795 6120 6165 - 0.000 1.000 1.000 0.000 -4 0 0 50 0 0 12 0.0000 4 120 1020 2070 2430 client interface\001 -4 2 0 50 0 0 12 0.0000 4 120 1080 6390 2385 server interface\001 -4 0 0 50 0 0 12 0.0000 4 120 60 1350 2655 I\001 -4 1 0 50 0 0 12 0.0000 4 165 825 2430 765 Component\001 -4 1 0 50 0 0 12 0.0000 4 165 1290 4275 765 BindingController\001 -4 1 0 50 0 0 12 0.0000 4 165 1410 6120 765 LifeCycleController\001 -4 0 0 50 0 0 12 0.0000 4 120 75 6300 2610 J\001 -4 0 0 50 0 0 12 0.0000 4 120 135 6300 3510 K\001 -4 0 0 50 0 0 12 0.0000 4 165 990 1665 1125 controller part\001 -4 0 0 50 0 0 12 0.0000 4 150 825 2115 1530 content part\001 -4 1 0 50 0 2 14 0.0000 4 135 570 4275 5085 Model\001 -4 0 0 50 0 0 12 0.0000 4 165 1185 4455 6165 Controller object\001 -4 1 0 50 0 2 14 0.0000 4 180 2175 4275 10035 Implementation in Julia\001 -4 2 4 50 0 0 12 1.5708 4 165 1080 1170 7830 Interface object\001 -4 2 24 50 0 0 12 1.5708 4 165 1230 1800 7830 Interceptor object\001 -4 2 12 50 0 0 12 1.5708 4 165 1080 2475 7830 Interface object\001 -4 2 4 50 0 0 12 1.5708 4 165 780 1440 7830 "impl" link\001 diff --git a/julia/doc/javadoc/figures/data_struct.gif b/julia/doc/javadoc/figures/data_struct.gif deleted file mode 100644 index bad7940bf7b5dcd6ebf54b59841ecb7bc55be3c8..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/data_struct.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/genericfactory-mixins.fig b/julia/doc/javadoc/figures/genericfactory-mixins.fig deleted file mode 100644 index 70939b9c9f20f4fa5ff7c2abe26aceb592111d80..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/genericfactory-mixins.fig +++ /dev/null @@ -1,29 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2565 3375 2565 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2565 2475 1530 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1530 1575 2520 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3915 1575 2610 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2700 2475 3915 1890 -4 0 0 50 0 0 12 0.0000 4 120 1545 1800 900 BasicControllerMixin\001 -4 0 0 50 0 0 12 0.0000 4 120 1215 900 1800 UseLoaderMixin\001 -4 0 0 50 0 0 12 0.0000 4 165 1620 3150 1800 UseTypeFactoryMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1920 1800 2700 BasicGenericFactoryMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1980 1800 3600 CheckGenericFactoryMixin\001 diff --git a/julia/doc/javadoc/figures/genericfactory-mixins.gif b/julia/doc/javadoc/figures/genericfactory-mixins.gif deleted file mode 100644 index fc97af5506911b9cbf343f7ad5753a34516ccfc5..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/genericfactory-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/interceptor.fig b/julia/doc/javadoc/figures/interceptor.fig deleted file mode 100644 index 5ae37732c5427fbdb6b327f529aacedc26eb8f9d..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/interceptor.fig +++ /dev/null @@ -1,35 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -1 2 0 1 0 7 50 0 -1 0.000 1 0.0000 5445 1080 135 135 5310 945 5580 1215 -1 2 0 1 4 7 50 0 -1 0.000 1 0.0000 5445 540 135 135 5310 540 5580 540 -1 2 0 1 4 -1 50 0 -1 0.000 1 0.0000 405 2565 135 135 270 2565 540 2565 -1 2 0 1 24 26 50 0 20 0.000 1 0.0000 1080 2565 135 135 945 2430 1215 2700 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 900 900 6210 900 6210 4860 900 4860 900 900 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 540 2565 945 2565 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5445 675 5445 945 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 1260 1260 5850 1260 5850 4500 1260 4500 1260 1260 -3 2 0 1 0 7 50 0 -1 0.000 0 1 0 3 - 0 0 1.00 60.00 120.00 - 1215 2565 4410 2295 5445 1215 - 0.000 -1.000 0.000 -4 2 0 50 0 0 12 0.0000 4 165 1740 5220 1125 controller object, class C\001 -4 2 0 50 0 0 12 0.0000 4 165 2325 5175 630 control interface, name N, type T\001 -4 2 24 50 0 0 12 1.5708 4 165 1215 1125 2790 interceptor object\001 -4 0 0 50 0 0 12 0.0000 4 165 2565 1575 2835 reference from the interceptor to the \001 -4 0 0 50 0 0 12 0.0000 4 165 3000 1575 3060 controller object, stored in a 'delegate' field\001 -4 2 4 50 0 0 12 1.5708 4 165 1080 450 2790 Interface object\001 diff --git a/julia/doc/javadoc/figures/interceptor.gif b/julia/doc/javadoc/figures/interceptor.gif deleted file mode 100644 index 981e561bfd5aa41304d266858be6bde8fe0036f3..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/interceptor.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/lifecyclecontroller-mixins.fig b/julia/doc/javadoc/figures/lifecyclecontroller-mixins.fig deleted file mode 100644 index b36b180844122bfa8c7e5bcb1e3a8ab38d242ea5..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/lifecyclecontroller-mixins.fig +++ /dev/null @@ -1,53 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3915 2475 3915 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3915 1575 3915 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 2250 3375 2250 1575 3780 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 2340 3375 2340 2520 3780 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2430 3375 3870 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5715 3375 4005 2790 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 5850 3375 5850 2520 4050 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2250 5175 2250 3735 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3915 4275 3915 3645 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 2115 5175 945 3915 945 3015 3600 1890 -2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 1 2 - 0 0 1.00 60.00 120.00 - 0 0 1.00 60.00 120.00 - 3600 3555 4365 3555 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 4050 4275 7650 3735 7650 3060 4275 1890 -4 0 0 50 0 0 12 0.0000 4 120 1545 3150 900 BasicControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 2370 3150 2700 BasicLifeCycleCoordinatorMixin\001 -4 0 0 50 0 0 12 0.0000 4 165 1545 3150 1800 UseComponentMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 2580 4500 3600 OptimizedLifeCycleControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 2235 1125 3600 BasicLifeCycleControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1485 3150 4500 TypeLifeCycleMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1815 1350 5400 ContainerLifeCycleMixin\001 diff --git a/julia/doc/javadoc/figures/lifecyclecontroller-mixins.gif b/julia/doc/javadoc/figures/lifecyclecontroller-mixins.gif deleted file mode 100644 index 630f85fee43f840f0204c74e660b7ed38bab3e6a..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/lifecyclecontroller-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/namecontroller-mixins.fig b/julia/doc/javadoc/figures/namecontroller-mixins.fig deleted file mode 100644 index cdb6f331cb976e02bd1e90780b51b470a0a4de4a..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/namecontroller-mixins.fig +++ /dev/null @@ -1,11 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 0 4 50 0 0 12 0.0000 4 120 1965 900 1800 BasicNameControllerMixin\001 -4 0 0 50 0 0 12 0.0000 4 120 1545 900 1035 BasicControllerMixin\001 diff --git a/julia/doc/javadoc/figures/namecontroller-mixins.gif b/julia/doc/javadoc/figures/namecontroller-mixins.gif deleted file mode 100644 index c197e1574d3a38d01f7604382a3d7b16c325cfe0..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/namecontroller-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/shortcut1.fig b/julia/doc/javadoc/figures/shortcut1.fig deleted file mode 100644 index b4a8110e834f7901f462792bdbaa7a03301e7c61..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/shortcut1.fig +++ /dev/null @@ -1,141 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 2790 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2925 2790 2925 --6 -6 2430 2790 2565 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2475 2835 2475 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2475 2925 2520 2925 --6 -6 3510 2790 3645 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2835 3555 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2925 3600 2925 --6 -6 1530 2835 1575 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 2835 1575 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 2925 1530 2925 --6 -6 1170 2790 1305 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 2835 1215 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 2925 1260 2925 --6 -6 3870 2835 3915 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 2835 3915 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 2925 3870 2925 --6 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 2925 415 415 4545 2925 4960 2925 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 585 2925 415 415 585 2925 1000 2925 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 6840 415 415 4545 6840 4960 6840 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 585 6840 415 415 585 6840 1000 6840 -1 2 0 1 24 26 50 0 20 4.000 1 0.0000 3735 6840 90 90 3645 6750 3825 6930 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 2160 6840 90 90 2070 6750 2250 6930 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 3240 6840 90 90 3150 6750 3330 6930 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 2520 1305 6255 1305 6255 4455 2520 4455 2520 1305 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 3870 2340 5220 2340 5220 3510 3870 3510 3870 2340 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 3600 2070 5490 2070 5490 3780 3600 3780 3600 2070 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - -90 2340 1260 2340 1260 3510 -90 3510 -90 2340 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - -360 2070 1530 2070 1530 3780 -360 3780 -360 2070 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1620 2925 2430 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2880 2925 3510 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 990 2925 1170 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3960 2925 4140 2925 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2250 6840 3150 6840 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3330 6840 3645 6840 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 990 6840 2070 6840 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - -360 5985 1530 5985 1530 7695 -360 7695 -360 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - -90 6255 1260 6255 1260 7425 -90 7425 -90 6255 -2 2 1 1 0 33 55 0 -1 4.000 0 0 -1 0 0 5 - 2520 5220 6255 5220 6255 8370 2520 8370 2520 5220 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 3600 5985 5490 5985 5490 7695 3600 7695 3600 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 3870 6255 5220 6255 5220 7425 3870 7425 3870 6255 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 2790 1575 5985 1575 5985 4185 2790 4185 2790 1575 -2 2 1 1 0 7 54 0 -1 4.000 0 0 -1 0 0 5 - 2790 5490 5985 5490 5985 8100 2790 8100 2790 5490 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3825 6840 4140 6840 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 270 2025 90 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 180 2025 180 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1125 2025 945 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1035 2025 1035 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3105 1260 2925 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3015 1260 3015 1305 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4230 2025 4050 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4140 2025 4140 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4545 1260 4365 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4455 1260 4455 1305 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 5715 1260 5715 1305 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5805 1260 5625 1260 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5085 2025 4905 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4995 2025 4995 2070 -4 0 4 50 0 0 12 1.5708 4 165 630 3510 6750 impl link\001 -4 0 24 50 0 0 12 1.5708 4 165 885 4050 6750 delegate link\001 -4 1 0 50 0 0 12 0.0000 4 120 120 180 1935 C\001 -4 1 0 50 0 0 12 0.0000 4 120 240 1035 1935 BC\001 -4 1 0 50 0 0 12 0.0000 4 120 120 3015 1170 C\001 -4 1 0 50 0 0 12 0.0000 4 120 120 4140 1935 C\001 -4 1 0 50 0 0 12 0.0000 4 120 240 4455 1170 BC\001 -4 1 0 50 0 0 12 0.0000 4 120 240 5715 1170 CC\001 -4 1 0 50 0 0 12 0.0000 4 120 240 4995 1935 BC\001 -4 0 0 50 -1 0 12 0.0000 4 120 150 3195 7155 I2\001 -4 0 0 50 -1 0 12 0.0000 4 120 150 2115 7155 I1\001 diff --git a/julia/doc/javadoc/figures/shortcut1.gif b/julia/doc/javadoc/figures/shortcut1.gif deleted file mode 100644 index 9f735f5ba87325963e26fd1da4faad8823afe6aa..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/shortcut1.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/shortcut2.fig b/julia/doc/javadoc/figures/shortcut2.fig deleted file mode 100644 index a3bc4e085f54b67ae002388abb749c62f3ed8c2b..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/shortcut2.fig +++ /dev/null @@ -1,45 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 6840 415 415 4545 6840 4960 6840 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 585 6840 415 415 585 6840 1000 6840 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 2160 6840 90 90 2070 6750 2250 6930 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 3240 6840 90 90 3150 6750 3330 6930 -1 2 0 1 24 26 50 0 20 4.000 1 0.0000 3735 6840 90 90 3645 6750 3825 6930 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3330 6840 3645 6840 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 990 6840 2070 6840 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - -360 5985 1530 5985 1530 7695 -360 7695 -360 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - -90 6255 1260 6255 1260 7425 -90 7425 -90 6255 -2 2 1 1 0 33 55 0 -1 4.000 0 0 -1 0 0 5 - 2520 5220 6255 5220 6255 8370 2520 8370 2520 5220 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 3600 5985 5490 5985 5490 7695 3600 7695 3600 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 3870 6255 5220 6255 5220 7425 3870 7425 3870 6255 -2 2 1 1 0 7 54 0 -1 4.000 0 0 -1 0 0 5 - 2790 5490 5985 5490 5985 8100 2790 8100 2790 5490 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3825 6840 4140 6840 -3 2 0 1 4 7 50 0 -1 0.000 0 1 0 3 - 0 0 1.00 60.00 120.00 - 2250 6840 3375 7200 3735 6930 - 0.000 -1.000 0.000 -4 0 4 50 0 0 12 1.5708 4 165 630 3510 6750 impl link\001 -4 0 24 50 0 0 12 1.5708 4 165 885 4050 6750 delegate link\001 -4 1 0 50 0 0 12 0.0000 4 120 150 2160 7110 I1\001 -4 1 0 50 0 0 12 0.0000 4 120 150 3240 7110 I2\001 diff --git a/julia/doc/javadoc/figures/shortcut2.gif b/julia/doc/javadoc/figures/shortcut2.gif deleted file mode 100644 index 01a479cce13c9fd284ad4ccd8a7d976b26ef8eb2..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/shortcut2.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/supercontroller-mixins.fig b/julia/doc/javadoc/figures/supercontroller-mixins.fig deleted file mode 100644 index 7ad6147eace2b301591d0f02b4370045721872da..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/supercontroller-mixins.fig +++ /dev/null @@ -1,11 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -4 0 4 50 0 0 12 0.0000 4 165 1965 900 1350 BasicSuperControllerMixin\001 -4 0 0 50 0 0 12 0.0000 4 120 1545 900 675 BasicControllerMixin\001 diff --git a/julia/doc/javadoc/figures/supercontroller-mixins.gif b/julia/doc/javadoc/figures/supercontroller-mixins.gif deleted file mode 100644 index fbee3e5ad1e7d05c0d8bd20794abd296cd898749..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/supercontroller-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/template-mixins.fig b/julia/doc/javadoc/figures/template-mixins.fig deleted file mode 100644 index 5469526c0ea599da4a6daead6230f6c2b8bb49dc..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/template-mixins.fig +++ /dev/null @@ -1,47 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4365 2475 4365 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4455 2475 5715 1890 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5715 1620 4500 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4365 5175 4365 2835 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2925 4320 1665 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6300 4320 7785 3690 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3060 4320 4230 2835 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6165 4320 4500 2835 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1665 3375 4230 990 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 7785 3330 7785 1665 4680 990 -4 0 0 50 0 0 12 0.0000 4 120 1545 3600 900 BasicControllerMixin\001 -4 0 0 50 0 0 12 0.0000 4 165 1545 4950 1800 UseComponentMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1470 3600 2700 BasicTemplateMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1755 3600 5400 SingletonTemplateMixin\001 -4 0 0 50 0 0 12 0.0000 4 120 1860 900 3600 UseNameControllerMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1500 2250 4500 NameTemplateMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1710 5400 4500 AttributeTemplateMixin\001 -4 0 0 50 0 0 12 0.0000 4 120 2775 6300 3600 UseCloneableAttributeControllerMixin\001 diff --git a/julia/doc/javadoc/figures/template-mixins.gif b/julia/doc/javadoc/figures/template-mixins.gif deleted file mode 100644 index fa466d9493d5f7970fbad1a0d797cc912eec3f49..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/template-mixins.gif and /dev/null differ diff --git a/julia/doc/javadoc/figures/typefactory-mixins.fig b/julia/doc/javadoc/figures/typefactory-mixins.fig deleted file mode 100644 index 22f89eec885d5a43b831279ff2a7ae249c88385d..0000000000000000000000000000000000000000 --- a/julia/doc/javadoc/figures/typefactory-mixins.fig +++ /dev/null @@ -1,14 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1665 4725 1665 4140 -4 0 4 50 0 0 12 0.0000 4 165 1725 900 4050 BasicTypeFactoryMixin\001 -4 0 4 50 0 0 12 0.0000 4 165 1785 900 4950 CheckTypeFactoryMixin\001 diff --git a/julia/doc/javadoc/figures/typefactory-mixins.gif b/julia/doc/javadoc/figures/typefactory-mixins.gif deleted file mode 100644 index 69a4fd1e05a0e7afc27a017911add9186ed23003..0000000000000000000000000000000000000000 Binary files a/julia/doc/javadoc/figures/typefactory-mixins.gif and /dev/null differ diff --git a/julia/examples/common/README.txt b/julia/examples/common/README.txt deleted file mode 100644 index 25b69f5c42c38f799f5acbc47423227adb4d987c..0000000000000000000000000000000000000000 --- a/julia/examples/common/README.txt +++ /dev/null @@ -1,13 +0,0 @@ -This directory contains the examples of the product. -It contains(*) the following items: - -- lib: jar files shared by all examples, -- etc: configuration files shared by all examples, -- README.txt: explains the organisation of the examples directory, -- all other directories contain(*) the following items: - - README.txt file: describes the example and its configuration, - - lib: jar files needed by the example, - - etc: configuration files needed by the example, - - src: source code of the example. - -(*) some items may not be present, depending on the product or example. \ No newline at end of file diff --git a/julia/examples/common/build.xml b/julia/examples/common/build.xml deleted file mode 100644 index cbca000192b69bffe4bcc1d998ba994d9ff24c1f..0000000000000000000000000000000000000000 --- a/julia/examples/common/build.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/examples/common/etc/build.properties b/julia/examples/common/etc/build.properties deleted file mode 100644 index bbdd7a8cc277e2fe5bdbdb6947626f85f0a9dcd7..0000000000000000000000000000000000000000 --- a/julia/examples/common/etc/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Wich compiler do you want use ? - -build.compiler jikes - -# Class path of the ASM library (version 1.4.1 or higher) -# See http://asm.objectweb.org - -asm.path ../../externals/asm.jar - -# Class path of the Fractal API library (version 2.0 or higher) -# See http://fractal.objectweb.org - -fractal.path ../../externals/fractal.jar - -# Class path of Julia (Fractal API implementation, version 2.0 or higher) -# See http://fractal.objectweb.org - -julia.path ../../lib/julia-asm.jar:../../lib/julia-mixins.jar:../../lib/julia-runtime.jar - -# Class path of Julia J2ME (Fractal API implementation, version 2.0 or higher) -# See http://fractal.objectweb.org - -julia.j2me.path ../../lib/julia-asm.jar:../../lib/julia-mixins.jar:../../lib/julia-runtime-j2me.jar diff --git a/julia/examples/helloworld/README.txt b/julia/examples/helloworld/README.txt deleted file mode 100644 index 04f3d060416d69079fbf08aa6eb21b8e67580a2f..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -This example shows how to program a simple Fractal based application, -and how to deploy it. It also shows how Julia can be configured, and how -the Fractal ADL can be used to describe the architecture of an application, -and to deploy it. - -See the Fractal, the Fractal ADL and the Julia tutorials for more details -about this example. diff --git a/julia/examples/helloworld/etc/execute.properties b/julia/examples/helloworld/etc/execute.properties deleted file mode 100644 index b5aa1f87be3895aac026c5de7d3de10f020cfac5..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/etc/execute.properties +++ /dev/null @@ -1,18 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -run.jvm.parameters \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg,etc/julia-tutorial.cfg - -# Java class to be launched - -run.classname HelloWorld - -# Application arguments -# add "templates" to build the components through templates -# add "wrapper" to add an additional composite around each primitive - -run.parameters diff --git a/julia/examples/helloworld/etc/julia-tutorial.cfg b/julia/examples/helloworld/etc/julia-tutorial.cfg deleted file mode 100644 index 15b4cb34c3e115b8c60042498a2111a8344ed98a..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/etc/julia-tutorial.cfg +++ /dev/null @@ -1,240 +0,0 @@ -# ----------------------------------------------------------------------------- -# Definitions for the Julia tutorial - see the Julia tutorial -# ----------------------------------------------------------------------------- - -# (composite 'composite-section2.2) - -# (primitive 'primitive-section2.3) -# (composite 'composite-section2.3) - -# (primitive 'primitive-section2.4) -# (composite 'composite-section2.4) - -# (primitive 'primitive-section2.6) - -# (optimizationLevel mergeControllers) -# (optimizationLevel mergeControllersAndInterceptors) -# (optimizationLevel mergeControllersAndContent) -# (optimizationLevel mergeControllersInterceptorsAndContent) - -# (bootstrap 'bootstrap-section2.7) - -# ----------------------------------------------------------------------------- -# Definitions for section 2.2 of the Julia tutorial -# ----------------------------------------------------------------------------- - -(composite-section2.2 - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - (org.objectweb.fractal.julia.asm.TraceCodeGenerator inout) - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -# ----------------------------------------------------------------------------- -# Definitions for section 2.3 of the Julia tutorial -# ----------------------------------------------------------------------------- - -(primitive-section2.3 - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(composite-section2.3 - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -# ----------------------------------------------------------------------------- -# Definitions for section 2.4 of the Julia tutorial -# ----------------------------------------------------------------------------- - -(static-container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -(primitive-section2.4 - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'static-container-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(composite-section2.4 - 'composite-section2.3 -) - -# ----------------------------------------------------------------------------- -# Definitions for section 2.4 of the Julia tutorial -# ----------------------------------------------------------------------------- - -(primitive-section2.6 - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - HelloWorld$DebugController - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -# ----------------------------------------------------------------------------- -# Definitions for section 2.4 of the Julia tutorial -# ----------------------------------------------------------------------------- - -(bootstrap-section2.7 - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - org.objectweb.fractal.julia.loader.BasicLoader - # org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) diff --git a/julia/examples/helloworld/etc/julia.cfg b/julia/examples/helloworld/etc/julia.cfg deleted file mode 100644 index 8c35125c35c6ea2c2e8f3f007fbdf08dc8850a92..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/etc/julia.cfg +++ /dev/null @@ -1,614 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -# no custom definitions diff --git a/julia/examples/helloworld/src/ClientImpl.java b/julia/examples/helloworld/src/ClientImpl.java deleted file mode 100644 index 4357e370c57d3a1b40e0cc305831c4a905575243..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/src/ClientImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -import org.objectweb.fractal.api.control.BindingController; - -public class ClientImpl implements Main, BindingController { - - private Service service; - - public void main (final String[] args) { - service.print("hello world"); - } - - public String[] listFc () { - return new String[] { "s" }; - } - - public Object lookupFc (final String cItf) { - if (cItf.equals("s")) { - return service; - } - return null; - } - - public void bindFc (final String cItf, final Object sItf) { - if (cItf.equals("s")) { - service = (Service)sItf; - } - } - - public void unbindFc (final String cItf) { - if (cItf.equals("s")) { - service = null; - } - } -} diff --git a/julia/examples/helloworld/src/HelloWorld.java b/julia/examples/helloworld/src/HelloWorld.java deleted file mode 100644 index 1ef6aa2920af953576d9a132bda15636d1b8fb3b..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/src/HelloWorld.java +++ /dev/null @@ -1,201 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.util.Fractal; - -public class HelloWorld { - - public static void main (final String[] args) throws Exception { - - boolean useTemplates = false; - boolean useWrapper = false; - for (int i = 0; i < args.length; ++i) { - useTemplates |= args[i].equals("templates"); - useWrapper |= args[i].equals("wrapper"); - } - - Component rComp; - - Component boot = Fractal.getBootstrapComponent(); - TypeFactory tf = Fractal.getTypeFactory(boot); - // type of root component - ComponentType rType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "Main", false, false, false) - }); - // type of client component - ComponentType cType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "Main", false, false, false), - tf.createFcItfType("s", "Service", true, false, false) - }); - // type of server component - ComponentType sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", "Service", false, false, false), - tf.createFcItfType( - "attribute-controller", - "ServiceAttributes", - false, - false, - false) - }); - - GenericFactory cf = Fractal.getGenericFactory(boot); - - if (!useTemplates) { - - // ------------------------------------------------------------------- - // OPTION 1 : CREATE COMPONENTS DIRECTLY - // ------------------------------------------------------------------- - - // create root component - rComp = cf.newFcInstance(rType, "composite", null); - // create client component - Component cComp = cf.newFcInstance(cType, "primitive", "ClientImpl"); - // create server component - Component sComp = cf.newFcInstance(sType, "primitive", "ServerImpl"); - ((ServiceAttributes)Fractal.getAttributeController(sComp)).setHeader("-> "); - ((ServiceAttributes)Fractal.getAttributeController(sComp)).setCount(1); - - if (useWrapper) { - sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", "Service", false, false, false) - }); - // create client component "wrapper" component - Component CComp = cf.newFcInstance(cType, "composite", null); - // create server component "wrapper" component - Component SComp = cf.newFcInstance(sType, "composite", null); - // component assembly - Fractal.getContentController(CComp).addFcSubComponent(cComp); - Fractal.getContentController(SComp).addFcSubComponent(sComp); - Fractal.getBindingController(CComp).bindFc("m",cComp.getFcInterface("m")); - Fractal.getBindingController(cComp).bindFc("s", - Fractal.getContentController(CComp).getFcInternalInterface("s")); - Fractal.getBindingController(SComp).bindFc("s",sComp.getFcInterface("s")); - // replaces client and server components by "wrapper" components - cComp = CComp; - sComp = SComp; - } - - // component assembly - Fractal.getContentController(rComp).addFcSubComponent(cComp); - Fractal.getContentController(rComp).addFcSubComponent(sComp); - Fractal.getBindingController(rComp).bindFc("m", cComp.getFcInterface("m")); - Fractal.getBindingController(cComp).bindFc("s", sComp.getFcInterface("s")); - } else { - - // ------------------------------------------------------------------- - // OPTION 2 : CREATE COMPONENTS THROUGH TEMPLATES - // ------------------------------------------------------------------- - - // template to create root component - Component rTmpl = cf.newFcInstance( - rType, "compositeTemplate", new Object[] { "composite", null }); - // template to create client component - Component cTmpl = cf.newFcInstance( - cType, "primitiveTemplate", new Object[] { "primitive", "ClientImpl" }); - // template to create server component - Component sTmpl = cf.newFcInstance( - sType, "parametricPrimitiveTemplate", new Object[] { "primitive", "ServerImpl" }); - ((ServiceAttributes)Fractal.getAttributeController(sTmpl)).setHeader("-> "); - ((ServiceAttributes)Fractal.getAttributeController(sTmpl)).setCount(1); - - if (useWrapper) { - sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", "Service", false, false, false) - }); - // template to create client component "wrapper" component - Component CTmpl = cf.newFcInstance( - cType, "compositeTemplate", new Object[] { "composite", null }); - // template to create server component "wrapper" component - Component STmpl = cf.newFcInstance( - sType, "compositeTemplate", new Object[] { "composite", null }); - // template component assembly - Fractal.getContentController(CTmpl).addFcSubComponent(cTmpl); - Fractal.getContentController(STmpl).addFcSubComponent(sTmpl); - Fractal.getBindingController(CTmpl).bindFc("m",cTmpl.getFcInterface("m")); - Fractal.getBindingController(cTmpl).bindFc("s", - Fractal.getContentController(CTmpl).getFcInternalInterface("s")); - Fractal.getBindingController(STmpl).bindFc("s",sTmpl.getFcInterface("s")); - // replaces client and server templates by "wrapper" templates - cTmpl = CTmpl; - sTmpl = STmpl; - } - - // template component assembly - Fractal.getContentController(rTmpl).addFcSubComponent(cTmpl); - Fractal.getContentController(rTmpl).addFcSubComponent(sTmpl); - Fractal.getBindingController(rTmpl).bindFc("m", cTmpl.getFcInterface("m")); - Fractal.getBindingController(cTmpl).bindFc("s", sTmpl.getFcInterface("s")); - - // template instantiation - rComp = Fractal.getFactory(rTmpl).newFcInstance(); - } - - // ----------------------------------------------------------------------- - // COMMON PART - // ----------------------------------------------------------------------- - - // start root component - Fractal.getLifeCycleController(rComp).startFc(); - - // call main method - ((Main)rComp.getFcInterface("m")).main(null); - } - - // Julia specific code, to print the content of created components - - public static class DebugController - implements org.objectweb.fractal.julia.Controller - { - public void initFcController ( - org.objectweb.fractal.julia.InitializationContext ic) - { - System.err.println("COMPONENT CREATED"); - System.err.println("INTERFACES:"); - java.util.Iterator i = ic.interfaces.keySet().iterator(); - while (i.hasNext()) { - String key = (String)i.next(); - if (!key.startsWith("/")) { - System.err.println(" "+key+" "+ic.interfaces.get(key)); - } - } - System.err.println("CONTROLLER OBJECTS:"); - i = ic.controllers.iterator(); - while (i.hasNext()) { - Object o = i.next(); - if (o instanceof org.objectweb.fractal.julia.Interceptor) { - Object p = ((org.objectweb.fractal.julia.Interceptor)o).getFcItfDelegate(); - System.err.println(" "+o+" (Interceptor,impl="+p+")"); - } else { - System.err.println(" "+o); - } - } - System.err.println("CONTENT:\n "+ic.content); - } - } -} diff --git a/julia/examples/helloworld/src/Main.java b/julia/examples/helloworld/src/Main.java deleted file mode 100644 index ed33bd07fec0a93f1312d035d953b2fff37c66eb..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/src/Main.java +++ /dev/null @@ -1,26 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -public interface Main { - void main (String[] args); -} diff --git a/julia/examples/helloworld/src/ServerImpl.java b/julia/examples/helloworld/src/ServerImpl.java deleted file mode 100644 index fe64c8f5bd08ae440990e88b2c5da6204f6094e2..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/src/ServerImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -public class ServerImpl implements Service, ServiceAttributes { - - private String header = ""; - - private int count = 0; - - public void print (final String msg) { - new Exception() { - public String toString () { - return "Server: print method called"; - } - }.printStackTrace(); - System.err.println("Server: begin printing..."); - for (int i = 0; i < count; ++i) { - System.err.println(header + msg); - } - System.err.println("Server: print done."); - } - - public String getHeader () { - return header; - } - - public void setHeader (final String header) { - this.header = header; - } - - public int getCount () { - return count; - } - - public void setCount (final int count) { - this.count = count; - } -} diff --git a/julia/examples/helloworld/src/Service.java b/julia/examples/helloworld/src/Service.java deleted file mode 100644 index dff24a6c8aea4550275dcb63d58da1702eec22e2..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/src/Service.java +++ /dev/null @@ -1,26 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -public interface Service { - void print (String msg); -} diff --git a/julia/examples/helloworld/src/ServiceAttributes.java b/julia/examples/helloworld/src/ServiceAttributes.java deleted file mode 100644 index c885cb21deaf86bb3cc393e0bae9c9260934bedb..0000000000000000000000000000000000000000 --- a/julia/examples/helloworld/src/ServiceAttributes.java +++ /dev/null @@ -1,31 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -import org.objectweb.fractal.api.control.AttributeController; - -public interface ServiceAttributes extends AttributeController { - String getHeader (); - void setHeader (String header); - int getCount (); - void setCount (int count); -} diff --git a/julia/examples/interceptor/README.txt b/julia/examples/interceptor/README.txt deleted file mode 100644 index 2a020eb990065db831ab75786cc47590c5c5fa98..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This example shows how to write your own interceptors and associated -controllers with Julia, by using the SimpleCodeGenerator super class. diff --git a/julia/examples/interceptor/etc/execute.properties b/julia/examples/interceptor/etc/execute.properties deleted file mode 100644 index 65201620b781727f01f92287f64b0eb08242d6df..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/etc/execute.properties +++ /dev/null @@ -1,16 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -run.jvm.parameters \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -# Java class to be launched - -run.classname interceptor.Interceptor - -# Application arguments - -run.parameters diff --git a/julia/examples/interceptor/etc/julia.cfg b/julia/examples/interceptor/etc/julia.cfg deleted file mode 100644 index bb21a7e277a45fc0012fb5916e207251594cbc97..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/etc/julia.cfg +++ /dev/null @@ -1,745 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -(statPrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - (stat-controller stat.StatController) - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - (stat.StatControllerImpl off) - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - stat.StatCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(statTracePrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - (stat-controller stat.StatController) - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - (stat.StatControllerImpl on) - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - stat.StatCodeGenerator - org.objectweb.fractal.julia.asm.TraceCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(emptyPrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptor - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(fullStatPrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - (stat-controller stat.StatController) - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - (stat.StatControllerImpl off) - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - stat.StatCodeGenerator - stat.StatClassTransformer # transforms field accesses in content class - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - mergeControllersInterceptorsAndContent # mandatory for ClassTransformers - ) -) diff --git a/julia/examples/interceptor/src/interceptor/I.java b/julia/examples/interceptor/src/interceptor/I.java deleted file mode 100644 index 05b6d6f73494301e3902d5c383d55597831b9738..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/src/interceptor/I.java +++ /dev/null @@ -1,27 +0,0 @@ -package interceptor; -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -public interface I { - void m (String s); -} diff --git a/julia/examples/interceptor/src/interceptor/IImpl.java b/julia/examples/interceptor/src/interceptor/IImpl.java deleted file mode 100644 index e25f79240ced38763f01d7c6584c1bd6386b48c7..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/src/interceptor/IImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -package interceptor; -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -public class IImpl implements I { - - public String s; - - public void m (final String s) { - if (s == null) { - throw new NullPointerException(); - } - this.s = s; - System.err.println("m(" + s + ") called on " + this); - } -} diff --git a/julia/examples/interceptor/src/interceptor/Interceptor.java b/julia/examples/interceptor/src/interceptor/Interceptor.java deleted file mode 100644 index bc1a1035405d2fe135ea0a9606ee930f5b8b71f3..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/src/interceptor/Interceptor.java +++ /dev/null @@ -1,278 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package interceptor; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.control.binding.Util; - -import org.objectweb.fractal.util.Fractal; - -import stat.StatController; - -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.Iterator; - -public class Interceptor { - - public static void main (final String[] args) throws Exception { - Component boot = Fractal.getBootstrapComponent(); - - TypeFactory tf = Fractal.getTypeFactory(boot); - ComponentType cType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", "interceptor.I", false, false, false) - }); - - GenericFactory cf = Fractal.getGenericFactory(boot); - Component cComp = cf.newFcInstance( - cType, "statPrimitive", "interceptor.IImpl"); - Component rComp = cf.newFcInstance( - cType, "composite", null); - Fractal.getContentController(rComp).addFcSubComponent(cComp); - Fractal.getBindingController(rComp).bindFc("s", cComp.getFcInterface("s")); - Fractal.getLifeCycleController(rComp).startFc(); - - System.err.println("INITIAL CONFIGURATION"); - test(rComp); - - // adds a trace aspect in the interceptor - System.err.println("CHANGE THE INTERCEPTOR (ADD A TRACE ASPECT)"); - cComp = changeComponent(cType, "statTracePrimitive", cComp); - test(rComp); - System.err.println("(note that the StatController state has been lost)\n"); - - // completely removes the interceptor and the controller - System.err.println("REMOVE THE INTERCEPTOR AND THE CONTROLLER"); - cComp = changeComponent(cType, "emptyPrimitive", cComp); - test(rComp); - - // adds the interceptor back - System.err.println("ADD BACK THE INTERCEPTOR AND THE CONTROLLER"); - cComp = changeComponent(cType, "statPrimitive", cComp); - test(rComp); - - // ----- - - // tests field interceptors (changeComponent can be used, but will not - // preserve the component's state, since the content and controller part are - // merged in 'fullStatPrimitive' components) - System.err.println("CREATE A NEW COMPONENT WITH A FIELD STAT CONTROLLER"); - cComp = cf.newFcInstance( - cType, "fullStatPrimitive", "interceptor.IImpl"); - rComp = cf.newFcInstance( - cType, "composite", null); - Fractal.getContentController(rComp).addFcSubComponent(cComp); - Fractal.getBindingController(rComp).bindFc("s", cComp.getFcInterface("s")); - Fractal.getLifeCycleController(rComp).startFc(); - test(rComp); - } - - private static void test (final Component rComp) - throws NoSuchInterfaceException - { - System.err.println(); - - I i = (I)rComp.getFcInterface("s"); - i.m("a"); - i.m("b"); - try { - i.m(null); - } catch (NullPointerException e) { - } - i.m("c"); - - System.err.println(); - - StatController sc; - try { - Component c = Fractal.getContentController(rComp).getFcSubComponents()[0]; - sc = (StatController)c.getFcInterface("stat-controller"); - } catch (NoSuchInterfaceException e) { - System.err.println("No StatController!"); - System.err.println(); - return; - } - - System.err.println("number of calls: " + sc.getNumberOfMethodCall()); - System.err.println("number of success: " + sc.getNumberOfMethodSuccess()); - System.err.println("number of reads: " + sc.getNumberOfFieldRead()); - System.err.println("number of writes: " + sc.getNumberOfFieldWrite()); - System.err.println("total execution time: " + sc.getTotalExecutionTime()); - System.err.println(); - } - - /** - * Changes the type, the controller objects and the interceptors of the given - * primitive component. In fact a new component is created, with "physically" - * the same content as the old component, the old component is unbound and - * removed, and the new one is added and bound like the old one. - */ - - public static Component changeComponent ( - final Type newType, - final Object newControllerDesc, - final Component component) throws Exception - { - // 1 stops "component" - boolean isStarted = false; - try { - LifeCycleController lc = Fractal.getLifeCycleController(component); - isStarted = lc.getFcState().equals("STARTED"); - if (isStarted) { - Fractal.getLifeCycleController(component).stopFc(); - } - } catch (NoSuchInterfaceException ignored) { - } - - // 2 stops the parent components of "component" - Component[] parents; - LifeCycleController[] parentLCs; - boolean[] parentStates; - try { - parents = Fractal.getSuperController(component).getFcSuperComponents(); - parentLCs = new LifeCycleController[parents.length]; - parentStates = new boolean[parents.length]; - for (int i = 0; i < parents.length; ++i) { - try { - parentLCs[i] = Fractal.getLifeCycleController(parents[i]); - parentStates[i] = parentLCs[i].getFcState().equals("STARTED"); - if (parentStates[i]) { - parentLCs[i].stopFc(); - } - } catch (NoSuchInterfaceException ignored) { - } - } - } catch (NoSuchInterfaceException e) { - parents = new Component[0]; - parentLCs = null; - parentStates = null; - } - - // 3 unbinds "component" - Map bindingsFrom = new HashMap(); - BindingController bc; - try { - bc = Fractal.getBindingController(component); - } catch (NoSuchInterfaceException e) { - bc = null; - } - if (bc != null) { - String[] names = bc.listFc(); - for (int i = 0; i < names.length; ++i) { - bindingsFrom.put(names[i], bc.lookupFc(names[i])); - bc.unbindFc(names[i]); - } - } - - // 4 removes the bindings to "component" - Map bindingsTo = new HashMap(); - Object[] itfs = component.getFcInterfaces(); - for (int i = 0; i < itfs.length; ++i) { - Interface itf = (Interface)itfs[i]; - if (!((InterfaceType)itf.getFcItfType()).isFcClientItf()) { - Set clients = Util.getFcClientItfsBoundTo(itf); - Iterator it = clients.iterator(); - while (it.hasNext()) { - Interface citf = (Interface)it.next(); - Fractal.getBindingController( - citf.getFcItfOwner()).unbindFc(citf.getFcItfName()); - bindingsTo.put(citf, itf.getFcItfName()); - } - } - } - - // 5 removes "component" from its parent components - for (int i = 0; i < parents.length; ++i) { - Fractal.getContentController(parents[i]).removeFcSubComponent(component); - } - - // creates the new component with the current component's content - // (this part is the only Julia specific part) - Object impl = component.getFcInterface("/content"); - Component boot = Fractal.getBootstrapComponent(); - GenericFactory gf = Fractal.getGenericFactory(boot); - Component newComponent = gf.newFcInstance(newType, newControllerDesc, impl); - - // 5' adds "newComponent" to the parent components - for (int i = 0; i < parents.length; ++i) { - Fractal.getContentController(parents[i]).addFcSubComponent(newComponent); - } - - // 4' adds the bindings to "newComponent" - Iterator it = bindingsTo.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry e = (Map.Entry)it.next(); - Interface clientItf = (Interface)e.getKey(); - String serverItf = (String)e.getValue(); - Fractal.getBindingController(clientItf.getFcItfOwner()).bindFc( - clientItf.getFcItfName(), newComponent.getFcInterface(serverItf)); - } - - // 3' binds "newComponent" - try { - bc = Fractal.getBindingController(newComponent); - } catch (NoSuchInterfaceException e) { - bc = null; - } - if (bc != null) { - Iterator i = bindingsFrom.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry e = (Map.Entry)i.next(); - String clientItf = (String)e.getKey(); - Object serverItf = e.getValue(); - bc.bindFc(clientItf, serverItf); - } - } - - // 2' starts the parent components of "newComponent" - for (int i = 0; i < parents.length; ++i) { - if (parentStates[i]) { - parentLCs[i].startFc(); - } - } - - // 1' starts "newComponent" - if (isStarted) { - try { - Fractal.getLifeCycleController(newComponent).startFc(); - } catch (NoSuchInterfaceException ignored) { - } - } - - // returns the new component - return newComponent; - } -} diff --git a/julia/examples/interceptor/src/stat/StatClassTransformer.java b/julia/examples/interceptor/src/stat/StatClassTransformer.java deleted file mode 100644 index 8e9855b8dbe04c73922a61587995577f4b2b06d6..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/src/stat/StatClassTransformer.java +++ /dev/null @@ -1,110 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package stat; - -import org.objectweb.fractal.julia.asm.ClassTransformer; - -import org.objectweb.asm.ClassAdapter; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.CodeAdapter; -import org.objectweb.asm.Constants; - -/** - * This class transformer inserts call to "getField" and "setField" methods - * before each read and write field access instructions in the class it visits. - */ - -public class StatClassTransformer extends ClassAdapter - implements ClassTransformer -{ - - private String className; - - public StatClassTransformer () { - super(null); - } - - public void setClassVisitor (final ClassVisitor cv) { - this.cv = cv; - } - - public void visit ( - final int access, - final String name, - final String superName, - final String[] interfaces, - final String sourceFile) - { - cv.visit(access, name, superName, interfaces, sourceFile); - this.className = name; - } - - public CodeVisitor visitMethod ( - final int access, - final String name, - final String desc, - final String[] exceptions, - final Attribute attrs) - { - CodeVisitor v = cv.visitMethod(access, name, desc, exceptions, attrs); - if (v != null) { - v = new StatCodeTransformer(className, v); - } - return v; - } - - private static class StatCodeTransformer extends CodeAdapter - implements Constants - { - - private String className; - - public StatCodeTransformer (final String className, final CodeVisitor c) { - super(c); - this.className = className; - } - - public void visitFieldInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - if (opcode == GETFIELD && owner.equals(className)) { - cv.visitVarInsn(ALOAD, 0); - cv.visitLdcInsn(name); - cv.visitMethodInsn( - INVOKEVIRTUAL, className, "getField", "(Ljava/lang/String;)V"); - } else if (opcode == PUTFIELD && owner.equals(className)) { - cv.visitVarInsn(ALOAD, 0); - cv.visitLdcInsn(name); - cv.visitMethodInsn( - INVOKEVIRTUAL, className, "setField", "(Ljava/lang/String;)V"); - } - cv.visitFieldInsn(opcode, owner, name, desc); - } - } -} diff --git a/julia/examples/interceptor/src/stat/StatCodeGenerator.java b/julia/examples/interceptor/src/stat/StatCodeGenerator.java deleted file mode 100644 index a08437465bff82f3390c410e76016cd4985d4619..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/src/stat/StatCodeGenerator.java +++ /dev/null @@ -1,72 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package stat; - -import org.objectweb.fractal.julia.asm.SimpleCodeGenerator; - -import java.lang.reflect.Method; - -/** - * This code generator generates interception code of the following form for - * all methods: - * - *

- * method-signature {
- *   return-type result;
- *   long context = delegate.preMethod(method-name);
- *   // original method code, where returns are replaced with gotos
- *   delegate.postMethod(method-name, context);
- *   return result;
- * }
- * 
- * - * where delegate is initialized with the following code: - * - *

- * delegate = (...)ic.getInterface("stat-controller");
- * 
- */ - -public class StatCodeGenerator extends SimpleCodeGenerator { - - protected String getControllerInterfaceName () { - return "stat-controller"; - } - - protected String getPreMethodName () { - return "preMethod"; - } - - protected String getPostMethodName () { - return "postMethod"; - } - - protected Class getContextType () { - return Long.TYPE; - } - - protected String getMethodName (final Method m) { - return m.getName(); - } -} diff --git a/julia/examples/interceptor/src/stat/StatController.java b/julia/examples/interceptor/src/stat/StatController.java deleted file mode 100644 index 3f641082e1a57184c0f85c1f48977b6e3556e407..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/src/stat/StatController.java +++ /dev/null @@ -1,65 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package stat; - -public interface StatController { - - /** - * Returns the total number of method calls that have been made on the server - * interfaces of the component (control interfaces excluded). - */ - - int getNumberOfMethodCall (); - - /** - * Returns the total number of method calls that have been made on the server - * interfaces of the component (control interfaces excluded), and that have - * "succeded", i.e., that have not thrown an exception. - */ - - int getNumberOfMethodSuccess (); - - /** - * Returns the number of field read accesses that have been made in the - * component. - */ - - int getNumberOfFieldRead (); - - /** - * Returns the number of field write accesses that have been made in the - * component. - */ - - int getNumberOfFieldWrite (); - - /** - * Returns the total execution time, in milliseconds, of the method calls that - * have been made on the server interfaces of the component (control - * interfaces excluded), and that have "succeded", i.e., that have not thrown - * an exception. - */ - - long getTotalExecutionTime (); -} diff --git a/julia/examples/interceptor/src/stat/StatControllerImpl.java b/julia/examples/interceptor/src/stat/StatControllerImpl.java deleted file mode 100644 index c35bd2c9cc915d109f70d2ab9e4fdce3da72bebb..0000000000000000000000000000000000000000 --- a/julia/examples/interceptor/src/stat/StatControllerImpl.java +++ /dev/null @@ -1,144 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package stat; - -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Tree; - -public class StatControllerImpl implements Initializable, StatController { - - /** - * Number of calls to preMethod, i.e., the total number of method calls. - */ - - private int calls; - - /** - * Number of calls to postMethod, i.e., the total number of method success - * (since postMethod is not called inside a finally block - see - * StatCodeGenerator - it is not called if the intercepted method throws an - * exception). - */ - - private int success; - - /** - * Number of read field accesses. - */ - - private int reads; - - /** - * Number of write field accesses. - */ - - private int writes; - - /** - * Total execution time, in milliseconds - */ - - private long totalTime; - - /** - * True if counters must be reinitialized when getter methods are called. - */ - - private boolean reset; - - // implementation of the Initializable interface - - public void initialize (final Tree args) { - String s = args.getSubTree(0).toString(); - if (s.equals("on")) { - reset = true; - } - } - - // implementation of the StatController interface - - public int getNumberOfMethodCall () { - int calls = this.calls; - if (reset) { - this.calls = 0; - } - return calls; - } - - public int getNumberOfMethodSuccess () { - int success = this.success; - if (reset) { - this.success = 0; - } - return success; - } - - public int getNumberOfFieldRead () { - int reads = this.reads; - if (reset) { - this.reads = 0; - } - return reads; - } - - public int getNumberOfFieldWrite () { - int writes = this.writes; - if (reset) { - this.writes = 0; - } - return writes; - } - - public long getTotalExecutionTime () { - long totalTime = this.totalTime; - if (reset) { - this.totalTime = 0; - } - return totalTime; - } - - // methods called by the associated interceptor - - public long preMethod (final String method) { - synchronized (this) { - ++calls; - return System.currentTimeMillis(); - } - } - - public void postMethod (final String method, long start) { - synchronized (this) { - ++success; - totalTime += System.currentTimeMillis() - start; - } - } - - public void getField (final String field) { - ++reads; - } - - public void setField (final String field) { - ++writes; - } -} diff --git a/julia/examples/j2me/build.xml b/julia/examples/j2me/build.xml deleted file mode 100644 index cfed037be2654bab71490869a6ab44067b461576..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/build.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/examples/j2me/etc/julia-j2me.cfg b/julia/examples/j2me/etc/julia-j2me.cfg deleted file mode 100644 index 88dc216bba391a2ca6a996e7b5a1dfa152105164..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/etc/julia-j2me.cfg +++ /dev/null @@ -1,26 +0,0 @@ -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - org.objectweb.fractal.julia.loader.BasicLoader - # org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) diff --git a/julia/examples/j2me/etc/julia.cfg b/julia/examples/j2me/etc/julia.cfg deleted file mode 100644 index 7ae0232cc3b757401634b57a9bdb6d65af7a5ec8..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/etc/julia.cfg +++ /dev/null @@ -1,636 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -# overriden definitions to remove mixins that do not work with J2ME - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - # org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - # org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) diff --git a/julia/examples/j2me/src/j2me/ClientImpl.java b/julia/examples/j2me/src/j2me/ClientImpl.java deleted file mode 100644 index 77a27b28c428139c6e89541e453a736c7e43f5f4..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/src/j2me/ClientImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package j2me; - -import org.objectweb.fractal.api.control.BindingController; - -public class ClientImpl implements Main, BindingController { - - private Service service; - - public void main (final String[] args) { - service.print("hello world"); - } - - public String[] listFc () { - return new String[] { "s" }; - } - - public Object lookupFc (final String cItf) { - if (cItf.equals("s")) { - return service; - } - return null; - } - - public void bindFc (final String cItf, final Object sItf) { - if (cItf.equals("s")) { - service = (Service)sItf; - } - } - - public void unbindFc (final String cItf) { - if (cItf.equals("s")) { - service = null; - } - } -} diff --git a/julia/examples/j2me/src/j2me/HelloWorld.java b/julia/examples/j2me/src/j2me/HelloWorld.java deleted file mode 100644 index c400398b2104b27df94de94c332b581c77064fd9..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/src/j2me/HelloWorld.java +++ /dev/null @@ -1,83 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package j2me; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.util.Fractal; - -public class HelloWorld { - - public static void main (final String[] args) throws Exception { - - Component boot = Fractal.getBootstrapComponent(); - TypeFactory tf = Fractal.getTypeFactory(boot); - // type of root component - ComponentType rType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "j2me.Main", false, false, false) - }); - // type of client component - ComponentType cType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "j2me.Main", false, false, false), - tf.createFcItfType("s", "j2me.Service", true, false, false) - }); - // type of server component - ComponentType sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", "j2me.Service", false, false, false), - tf.createFcItfType( - "attribute-controller", - "j2me.ServiceAttributes", - false, - false, - false) - }); - - GenericFactory cf = Fractal.getGenericFactory(boot); - - // create root component - Component rComp = cf.newFcInstance(rType, "composite", null); - // create client component - Component cComp = cf.newFcInstance(cType, "primitive", "j2me.ClientImpl"); - // create server component - Component sComp = cf.newFcInstance(sType, "primitive", "j2me.ServerImpl"); - ((ServiceAttributes)Fractal.getAttributeController(sComp)).setHeader("-> "); - ((ServiceAttributes)Fractal.getAttributeController(sComp)).setCount(1); - - // component assembly - Fractal.getContentController(rComp).addFcSubComponent(cComp); - Fractal.getContentController(rComp).addFcSubComponent(sComp); - Fractal.getBindingController(rComp).bindFc("m", cComp.getFcInterface("m")); - Fractal.getBindingController(cComp).bindFc("s", sComp.getFcInterface("s")); - - // start root component - Fractal.getLifeCycleController(rComp).startFc(); - - // call main method - ((Main)rComp.getFcInterface("m")).main(null); - } -} diff --git a/julia/examples/j2me/src/j2me/Main.java b/julia/examples/j2me/src/j2me/Main.java deleted file mode 100644 index 9a29bc491b22b9749a4bf2596ed72d0e6abacbe5..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/src/j2me/Main.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package j2me; - -public interface Main { - void main (String[] args); -} diff --git a/julia/examples/j2me/src/j2me/ServerImpl.java b/julia/examples/j2me/src/j2me/ServerImpl.java deleted file mode 100644 index cd0748a275aa074a289e53063314c198989f7c00..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/src/j2me/ServerImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package j2me; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header = ""; - - private int count = 0; - - public void print (final String msg) { - new Exception() { - public String toString () { - return "Server: print method called"; - } - }.printStackTrace(); - System.err.println("Server: begin printing..."); - for (int i = 0; i < count; ++i) { - System.err.println(header + msg); - } - System.err.println("Server: print done."); - } - - public String getHeader () { - return header; - } - - public void setHeader (final String header) { - this.header = header; - } - - public int getCount () { - return count; - } - - public void setCount (final int count) { - this.count = count; - } -} diff --git a/julia/examples/j2me/src/j2me/Service.java b/julia/examples/j2me/src/j2me/Service.java deleted file mode 100644 index 0097eb7df09edb7da18fc6c558d667ccb2b4f0b0..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/src/j2me/Service.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package j2me; - -public interface Service { - void print (String msg); -} diff --git a/julia/examples/j2me/src/j2me/ServiceAttributes.java b/julia/examples/j2me/src/j2me/ServiceAttributes.java deleted file mode 100644 index 64e7b9ff6aa96aec7af8551fe3214a565378111b..0000000000000000000000000000000000000000 --- a/julia/examples/j2me/src/j2me/ServiceAttributes.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package j2me; - -import org.objectweb.fractal.api.control.AttributeController; - -public interface ServiceAttributes extends AttributeController { - String getHeader (); - void setHeader (String header); - int getCount (); - void setCount (int count); -} diff --git a/julia/examples/protoactive/README.txt b/julia/examples/protoactive/README.txt deleted file mode 100644 index 1bccd29f65324f3b2fa5e60f5304d8e4647c450a..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/README.txt +++ /dev/null @@ -1,34 +0,0 @@ -This example shows how to extend Julia in order to provide Fractal components -that communicate through asynchronous method calls with futures, as in -ProActive (see http://www.objectweb.org). - -In order to do this we define a MetaObject interface (similar to the Proxy -interface in ProActive), that all meta objects must implement, as well as a -StubClassGenerator (similar to the BytecodeStubBuilder in ProActive) class -generator, whose role is to generate code to reify calls for each method of -each functional interface of the component, and to pass these reified method -calls to the MetaObject interface provided by the controller part of the -component. - -We then define a BodyMetaObject meta object that handles method calls in the -following way: -- create a future object to hold the reply, -- put the reified method call and its associated future in a "request" queue, -- return the future object immediately -A separate thread services the requests in the request queue in FIFO order, -and puts the results in the future objects. The classes of the future objects -are dynamically created by a FutureClassGenerator class generator. - -In order to create an "active" Julia component, we just have to add a -BodyMetaObject in the controller part of the component, and to use the -StubClassGenerator as interceptor class generator (see the julia.cfg file). - - -Note: although this example is inspired from ProActive, and uses similar -package and class names, it is just a very small prototype used to illustrate -how Julia can be extended (hence the 'protoactive' name). In particular, many -ProActive features are not implemented in this example: distribution (and -therefore mobility), security, call by value, exception handling... Finally, -the return type of an asynchronous methods cannot be a class (it must be -an interface or void - this is not an inherent limitation: it just happens -that this feature is currently not implemented). diff --git a/julia/examples/protoactive/etc/execute.properties b/julia/examples/protoactive/etc/execute.properties deleted file mode 100644 index 9a6647538f261ea959f633498f5baf6a6609a3fe..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/etc/execute.properties +++ /dev/null @@ -1,16 +0,0 @@ -# JVM arguments -# add "-Djulia.loader.gen.log=err" to log the generated classes -# add "-Djulia.loader.gen.dir=/tmp" to store the generated classes on disk - -run.jvm.parameters \ - -Dfractal.provider=org.objectweb.fractal.julia.Julia \ - -Djulia.loader=org.objectweb.fractal.julia.loader.DynamicLoader \ - -Djulia.config=etc/julia.cfg - -# Java class to be launched - -run.classname protoactive.ProtoActive - -# Application arguments - -run.parameters diff --git a/julia/examples/protoactive/etc/julia.cfg b/julia/examples/protoactive/etc/julia.cfg deleted file mode 100644 index d72b2d003195fbb04b1bba40d084528e8e0d528f..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/etc/julia.cfg +++ /dev/null @@ -1,659 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - # org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - # org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (/meta-object protoactive.core.mop.MetaObject) - ) - ( - 'component-impl - 'container-binding-controller-impl - protoactive.core.body.metaobject.BodyMetaObject - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - protoactive.core.mop.StubCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) diff --git a/julia/examples/protoactive/src/protoactive/BinaryTree.java b/julia/examples/protoactive/src/protoactive/BinaryTree.java deleted file mode 100644 index 6e1fb54cbbb5bb48932f96666613c1b3ca2f3c01..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/BinaryTree.java +++ /dev/null @@ -1,31 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive; - -public interface BinaryTree { - - void put (int key, Object value); - - Value get (int key); -} diff --git a/julia/examples/protoactive/src/protoactive/BinaryTreeImpl.java b/julia/examples/protoactive/src/protoactive/BinaryTreeImpl.java deleted file mode 100644 index be87ed32a31ac20fd1558aef4a3039a4d9ae79fd..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/BinaryTreeImpl.java +++ /dev/null @@ -1,151 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.util.Fractal; - - -public class BinaryTreeImpl implements BinaryTree, BindingController { - - private int key; - private Value value; - - private BinaryTree leftTree; - private BinaryTree rightTree; - - private static ComponentType TYPE; - - // implementation of the BinaryTree interface - - public Value get (int key) { - if (leftTree == null && rightTree == null) { - return null; - } - if (key == this.key) { - return value; - } else if (key < this.key) { - return leftTree.get(key); - } else { - return rightTree.get(key); - } - } - - public void put (int key, Object value) { - if (leftTree == null && rightTree == null) { - this.key = key; - this.value = new ValueImpl(value); - - Component leftComp = - ProtoActive.createActive(getType(), "protoactive.BinaryTreeImpl"); - Component rightComp = - ProtoActive.createActive(getType(), "protoactive.BinaryTreeImpl"); - - try { - leftTree = (BinaryTree)leftComp.getFcInterface("server"); - rightTree = (BinaryTree)rightComp.getFcInterface("server"); - } catch (NoSuchInterfaceException e) { - e.printStackTrace(); - System.exit(0); - } - } - if (key == this.key) { - this.value = new ValueImpl(value); - } else if (key < this.key) { - leftTree.put(key, value); - } else { - rightTree.put(key, value); - } - } - - // implementation of the BindingController interface - - public String[] listFc () { - return new String[] { "left", "right" }; - } - - public Object lookupFc (String clientItfName) { - if (clientItfName.equals("left")) { - return leftTree; - } else if (clientItfName.equals("right")) { - return rightTree; - } - return null; - } - - public void bindFc (String clientItfName, Object serverItf) { - if (clientItfName.equals("left")) { - leftTree = (BinaryTree)serverItf; - } else if (clientItfName.equals("right")) { - rightTree = (BinaryTree)serverItf; - } - } - - public void unbindFc (String clientItfName) { - if (clientItfName.equals("left")) { - leftTree = null; - } else if (clientItfName.equals("right")) { - rightTree = null; - } - } - - // utility classes and methods - - static ComponentType getType () { - if (TYPE == null) { - try { - Component boot = Fractal.getBootstrapComponent(); - TypeFactory tf = Fractal.getTypeFactory(boot); - TYPE = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", "protoactive.BinaryTree", false, false, false), - tf.createFcItfType("left", "protoactive.BinaryTree", true, false, false), - tf.createFcItfType("right", "protoactive.BinaryTree", true, false, false) - }); - } catch (Exception e) { - e.printStackTrace(); - System.exit(0); - } - } - return TYPE; - } - - static class ValueImpl implements Value { - - private Object value; - - public ValueImpl (final Object value) { - this.value = value; - } - - public String toString () { - return value.toString(); - } - } -} diff --git a/julia/examples/protoactive/src/protoactive/ProtoActive.java b/julia/examples/protoactive/src/protoactive/ProtoActive.java deleted file mode 100644 index aca8cb6b6e7ced6b5b767ca71c65882a5d3f2715..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/ProtoActive.java +++ /dev/null @@ -1,71 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.ComponentType; - -import org.objectweb.fractal.util.Fractal; - -public class ProtoActive { - - private ProtoActive () { - } - - public static Component createActive ( - final ComponentType type, - final String className) - { - try { - Component boot = Fractal.getBootstrapComponent(); - GenericFactory cf = Fractal.getGenericFactory(boot); - Component comp = cf.newFcInstance(type, "primitive", className); - Fractal.getLifeCycleController(comp).startFc(); - return comp; - } catch (Exception e) { - e.printStackTrace(); - System.exit(0); - return null; - } - } - - public static void main (final String[] args) throws Exception { - - Component treeComp = ProtoActive.createActive( - BinaryTreeImpl.getType(), "protoactive.BinaryTreeImpl"); - - BinaryTree t = (BinaryTree)treeComp.getFcInterface("server"); - - t.put(1, "one"); - t.put(2, "two"); - t.put(3, "three"); - t.put(4, "four"); - - System.err.println("Value associated to key 3 = " + t.get(3)); - System.err.println("Value associated to key 4 = " + t.get(4)); - System.err.println("Value associated to key 2 = " + t.get(2)); - System.err.println("Value associated to key 1 = " + t.get(1)); - } -} diff --git a/julia/examples/protoactive/src/protoactive/Value.java b/julia/examples/protoactive/src/protoactive/Value.java deleted file mode 100644 index ae2efa2783cc1462222d6c4bae8fc81af20b2bd6..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/Value.java +++ /dev/null @@ -1,29 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive; - -public interface Value { - - String toString (); -} diff --git a/julia/examples/protoactive/src/protoactive/core/body/future/FutureClassGenerator.java b/julia/examples/protoactive/src/protoactive/core/body/future/FutureClassGenerator.java deleted file mode 100644 index b04e1fe6df8c778fb06be98a80ccd9ba3a65ef07..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/core/body/future/FutureClassGenerator.java +++ /dev/null @@ -1,109 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive.core.body.future; - -import org.objectweb.fractal.julia.asm.AbstractClassGenerator; - -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Type; - -import java.lang.reflect.Method; - -/** - * A class generator to generate LocalFuture classes. - * This class generator generates sub classes of the LocalFuture class that - * implement the given set of interfaces. - *

- * The code generated for the I interface below is the following: - *

- * public interface I {
- *   void m (int i);
- *   Object n (String s);
- * }
- *
- * public class XYZ extends LocalFuture implements I, Generated {
- *
- *   public void m (int i) {
- *     waitReply();
- *     ((I)reply).m();
- *   }
- *
- *   public Object n (String s) {
- *     waitReply();
- *     return ((I)reply).n(s);
- *   }
- *
- *   public String getFcGeneratorParameters () {
- *     return "(... LocalFuture (I))";
- *   }
- * }
- * 
- */ - -public class FutureClassGenerator extends AbstractClassGenerator { - - protected void generateMethod (final Method m) { - // generate the header of the forwarder method - String itf = m.getDeclaringClass().getName().replace('.', '/'); - String mName = m.getName(); - String mDesc = Type.getMethodDescriptor(m); - Class[] params = m.getParameterTypes(); - Class result = m.getReturnType(); - Class[] exceptions = m.getExceptionTypes(); - String[] excepts = new String[exceptions.length]; - for (int i = 0; i < exceptions.length; ++i) { - excepts[i] = exceptions[i].getName().replace('.', '/'); - } - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, excepts, null); - - // generate code to invoke 'waitReply' - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKEVIRTUAL, name, "waitReply", "()V"); - - // generate code to load and cast the 'reply' field - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "reply", "Ljava/lang/Object;"); - mv.visitTypeInsn(CHECKCAST, itf); - - // generate code to push method parameters - int offset = 1; - for (int i = 0; i < params.length; ++i) { - mv.visitVarInsn(ILOAD + getOpcodeOffset(params[i]), offset); - offset += getSize(params[i]); - } - - // generate code to invoke method - mv.visitMethodInsn(INVOKEINTERFACE, itf, mName, mDesc); - - // generate code to return result - if (result == Void.TYPE) { - mv.visitInsn(RETURN); - } else { - mv.visitInsn(IRETURN + getOpcodeOffset(result)); - } - - // end method - mv.visitMaxs(Math.max(offset, getSize(result)), offset); - } -} diff --git a/julia/examples/protoactive/src/protoactive/core/body/future/LocalFuture.java b/julia/examples/protoactive/src/protoactive/core/body/future/LocalFuture.java deleted file mode 100644 index dba3266c7cda0b70e282828055652749c7a15e09..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/core/body/future/LocalFuture.java +++ /dev/null @@ -1,47 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive.core.body.future; - -/** - * An abstract future object. - */ - -public class LocalFuture { - - protected Object reply; - - protected synchronized void waitReply () { - while (reply == null) { - try { - wait(); - } catch (InterruptedException e) { - } - } - } - - public synchronized void receiveReply (Object reply) { - this.reply = reply; - notifyAll(); - } -} diff --git a/julia/examples/protoactive/src/protoactive/core/body/metaobject/BodyMetaObject.java b/julia/examples/protoactive/src/protoactive/core/body/metaobject/BodyMetaObject.java deleted file mode 100644 index 7b039e46eba710297d634013e8e0fb53f00c7800..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/core/body/metaobject/BodyMetaObject.java +++ /dev/null @@ -1,194 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive.core.body.metaobject; - -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.Fractal; -import org.objectweb.fractal.api.Component; - -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; - -import protoactive.core.body.future.LocalFuture; -import protoactive.core.mop.MetaObject; - -import java.lang.reflect.Method; -import java.util.List; -import java.util.ArrayList; - -/** - * A meta object to handle reified method calls in an asynchronous way. This - * meta object is a controller object that also implements the - * LifeCycleController interface. - */ - -public class BodyMetaObject - implements LifeCycleController, MetaObject, Runnable -{ - - private List requests; - - private boolean running; - - private boolean requestStop; - - /** - * Creates a future object to wait for the reply of the given call, and - * push the reified method call and its associated future in the request - * list. Returns the future object immediately. - */ - - public Object handleMethodCall ( - final String itf, - final Object target, - final Method m, - final Object[] args) - { - Request r = new Request(); - r.target = target; - r.m = m; - r.args = args; - - Class c = m.getReturnType(); - if (c == Void.TYPE) { - r.future = null; - } else { - try { - Component boot = Fractal.getBootstrapComponent(); - Loader loader = (Loader)boot.getFcInterface("loader"); - r.future = (LocalFuture)loader.newObject( - new Tree(new Tree[] { - new Tree(new Tree[] { - new Tree("protoactive.core.body.future.FutureClassGenerator"), - new Tree("protoactive.core.body.future.LocalFuture"), - new Tree(new Tree[] { new Tree(c.getName()) }) - }) - }) - ); - } catch (Exception e) { - e.printStackTrace(); - throw new Error(); - } - } - - // put request into request list - synchronized (this) { - if (requests == null) { - requests = new ArrayList(); - } - requests.add(r); - notifyAll(); - } - - // return the future object - return r.future; - } - - public boolean isReflectedCall () { - Class[] stack = Helper.INSTANCE.getClassContext(); - return - stack.length > 3 && - stack[3].getName().equals("protoactive.core.body.metaobject.Request"); - } - - public String getFcState () { - return (running ? STARTED : STOPPED); - } - - public void startFc () { - synchronized (this) { - if (!running) { - // if not already running, start a thread to handle requests - running = true; - requestStop = false; - new Thread(this).start(); - } - } - } - - public void stopFc () { - synchronized (this) { - // ask the service thread to stop - requestStop = true; - notifyAll(); - // wait until is effectively stopped - while (running) { - try { - wait(); - } catch (InterruptedException e) { - } - } - } - } - - /** - * Code of the thread that handles requests in FIFO order. This thread - * gets a request from the request list, executes the corresponding method - * call, and puts the result in the associated future object. It then - * gets another request, and so on until the 'requestStop' flag is true. It - * then sets the 'running' flag to 'false' and stops itself. - */ - - public void run () { - while (true) { - // get a request from request list - Request r; - synchronized (this) { - // block until there is at least one request in the queue, - // or requestStop is true - while ((requests == null || requests.size() == 0) && !requestStop) { - try { - wait(); - } catch (InterruptedException e) { - } - } - if (!requestStop) { - r = (Request)requests.remove(0); - } else { - // we are asked to stop, so we stop ourselves, and notify others that - // we have stopped ourselves. - running = false; - notifyAll(); - return; - } - } - // respond to the request - System.err.println( - Thread.currentThread() + " HANDLE REQUEST " + r); - Object reply = r.invoke(); - if (r.future != null) { - r.future.receiveReply(reply); - } - } - } - - public static class Helper extends SecurityManager { - - public final static Helper INSTANCE = new Helper(); - - public Class[] getClassContext() { - return super.getClassContext(); - } - } -} diff --git a/julia/examples/protoactive/src/protoactive/core/body/metaobject/Request.java b/julia/examples/protoactive/src/protoactive/core/body/metaobject/Request.java deleted file mode 100644 index 083d15df10fb67408aa4326d25e94cb97a2b7306..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/core/body/metaobject/Request.java +++ /dev/null @@ -1,58 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive.core.body.metaobject; - -import protoactive.core.body.future.LocalFuture; - -import java.lang.reflect.Method; - -public class Request { - - public Object target; - - public Method m; - - public Object[] args; - - public LocalFuture future; - - public String toString () { - String s = m.getName() + "("; - for (int i = 0; i < args.length; ++i) { - s = s + args[i]; - if (i < args.length - 1) { - s = s + ","; - } - } - return s + ")"; - } - - public Object invoke () { - try { - return m.invoke(target, args); - } catch (Exception e) { - throw new Error("Invocation exception: " + e); - } - } -} diff --git a/julia/examples/protoactive/src/protoactive/core/mop/MetaObject.java b/julia/examples/protoactive/src/protoactive/core/mop/MetaObject.java deleted file mode 100644 index 1e316317b26c902e07c562d0bb8e48b0e81d4aab..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/core/mop/MetaObject.java +++ /dev/null @@ -1,31 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive.core.mop; - -import java.lang.reflect.Method; - -public interface MetaObject { - - Object handleMethodCall (String itf, Object target, Method m, Object[] args); -} diff --git a/julia/examples/protoactive/src/protoactive/core/mop/StubCodeGenerator.java b/julia/examples/protoactive/src/protoactive/core/mop/StubCodeGenerator.java deleted file mode 100644 index a734575f90d889ec80702c585c9dd306c9aeef07..0000000000000000000000000000000000000000 --- a/julia/examples/protoactive/src/protoactive/core/mop/StubCodeGenerator.java +++ /dev/null @@ -1,83 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package protoactive.core.mop; - -import org.objectweb.fractal.julia.asm.MetaCodeGenerator; - -/** - * A {@link CodeGenerator CodeGenerator} to generate interception code that - * reifies method calls and pass them to the MetaObject interface of the - * component. More precisely, the interception code generated for a method m: - *
- * int m (int i, String s) {
- *   // original code
- * }
- * 
- * is the following: - *
- * int m (int i, String s) {
- *   if (!AbstractMetaObject.isReflectedCall()) {
- *     return ((Integer)mo.handleMethodCall(new MethodCall(
- *       "I",
- *       "m",
- *       "(ILjava/lang/String;)I",
- *       new Object[] {new Integer(i), s}))).intValue();
- *   } else {
- *     // original code
- *   }
- * }
- * 
- * The {@link #generateInitCode generateInitCode} method generates code blocks - * of the following form: - *
- * mo = (...)ic.getInterface("/meta-object");
- * 
- * where mo is a field added to the class that is being generated (in - * fact, if the controller and interceptor classes are merged (see {@link - * InterceptorClassGenerator InterceptorClassGenerator}), the mo field - * is not generated and replaced by this in the above code). - */ - -public class StubCodeGenerator extends MetaCodeGenerator { - - protected String getControllerInterfaceName () { - return "/meta-object"; - } - - protected String getHandleMethodCallMethodName () { - return "handleMethodCall"; - } - - protected boolean reifyInterfaceName () { - return true; - } - - protected boolean reifyTargetObject () { - return true; - } - - protected String getIsReflectedCallMethodName () { - return "isReflectedCall"; - } -} diff --git a/julia/externals/README.txt b/julia/externals/README.txt deleted file mode 100644 index 336e5a5f98d9fbe884814c08329ea286ea55a00a..0000000000000000000000000000000000000000 --- a/julia/externals/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the external libraries required for running the product. diff --git a/julia/externals/asm.jar b/julia/externals/asm.jar deleted file mode 100644 index 41e00315ffb0dbd0a386c5a7d39f3bea178804ee..0000000000000000000000000000000000000000 Binary files a/julia/externals/asm.jar and /dev/null differ diff --git a/julia/externals/fractal.jar b/julia/externals/fractal.jar deleted file mode 100644 index 6bf74c05aaf416490008ba43dce643df09adbbd5..0000000000000000000000000000000000000000 Binary files a/julia/externals/fractal.jar and /dev/null differ diff --git a/julia/externals/ow_monolog.jar b/julia/externals/ow_monolog.jar deleted file mode 100644 index e6eb7831a9c2f630430663dd3619b5f083dd17a7..0000000000000000000000000000000000000000 Binary files a/julia/externals/ow_monolog.jar and /dev/null differ diff --git a/julia/jdoc/README.txt b/julia/jdoc/README.txt deleted file mode 100644 index a78cb67fa8d1679fe5fd3fe8efc3aab86e5b6db8..0000000000000000000000000000000000000000 --- a/julia/jdoc/README.txt +++ /dev/null @@ -1,39 +0,0 @@ -This directory contains ant files to build the javadocs of the product. -The following rules describe the convention to write such files: - -- An ant file must build only one javadoc. - -- As there may exist several javadocs, all javadocs must be produced - in a sub dir of ${out.dist.jdoc}. For example the user javadoc could be - produced into the ${out.dist.jdoc}/user directory - -- The name of the ant file must be the name of the destination directory of the - javadoc it builds. - -- Only the default task is called on an xml file. - -Sample ant file: - - - - - - - - - - - - - - - - - - ... - - - - diff --git a/julia/jdoc/asm-list/package-list b/julia/jdoc/asm-list/package-list deleted file mode 100644 index a5d8120a2ddf779ee56f5caf3a59dd10c76e8f01..0000000000000000000000000000000000000000 --- a/julia/jdoc/asm-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.asm diff --git a/julia/jdoc/fractal-list/package-list b/julia/jdoc/fractal-list/package-list deleted file mode 100644 index 0c7ce27ea081eefb65b09e2cd0f5866cd084660f..0000000000000000000000000000000000000000 --- a/julia/jdoc/fractal-list/package-list +++ /dev/null @@ -1,4 +0,0 @@ -org.objectweb.fractal.api -org.objectweb.fractal.api.control -org.objectweb.fractal.api.factory -org.objectweb.fractal.api.type diff --git a/julia/jdoc/jdk-list/package-list b/julia/jdoc/jdk-list/package-list deleted file mode 100644 index 7f582f053dd0c03fe4df1013b086217010da00f1..0000000000000000000000000000000000000000 --- a/julia/jdoc/jdk-list/package-list +++ /dev/null @@ -1,76 +0,0 @@ -java.applet -java.awt -java.awt.color -java.awt.datatransfer -java.awt.dnd -java.awt.event -java.awt.font -java.awt.geom -java.awt.im -java.awt.im.spi -java.awt.image -java.awt.image.renderable -java.awt.print -java.beans -java.beans.beancontext -java.io -java.lang -java.lang.ref -java.lang.reflect -java.math -java.net -java.rmi -java.rmi.activation -java.rmi.dgc -java.rmi.registry -java.rmi.server -java.security -java.security.acl -java.security.cert -java.security.interfaces -java.security.spec -java.sql -java.text -java.util -java.util.jar -java.util.zip -javax.accessibility -javax.naming -javax.naming.directory -javax.naming.event -javax.naming.ldap -javax.naming.spi -javax.rmi -javax.rmi.CORBA -javax.sound.midi -javax.sound.midi.spi -javax.sound.sampled -javax.sound.sampled.spi -javax.swing -javax.swing.border -javax.swing.colorchooser -javax.swing.event -javax.swing.filechooser -javax.swing.plaf -javax.swing.plaf.basic -javax.swing.plaf.metal -javax.swing.plaf.multi -javax.swing.table -javax.swing.text -javax.swing.text.html -javax.swing.text.html.parser -javax.swing.text.rtf -javax.swing.tree -javax.swing.undo -javax.transaction -org.omg.CORBA -org.omg.CORBA_2_3 -org.omg.CORBA_2_3.portable -org.omg.CORBA.DynAnyPackage -org.omg.CORBA.ORBPackage -org.omg.CORBA.portable -org.omg.CORBA.TypeCodePackage -org.omg.CosNaming -org.omg.CosNaming.NamingContextPackage -org.omg.SendingContext -org.omg.stub.java.rmi diff --git a/julia/jdoc/julia.xml b/julia/jdoc/julia.xml deleted file mode 100644 index 6da084bf98f59a85b015a0b13d1baa2ef0fbcabc..0000000000000000000000000000000000000000 --- a/julia/jdoc/julia.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/jdoc/monolog-list/package-list b/julia/jdoc/monolog-list/package-list deleted file mode 100644 index 1ed8775b725c050c235db5e1b94388c144232567..0000000000000000000000000000000000000000 --- a/julia/jdoc/monolog-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.util.monolog.api diff --git a/julia/src/org/objectweb/fractal/julia/BasicComponentInterface.java b/julia/src/org/objectweb/fractal/julia/BasicComponentInterface.java deleted file mode 100644 index b4640d4a4e00d2724e0533f51824f4d690081a65..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/BasicComponentInterface.java +++ /dev/null @@ -1,191 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.Type; - -/** - * Provides a basic implementation of the {@link ComponentInterface} interface. - */ - -public abstract class BasicComponentInterface implements ComponentInterface { - - /** - * The component to which this component interface belongs. - */ - - protected Component owner; - - /** - * The name of this component interface. - */ - - protected String name; - - /** - * The type of this component interface. - */ - - protected Type type; - - /** - * The flags of this component interfaces. These flags indicates if this - * component interface is an internal interface or not, and if it has an - * permanently associated interceptor or not. - */ - - protected int flags; - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Constructs an uninitialized {@link BasicComponentInterface}. This default - * public constructor is needed for the implementation of the {@link #clone - * clone} method. - */ - - public BasicComponentInterface () { - } - - /** - * Constructs a new {@link BasicComponentInterface}. - * - * @param owner the component to which the interface belongs. If this - * parameter is null the owner is set to the interface itself, - * which must therefore be a {@link Component} interface. - * @param name the name of the interface. - * @param type the type of the interface. - * @param isInternal true if the interface is an internal interface. - * @param impl the object that implements the interface. - */ - - public BasicComponentInterface ( - final Component owner, - final String name, - final Type type, - final boolean isInternal, - final Object impl) - { - boolean hasInterceptor = impl instanceof Interceptor; - this.owner = owner == null ? (Component)this : owner; - this.name = name; - this.type = type; - this.flags = (isInternal ? 0x01 : 0x00) | (hasInterceptor ? 0x02 : 0x00); - this.setFcItfImpl(impl); - } - - // ------------------------------------------------------------------------- - // Implementation of the Interface interface - // ------------------------------------------------------------------------- - - public Component getFcItfOwner () { - return owner; - } - - public String getFcItfName () { - return name; - } - - public Type getFcItfType () { - return type; - } - - public boolean isFcInternalItf () { - return (flags & 0x01) != 0; - } - - // ------------------------------------------------------------------------- - // Implementation of the ComponentInterface interface - // ------------------------------------------------------------------------- - - public void setFcItfName (final String name) { - this.name = name; - } - - public boolean hasFcInterceptor () { - return (flags & 0x02) != 0; - } - - // ------------------------------------------------------------------------- - // Overriden Object methods - // ------------------------------------------------------------------------- - - /** - * Returns the hash code of this component interface. - * - * @return the hash code of this component interface. - */ - - public int hashCode () { - return System.identityHashCode(getFcItfOwner()) * getFcItfName().hashCode(); - } - - /** - * Tests if the given object is equal to this component interface. - * - * @param o the object to be compared to this component interface. - * @return true if o is a component interface with the same name and - * owner as this component interface, and if both are internal (resp. - * external) component interfaces. - */ - - public boolean equals (final Object o) { - if (o == this) { - return true; - } - if (o instanceof Interface) { - Interface itf = (Interface)o; - return - getFcItfOwner() == itf.getFcItfOwner() && // TODO ou equals? - getFcItfName().equals(itf.getFcItfName()) && - isFcInternalItf() == itf.isFcInternalItf(); - } - return false; - } - - public Object clone () { - // cannot use super.clone(), because the clone method is not defined in all - // Java platforms (such as J2ME, CLDC profile) - BasicComponentInterface clone; - try { - clone = (BasicComponentInterface)getClass().newInstance(); - } catch (Exception e) { - throw new Error("Internal error"); // should not happen - } - clone.owner = this.owner; - clone.name = name; - clone.type = type; - clone.flags = flags; - Object impl = getFcItfImpl(); - if (hasFcInterceptor()) { - impl = ((Interceptor)impl).clone(); - } - clone.setFcItfImpl(impl); - return clone; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/BasicComponentMixin.java b/julia/src/org/objectweb/fractal/julia/BasicComponentMixin.java deleted file mode 100644 index ae33d8c0241fa0ea7ae2e56ddd9b5acfb02837e7..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/BasicComponentMixin.java +++ /dev/null @@ -1,131 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.factory.InstantiationException; - -import java.util.Map; - -/** - * Provides a basic implementation of the {@link Component} interface. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class BasicComponentMixin implements Controller, Component { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicComponentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The type of this component. - */ - - public Type fcType; - - /** - * The interfaces of this component. This map associates each interface to its - * name. - */ - - public Map fcInterfaces; - - /** - * Initializes the fields of this mixin from the given context, and then calls - * the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - this.fcType = ic.type; - this.fcInterfaces = ic.interfaces; - _super_initFcController(ic); - } - - public Type getFcType () { - return fcType; - } - - public Object[] getFcInterfaces () { - if (fcInterfaces == null) { - return new Object[0]; - } - // returns the names of all the public interfaces in fcInterfaces - // interfaces whose name begins with '/' are private - int size = 0; - String[] names = new String[fcInterfaces.size()]; - names = (String[])fcInterfaces.keySet().toArray(names); - for (int i = 0; i < names.length; ++i) { - if (names[i].charAt(0) != '/') { - ++size; - } - } - int index = 0; - Object[] itfs = new Object[size]; - for (int i = 0; i < names.length; ++i) { - if (names[i].charAt(0) != '/') { - itfs[index++] = fcInterfaces.get(names[i]); - } - } - return itfs; - } - - public Object getFcInterface (final String interfaceName) - throws NoSuchInterfaceException - { - Object itf = fcInterfaces == null ? null : fcInterfaces.get(interfaceName); - if (itf == null) { - throw new ChainedNoSuchInterfaceException(null, this, interfaceName); - } - return itf; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/BasicControllerMixin.java b/julia/src/org/objectweb/fractal/julia/BasicControllerMixin.java deleted file mode 100644 index 4bbe86b2c325f429ec98ae499b62a5b07ef35bd1..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/BasicControllerMixin.java +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.factory.InstantiationException; - -/** - * Provides a basic implementation of the {@link Controller} interface. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public class BasicControllerMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor (uninstantiable class) - // ------------------------------------------------------------------------- - - private BasicControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Does nothing. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - } -} diff --git a/julia/src/org/objectweb/fractal/julia/BasicInitializableMixin.java b/julia/src/org/objectweb/fractal/julia/BasicInitializableMixin.java deleted file mode 100644 index 0d9d31be69637f8a4e6768a078f7b98926c7485a..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/BasicInitializableMixin.java +++ /dev/null @@ -1,55 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Tree; - -/** - * Provides an empty implementation of the {@link Initializable} interface. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public class BasicInitializableMixin implements Initializable { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicInitializableMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - public void initialize (final Tree args) throws Exception { - // does nothing - } -} diff --git a/julia/src/org/objectweb/fractal/julia/ChainedNoSuchInterfaceException.java b/julia/src/org/objectweb/fractal/julia/ChainedNoSuchInterfaceException.java deleted file mode 100644 index b833247581883bb4c149b7c09f009147e540ca0b..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/ChainedNoSuchInterfaceException.java +++ /dev/null @@ -1,170 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; - -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.ObjectOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; - -/** - * A sub class of the {@link NoSuchInterfaceException} class. - */ - -public class ChainedNoSuchInterfaceException extends NoSuchInterfaceException { - - /** - * The exception that caused this exception. May be null. - */ - - private final Throwable exception; - - /** - * The component whose interface cannot be found. May be null. - */ - - private transient Component component; - - /** - * Constructs a new {@link ChainedNoSuchInterfaceException} exception. - * - * @param exception the cause of this exception. May be null. - * @param component the component whose interface cannot be found. May be - * null. - * @param message the name of the interface that cannot be found. - */ - - public ChainedNoSuchInterfaceException ( - final Throwable exception, - final Component component, - final String message) - { - super(message); - this.exception = exception; - this.component = component; - } - - /** - * Returns the exception that caused in this exception. - * - * @return the exception that caused this exception. May be null. - */ - - public Throwable getException () { - return exception; - } - - /** - * Returns the component whose interface cannot be found. - * - * @return the component whose interface cannot be found. May be - * null. - */ - - public Component getComponent () { - if (component != null && !(component instanceof Interface)) { - try { - return (Component)component.getFcInterface("component"); - } catch (NoSuchInterfaceException ignored) { - } - } - return component; - } - - // ------------------------------------------------------------------------- - // Overriden Exception methods - // ------------------------------------------------------------------------- - - /** - * Returns a String representation of this exception. - * - * @return a String representation of this exception. - */ - - public String toString () { - StringBuffer buf = new StringBuffer(); - buf.append("NoSuchInterfaceException: "); - buf.append(getMessage()); - if (getComponent() != null) { - buf.append(" in component "); - Util.toString(getComponent(), buf); - } - return buf.toString(); - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - exception.printStackTrace(); - } - super.printStackTrace(); - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - private void writeObject (final ObjectOutputStream out) throws IOException { - out.defaultWriteObject(); - Component c = getComponent(); - out.writeObject(c instanceof Interface ? c : null); - } - - private void readObject (final ObjectInputStream in) - throws IOException, ClassNotFoundException - { - in.defaultReadObject(); - component = (Component)in.readObject(); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/ComponentInterface.java b/julia/src/org/objectweb/fractal/julia/ComponentInterface.java deleted file mode 100644 index ea5e45af269cbb7f2f5de94a14dabf68ba4d23ec..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/ComponentInterface.java +++ /dev/null @@ -1,83 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Interface; - -/** - * An extended {@link Interface} interface. This extended interface provides - * access to the object that implements a component interface. - */ - -public interface ComponentInterface extends Interface { - - /** - * Sets the name of this component interface. - * - * @param name the new name of this component interface. - */ - - void setFcItfName (String name); - - /** - * Returns the object that implements this component interface. - * - * @return the object that implements this component interface. - * @see #setFcItfImpl setFcItfImpl - */ - - Object getFcItfImpl (); - - /** - * Sets the object that implements this component interface. - * - * @param impl the object that implements this component interface. - * @see #getFcItfImpl getFcItfImpl - */ - - void setFcItfImpl (Object impl); - - /** - * Returns true if this interface has a permanently associated - * interceptor. Note that, due to the algorithm to compute shortcut links - * between components, the object that implements this component interface may - * temporarily be an interceptor object, even if this interface has no - * permanently associated interceptor. This method is therefore NOT equivalent - * to {@link #getFcItfImpl getFcItfImpl} instanceof Interceptor (but - * it implies it). - * - * @return true if this interface has a permanently associated - * interceptor. - */ - - boolean hasFcInterceptor (); - - /** - * Creates and returns a copy of this component interface. - * - * @return a copy of this component interface. - */ - - Object clone (); -} diff --git a/julia/src/org/objectweb/fractal/julia/Controller.java b/julia/src/org/objectweb/fractal/julia/Controller.java deleted file mode 100644 index b45e31344f1723faa4fa1d26ae552b43d3c1eadd..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/Controller.java +++ /dev/null @@ -1,45 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.factory.InstantiationException; - -/** - * A controller object, i.e., an object that belongs to the controller part of - * a component. This interface is used to initialize these controller objects. - */ - -public interface Controller { - - /** - * Initialize this controller object. - * - * @param ic information about the component to which this controller object - * belongs. - * @throws InstantiationException if the initialization fails. - */ - - void initFcController (InitializationContext ic) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/InitializationContext.java b/julia/src/org/objectweb/fractal/julia/InitializationContext.java deleted file mode 100644 index 32f0528a3c38377b3206aab423a85df286353221..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/InitializationContext.java +++ /dev/null @@ -1,141 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.factory.ChainedInstantiationException; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * A context used to initialize {@link Controller} objects. - * @see Controller#initFcController initFcController - */ - -public class InitializationContext { - - /** - * The type of the component to which the controller object belongs. - */ - - public Type type; - - /** - * The controllers objects of the component to which the controller object - * belongs. - */ - - public List controllers; - - /** - * The external interfaces of the component to which the controller object - * belongs. - */ - - public Map interfaces; - - /** - * The external interfaces of the component to which the controller object - * belongs. - */ - - public Map internalInterfaces; - - /** - * The content of the component to which the controller object belongs. - */ - - public Object content; - - /** - * Miscellaneous additional context information. - */ - - public Object hints; - - /** - * Constructs an uninitialized {@link InitializationContext} object. - */ - - public InitializationContext () { - } - - /** - * Initializes and fills in the fields of this object. This method must create - * the type, the controller objects and the interfaces of a component. The - * default implementation of this method does nothing. - * - * @throws InstantiationException if the component type, a controller object - * or a component interface cannot be created. - */ - - public void create () throws InstantiationException { - controllers = new ArrayList(); - interfaces = new HashMap(); - internalInterfaces = new HashMap(); - } - - /** - * Returns the component interface of the {@link #interfaces interfaces} map - * whose name is given. - * - * @param name the name of a component interface. - * @return the interface whose name is given. - * @throws InstantiationException if there is no such component interface. - */ - - public Object getInterface (final String name) throws InstantiationException { - Object o = getOptionalInterface(name); - if (o == null) { - throw new ChainedInstantiationException( - null, - (Component)getOptionalInterface("component"), - "Cannot find the required interface '" + name + '\''); - } - return o; - } - - /** - * Returns the component interface of the {@link #interfaces interfaces} map - * whose name is given. - * - * @param name the name of a component interface. - * @return the interface whose name is given, or null if there is no - * such component interface. - */ - - public Object getOptionalInterface (final String name) { - Object o = interfaces.get(name); - if (o instanceof ComponentInterface) { - o = ((ComponentInterface)o).getFcItfImpl(); - } - return o; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/Interceptor.java b/julia/src/org/objectweb/fractal/julia/Interceptor.java deleted file mode 100644 index b2092356e20c83bee761aa3e549ffbfd4048d96d..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/Interceptor.java +++ /dev/null @@ -1,61 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -/** - * An interceptor object, i.e., a {@link Controller} object that intercepts - * method calls. An interceptor does some pre and post computations before and - * after delegating calls to a "delegate" object. - */ - -public interface Interceptor extends Controller { - - /** - * Returns the object to which this interceptor delegates method calls. - * - * @return the object to which this interceptor delegates method calls. - * @see #setFcItfDelegate setFcItfDelegate - */ - - Object getFcItfDelegate (); - - /** - * Sets the object to which this interceptor delegates method calls. - * - * @param delegate the object to which this interceptor delegates method - * calls. - * @see #getFcItfDelegate getFcItfDelegate - */ - - void setFcItfDelegate (Object delegate); - - /** - * Clones this interceptor object. This method declaration is needed because - * the clone method is not defined in J2ME (CLDC profile). - * - * @return a copy of this interceptor object. - */ - - Object clone (); -} diff --git a/julia/src/org/objectweb/fractal/julia/InterceptorInterface.java b/julia/src/org/objectweb/fractal/julia/InterceptorInterface.java deleted file mode 100644 index 353af8620b31ee8018e8955fe7cad5acbd1415bc..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/InterceptorInterface.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.Type; - -/** - * An {@link Interface} that is also an {@link Interceptor}. The methods of - * this class are implemented by forwarding calls to the {@link - * #getFcItfDelegate getFcItfDelegate} object (which must therefore be an - * {@link Interface}). This class can be used as a super class to generate - * output interceptors for primitive components. - */ - -public abstract class InterceptorInterface implements Interceptor, Interface { - - public Component getFcItfOwner () { - return ((Interface)getFcItfDelegate()).getFcItfOwner(); - } - - public String getFcItfName () { - return ((Interface)getFcItfDelegate()).getFcItfName(); - } - - public Type getFcItfType () { - return ((Interface)getFcItfDelegate()).getFcItfType(); - } - - public boolean isFcInternalItf () { - return ((Interface)getFcItfDelegate()).isFcInternalItf(); - } - - public abstract Object clone (); -} diff --git a/julia/src/org/objectweb/fractal/julia/Julia.java b/julia/src/org/objectweb/fractal/julia/Julia.java deleted file mode 100644 index 41e9a31d848db6c11f65e9f5e96c39d6d77a60f7..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/Julia.java +++ /dev/null @@ -1,136 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.factory.Factory; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin; -import org.objectweb.fractal.julia.factory.ChainedInstantiationException; -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.type.BasicTypeFactoryMixin; - -/** - * Provides access to the Julia bootstrap component. - */ - -public class Julia implements Factory { - - /** - * The bootstrap component. - */ - - private static Component bootstrapComponent; - - // ------------------------------------------------------------------------- - // Implementation of the Factory interface - // ------------------------------------------------------------------------- - - /** - * @return null. - */ - - public Type getFcInstanceType () { - return null; - } - - /** - * @return null. - */ - - public Object getFcControllerDesc () { - return null; - } - - /** - * @return null. - */ - - public Object getFcContentDesc () { - return null; - } - - /** - * Returns the Julia bootstrap component. If this component does not exists - * yet, it is created as follows: - *
    - *
  • a pre bootstrap component is created by assembling a {@link Loader} - * object, a {@link BasicTypeFactoryMixin} object, and a {@link - * BasicGenericFactoryMixin} object. The loader object is created by - * instantiating the class specified in the "julia.loader" system - * property.
  • - *
  • the pre bootstrap component is used to create the real bootstrap - * component, by calling the newFcInstance method of the - * GenericFactory interface of the pre bootstrap component, with the - * "bootstrap" string as controller descriptor.
  • - *
- */ - - public Component newFcInstance () throws InstantiationException { - if (bootstrapComponent == null) { - String boot = System.getProperty("julia.loader"); - if (boot == null) { - throw new InstantiationException( - "The julia.loader system property is not defined"); - } - - // creates the pre bootstrap controller components - Loader loader; - try { - loader = (Loader)_forName(boot).newInstance(); - } catch (Exception e) { - throw new InstantiationException( - "Cannot find or instantiate the '" + boot + - "' class specified in the julia.loader system property"); - } - BasicTypeFactoryMixin typeFactory = new BasicTypeFactoryMixin(); - BasicGenericFactoryMixin genericFactory = new BasicGenericFactoryMixin(); - genericFactory._this_weaveableL = loader; - genericFactory._this_weaveableTF = typeFactory; - - // use the pre bootstrap component to create the real bootstrap component - ComponentType t = typeFactory.createFcType(new InterfaceType[0]); - try { - bootstrapComponent = genericFactory.newFcInstance(t, "bootstrap", null); - } catch (InstantiationException e) { - throw new ChainedInstantiationException( - e, null, "Cannot create the bootstrap component"); - } - } - return bootstrapComponent; - } - - /* - * Convenient method used for J2ME conversion - * (ClassLoader not available in CDLC) - */ - - private Class _forName (String name) throws ClassNotFoundException { - return getClass().getClassLoader().loadClass(name); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/TypeComponentMixin.java b/julia/src/org/objectweb/fractal/julia/TypeComponentMixin.java deleted file mode 100644 index 12110c149a525e9d883f17ba98a07f9f514100f8..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/TypeComponentMixin.java +++ /dev/null @@ -1,117 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import java.util.Map; - -/** - * Provides basic type system related checks to a {@link Component}. - *
- *
- * Requirements - *
    - *
  • the type of the component in which this mixin is used must be an instance - * of {@link ComponentType}.
  • - *
- */ - -public abstract class TypeComponentMixin implements Component { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private TypeComponentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks the interface name against the component's type and then calls the - * overriden method. This method also creates the collection interfaces - * when needed, and puts them in the {@link #_this_fcInterfaces} map. - */ - - public Object getFcInterface (final String interfaceName) - throws NoSuchInterfaceException - { - if (interfaceName.indexOf('/') != -1) { - return _super_getFcInterface(interfaceName); - } - ComponentType compType = (ComponentType)_this_getFcType(); - InterfaceType itfType; - try { - itfType = compType.getFcInterfaceType(interfaceName); - } catch (NoSuchInterfaceException e) { - throw new ChainedNoSuchInterfaceException(null, this, interfaceName); - } - Object result; - try { - result = _super_getFcInterface(interfaceName); - } catch (NoSuchInterfaceException e) { - if (itfType.isFcCollectionItf()) { - result = _super_getFcInterface("/collection/" + itfType.getFcItfName()); - result = ((ComponentInterface)result).clone(); - ((ComponentInterface)result).setFcItfName(interfaceName); - _this_fcInterfaces.put(interfaceName, result); - } else { - throw e; - } - } - return result; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The fcInterfaces field required by this mixin. This field is - * supposed to store the interfaces of the component. - */ - - public Map _this_fcInterfaces; - - /** - * The {@link #getFcType getFcType} method overriden by this mixin. - */ - - public abstract Type _this_getFcType (); - - /** - * The {@link Component#getFcInterface getFcInterface} method overriden by - * this mixin. - */ - - public abstract Object _super_getFcInterface (String interfaceName) - throws NoSuchInterfaceException; -} diff --git a/julia/src/org/objectweb/fractal/julia/UseComponentMixin.java b/julia/src/org/objectweb/fractal/julia/UseComponentMixin.java deleted file mode 100644 index 7133e80530e80e3683b224271d48e66e62a1738b..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/UseComponentMixin.java +++ /dev/null @@ -1,90 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.InstantiationException; - -/** - * Provides a {@link Component} field to a {@link Controller}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller belongs must provide the {@link - * Component} interface.
  • - *
- */ - -public abstract class UseComponentMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseComponentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The {@link Component} interface of the component to which this controller - * object belongs. - */ - - public Component weaveableC; - - /** - * The {@link Component} interface of the component to which this controller - * object belongs. - */ - - public Component weaveableOptC; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableC = (Component)ic.getInterface("component"); - weaveableOptC = weaveableC; - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/Util.java b/julia/src/org/objectweb/fractal/julia/Util.java deleted file mode 100644 index 67f856de2f61ae2486294a856320dd055ce946e8..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/Util.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.objectweb.fractal.julia; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.api.control.SuperController; - -/** - * Provides static utility methods related to {@link Component}. - */ - -public class Util { - - private Util () { - } - - /** - * Computes a string representation of the given component. - * - * @param component a component. - * @param buf the buffer to be used to store the result of this method. - */ - - public static void toString ( - final Component component, - final StringBuffer buf) - { - try { - NameController nc = - (NameController)component.getFcInterface("name-controller"); - try { - SuperController sc = - (SuperController)component.getFcInterface("super-controller"); - Component[] superComponents = sc.getFcSuperComponents(); - if (superComponents.length > 0) { - toString(superComponents[0], buf); - } - } catch (NoSuchInterfaceException ignored) { - } - buf.append('/'); - buf.append(nc.getFcName()); - } catch (NoSuchInterfaceException e) { - buf.append(component.toString()); - return; - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/ant/J2MEConverter.java b/julia/src/org/objectweb/fractal/julia/ant/J2MEConverter.java deleted file mode 100644 index 82a1f04ebccefafba3e53686bfd3336c1e7670ab..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/ant/J2MEConverter.java +++ /dev/null @@ -1,639 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.ant; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.taskdefs.MatchingTask; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.ClassAdapter; -import org.objectweb.asm.CodeAdapter; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.FileOutputStream; -import java.util.HashMap; -import java.util.Map; -import java.util.Arrays; -import java.util.List; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Set; -import java.util.HashSet; -import java.util.zip.ZipFile; -import java.util.zip.ZipEntry; - -public class J2MEConverter extends MatchingTask { - - private File src; - - private File dst; - - private File cldcJar; - - private Set cldcAPI; - - private int errors; - - private final static String[] METHODS = new String[] { - "java/util/List,size()I", - "java/util/List,get(I)Ljava/lang/Object;", - "java/util/List,contains(Ljava/lang/Object;)Z", - "java/util/List,set(ILjava/lang/Object;)Ljava/lang/Object;", - "java/util/List,add(Ljava/lang/Object;)Z", - "java/util/List,add(ILjava/lang/Object;)V", - "java/util/List,remove(Ljava/lang/Object;)Z", - "java/util/List,remove(I)Ljava/lang/Object;", - "java/util/List,toArray()[Ljava/lang/Object;", - "java/util/List,toArray([Ljava/lang/Object;)[Ljava/lang/Object;", - "java/util/Set,size()I", - "java/util/Set,contains(Ljava/lang/Object;)Z", - "java/util/Set,add(Ljava/lang/Object;)Z", - "java/util/Set,toArray()[Ljava/lang/Object;", - "java/util/Set,toArray([Ljava/lang/Object;)[Ljava/lang/Object;", - "java/util/Map,size()I", - "java/util/Map,get(Ljava/lang/Object;)Ljava/lang/Object;", - "java/util/Map,put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;", - "java/util/Map,remove(Ljava/lang/Object;)Ljava/lang/Object;", - "java/util/Map,keySet()Ljava/util/Set;", - "java/util/ArrayList,()V", - "java/util/HashSet,()V", - "java/util/HashMap,()V", - }; - - private final static Map INDEXES = new HashMap(); - - static { - for (int i = 0; i < METHODS.length; ++i) { - INDEXES.put(METHODS[i], new Integer(i)); - } - } - - public void setSrcdir (final File src) { - this.src = src; - } - - public void setDestdir (final File dst) { - this.dst = dst; - } - - public void setCldcjar (final File cldcJar) { - this.cldcJar = cldcJar; - } - - /** - * Executes this task. - */ - - public void execute () { - if (src == null) { - throw new BuildException("srcdir must be specified"); - } - if (dst == null) { - throw new BuildException("destdir must be specified"); - } - - try { - if (cldcJar != null) { - cldcAPI = new HashSet(); - ZipFile zf = new ZipFile(cldcJar); - Enumeration e = zf.entries(); - while (e.hasMoreElements()) { - ZipEntry ze = (ZipEntry)e.nextElement(); - if (ze.getName().endsWith(".class")) { - new ClassReader(zf.getInputStream(ze)).accept(new ClassAnalyzer(), true); - } - } - } - } catch (Exception e) { - log(e.getMessage()); - } - - int total = 0; - String[] files = getDirectoryScanner(src).getIncludedFiles(); - for (int i = 0; i < files.length; ++i) { - File srcFile = new File(src, files[i]); - File dstFile = new File(dst, files[i]); - if (dstFile.exists() && dstFile.lastModified() > srcFile.lastModified()) { - continue; - } - - ClassReader cr; - try { - InputStream is = new FileInputStream(srcFile); - cr = new ClassReader(is); - } catch (Exception e) { - log(e.getMessage()); - continue; - } - - ClassWriter cw = new ClassWriter(false); - ClassConverter converter = new ClassConverter(cw); - cr.accept(converter, true); - - try { - dstFile.getParentFile().mkdirs(); - OutputStream os = new FileOutputStream(dstFile); - os.write(cw.toByteArray()); - os.close(); - } catch (Exception e) { - log(e.getMessage()); - continue; - } - ++total; - } - - if (errors > 0) { - throw new BuildException(); - } else if (total > 0) { - if (total == 1) { - log("1 class transformed into " + dst); - } else { - log(total + " classes transformed into " + dst); - } - } - } - - static String convertDescriptor (final String desc) { - if (desc.equals("java/util/ArrayList")) { - return "java/util/Vector"; - } else if (desc.equals("java/util/HashSet")) { - return "java/util/Hashtable"; - } else if (desc.equals("java/util/HashMap")) { - return "java/util/Hashtable"; - } - boolean done; - String newDesc = desc; - do { - done = true; - int i = newDesc.indexOf("java/util/List"); - if (i != -1) { - newDesc = newDesc.substring(0, i) - + "java/util/Vector" - + newDesc.substring(i + 14); - done = false; - } - i = newDesc.indexOf("java/util/Set"); - if (i != -1) { - newDesc = newDesc.substring(0, i) - + "java/util/Hashtable" - + newDesc.substring(i + 13); - done = false; - } - i = newDesc.indexOf("java/util/Map"); - if (i != -1) { - newDesc = newDesc.substring(0, i) - + "java/util/Hashtable" - + newDesc.substring(i + 13); - done = false; - } - } while (!done); - return newDesc; - } - - class ClassAnalyzer implements ClassVisitor, Constants { - - private String name; - - public void visit ( - final int access, - final String name, - final String superName, - final String[] interfaces, - final String sourceFile) - { - this.name = name; - } - - public void visitField ( - int access, - String name, - String desc, - Object value, - Attribute attrs) - { - if ((access & (ACC_PUBLIC | ACC_PROTECTED)) != 0) { - cldcAPI.add(this.name+","+name); - } - } - - public CodeVisitor visitMethod ( - final int access, - final String name, - final String desc, - final String[] exceptions, - final Attribute attrs) - { - if ((access & (ACC_PUBLIC | ACC_PROTECTED)) != 0) { - cldcAPI.add(this.name+","+name+desc); - } - return null; - } - - public void visitInnerClass ( - final String name, - final String outerName, - final String innerName, - final int access) - { - } - - public void visitAttribute (final Attribute attribute) { - } - - public void visitEnd () { - } - } - - class ClassConverter extends ClassAdapter implements Constants { - - private String name; - private boolean hasVectorToArray; - private boolean hasHashtableToArray; - - public ClassConverter (ClassVisitor cv) { - super(cv); - } - - public void visit ( - final int access, - final String name, - final String superName, - final String[] interfaces, - final String sourceFile) - { - this.name = name; - List itfList = new ArrayList(Arrays.asList(interfaces)); - itfList.remove("java/io/Serializable"); - String[] itfs = (String[])itfList.toArray(new String[itfList.size()]); - cv.visit(access, name, superName, itfs, sourceFile); - } - - public void visitField ( - int access, - String name, - String desc, - Object value, - Attribute attrs) - { - cv.visitField(access, name, convertDescriptor(desc), value, attrs); - } - - public CodeVisitor visitMethod ( - final int access, - final String name, - final String desc, - final String[] exceptions, - final Attribute attrs) - { - if (name.equals("writeObject") && desc.equals("(Ljava/io/ObjectOutputStream;)V")) { - return null; - } - if (name.equals("readObject") && desc.equals("(Ljava/io/ObjectInputStream;)V")) { - return null; - } - if (name.equals("printStackTrace") && !desc.equals("()V")) { - return null; - } - if (name.equals("getInputStream")) { - CodeVisitor c = cv.visitMethod(access, name, desc, exceptions, attrs); - c.visitTypeInsn(NEW, "java/io/IOException"); - c.visitInsn(DUP); - c.visitMethodInsn(INVOKESPECIAL, "java/io/IOException", "", "()V"); - c.visitInsn(ATHROW); - c.visitMaxs(2, 2); - return null; - } - if (name.equals("_forName")) { - CodeVisitor c = cv.visitMethod(access, name, desc, exceptions, attrs); - c.visitVarInsn(ALOAD, 1); - c.visitMethodInsn(INVOKESTATIC, "java/lang/Class", "forName", desc); - c.visitInsn(ARETURN); - c.visitMaxs(2, 2); - return null; - } - String newDesc = convertDescriptor(desc); - return new CodeConverter( - this, cv.visitMethod(access, name, newDesc, exceptions, attrs)); - } - - public void generateVectorToArrayMethod () { - if (hasVectorToArray) { - return; - } else { - hasVectorToArray = true; - } - CodeVisitor c = cv.visitMethod(ACC_STATIC, "toArray", "(Ljava/util/Vector;[Ljava/lang/Object;)[Ljava/lang/Object;", null, null); - c.visitInsn(ICONST_0); - c.visitVarInsn(ISTORE, 2); - Label l0 = new Label(); - c.visitJumpInsn(GOTO, l0); - Label l1 = new Label(); - c.visitLabel(l1); - c.visitVarInsn(ALOAD, 1); - c.visitVarInsn(ILOAD, 2); - c.visitVarInsn(ALOAD, 0); - c.visitVarInsn(ILOAD, 2); - c.visitMethodInsn(INVOKEVIRTUAL, "java/util/Vector", "elementAt", "(I)Ljava/lang/Object;"); - c.visitInsn(AASTORE); - c.visitIincInsn(2, 1); - c.visitLabel(l0); - c.visitVarInsn(ILOAD, 2); - c.visitVarInsn(ALOAD, 1); - c.visitInsn(ARRAYLENGTH); - c.visitJumpInsn(IF_ICMPLT, l1); - c.visitVarInsn(ALOAD, 1); - c.visitInsn(ARETURN); - c.visitMaxs(4, 3); - } - - public void generateHashtableToArrayMethod () { - if (hasHashtableToArray) { - return; - } else { - hasHashtableToArray = true; - } - CodeVisitor c = cv.visitMethod(ACC_STATIC, "toArray", "(Ljava/util/Hashtable;[Ljava/lang/Object;)[Ljava/lang/Object;", null, null); - c.visitInsn(ICONST_0); - c.visitVarInsn(ISTORE, 2); - c.visitVarInsn(ALOAD, 0); - c.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "keys", "()Ljava/util/Enumeration;"); - c.visitVarInsn(ASTORE, 3); - Label l0 = new Label(); - c.visitJumpInsn(GOTO, l0); - Label l1 = new Label(); - c.visitLabel(l1); - c.visitVarInsn(ALOAD, 1); - c.visitVarInsn(ILOAD, 2); - c.visitIincInsn(2, 1); - c.visitVarInsn(ALOAD, 3); - c.visitMethodInsn(INVOKEINTERFACE, "java/util/Enumeration", "nextElement", "()Ljava/lang/Object;"); - c.visitInsn(AASTORE); - c.visitLabel(l0); - c.visitVarInsn(ALOAD, 3); - c.visitMethodInsn(INVOKEINTERFACE, "java/util/Enumeration", "hasMoreElements", "()Z"); - c.visitJumpInsn(IFNE, l1); - c.visitVarInsn(ALOAD, 1); - c.visitInsn(ARETURN); - c.visitMaxs(3, 4); - } - } - - class CodeConverter extends CodeAdapter implements Constants { - - ClassConverter c; - String lastMethodCallInsn; - boolean mustNotUseResult; - - public CodeConverter (ClassConverter c, CodeVisitor cv) { - super(cv); - this.c = c; - } - - private void check (int opcode) { - if (mustNotUseResult && opcode != POP) { - log(c.name + ": must not use result of " + lastMethodCallInsn); - ++errors; - } - mustNotUseResult = false; - } - - public void visitInsn (final int opcode) { - check(opcode); - cv.visitInsn(opcode); - } - - public void visitIntInsn (final int opcode, final int operand) { - check(opcode); - cv.visitIntInsn(opcode, operand); - } - - public void visitVarInsn (final int opcode, final int var) { - check(opcode); - cv.visitVarInsn(opcode, var); - } - - public void visitTypeInsn (final int opcode, final String desc) { - check(opcode); - cv.visitTypeInsn(opcode, convertDescriptor(desc)); - } - - public void visitFieldInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - check(opcode); - if (cldcAPI != null && owner.startsWith("java")) { - String key = owner+","+name; - if (!cldcAPI.contains(key)) { - log(c.name + ": must not use " + key + "(not in CLDC API)"); - ++errors; - } - } - cv.visitFieldInsn(opcode, owner, name, convertDescriptor(desc)); - } - - public void visitMethodInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - check(opcode); - String key = owner + "," + name + desc; - if (cldcAPI != null && owner.startsWith("java")) { - if (!cldcAPI.contains(key) && INDEXES.get(key) == null) { - log(c.name + ": must not use " + key + " (not in CLDC API)"); - ++errors; - } - } - String newDesc = convertDescriptor(desc); - if (owner.startsWith("java/util") - && !owner.equals("java/util/Vector") - && !owner.equals("java/util/Hashtable") - && !owner.equals("java/util/Enumeration")) - { - Integer id = (Integer)INDEXES.get(key); - if (id == null) { - log(c.name + ": unauthorized method " + key); - ++errors; - } - lastMethodCallInsn = key; - switch (id.intValue()) { - case 0: // "java/util/List,size,()I" - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", name, desc); - break; - case 1: // "java/util/List,get,(I)Ljava/lang/Object;" - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", name, desc); - break; - case 2: // "java/util/List,contains,(Ljava/lang/Object;)Z" - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", name, desc); - break; - case 3: // "java/util/List,set,(ILjava/lang/Object;)Ljava/lang/Object;" - mustNotUseResult = true; - cv.visitInsn(SWAP); - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", "setElementAt", "(Ljava/lang/Object;I)V"); - cv.visitInsn(ACONST_NULL); - break; - case 4: // "java/util/List,add,(Ljava/lang/Object;)Z" - mustNotUseResult = true; - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", "addElement", "(Ljava/lang/Object;)V"); - cv.visitInsn(ICONST_0); - break; - case 5: // "java/util/List,add,(ILjava/lang/Object;)V" - cv.visitInsn(SWAP); - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", "insertElementAt", "(Ljava/lang/Object;I)V"); - break; - case 6: // "java/util/List,remove,(Ljava/lang/Object;)Z" - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", "removeElement", desc); - break; - case 7: // "java/util/List,remove,(I)Ljava/lang/Object;" - mustNotUseResult = true; - cv.visitMethodInsn( - INVOKEVIRTUAL, "java/util/Vector", "removeElementAt", "(I)V"); - cv.visitInsn(ACONST_NULL); - break; - case 8: // "java/util/List,toArray,()[Ljava/lang/Object;" - cv.visitInsn(DUP); - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Vector", "size", "()I"); - cv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); - c.generateVectorToArrayMethod(); - cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Vector;[Ljava/lang/Object;)[Ljava/lang/Object;"); - break; - case 9: // "java/util/List,toArray,([Ljava/lang/Object;)[Ljava/lang/Object;" - c.generateVectorToArrayMethod(); - cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Vector;[Ljava/lang/Object;)[Ljava/lang/Object;"); - break; - case 10: // "java/util/Set,size,()I" - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc); - break; - case 11: // "java/util/Set,contains,(Ljava/lang/Object;)Z" - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "containsKey", desc); - break; - case 12: // "java/util/Set,add,(Ljava/lang/Object;)Z" - mustNotUseResult = true; - cv.visitInsn(DUP); - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - cv.visitInsn(POP); - cv.visitInsn(ICONST_0); - break; - case 13: // "java/util/Set,toArray,()[Ljava/lang/Object;" - cv.visitInsn(DUP); - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", "size", "()I"); - cv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); - c.generateHashtableToArrayMethod(); - cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Hashtable;[Ljava/lang/Object;)[Ljava/lang/Object;"); - break; - case 14: // "java/util/Set,toArray,([Ljava/lang/Object;)[Ljava/lang/Object;" - c.generateHashtableToArrayMethod(); - cv.visitMethodInsn(INVOKESTATIC, c.name, name, "(Ljava/util/Hashtable;[Ljava/lang/Object;)[Ljava/lang/Object;"); - break; - case 15: // "java/util/Map,size,()I" - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc); - break; - case 16: // "java/util/Map,get,(Ljava/lang/Object;)Ljava/lang/Object;" - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc); - break; - case 17: // "java/util/Map,put,(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;" - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc); - break; - case 18: // "java/util/Map,remove,(Ljava/lang/Object;)Ljava/lang/Object;" - cv.visitMethodInsn(INVOKEVIRTUAL, "java/util/Hashtable", name, desc); - break; - case 19: // "java/util/Map,keySet,()Ljava/util/Set;" - // nothing to do: the key set is the map itself (clone needed?) - break; - case 20: // "java/util/ArrayList,()V" - cv.visitMethodInsn(opcode, "java/util/Vector", name, desc); - break; - case 21: // "java/util/HashSet,()V" - cv.visitMethodInsn(opcode, "java/util/Hashtable", name, desc); - break; - case 22: // "java/util/HashMap,()V" - cv.visitMethodInsn(opcode, "java/util/Hashtable", name, desc); - break; - default: - throw new RuntimeException("Internal error"); // should not happen - } - } else { - cv.visitMethodInsn(opcode, owner, name, newDesc); - } - } - - public void visitJumpInsn (final int opcode, final Label label) { - check(opcode); - cv.visitJumpInsn(opcode, label); - } - - public void visitLdcInsn (final Object cst) { - check(LDC); - cv.visitLdcInsn(cst); - } - - public void visitIincInsn (final int var, final int increment) { - check(IINC); - cv.visitIincInsn(var, increment); - } - - public void visitTableSwitchInsn ( - final int min, - final int max, - final Label dflt, - final Label labels[]) - { - check(TABLESWITCH); - cv.visitTableSwitchInsn(min, max, dflt, labels); - } - - public void visitLookupSwitchInsn ( - final Label dflt, - final int keys[], - final Label labels[]) - { - check(LOOKUPSWITCH); - cv.visitLookupSwitchInsn(dflt, keys, labels); - } - - public void visitMultiANewArrayInsn (final String desc, final int dims) { - check(MULTIANEWARRAY); - cv.visitMultiANewArrayInsn(desc, dims); - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/ant/package.html b/julia/src/org/objectweb/fractal/julia/ant/package.html deleted file mode 100644 index fe627e92717e47e2d67ea613ec5060fcf0b81cca..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/ant/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -Provides a tool to convert J2SE classes to J2ME compliant classes. -@since Julia 2.0 - - diff --git a/julia/src/org/objectweb/fractal/julia/asm/AbstractClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/AbstractClassGenerator.java deleted file mode 100644 index 40f773fd6cf3f12528fd784dc4d28aa80ead7511..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/AbstractClassGenerator.java +++ /dev/null @@ -1,310 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.loader.Generated; -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Type; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * An abstract class generator based on the {@link org.objectweb.asm} package. - * This class generator takes as parameter the name of a super class and a list - * of interface names, and generates a sub class of the given super class that - * implements all the given interfaces. - *

- * Note: since this class stores information about the class that is - * currently being generated in its fields, it should not be used by multiple - * threads simultaneously. - */ - -public abstract class AbstractClassGenerator implements - ClassGenerator, - Constants -{ - - /** - * The class that is being generated. - */ - - public ClassWriter cw; - - /** - * The internal name of the class that is being generated. - */ - - public String name; - - /** - * The internal name of the super class of the class that is being generated. - */ - - public String superClass; - - /** - * The interfaces to be implemented by the class that is being generated. - * More precisely, this list of String is the list of the internal names of - * these interfaces. - */ - - public List interfaces; - - /** - * The parameters used to generate the class that is being generated. - */ - - public String parameters; - - /** - * The class whose class loader must be used to generate the class. - * May be null. - */ - - public Loader loader; - - /** - * Generates a sub class of the given class that implements the given - * interfaces. This method initializes the fields of this class, and then - * calls {@link #parseArgs parseArgs}, {@link #generateHeader generateHeader}, - * {@link #generateConstructor generateConstructor}, {@link - * #generateDefaultMethods generateDefaultMethods} and {@link - * #generateInterfaceMethods generateInterfaceMethods}, in this order, in - * order to generate the specified class. - */ - - public byte[] generateClass ( - final String name, - final Tree args, - final Loader loader) throws ClassGenerationException - { - this.name = name.replace('.', '/'); - this.parameters = args.toString(); - this.loader = loader; - this.cw = new ClassWriter(computeMaxs()); - parseArgs(args); - generateHeader(); - generateConstructor(); - generateDefaultMethods(); - generateInterfaceMethods(); - return cw.toByteArray(); - } - - /** - * Initializes this class generator with the given arguments. The default - * implementation of this method requires arguments of the form - * "(objectDescriptor superClassName (itfName1 ... itfNameN) ...)", where - * superClassName is the name of the super class of the class to be generated, - * and itfName1 ... itfNameN the names of the interfaces it must implement. - * - * @param args the descriptor of the class to be generated. - */ - - protected void parseArgs (final Tree args) { - superClass = args.getSubTree(1).toString().replace('.', '/'); - interfaces = new ArrayList(Arrays.asList(args.getSubTree(2).getSubTrees())); - for (int i = 0; i < interfaces.size(); ++i) { - interfaces.set(i, interfaces.get(i).toString().replace('.', '/')); - } - } - - /** - * Returns true if maxStack and maxLocals must be automatically - * computed. This method returns false by default. - * - * @return true if the maximum stack size and the maximum number of - * local variables of the methods generated by this class generator must - * be automatically computed (see {@link ClassWriter#ClassWriter - * ClassWriter}). - */ - - protected boolean computeMaxs () { - return false; - } - - /** - * Generates the header of the class to be generated. - * - * @throws ClassGenerationException if a problem occurs. - */ - - protected void generateHeader () throws ClassGenerationException { - int access = ACC_PUBLIC; - List itfList = getImplementedInterfaces(); - String[] itfs = (String[])itfList.toArray(new String[itfList.size()]); - cw.visit(access, name, superClass, itfs, getSource()); - } - - /** - * Returns the source of the class to be generated. The default implementation - * of this method returns "GENERATED". - * - * @return the source of the class to be generated. - */ - - protected String getSource () { - return "GENERATED"; - } - - /** - * Returns all the interfaces implemented by the class to be generated. This - * list contains the {@link #interfaces interfaces} interfaces, and some - * default interfaces such as {@link - * org.objectweb.fractal.julia.loader.Generated}. This method is used by - * {@link #generateHeader generateHeader}. - * - * @return the names of all the interfaces implemented by the generated class. - * @throws ClassGenerationException if a problem occurs. - */ - - protected List getImplementedInterfaces () throws ClassGenerationException { - List itfs = new ArrayList(interfaces); - itfs.add(Type.getInternalName(Generated.class)); - return itfs; - } - - /** - * Generates the constructor of the class to be generated. The default - * implementation of this method generates an empty public constructor without - * arguments. The super class should also have such a constructor. - * - * @throws ClassGenerationException if a problem occurs. - */ - - protected void generateConstructor () throws ClassGenerationException { - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); - // generates the bytecode corresponding to 'super(...);' - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, superClass, "", "()V"); - mv.visitInsn(RETURN); - mv.visitMaxs(1, 1); - } - - /** - * Generates the default methods of the class to be generated. The default - * implementation of this method generates the {@link - * org.objectweb.fractal.julia.loader.Generated#getFcGeneratorParameters - * getFcGeneratorParameters} method. - * - * @throws ClassGenerationException if a problem occurs. - */ - - protected void generateDefaultMethods () throws ClassGenerationException { - String name = "getFcGeneratorParameters"; - String desc = "()Ljava/lang/String;"; - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, name, desc, null, null); - mv.visitLdcInsn(parameters); - mv.visitInsn(ARETURN); - mv.visitMaxs(1, 1); - } - - /** - * Generates the methods of the interfaces to be implemented by the class to - * be generated. This method calls {@link #generateMethod generateMethod} for - * each method of each interface to be implemented ({@link #generateMethod - * generateMethod} is called only once per method, even for those that are - * specified in several interfaces). - * - * @throws ClassGenerationException if a problem occurs. - */ - - protected void generateInterfaceMethods () throws ClassGenerationException { - List generated = new ArrayList(); - for (int i = 0; i < interfaces.size(); ++i) { - String s = ((String)interfaces.get(i)).replace('/', '.'); - Class itf; - try { - itf = loader.loadClass(s); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, parameters, "Cannot load the '" + s + "' interface"); - } - Method[] meths = itf.getMethods(); - for (int j = 0; j < meths.length; ++j) { - Method meth = meths[j]; - String desc = meth.getName() + Type.getMethodDescriptor(meth); - if (!generated.contains(desc)) { - generateMethod(meth); - generated.add(desc); - } - } - } - } - - /** - * Generates a method of an interface to be implemented by the class to be - * generated. - * - * @param m the method to be generated. - * @throws ClassGenerationException if a problem occurs. - */ - - protected abstract void generateMethod (Method m) - throws ClassGenerationException; - - /** - * Returns the offset which must be added to some opcodes to get an opcode of - * the given type. More precisely, returns the offset which must be added to - * an opc_iXXXX opcode to get the opc_YXXXX opcode corresponding to the given - * type. For example, if the given type is double the result is 3, which - * means that opc_dload, opc_dstore, opc_dreturn... opcodes are equal to - * opc_iload+3, opc_istore+3, opc_ireturn+3... - * - * @param type a Java class representing a Java type (primitive or not). - * @return the opcode offset of the corresponding to the given type. - */ - - public static int getOpcodeOffset (final Class type) { - if (type == Double.TYPE) { - return 3; - } else if (type == Float.TYPE) { - return 2; - } else if (type == Long.TYPE) { - return 1; - } else if (type.isPrimitive()) { - return 0; - } - return 4; - } - - /** - * Returns the size of the given type. This size is 2 for the double and long - * types, and 1 for the other types. - * - * @param type a Java class representing a Java type (primitive or not). - * @return the size of the given type. - */ - - public static int getSize (final Class type) { - return (type == Double.TYPE || type == Long.TYPE ? 2 : 1); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/AbstractCodeGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/AbstractCodeGenerator.java deleted file mode 100644 index 7d362b4cede1dde718f920eb12ee9e63504bc568..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/AbstractCodeGenerator.java +++ /dev/null @@ -1,271 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; - -import java.lang.reflect.Method; - -/** - * An abstract {@link CodeGenerator} to add interception code - * "around" methods. More precisely, depending on the result of the {@link - * #getInterceptionType getInterceptionType} method, the code adapters returned - * by the {@link #generateInterceptionCode generateInterceptionCode} method - * (see {@link CodeGenerator}) transform the original methods into - * methods of the following form: - * - *

- * method-signature {
- *   // pre code block generated by 'generateInterceptionCodeBlock'
- *   // original method code
- * }
- * 
- * - * if {@link #getInterceptionType getInterceptionType} returns - * {@link InterceptorCodeAdapter#EMPTY EMPTY}, - * - *

- * method-signature {
- *   return-type result;
- *   // pre code block generated by 'generateInterceptionCodeBlock'
- *   // original method code, where returns are replaced with gotos
- *   // post code block generated by 'generateInterceptionCodeBlock'
- *   return result;
- * }
- * 
- * - * if {@link #getInterceptionType getInterceptionType} returns - * {@link InterceptorCodeAdapter#NORMAL NORMAL}, - * - *

- * method-signature {
- *   // pre code block generated by 'generateInterceptionCodeBlock'
- *   try {
- *     // original method code
- *   } finally {
- *     // post code block generated by 'generateInterceptionCodeBlock'
- *   }
- * }
- * 
- * - * if {@link #getInterceptionType getInterceptionType} returns - * {@link InterceptorCodeAdapter#FINALLY FINALLY}. - */ - -public abstract class AbstractCodeGenerator implements Constants, CodeGenerator { - - // ------------------------------------------------------------------------- - // Implementation of the CodeGenerator interface - // ------------------------------------------------------------------------- - - public int init (final InterceptorClassGenerator icg) { - return IN; - } - - public void generateInitCode (final CodeVisitor cv) - throws ClassGenerationException - { - // does nothing - } - - public CodeVisitor generateInterceptionCode ( - final Method m, - final CodeVisitor cv) throws ClassGenerationException - { - if (intercept(m)) { - return new SimpleInterceptorCodeAdapter(cv, m); - } else { - return cv; - } - } - - public void generateCloneCode (final CodeVisitor cv) - throws ClassGenerationException - { - // does nothing - } - - public void close () { - // does nothing - } - - // ------------------------------------------------------------------------- - // Utility methods - // ------------------------------------------------------------------------- - - /** - * Returns true if this code generator must generate interception - * code for the given method. The default implementation of this method - * returns true for all methods. - * - * @param m a method object. - * @return true if this code generator must generate interception - * code for the given method, or false if the given method must - * be left unchanged. - */ - - protected boolean intercept (final Method m) { - return true; - } - - /** - * Returns the type of the interception code to be generated for the given - * method. The default implementation of this method returns {@link - * InterceptorCodeAdapter#NORMAL NORMAL} for all methods. - * - * @param m a method object. - * @return {@link InterceptorCodeAdapter#EMPTY EMPTY} to generate only a pre - * code block at the beginning of the method, {@link - * InterceptorCodeAdapter#NORMAL NORMAL} to generate both a pre code - * block and a post code block, or {@link InterceptorCodeAdapter#FINALLY - * FINALLY} to generate a pre code block, and a post code block inside a - * finally block (to be sure that the post code block will always be - * executed). - */ - - protected int getInterceptionType (final Method m) { - return InterceptorCodeAdapter.NORMAL; - } - - /** - * Returns the number of local variables that are used by the generated - * interception code. The default implementation of this method returns 0 - * for all methods. - * - * @param m a method object. - * @return the number of local variables that are used by the generated - * interception code. - */ - - protected int getInterceptionCodeFormals (final Method m) { - return 0; - } - - /** - * Generates an interception code block for the given method. - * - * @param m the method for which the interception code must be generated. - * @param pre true to generate a pre code block, or false to - * generate a post code block. - * @param cv the method visitor to be used to generate the interception code. - * @param formals the index of the first local variable reserved for the code - * block. The generated code can use the local variables between indexes - * formals, inclusive, and formals + - * getInterceptionCodeFormals(m), exclusive. - */ - - protected abstract void generateInterceptionCodeBlock ( - final Method m, - final boolean pre, - final CodeVisitor cv, - final int formals); - - // ------------------------------------------------------------------------- - // Utility class - // ------------------------------------------------------------------------- - - /** - * A code adapter to insert pre and post code blocks around visited methods. - */ - - class SimpleInterceptorCodeAdapter extends InterceptorCodeAdapter { - - /** - * The type of "around" code to be inserted. See getInterceptionType. - */ - - private int interceptionType; - - /** - * Beginning of the original method code. - */ - - private Label tryLabel; - - /** - * Beginning of the exception handler block for the finally block. - */ - - private Label catchLabel; - - /** - * Constructs a new {@link SimpleInterceptorCodeAdapter}. - * - * @param cv the code visitor to which this adapter must delegate calls. - * @param m the method for which this code adapter is used. - */ - - public SimpleInterceptorCodeAdapter (final CodeVisitor cv, final Method m) { - // local variables that are inserted: - // local var at index nbFormals = return address for RET - // local var at index nbFormals + 1 = catched exception - // local var at index nbFormals + 2, 3, ... = user defined variables - super( - cv, - m, - getInterceptionCodeFormals(m) + - (getInterceptionType(m) == FINALLY ? 2 : 0), - getInterceptionType(m)); - // generates the pre code block - interceptionType = getInterceptionType(m); - if (interceptionType == FINALLY) { - tryLabel = new Label(); - catchLabel = new Label(); - generateInterceptionCodeBlock(m, true, cv, nbFormals + 2); - cv.visitLabel(tryLabel); - } else { - generateInterceptionCodeBlock(m, true, cv, nbFormals); - } - } - - public void visitMaxs (final int maxStack, final int maxLocals) { - if (interceptionType == NORMAL) { - visitLabel(postBlockLabel); - // generates the post code block - generateInterceptionCodeBlock(m, false, cv, nbFormals); - // generates the appropriate xRETURN opcode - generateReturnCode(); - } else if (interceptionType == FINALLY) { - // generates the bytecode corresponding to: finally { - cv.visitLabel(catchLabel); - cv.visitVarInsn(ASTORE, nbFormals + 1); - cv.visitJumpInsn(JSR, postBlockLabel); - cv.visitVarInsn(ALOAD, nbFormals + 1); - cv.visitInsn(ATHROW); - cv.visitLabel(postBlockLabel); - cv.visitVarInsn(ASTORE, nbFormals); - // generates the content of the finally block - generateInterceptionCodeBlock(m, false, cv, nbFormals + 2); - // generates the end of the finally block - cv.visitVarInsn(RET, nbFormals); - // generates the exception table - cv.visitTryCatchBlock(tryLabel, catchLabel, catchLabel, null); - } - // visits the max stack and max locals attributes - cv.visitMaxs(maxStack, maxLocals); - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/AttributeControllerClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/AttributeControllerClassGenerator.java deleted file mode 100644 index e36a5d421d2d7746319d71d882281a581fc6f880..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/AttributeControllerClassGenerator.java +++ /dev/null @@ -1,251 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.api.control.AttributeController; - -import org.objectweb.fractal.julia.control.attribute.CloneableAttributeController; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Label; -import org.objectweb.asm.Type; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * A class generator to generate {@link AttributeController} - * classes. This generator produces classes that implement a given set of - * attribute controller interfaces, i.e., interfaces with only getXXX - * and setXXX methods. The methods that are generated to implement - * these interfaces store and retreive values in private fields of the generated - * class, two for each method pair. - *

- * More precisely, the code generated for the IAttributes interface below is the - * following: - *

- * public interface IAttributes extends AttributeController {
- *   int getI ();
- *   void setI (int i);
- * }
- *
- * public class XYZ
- *   implements IAttributes, CloneableAttributeController, Generated
- * {
- *
- *   private int I;
- *   private boolean _I; // true if I has been set
- *
- *   public int getI () {
- *     return I;
- *   }
- *
- *   public void setI (int i) {
- *     I = i;
- *     _I = true;
- *   }
- *
- *   public void cloneFcAttributes (AttributeController ac) {
- *     if (_I) {
- *       ((IAttributes)ac).setI(I);
- *     }
- *   }
- *
- *   public String getFcGeneratorParameters () {
- *     return "(... ... (IAttributes))";
- *   }
- * }
- * 
- */ - -public class AttributeControllerClassGenerator extends AbstractClassGenerator { - - /** - * The set of already generated fields. - */ - - private Set fields = new HashSet(); - - /** - * The {@link CodeVisitor} used to generate the {@link - * CloneableAttributeController#cloneFcAttributes cloneFcAttributes} method. - */ - - private CodeVisitor imv; - - /** - * A label that designates the end of the {@link - * CloneableAttributeController#cloneFcAttributes cloneFcAttributes} method. - */ - - private Label endLabel; - - /** - * Initializes this class generator with the given arguments. This method - * requires arguments of the form "(objectDescriptor (itfName1 ... - * itfNameN))", where itfName1 ... itfNameN are the names of the interfaces it - * must implement. - * - * @param args the descriptor of the class to be generated. - */ - - protected void parseArgs (final Tree args) { - superClass = "java/lang/Object"; - interfaces = new ArrayList(Arrays.asList(args.getSubTree(1).getSubTrees())); - for (int i = 0; i < interfaces.size(); ++i) { - interfaces.set(i, interfaces.get(i).toString().replace('.', '/')); - } - } - - /** - * Adds {@link CloneableAttributeController} to the list returned by the - * overriden method. - */ - - protected List getImplementedInterfaces () throws ClassGenerationException { - List itfs = super.getImplementedInterfaces(); - itfs.add(Type.getInternalName(CloneableAttributeController.class)); - return itfs; - } - - /** - * Calls the overriden method and generates the header of the {@link - * CloneableAttributeController#cloneFcAttributes cloneFcAttributes} method. - */ - - protected void generateDefaultMethods () throws ClassGenerationException { - super.generateDefaultMethods(); - imv = cw.visitMethod( - ACC_PUBLIC, - "cloneFcAttributes", - "(" + Type.getDescriptor(AttributeController.class) + ")V", - null, - null); - } - - /** - * Calls the overriden method and finishes the generation of the {@link - * CloneableAttributeController#cloneFcAttributes cloneFcAttributes} method. - */ - - protected void generateInterfaceMethods () throws ClassGenerationException { - super.generateInterfaceMethods(); - if (endLabel != null) { - imv.visitLabel(endLabel); - } - imv.visitInsn(RETURN); - imv.visitMaxs(3, 3); - } - - /** - * Generates a getter or setter method, and the corresponding fields if they - * are not already generated. If the given method is a setter method, this - * method also adds code corresponding to this attribute to the {@link - * CloneableAttributeController#cloneFcAttributes cloneFcAttributes} method. - */ - - protected void generateMethod (final Method m) { - // generates the header of the method - String mName = m.getName(); - String mDesc = Type.getMethodDescriptor(m); - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - // computes the name and type of the corresponding field - String fieldName = mName.substring(3); - String iFieldName = "_" + fieldName; - Class fieldType; - if (mName.startsWith("get")) { - fieldType = m.getReturnType(); - } else { - fieldType = m.getParameterTypes()[0]; - } - String fieldDesc = Type.getDescriptor(fieldType); - if (!fields.contains(fieldName)) { - cw.visitField(ACC_PRIVATE, fieldName, fieldDesc, null, null); - cw.visitField(ACC_PRIVATE, iFieldName, "Z", null, null); - fields.add(fieldName); - } - if (mName.startsWith("get")) { - // generates the bytecode corresponding to 'return xxx;' - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, fieldName, fieldDesc); - mv.visitInsn(IRETURN + getOpcodeOffset(fieldType)); - } else { - // generates the bytecode corresponding to 'this.xxx = xxx;' - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ILOAD + getOpcodeOffset(fieldType), 1); - mv.visitFieldInsn(PUTFIELD, name, fieldName, fieldDesc); - // generates the bytecode corresponding to 'this._xxx = true;' - mv.visitVarInsn(ALOAD, 0); - mv.visitInsn(ICONST_1); - mv.visitFieldInsn(PUTFIELD, name, iFieldName, "Z"); - mv.visitInsn(RETURN); - // adds code corresponding to 'xxx' in 'copyFcAttributes' - generateInitMethod(fieldName, fieldDesc, iFieldName, m); - } - mv.visitMaxs(Math.max(2, 1 + getSize(fieldType)), 1 + getSize(fieldType)); - } - - /** - * Adds the code corresponding to the given attribute to the {@link - * CloneableAttributeController#cloneFcAttributes cloneFcAttributes} method. - * - * @param fieldName the name of the 'xxx' field corresponding to the - * attribute. - * @param fieldDesc the descriptor of the 'xxx' field corresponding to an - * attribute. - * @param iFieldName the name of the '_xxx' field corresponding to the - * attribute. - * @param m the 'setXXX' setter method corresponding to the attribute. - */ - - private void generateInitMethod ( - final String fieldName, - final String fieldDesc, - final String iFieldName, - final Method m) - { - if (endLabel != null) { - imv.visitLabel(endLabel); - } - endLabel = new Label(); - String owner = Type.getInternalName(m.getDeclaringClass()); - String desc = Type.getMethodDescriptor(m); - // generates the bytecode corresponding to 'if (_xxx) {' - imv.visitVarInsn(ALOAD, 0); - imv.visitFieldInsn(GETFIELD, name, iFieldName, "Z"); - imv.visitJumpInsn(IFEQ, endLabel); - // generates the bytecode corresponding to '(XYZ)ac' - imv.visitVarInsn(ALOAD, 1); - imv.visitTypeInsn(CHECKCAST, owner); - // generates the bytecode corresponding to 'setXXX(xxx)' - imv.visitVarInsn(ALOAD, 0); - imv.visitFieldInsn(GETFIELD, name, fieldName, fieldDesc); - imv.visitMethodInsn(INVOKEINTERFACE, owner, m.getName(), desc); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/ClassGenerationException.java b/julia/src/org/objectweb/fractal/julia/asm/ClassGenerationException.java deleted file mode 100644 index bc2df774022e48bbe66ff33cbd9505953051bb64..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/ClassGenerationException.java +++ /dev/null @@ -1,117 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import java.io.PrintStream; -import java.io.PrintWriter; - -/** - * Thrown when a problem occurs during the generation of a class. See {@link - * ClassGenerator#generateClass generateClass}. - */ - -public class ClassGenerationException extends ClassNotFoundException { - - /** - * The exception that caused this exception. May be null. - */ - - private Throwable exception; - - /** - * The class descriptor of the class that cannot be generated. - */ - - private String classDescriptor; - - /** - * Constructs a new {@link ClassGenerationException} object. - * - * @param exception the cause of this exception. May be null. - * @param classDescriptor the class descriptor of the class that cannot be - * generated. - * @param message the name of the interface that cannot be found. - */ - - public ClassGenerationException ( - final Throwable exception, - final String classDescriptor, - final String message) - { - super("Cannot generate the " + classDescriptor + " class. " + message); - this.exception = exception; - this.classDescriptor = classDescriptor; - } - - public Throwable getException () { - return exception; - } - - /** - * Returns the class descriptor of the class that cannot be generated. - * - * @return the class descriptor of the class that cannot be generated. - */ - - public String getClassDescriptor () { - return classDescriptor; - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - exception.printStackTrace(); - } - super.printStackTrace(); - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/ClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/ClassGenerator.java deleted file mode 100644 index 0d30bb4cd982eac97453e6e947f82436d283da70..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/ClassGenerator.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; - -/** - * The interface that all Julia's class generators must implement. - */ - -public interface ClassGenerator { - - /** - * Generates the class whose descriptor is given, with the given name. The - * generated class must implement the {@link - * org.objectweb.fractal.julia.loader.Generated} interface, and its {@link - * org.objectweb.fractal.julia.loader.Generated#getFcGeneratorParameters - * getFcGeneratorParameters} method must return args.toString(). - * - * @param name the name of the class to be generated. - * @param args the descriptor of the class to be generated. This - * descriptor must be of the form "(objectDescriptor arg1 ... - * argN)" (see {@link - * Loader#loadClass(org.objectweb.fractal.julia.loader.Tree) loadClass}). - * @param loader the loader to be used to load or generate auxiliary classes, - * if needed. - * @return a class named name and whose content is described by the - * given class descriptor. - * @throws ClassGenerationException if a problem occurs during the generation - * of the class. - */ - - byte[] generateClass (String name, Tree args, Loader loader) - throws ClassGenerationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/ClassTransformer.java b/julia/src/org/objectweb/fractal/julia/asm/ClassTransformer.java deleted file mode 100644 index 6a4004a8333212fed28a82e59b4485dbd0bdc7ac..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/ClassTransformer.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.objectweb.fractal.julia.asm; - -import org.objectweb.asm.ClassVisitor; - -/** - * A {@link ClassVisitor} that transforms the classes it visits. - */ -public interface ClassTransformer extends ClassVisitor { - - /** - * Sets the class visitor that must be used by this transformer to generate - * the transformed classes. - * - * @param cv a class visitor. - */ - - void setClassVisitor (ClassVisitor cv); -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/CodeGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/CodeGenerator.java deleted file mode 100644 index 4ef4b26c2f9dd5b2cec15f772a9aec84bb192de0..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/CodeGenerator.java +++ /dev/null @@ -1,184 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.asm.CodeVisitor; - -import java.lang.reflect.Method; - -/** - * A code generator used by an {@link InterceptorClassGenerator} to generate - * interception code. The interception - * code for a given method is generated by using a kind of {@link - * org.objectweb.asm.CodeAdapter}: the original method code is - * visited by a code adapter, which adds the interception code on the fly. For - * example, to add pre and post code blocks to a method, the previous code - * adapter can be of the following form: - *
- * public class PrePostCodeAdapter implements CodeVisitor {
- *   private CodeVisitor cv;
- *   private Label postBlockLabel;
- *   public PrePostCodeAdapter (CodeVisitor cv) {
- *     this.cv = cv;
- *     this.postBlockLabel = new Label();
- *     // GENERATES PRE CODE BLOCK using cv
- *   }
- *   public void visitInsn (int opcode) {
- *     // replaces xRETURN instructions with the following instructions:
- *     //   xSTORE result
- *     //   GOTO postBlockLabel
- *   }
- *   public void visitVarInsn (int opcode, int var) {
- *     // inserts a variable to store the result, just after the parameters
- *     // shifts the existing variables to make room for this new variable
- *   }
- *   public void visitMaxs (int maxStack, int maxLocals) {
- *     cv.visitLabel(postBlockLabel);
- *     // GENERATES POST CODE BLOCK using cv
- *     // generates appropriate xLOAD xRETURN instructions
- *     cv.visitMaxs(maxStack, maxLocals);
- *   }
- *   // the other CodeVisitor methods are implemented by just delegating to cv
- * }
- * 
- * When the original method code is visited by this code adapter, the pre code - * block is generated immediately. Then the original method code is regenerated - * as is, except that returns are replaced with gotos. The post code block is - * inserted when the end of the original method code is visited (i.e., when - * visitMaxs is called). - *

- * The original method code can also be completely replaced with a code adapter - * of the following form: - *

- * public class AroundCodeAdapter implements CodeVisitor {
- *   public AroundCodeAdapter (CodeVisitor cv) {
- *     // generates the code replacing the original method code
- *   }
- *   // the CodeVisitor methods are implemented by doing nothing
- * }
- * 
- * These code adapters are returned by the {@link #generateInterceptionCode - * generateInterceptionCode} method. More precisely, given a code visitor, this - * method should return a code adapter that adds the desired interception code - * for the given method. - *

- * When several code generators are used by an interceptor class generator, the - * code adapters returned by the {@link #generateInterceptionCode - * generateInterceptionCode} methods of these code generators are chained - * together. The first code adapter in this chain visits the original - * code of each method. The second code adapter visits the code modified on the - * fly by the first code adapter. The third code adapter visits the code - * modified on the fly by the first and second code adapters, and so on. The - * result is a code that includes the interception code generated by each - * code generator. - */ - -public interface CodeGenerator { - - /** - * The type of code generators that applies only to input interceptor classes. - * See {@link InterceptorClassGenerator#in here} for more details. - */ - - int IN = 0; - - /** - * The type of code generators that applies only to output interceptor - * classes. See {@link InterceptorClassGenerator#in here} for more details. - */ - - int OUT = 1; - - /** - * The type of code generators that applies to input and output interceptor - * classes. See {@link InterceptorClassGenerator#in here} for more details. - */ - - int IN_OUT = 2; - - /** - * Initializes this code generator. - * - * @param icg the interceptor class generator to which this code generator - * belongs. - * - * @return the type of this code generator, i.e., either {@link #IN IN}, - * {@link #OUT OUT} or {@link #IN_OUT IN_OUT}. - */ - - int init (InterceptorClassGenerator icg); - - /** - * Generates the initialization code for this code generator. This code is - * added to the {@link org.objectweb.fractal.julia.Controller#initFcController - * initFcController} method by the interceptor class generator that calls this - * method. By hypothesis, the stack is empty at the beginning of the generated - * code. Moreover, the stack must also be empty at the end of the code - * generated by this method. - * - * @param cv the method visitor to be used to generate the initialization - * code. - * @throws ClassGenerationException if a problem occurs. - */ - - void generateInitCode (CodeVisitor cv) throws ClassGenerationException; - - /** - * Generates the interception code for the given method. - * - * @param m the method for which the interception code must be generated. - * @param cv the method visitor to be used to generate the interception code. - * @return a method visitor to be used to visit the original method code. - * This method visitor should be a kind of {@link - * org.objectweb.asm.CodeAdapter}, that should add the - * interception code to the visited code on the fly. See {@link - * CodeGenerator}. - * @throws ClassGenerationException if a problem occurs. - */ - - CodeVisitor generateInterceptionCode (Method m, CodeVisitor cv) - throws ClassGenerationException; - - /** - * Generates the cloning code for this code generator. This code is - * added to the {@link org.objectweb.fractal.julia.Interceptor#clone clone} - * method by the interceptor class generator that calls this method. By - * hypothesis, the stack is empty at the beginning of the generated code. - * Moreover, the stack must also be empty at the end of the code generated by - * this method. - * - * @param cv the method visitor to be used to generate the cloning code. - * @throws ClassGenerationException if a problem occurs. - */ - - void generateCloneCode (CodeVisitor cv) - throws ClassGenerationException; - - /** - * Closes this code generator. This method can be used to do some cleanup - * before computing the bytecode of the interceptor class. - */ - - void close (); -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/ContextClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/ContextClassGenerator.java deleted file mode 100644 index 31549e32dda1798e26f2a7b7e2521114476dcb94..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/ContextClassGenerator.java +++ /dev/null @@ -1,1077 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; -import org.objectweb.asm.Type; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * A class generator to generate {@link - * org.objectweb.fractal.julia.InitializationContext} classes. This class - * generates classes of the following form: - * - *

- * public class XYZ extends InitializationContext implements Generated {
- *
- *   private static ComponentType componentType;
- *   private static ComponentType internalComponentType;
- *
- *   public void create() {
- *     super.create();
- *     ComponentType compType;
- *     if (componentType == null) {
- *       TypeFactory tf = (TypeFactory)hints;
- *       componentType = tf.createFcType(new InterfaceType[] {
- *         tf.createFcItfType(...),
- *         ...
- *         tf.createFcItfType(...)
- *       });
- *       internalComponentType = tf.createFcType(new InterfaceType[] {
- *         tf.createFcItfType(...),
- *         ...
- *         tf.createFcItfType(...)
- *       });
- *     }
- *     compType = componentType;
- *     controllers.add(new controller-class1());
- *     ...
- *     controllers.add(new controller-classN());
- *   [ if (content == null) content = new content-class(); ]
- *     Component owner = null;
- *     Object impl = controllers.get(0);
- *     interfaces.put("component", owner = new interface-class1(..., impl));
- *     ...
- *     impl = controllers.get(I); // or impl = content;
- *   [ impl = new interceptor-classM(impl); ]
- *   [ controllers.add(impl);                      ]
- *     interfaces.put("...", new interface-classM(..., impl));
- *   [ internalInterfaces.put("...", new interface-classM(..., impl)); ]
- *     return;
- *   }
- *
- *   public String getFcGeneratorParameters() {
- *     return "(... ...)";
- *   }
- * }
- * 
- */ - -public class ContextClassGenerator implements Constants, ClassGenerator { - - /** - * Internal name of the super class of the classes generated by this - * generator. - */ - - private final static String SUPER = - "org/objectweb/fractal/julia/InitializationContext"; - - /** - * The valid optimization levels. - */ - - private final static String[] OPTIMIZATIONS = { - "none", - "mergeControllers", - "mergeControllersAndInterceptors", - "mergeControllersAndContent", - "mergeControllersInterceptorsAndContent" - }; - - /** - * Internal name of the class generated by this generator. - */ - - private String name; - - /** - * The class visitor used to generate the class. - */ - - private ClassVisitor cv; - - /** - * The descriptor of the class that is being generated. - */ - - private Tree args; - - /** - * The loader used to load auxiliary classes. - */ - - private Loader loader; - - /** - * The types of the functional and control interfaces of the components that - * will be created by the generated class. - */ - - private Tree interfaceTypes; - - /** - * The names of the classes of the controller objects of the components that - * will be created by the generated class. - */ - - private Tree[] controllerTrees; - - /** - * The classes of the controller objects of the components that will be - * created by the generated class. - */ - - private List controllerClasses; - - /** - * The class of the content part of the components that will be created by the - * generated class. - */ - - private Class contentClass; - - /** - * Generates the class whose descriptor is given, with the given name. - * - * @param name the name of the class to be generated. - * @param args the descriptor of the class to be generated. This - * descriptor must be of the form TODO. - * @param loader the loader to be used to load or generate auxiliary classes, - * if needed. - * @return a class named name and whose content is described by the - * given class descriptor. - * @throws ClassGenerationException if a problem occurs during the generation - * of the class. - */ - - public byte[] generateClass ( - final String name, - final Tree args, - final Loader loader) throws ClassGenerationException - { - this.name = name.replace('.', '/'); - this.cv = new ClassWriter(true); - this.args = args; - this.loader = loader; - - // creates the class header - cv.visit( - ACC_PUBLIC, - this.name, - SUPER, - new String[] { "org/objectweb/fractal/julia/loader/Generated" }, - null); - - // generates the "componentType" static field - cv.visitField( - ACC_PRIVATE + ACC_STATIC, - "componentType", - "Lorg/objectweb/fractal/api/type/ComponentType;", - null, - null); - - // generates the "internalComponentType" static field - cv.visitField( - ACC_PRIVATE + ACC_STATIC, - "internalComponentType", - "Lorg/objectweb/fractal/api/type/ComponentType;", - null, - null); - - // generates the default constructor - CodeVisitor mv = cv.visitMethod(ACC_PUBLIC, "", "()V", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, SUPER, "", "()V"); - mv.visitInsn(RETURN); - mv.visitMaxs(0, 0); - - // generates the "create" method (see InitilizationContext) - mv = cv.visitMethod(ACC_PUBLIC, "create", "()V", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, SUPER, "create", "()V"); - computeInterfaceTypes(); - generateCreateType(mv); - generateCreateControllers(mv); - generateCreateContent(mv); - generateCreateInterfaces(mv); - mv.visitInsn(RETURN); - mv.visitMaxs(0, 0); - - // generates the 'getFcGeneratorParameters' method - String mName = "getFcGeneratorParameters"; - String mDesc = "()Ljava/lang/String;"; - mv = cv.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - mv.visitLdcInsn(args.toString()); - mv.visitInsn(ARETURN); - mv.visitMaxs(0, 0); - - // returns the generated class - return ((ClassWriter)cv).toByteArray(); - } - - /** - * Computes all the interface types of the component. This method merges the - * control interface type descriptors and the functional interface type - * descriptors into a single descriptor "interfaceTypes" - */ - - public void computeInterfaceTypes () { - Tree[] functionalItfs = args.getSubTree(1).getSubTrees(); - Tree[] controlItfs = args.getSubTree(2).getSubTree(1).getSubTrees(); - Tree[] allItfs = new Tree[functionalItfs.length + controlItfs.length]; - for (int i = 0; i < controlItfs.length; ++i) { - allItfs[i] = new Tree(new Tree[] { - controlItfs[i].getSubTree(0), - controlItfs[i].getSubTree(1), - new Tree("false"), - new Tree("false"), - new Tree("false") - }); - } - for (int i = 0; i < functionalItfs.length; ++i) { - allItfs[i + controlItfs.length] = functionalItfs[i]; - } - interfaceTypes = new Tree(allItfs); - } - - /** - * Generates the code to initialize the "componentType" and - * "internalComponentType" static fields of the generated class. - * - * @param mv the code visitor to be used to generate the code. - */ - - public void generateCreateType (final CodeVisitor mv) { - // generates "if (componentType == null) {" - Label l = new Label(); - mv.visitFieldInsn( - GETSTATIC, - name, - "componentType", - "Lorg/objectweb/fractal/api/type/ComponentType;"); - mv.visitJumpInsn(IFNONNULL, l); - - // generates "TypeFactory tf = (TypeFactory)hints;" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "hints", "Ljava/lang/Object;"); - mv.visitTypeInsn(CHECKCAST, "org/objectweb/fractal/api/type/TypeFactory"); - mv.visitVarInsn(ASTORE, 1); - - // EXTERNAL COMPONENT TYPE - - // computes the number of external public interfaces - int externalItfs = interfaceTypes.getSize(); - for (int i = 0; i < interfaceTypes.getSize(); ++i) { - Tree itf = interfaceTypes.getSubTree(i); - if (itf.getSubTree(0).toString().startsWith("/")) { - --externalItfs; - } - } - - // generates "new InterfaceType[...] {" - mv.visitVarInsn(ALOAD, 1); - mv.visitIntInsn(SIPUSH, externalItfs); - mv.visitTypeInsn(ANEWARRAY, "org/objectweb/fractal/api/type/InterfaceType"); - - int j = 0; - for (int i = 0; i < interfaceTypes.getSize(); ++i) { - Tree itf = interfaceTypes.getSubTree(i); - if (itf.getSubTree(0).toString().startsWith("/")) { - continue; - } - // generates "tf.createFcItfType(...);" - mv.visitInsn(DUP); - mv.visitIntInsn(SIPUSH, j++); - mv.visitVarInsn(ALOAD, 1); - mv.visitLdcInsn(itf.getSubTree(0).toString()); - mv.visitLdcInsn(itf.getSubTree(1).toString()); - mv.visitInsn(itf.getSubTree(2).equals("true") ? ICONST_1 : ICONST_0); - mv.visitInsn(itf.getSubTree(3).equals("true") ? ICONST_1 : ICONST_0); - mv.visitInsn(itf.getSubTree(4).equals("true") ? ICONST_1 : ICONST_0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/api/type/TypeFactory", - "createFcItfType", - "(Ljava/lang/String;Ljava/lang/String;ZZZ)" + - "Lorg/objectweb/fractal/api/type/InterfaceType;"); - mv.visitInsn(AASTORE); - } - - // generates "componentType = tf.createFcType(...);" - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/api/type/TypeFactory", - "createFcType", - "([Lorg/objectweb/fractal/api/type/InterfaceType;)" + - "Lorg/objectweb/fractal/api/type/ComponentType;"); - mv.visitFieldInsn( - PUTSTATIC, - name, - "componentType", - "Lorg/objectweb/fractal/api/type/ComponentType;"); - - // INTERNAL COMPONENT TYPE - - // computes the number of internal public interfaces - int internalIfts = interfaceTypes.getSize(); - for (int i = 0; i < interfaceTypes.getSize(); ++i) { - Tree itf = interfaceTypes.getSubTree(i); - String name = itf.getSubTree(0).toString(); - if (name.startsWith("/") || - name.equals("component") || - name.endsWith("-controller")) - { - --internalIfts; - } - } - - // generates "new InterfaceType[...] {" - mv.visitVarInsn(ALOAD, 1); - mv.visitIntInsn(SIPUSH, internalIfts); - mv.visitTypeInsn(ANEWARRAY, "org/objectweb/fractal/api/type/InterfaceType"); - - j = 0; - for (int i = 0; i < interfaceTypes.getSize(); ++i) { - Tree itf = interfaceTypes.getSubTree(i); - String name = itf.getSubTree(0).toString(); - if (name.startsWith("/") || - name.equals("component") || - name.endsWith("-controller")) - { - continue; - } - // generates "tf.createFcItfType(...);" - mv.visitInsn(DUP); - mv.visitIntInsn(SIPUSH, j++); - mv.visitVarInsn(ALOAD, 1); - mv.visitLdcInsn(itf.getSubTree(0).toString()); - mv.visitLdcInsn(itf.getSubTree(1).toString()); - mv.visitInsn(itf.getSubTree(2).equals("true") ? ICONST_0 : ICONST_1); - mv.visitInsn(itf.getSubTree(3).equals("true") ? ICONST_1 : ICONST_0); - mv.visitInsn(itf.getSubTree(4).equals("true") ? ICONST_1 : ICONST_0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/api/type/TypeFactory", - "createFcItfType", - "(Ljava/lang/String;Ljava/lang/String;ZZZ)" + - "Lorg/objectweb/fractal/api/type/InterfaceType;"); - mv.visitInsn(AASTORE); - } - - // generates "internalComponentType = tf.createFcType(...);" - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/api/type/TypeFactory", - "createFcType", - "([Lorg/objectweb/fractal/api/type/InterfaceType;)" + - "Lorg/objectweb/fractal/api/type/ComponentType;"); - mv.visitFieldInsn( - PUTSTATIC, - name, - "internalComponentType", - "Lorg/objectweb/fractal/api/type/ComponentType;"); - - // generates "}" (end of "if (componentType == null)" statement) - mv.visitLabel(l); - - // generates "type = componentType;" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn( - GETSTATIC, - name, - "componentType", - "Lorg/objectweb/fractal/api/type/ComponentType;"); - mv.visitFieldInsn( - PUTFIELD, - name, - "type", - "Lorg/objectweb/fractal/api/Type;"); - - // generates "ComponentType compType = componentType;" - mv.visitFieldInsn( - GETSTATIC, - name, - "componentType", - "Lorg/objectweb/fractal/api/type/ComponentType;"); - mv.visitVarInsn(ASTORE, 2); - } - - /** - * Generates the code to create the component's controller objects. - * - * @param mv the code visitor to be used to generate the code. - * @throws ClassGenerationException if a problem occurs - */ - - public void generateCreateControllers (final CodeVisitor mv) - throws ClassGenerationException - { - // creates a context to evaluate the controller descriptors - Map context = new HashMap(); - for (int i = 0; i < interfaceTypes.getSize(); ++i) { - String itfName = interfaceTypes.getSubTree(i).getSubTree(0).toString(); - if (itfName.equals("attribute-controller")) { - Tree itfSignature = interfaceTypes.getSubTree(i).getSubTree(1); - context.put("attributeControllerInterface", itfSignature); - break; - } - } - - // evaluates the controller descriptors - Tree[] controllerDescs; - Tree[] controllerArgs; - try { - Tree t = args.getSubTree(2).getSubTree(2); - controllerDescs = loader.evalTree(t, context).getSubTrees(); - controllerArgs = new Tree[controllerDescs.length]; - for (int i = 0; i < controllerDescs.length; i++) { - Tree controllerDesc = controllerDescs[i]; - if (controllerDesc.getSize() > 0) { - controllerDescs[i] = controllerDesc.getSubTree(0); - if (controllerDesc.getSize() > 1) { - Tree[] trees = controllerDesc.getSubTrees(); - Tree[] args = new Tree[trees.length - 1]; - System.arraycopy(trees, 1, args, 0, args.length); - controllerArgs[i] = new Tree(args); - } - } - } - } catch (Exception e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find or evaluate the controller class descriptors"); - } - - // checks the optimization level - String optimize = args.getSubTree(2).getSubTree(5).toString(); - if (!Arrays.asList(OPTIMIZATIONS).contains(optimize)) { - throw new ClassGenerationException( - null, args.toString(), "Invalid optimization level: " + optimize); - } - - controllerClasses = new ArrayList(); - if (optimize.indexOf("Controllers") != -1) { - // computes the class descriptor of the merged controller class - Tree[] mergeClassDesc = new Tree[controllerDescs.length + 2]; - // name of the "merge class generator" class - mergeClassDesc[0] = args.getSubTree(2).getSubTree(4); - // super to be used for the merged class - mergeClassDesc[1] = new Tree("java.lang.Object"); - - String content = args.getSubTree(3).toString(); - if (optimize.indexOf("Content") != -1 && !content.equals("EMPTY")) { - try { - contentClass = loader.loadClass(content); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, args.toString(), "Cannot find the '" + content + "' class"); - } - mergeClassDesc[1] = new Tree(content); - } - // classes to be merged - for (int i = 0; i < controllerDescs.length; ++i) { - Tree controllerDesc = controllerDescs[i]; - try { - Class c = loader.loadClass(controllerDesc); - mergeClassDesc[i + 2] = new Tree(c.getName()); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find or generate the '" + controllerDesc + - "' controller class"); - } - } - - // loads the merged controller class - Class mergedClass; - String mergedClassName; - try { - mergedClass = loader.loadClass(new Tree(mergeClassDesc)); - mergedClassName = Type.getInternalName(mergedClass); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find or generate the merged controller class"); - } - - Tree interceptors = args.getSubTree(2).getSubTree(3); - if (optimize.indexOf("Interceptors") > 0 && interceptors.getSize() > 0) { - // generates a sub class of mergedClass - // with the interceptor class generator - - // computes the arguments for the merged interceptor class generator - List itfList = new ArrayList(); - List itfNameList = new ArrayList(); - for (int i = 0; i < interfaceTypes.getSize(); ++i) { - Tree itfType = interfaceTypes.getSubTree(i); - String itfName = itfType.getSubTree(0).toString(); - String itfSignature = itfType.getSubTree(1).toString(); - boolean isClient = itfType.getSubTree(2).equals("true"); - boolean isControl = - itfName.startsWith("/") || - itfName.equals("component") || - itfName.endsWith("-controller"); - if (!isClient && !isControl && !itfList.contains(itfSignature)) { - itfList.add(itfSignature); - itfNameList.add(new Tree(itfName)); - } - } - for (int i = 0; i < itfList.size(); ++i) { - itfList.set(i, new Tree((String)itfList.get(i))); - } - Tree[] itfTrees = - (Tree[])itfList.toArray(new Tree[itfList.size()]); - Tree[] itfNameTrees = - (Tree[])itfNameList.toArray(new Tree[itfNameList.size()]); - - // computes the merged interceptor class generator descriptor - Map itfCtxt = new HashMap(); - itfCtxt.put("interfaceName", new Tree(itfNameTrees)); - Tree classGen; - try { - classGen = loader.evalTree(interceptors.getSubTree(0), itfCtxt); - } catch (Exception e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot get the merged interceptor class generator descriptor"); - } - - // loads the merged interceptor class, sub class of 'mergeClass' - try { - mergedClass = loader.loadClass(new Tree(new Tree[] { - classGen, - new Tree(mergedClass.getName()), - new Tree(itfTrees), - new Tree(new Tree[0]), - new Tree("in") - })); - mergedClassName = Type.getInternalName(mergedClass); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find or generate the merged interceptor class"); - } - } - - controllerClasses.add(mergedClass); - - // generates "new ()" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "controllers", "Ljava/util/List;"); - mv.visitTypeInsn(NEW, mergedClassName); - mv.visitInsn(DUP); - mv.visitMethodInsn(INVOKESPECIAL, mergedClassName, "", "()V"); - // generates the code to initialize the merged controller object - mv.visitInsn(DUP); - mv.visitTypeInsn( - CHECKCAST, - "org/objectweb/fractal/julia/loader/Initializable"); - generateCreateTreeCode(mv, new Tree(controllerArgs)); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/julia/loader/Initializable", - "initialize", - "(Lorg/objectweb/fractal/julia/loader/Tree;)V"); - // generates "controllers.add(...);" - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - "add", - "(Ljava/lang/Object;)Z"); - mv.visitInsn(POP); - - if (optimize.indexOf("Content") != -1 && !content.equals("EMPTY")) { - // generates "content = controllers.get(0);" - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "controllers", "Ljava/util/List;"); - mv.visitInsn(ICONST_0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - "get", - "(I)Ljava/lang/Object;"); - mv.visitFieldInsn(PUTFIELD, name, "content", "Ljava/lang/Object;"); - } - } else { - // generates the code to create each controller object separately - for (int i = 0; i < controllerDescs.length; ++i) { - Tree controllerDesc = controllerDescs[i]; - Class c; - String n; - try { - c = loader.loadClass(controllerDesc); - n = c.getName().replace('.', '/'); - controllerClasses.add(c); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find or generate the '" + controllerDesc + - "' controller class"); - } - // generates "new ()" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "controllers", "Ljava/util/List;"); - mv.visitTypeInsn(NEW, n); - mv.visitInsn(DUP); - mv.visitMethodInsn(INVOKESPECIAL, n, "", "()V"); - if (controllerArgs[i] != null) { - // generates the code to initialize the controller object - mv.visitInsn(DUP); - mv.visitTypeInsn( - CHECKCAST, - "org/objectweb/fractal/julia/loader/Initializable"); - generateCreateTreeCode(mv, controllerArgs[i]); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/julia/loader/Initializable", - "initialize", - "(Lorg/objectweb/fractal/julia/loader/Tree;)V"); - } - // generates "controllers.add(...);" - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - "add", - "(Ljava/lang/Object;)Z"); - mv.visitInsn(POP); - } - } - - // stores the names of the 'controllerClasses' classes in 'controllerTrees' - controllerTrees = new Tree[controllerClasses.size()]; - for (int l = 0; l < controllerTrees.length; ++l) { - controllerTrees[l] = new Tree(((Class)controllerClasses.get(l)).getName()); - } - } - - /** - * Generates the code to create the given tree. - * - * @param mv the code visitor to be used to generate the code. - * @param t a tree. - */ - - private void generateCreateTreeCode (final CodeVisitor mv, final Tree t) { - String tree = "org/objectweb/fractal/julia/loader/Tree"; - if (t == null) { - mv.visitInsn(ACONST_NULL); - } else if (t.getSize() == 0) { - mv.visitTypeInsn(NEW, tree); - mv.visitInsn(DUP); - mv.visitLdcInsn(t.toString()); - mv.visitMethodInsn(INVOKESPECIAL, tree, "", "(Ljava/lang/String;)V"); - } else { - mv.visitTypeInsn(NEW, tree); - mv.visitInsn(DUP); - mv.visitIntInsn(SIPUSH, t.getSize()); - mv.visitTypeInsn(ANEWARRAY, tree); - for (int i = 0; i < t.getSize(); ++i) { - mv.visitInsn(DUP); - mv.visitIntInsn(SIPUSH, i); - generateCreateTreeCode(mv, t.getSubTree(i)); - mv.visitInsn(AASTORE); - } - mv.visitMethodInsn(INVOKESPECIAL, tree, "", "([L" + tree + ";)V"); - } - } - - /** - * Generates the code to create the component's content. - * - * @param mv the code visitor to be used to generate the code. - * @throws ClassGenerationException if the component's content class cannot be - * found. - */ - - public void generateCreateContent (final CodeVisitor mv) - throws ClassGenerationException - { - String content = args.getSubTree(3).toString(); - if (content.equals("EMPTY")) { - return; - } - - // 'contentClass' can have been initialized in generateCreateControllers - if (contentClass == null) { - try { - contentClass = loader.loadClass(content); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, args.toString(), "Cannot find the '" + content + "' class"); - } - content = content.replace('.', '/'); - // generates "content = new ();" - Label end = new Label(); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "content", "Ljava/lang/Object;"); - mv.visitJumpInsn(IFNONNULL, end); - mv.visitVarInsn(ALOAD, 0); - mv.visitTypeInsn(NEW, content); - mv.visitInsn(DUP); - mv.visitMethodInsn(INVOKESPECIAL, content, "", "()V"); - mv.visitFieldInsn(PUTFIELD, name, "content", "Ljava/lang/Object;"); - mv.visitLabel(end); - } - - // generates "interfaces.put("/content", content);" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, this.name, "interfaces", "Ljava/util/Map;"); - mv.visitLdcInsn("/content"); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "content", "Ljava/lang/Object;"); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - mv.visitInsn(POP); - } - - /** - * Generates the code to create the component interfaces. - * - * @param mv the code visitor to be used to generate the code. - * @throws ClassGenerationException if a problem occurs. - */ - - public void generateCreateInterfaces (final CodeVisitor mv) - throws ClassGenerationException - { - String optimize = args.getSubTree(2).getSubTree(5).toString(); - Tree interceptors = args.getSubTree(2).getSubTree(3); - boolean interceptorsMerged = optimize.indexOf("Interceptors") != -1; - - Tree itfClassGen = args.getSubTree(2).getSubTree(0); - boolean hasItfClassGen = !itfClassGen.equals("NONE"); - - // generates "Component owner = null;" - mv.visitInsn(ACONST_NULL); - mv.visitVarInsn(ASTORE, 3); - - for (int i = 0; i < interfaceTypes.getSize(); ++i) { - Tree itf = interfaceTypes.getSubTree(i); - String itfName = itf.getSubTree(0).toString(); - String itfSignature = itf.getSubTree(1).toString(); - boolean isClient = itf.getSubTree(2).toString().equals("true"); - boolean isCollection = itf.getSubTree(4).toString().equals("true"); - boolean isControl = - !isClient && - (itfName.startsWith("/") || - itfName.equals("component") || - itfName.endsWith("-controller")); - - // loads the functional interface - Class itfClass; - try { - itfClass = loader.loadClass(itfSignature); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, args.toString(), "Cannot find the '" + itfSignature + "' class"); - } - - // loads the corresponding ComponentInterface sub class - Class compItfClass; - String compItfClassName; - if (hasItfClassGen) { - try { - compItfClass = loader.loadClass(new Tree(new Tree[] { - itfClassGen, - new Tree(new Tree[] { new Tree(itfSignature) }) - })); - compItfClassName = compItfClass.getName().replace('.', '/'); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find or generate the ComponentInterface class for the '" + - itfSignature + "' class"); - } - } else { - compItfClass = null; - compItfClassName = null; - } - - // finds the ComponentInterace.getFcItfImpl object, and generates the - // corresponding "Object impl = ...;" code - - if (isClient) { - // generates "Object impl = null;" - mv.visitInsn(ACONST_NULL); - mv.visitVarInsn(ASTORE, 4); - } else { - // looks for 'impl' in the controller objects, and in 'content' - int u = -1; - int v = -1; - int w; - for (int j = 0; j < controllerClasses.size(); ++j) { - if (itfClass.isAssignableFrom((Class)controllerClasses.get(j))) { - u = j + 1; - break; - } - } - if (contentClass != null && itfClass.isAssignableFrom(contentClass)) { - v = 0; - } - if (isControl || interceptorsMerged) { - w = u != -1 ? u : v; - } else { - w = v != -1 ? v : u; - } - if (w == -1 && isControl) { - throw new ClassGenerationException( - null, - args.toString(), - "Implementation missing for control interface " + - itfName + " of type " + itfSignature); - } - - // generates the code to store the object that has been found in 'impl' - if (w != -1) { - if (w == 0) { - // generates "Object impl = null;" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "content", "Ljava/lang/Object;"); - } else { - // generates "Object impl = controllers.get();" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "controllers", "Ljava/util/List;"); - mv.visitIntInsn(SIPUSH, w - 1); - mv.visitMethodInsn( - INVOKEINTERFACE, "java/util/List", "get", "(I)Ljava/lang/Object;"); - } - } else { - // generates "Object impl = null;" - mv.visitInsn(ACONST_NULL); - } - mv.visitVarInsn(ASTORE, 4); - } - - // if there are interceptors, - // generates "impl = new (impl);" - // "controllers.add(impl);" - - if (!isControl && - interceptors.getSize() > 0 && - (isClient || !interceptorsMerged)) - { - // if the input interceptors have been merged to the controller - // class, and if the interface is a server interface, we must not - // create a redundant interceptor for it. Hence the last condition. - - // loads the interceptor class - Class ic; - try { - // computes the interceptor's super class - // TODO remove these hardcoded class names -> move them to julia.cfg - String superClass; - if (isClient) { - superClass = "org.objectweb.fractal.julia.InterceptorInterface"; - } else { - superClass = "java.lang.Object"; - } - - // creates a context to evaluate the interceptor class descriptor - Map itfCtxt = new HashMap(); - itfCtxt.put( - "interfaceName", - new Tree(new Tree[] { new Tree(itfName) })); - - // computes the interceptor class descriptor - Tree icDesc = new Tree(new Tree[] { - loader.evalTree(interceptors.getSubTree(0), itfCtxt), - new Tree(superClass), - new Tree(new Tree[] { new Tree(itfSignature) }), - new Tree(controllerTrees), - new Tree(isClient ? "out" : "in") - }); - - // loads the interceptor class - ic = loader.loadClass(icDesc); - } catch (IllegalClassDescriptorException e) { - ic = null; - } catch (Exception e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find or generate the interceptor class for the '" + - itfSignature + "' interface"); - } - - if (ic != null) { - // name of the interceptor class - String icName = ic.getName().replace('.', '/'); - - // generates "impl = new (impl);" - mv.visitTypeInsn(NEW, icName); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn( - INVOKESPECIAL, icName, "", "(Ljava/lang/Object;)V"); - mv.visitVarInsn(ASTORE, 4); - - // generates "controllers.add(impl);" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "controllers", "Ljava/util/List;"); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/List", - "add", - "(Ljava/lang/Object;)Z"); - mv.visitInsn(POP); - } - } - - // EXTERNAL INTERFACE - - // begins generation of "interfaces.put(, new ...);" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "interfaces", "Ljava/util/Map;"); - mv.visitLdcInsn(isCollection ? "/collection/" + itfName : itfName); - - if (hasItfClassGen) { - // generates "new ( - // owner, - // , - // componentType.getFcItfType(), // or null - // false, - // impl) - mv.visitTypeInsn(NEW, compItfClassName); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, 3); - mv.visitLdcInsn(itfName); - if (itfName.startsWith("/")) { - mv.visitInsn(ACONST_NULL); - } else { - mv.visitVarInsn(ALOAD, 2); - mv.visitLdcInsn(itfName); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/api/type/ComponentType", - "getFcInterfaceType", - "(Ljava/lang/String;)Lorg/objectweb/fractal/api/type/InterfaceType;"); - } - mv.visitInsn(ICONST_0); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn( - INVOKESPECIAL, - compItfClassName, - "", - "(Lorg/objectweb/fractal/api/Component;Ljava/lang/String;" + - "Lorg/objectweb/fractal/api/Type;ZLjava/lang/Object;)V"); - } else { - // generates 'impl' - mv.visitVarInsn(ALOAD, 4); - } - - if (itfName.equals("component")) { - // generates "owner = " - mv.visitInsn(DUP); - mv.visitVarInsn(ASTORE, 3); - } - - // ends generation of "interfaces.put(, new ...);" - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - mv.visitInsn(POP); - - // INTERNAL INTERFACE - - if (isControl) { - continue; - } - - // begins generation of "internalInterfaces.put(, new ...);" - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "internalInterfaces", "Ljava/util/Map;"); - mv.visitLdcInsn(isCollection ? "/collection/" + itfName : itfName); - - if (hasItfClassGen) { - // generates "new ( - // owner, - // , - // internalComponentType.getFcItfType(), - // true, - // impl) - mv.visitTypeInsn(NEW, compItfClassName); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, 3); - mv.visitLdcInsn(itfName); - mv.visitFieldInsn( - GETSTATIC, - name, - "internalComponentType", - "Lorg/objectweb/fractal/api/type/ComponentType;"); - mv.visitLdcInsn(itfName); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/api/type/ComponentType", - "getFcInterfaceType", - "(Ljava/lang/String;)Lorg/objectweb/fractal/api/type/InterfaceType;"); - mv.visitInsn(ICONST_1); - mv.visitVarInsn(ALOAD, 4); - mv.visitMethodInsn( - INVOKESPECIAL, - compItfClassName, - "", - "(Lorg/objectweb/fractal/api/Component;Ljava/lang/String;" + - "Lorg/objectweb/fractal/api/Type;ZLjava/lang/Object;)V"); - } else { - // generates 'impl' - mv.visitVarInsn(ALOAD, 4); - } - - // ends generation of "internalInterfaces.put(, new ...);" - mv.visitMethodInsn( - INVOKEINTERFACE, - "java/util/Map", - "put", - "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); - mv.visitInsn(POP); - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/IllegalClassDescriptorException.java b/julia/src/org/objectweb/fractal/julia/asm/IllegalClassDescriptorException.java deleted file mode 100644 index a4377bcf009431948303e15a851cc94eb2168369..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/IllegalClassDescriptorException.java +++ /dev/null @@ -1,42 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -public class IllegalClassDescriptorException extends ClassGenerationException { - - /** - * Constructs a new {@link IllegalClassDescriptorException} object. - * - * @param classDescriptor the class descriptor of the class that cannot be - * generated. - * @param message a detailed error message. - */ - - public IllegalClassDescriptorException ( - final String classDescriptor, - final String message) - { - super(null, classDescriptor, message); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/InterceptorClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/InterceptorClassGenerator.java deleted file mode 100644 index 0ee2626284eb60df19a250682d178bbc5f1802c9..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/InterceptorClassGenerator.java +++ /dev/null @@ -1,905 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.julia.InitializationContext; -import org.objectweb.fractal.julia.Interceptor; -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Type; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassAdapter; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.CodeAdapter; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import java.io.IOException; - -/** - * A class generator to generate {@link Interceptor} classes. This - * generator produces sub classes of a given class that implement a given set - * of interfaces by adding interception code to the original code of each - * method (this original code just forwards method calls to the {@link - * Interceptor#getFcItfDelegate getFcItfDelegate} object). The interception - * code is generated by {@link CodeGenerator} and/or {@link ClassTransformer} - * objects. - *

- * The original code of each method is visited and adapted on the fly by the - * code adapters returned by the code generators (see {@link CodeGenerator}), - * resulting in a modified code that includes the interception - * code generated by each code generator. - *

- * For example, if the original code void m () { impl.m() } is modified - * by the code adapter returned by a code generator A into: - *

- * void m () {
- *   // pre code A
- *   try {
- *     impl.m();
- *   } finally {
- *     // post code A
- *   }
- * }
- * 
- * and by the code adapter returned by a code generator B into: - *
- * void m () {
- *   // pre code B
- *   impl.m();
- *   // post code B
- * }
- * 
- * then the original code will be modified by A and B, in this order (the last - * code adapter is applied first), into: - *
- * void m () {
- *   // pre code A
- *   try {
- *     // pre code B
- *     impl.m();
- *     // post code B
- *   } finally {
- *     // post code A
- *   }
- * }
- * 
- * If the original code is modified by B and A, the result is: - *
- * void m () {
- *   // pre code B
- *   // pre code A
- *   try {
- *     impl.m();
- *   } finally {
- *     // post code A
- *   }
- *   // post code B
- * }
- * 
- * - * The complete class generated for an interface I containing only the - * above m method, and with A = {@link LifeCycleCodeGenerator} and B = - * {@link TraceCodeGenerator}, in this order, is the following (if there is more - * than one interface, some additional casts are used - as in the {@link - * InterfaceClassGenerator} class): - *
- * public class XYZ
- *   implements I, Interceptor, Generated
- * {
- *
- *   private I impl;
- *   private UVW lc;
- *
- *   public XYZ (Object impl) {
- *     setFcItfDelegate(impl);
- *   }
- *
- *   public void m () {
- *     synchronized(lc) {
- *       if (lc.fcState != 2)
- *         lc.incrementFcInvocationCounter();
- *       else
- *         lc.fcInvocationCounter++;
- *     }
- *     try {
- *       System.err.println("Entering public abstract void I.m()");
- *       impl.m();
- *       System.err.println("Leaving public abstract void I.m()");
- *     } finally {
- *       synchronized (lc) {
- *         if (lc.fcState != 2)
- *           lc.decrementFcInvocationCounter();
- *         else
- *           lc.fcInvocationCounter--;
- *       }
- *     }
- *   }
- *
- *   // overriden Controller methods
- *
- *   public void initFcController (InitializationContext ic) {
- *     lc = (UVW)ic.getInterface("lifecycle-controller");
- *   }
- *
- *   // Interceptor methods
- *
- *   public Object getFcItfDelegate () {
- *     return impl;
- *   }
- *
- *   public void setFcItfDelegate (Object o) {
- *     impl = (I)o;
- *   }
- *
- *   public Object clone () {
- *     XYZ clone = new XYZ(impl);
- *     clone.lc = lc;
- *     return clone;
- *   }
- *
- *   // Generated methods
- *
- *   public String getFcGeneratorParameters () {
- *     return "((...InterceptorClassGenerator ...LifeCycleCodeGenerator
- *               ...TraceCodeGenerator) java.lang.Object (I) (...) in)";
- *   }
- * }
- * 
- * This class generator can be used in two different ways, corresponding to - * the {@link ContextClassGenerator#generateClass optimization levels} of - * components: - *
    - *
  • none, mergedControllers or - * mergeControllersAndContent: in this case the arguments of the - * class generator must be of the form "(object-descriptor superClass (itf ... - * itf) (controller ... controller) in|out)", with an non empty list of - * controller class names.
  • - *
  • mergedControllersAndInterceptors or - * mergeControllersInterceptorsAndContent: in this case the arguments - * of the class generator must be of the form "(object-descriptor superClass - * (itf ... itf) () in|out)", i.e. the controller class name list must be empty, - * and the super class must be the merged controller class.
  • - *
- * In the last case the generated code is quite different from the above code: - *
    - *
  • the "impl" field is not generated: the "fcContent" field is used instead. - *
  • - *
  • the {@link Interceptor} interface is not implemented.
  • - *
  • the code generated by the code generators may be different. This is the - * case for example with the life cycle code generator: the "lc" field is not - * generated, and replaced by this in the code (the "fcState" and - * "fcInvocationCounter" fields should indeed be defined in the super class in - * this case).
  • - *
- * {@link ClassTransformer ClassTransformers} can be used only with the - * mergeControllersInterceptorsAndContent option. These transformers - * transform the "user component" class, before the interception code is - * added by the {@link CodeGenerator CodeGenerators}. If class transformers are - * used, the generated class is not generated as a sub class of the given - * super class: instead, the code of this super class (and of its own super - * class) is directly copied (after tranformation) into the generated class. - */ - -public class InterceptorClassGenerator - extends AbstractClassGenerator - implements Initializable -{ - - /** - * Names of the methods that can be defined both in the content class and in - * the merged controller class. - */ - - private final static List FRACTAL_METHODS = Arrays.asList(new String[] { - "listFc", "lookupFc", "bindFc", "unbindFc", - "getFcState", "startFc", "stopFc" - }); - - /** - * The arguments of the class that is being generated. - */ - - public Tree args; - - /** - * Descriptors of the code generators used by this class generator. - */ - - public Tree codeGenDescs; - - /** - * The code generators used by this interceptor class generator. - */ - - public CodeGenerator[] codeGens; - - /** - * The class transformers used by this interceptor class generator. - */ - - public ClassTransformer[] classTransformers; - - /** - * The controller classes that can be used by the generated interceptor class. - */ - - public Class[] controllerClasses; - - /** - * true if the class to be generated is an input interceptor class. - * An input interceptor intercepts incoming calls, in external server - * interfaces, while an output interceptor intercepts outgoing calls, in - * external client interfaces (or in the corresponding internal server - * interfaces). - */ - - public boolean in; - - /** - * Indicates if the controller and interceptor classes are merged. This is - * equivalent to the fact that the controller class list is empty. - */ - - public boolean mergeInterceptors; - - /** - * Indicates if the controller, interceptor and content classes are merged. - */ - - public boolean mergeAll; - - /** - * Indicates if the interceptors are generated for a composite component. This - * field is only used if interceptor and controller classes are merged. It is - * true if the merged controller class implements ContentController. - */ - - public boolean isComposite; - - /** - * Indicates if the content class must be transformed. - */ - - private boolean transformContentClass; - - /** - * The merged controller class that is the super class of the generated class. - * This field is null if interceptors are not merged with controller classes. - */ - - private Class mergedControllerClass; - - /** - * The content class that is the super class of the mergedController class. - * This field is null if not all the interceptors, controllers and content - * classes are merged. - */ - - private Class contentClass; - - /** - * The "impl" field name. - */ - - public String implFieldName; - - /** - * The "impl" field descriptor. - */ - - public String implFieldDesc; - - /** - * Initializes this object with the given arguments. - * - * @param args the descriptors of the code generators to be used by this - * interceptor class generator. This tree must be a list of object - * descriptors (see @link Loader#createObject createObject}, each object - * descriptor describing a {@link CodeGenerator}. - */ - - public void initialize (final Tree args) { - codeGenDescs = args; - } - - /** - * Initializes the specific fields of this class before calling the overriden - * method. - * - * @param name the name of the class to be generated. - * @param args a tree of the form "(object descriptor superClass (itf1 ... - * itfN) (class1 ... classM) in|out)", where itf1 ... itfN are the names - * of the interfaces that the generated class must implement, class1 ... - * classM are the names of the controller classes that can used by the - * generated interceptor class, and in or out indicates if an input or - * output interceptor class must be generated. - * @param loader the class loader to be used to generate the specified class. - * This parameter, which may be null, can be a class loader, a - * class, or any other object (the class loader is then found by using - * the getClass() and getClassLoader() methods). - * @return a sub class of the given class that implements the given - * interfaces. - * @throws ClassGenerationException if any other problem occurs. - */ - - public byte[] generateClass ( - final String name, - final Tree args, - final Loader loader) throws ClassGenerationException - { - this.args = args; - this.superClass = args.getSubTree(1).toString().replace('.', '/'); - Tree controllerDescs = args.getSubTree(3); - controllerClasses = new Class[controllerDescs.getSize()]; - for (int i = 0; i < controllerClasses.length; ++i) { - try { - controllerClasses[i] = loader.loadClass(controllerDescs.getSubTree(i)); - } catch (Exception e) { - throw new ClassGenerationException( - e, args.toString(), "Cannot load one of the controller class"); - } - } - // tests if all the controller, interceptor and content classes are merged - mergeInterceptors = controllerClasses.length == 0; - if (mergeInterceptors) { - try { - mergedControllerClass = loader.loadClass(args.getSubTree(1)); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot load the '" + args.getSubTree(1) + "' class"); - } - isComposite = ContentController.class.isAssignableFrom(mergedControllerClass); - contentClass = mergedControllerClass.getSuperclass(); - mergeAll = !contentClass.equals(Object.class); - } - - // creates the code generators - in = args.getSubTree(4).toString().equals("in"); - List codeGenList = new ArrayList(); - List classTransformList = new ArrayList(); - for (int i = 0; i < codeGenDescs.getSize(); ++i) { - Object o; - try { - o = loader.newObject(codeGenDescs.getSubTree(i)); - } catch (Exception e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot find the '" + codeGenDescs.getSubTree(i) + - "' code generator class"); - } - if (o instanceof ClassTransformer) { - classTransformList.add(o); - } else if (o instanceof CodeGenerator) { - int type = ((CodeGenerator)o).init(this); - if (type == CodeGenerator.IN_OUT || (type == CodeGenerator.IN) == in) { - codeGenList.add(o); - } - } else { - throw new ClassGenerationException( - null, - args.toString(), - codeGenDescs.getSubTree(i) - + " is not a ClassTransformer or a CodeGenerator"); - } - } - if (codeGenList.size() == 0) { - throw new IllegalClassDescriptorException( - args.toString(), "no applicable code generator"); - } - codeGens = new CodeGenerator[codeGenList.size()]; - classTransformers = new ClassTransformer[classTransformList.size()]; - codeGenList.toArray(codeGens); - classTransformList.toArray(classTransformers); - - if (classTransformers.length > 0) { - if (!mergeAll) { - throw new ClassGenerationException( - null, - args.toString(), - "Class transformers cannot be used without the " - + "mergeControllersInterceptorsAndContent optimization option"); - } - transformContentClass = true; - } - - return super.generateClass(name, args, loader); - } - - protected void parseArgs (final Tree args) { - super.parseArgs(args); - if (transformContentClass) { - superClass = "java/lang/Object"; - } - } - - /** - * Returns true. - */ - - protected boolean computeMaxs () { - return true; - } - - protected String getSource () { - String s = interfaces.get(0).toString(); - if (s.lastIndexOf('/') != -1) { - s = s.substring(s.lastIndexOf('/') + 1); - } - return "INTERCEPTOR[" + s + "]"; - } - - /** - * Adds {@link Interceptor} to the list returned by the overriden - * method. In fact this interface is not added if the interceptors are merged - * with the controller objects, and if isComposite is false. - */ - - protected List getImplementedInterfaces () throws ClassGenerationException { - List itfs = super.getImplementedInterfaces(); - if (transformContentClass) { - // adds the interfaces implemented by the content - // and the merged controller classes - for (int p = 0; p < 2; ++p) { - Class[] classes; - if (p == 0) { - classes = contentClass.getInterfaces(); - } else { - classes = mergedControllerClass.getInterfaces(); - } - for (int i = 0; i < classes.length; i++) { - String s = Type.getInternalName(classes[i]); - if (!itfs.contains(s)) { - itfs.add(s); - } - } - } - } else if (!mergeInterceptors || isComposite) { - itfs.add(Type.getInternalName(Interceptor.class)); - } - return itfs; - } - - protected void generateConstructor () throws ClassGenerationException { - if (transformContentClass) { - // do not generate any constructor: - // the content class constructors will be copied into the generated class - return; - } - super.generateConstructor(); - CodeVisitor mv = cw.visitMethod( - ACC_PUBLIC, "", "(Ljava/lang/Object;)V", null, null); - // generates the bytecode corresponding to 'super();' - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, superClass, "", "()V"); - // generates the bytecode corresponding to 'setFcItfDelegate(arg0);' - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/julia/Interceptor", - "setFcItfDelegate", - "(Ljava/lang/Object;)V"); - mv.visitInsn(RETURN); - mv.visitMaxs(2, 2); - } - - /** - * Calls the overriden method and generates the "impl" field and the methods - * of the {@link Interceptor Interceptor} interface. This method also - * generates the "initFcController" method, by concatenating the code - * generated by the {@link CodeGenerator#generateInitCode generateInitCode} - * method of each code generator. If the interceptor and controller objects - * are merged, and if isComposite is false, this method just calls the - * overriden method and sets the "impl" field to the "fcContent" field. - */ - - protected void generateDefaultMethods () throws ClassGenerationException { - super.generateDefaultMethods(); - - if (mergeInterceptors && !isComposite) { - implFieldName = "fcContent"; - implFieldDesc = "Ljava/lang/Object;"; - return; - } - - // generates the "impl" field - - implFieldName = "impl"; - if (interfaces.size() == 1) { - implFieldDesc = "L" + (String)interfaces.get(0) + ";"; - } else { - implFieldDesc = "Ljava/lang/Object;"; - } - cw.visitField(ACC_PRIVATE, implFieldName, implFieldDesc, null, null); - - // generates the Controller method - - String mName; - String mDesc; - CodeVisitor mv; - - if (!mergeInterceptors || !isComposite) { - mName = "initFcController"; - mDesc = "(" + Type.getDescriptor(InitializationContext.class) + ")V"; - mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - for (int i = 0; i < codeGens.length; ++i) { - codeGens[i].generateInitCode(mv); - } - mv.visitInsn(RETURN); - mv.visitMaxs(0, 0); - } - - // generates the Interceptor methods - - mName = "getFcItfDelegate"; - mDesc = "()Ljava/lang/Object;"; - mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, implFieldName, implFieldDesc); - mv.visitInsn(ARETURN); - mv.visitMaxs(1, 1); - - mName = "setFcItfDelegate"; - mDesc = "(Ljava/lang/Object;)V"; - mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD,1); - if (interfaces.size() == 1) { - mv.visitTypeInsn(CHECKCAST, (String)interfaces.get(0)); - } - mv.visitFieldInsn(PUTFIELD, name, implFieldName, implFieldDesc); - mv.visitInsn(RETURN); - mv.visitMaxs(2, 2); - - mName = "clone"; - mDesc = "()Ljava/lang/Object;"; - mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - if (mergeInterceptors) { - mv.visitTypeInsn(NEW, "java/lang/RuntimeException"); - mv.visitInsn(DUP); - mv.visitLdcInsn("Cannot use merged interceptors with collection interfaces"); - mv.visitMethodInsn( - INVOKESPECIAL, - "java/lang/RuntimeException", - "", - "(Ljava/lang/String;)V"); - mv.visitInsn(ATHROW); - mv.visitMaxs(2, 2); - } else { - // cannot use super.clone(), because the clone method is not defined in all - // Java platforms (such as J2ME, CLDC profile) - mv.visitTypeInsn(NEW, name); - mv.visitInsn(DUP); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKEINTERFACE, - "org/objectweb/fractal/julia/Interceptor", - "getFcItfDelegate", - "()Ljava/lang/Object;"); - mv.visitMethodInsn(INVOKESPECIAL, name, "", "(Ljava/lang/Object;)V"); - mv.visitVarInsn(ASTORE, 1); - for (int i = 0; i < codeGens.length; ++i) { - codeGens[i].generateCloneCode(mv); - } - mv.visitVarInsn(ALOAD, 1); - mv.visitInsn(ARETURN); - mv.visitMaxs(2, 2); - } - } - - protected void generateInterfaceMethods () throws ClassGenerationException { - if (transformContentClass) { - Map methods = new HashMap(); - for (int i = 0; i < interfaces.size(); ++i) { - String s = ((String)interfaces.get(i)).replace('/', '.'); - Class itf; - try { - itf = loader.loadClass(s); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, parameters, "Cannot load the '" + s + "' interface"); - } - Method[] meths = itf.getMethods(); - for (int j = 0; j < meths.length; ++j) { - Method meth = meths[j]; - String desc = meth.getName() + Type.getMethodDescriptor(meth); - methods.put(desc, meth); - } - } - - // copies the content class into the generated class - // (transforms it and adds interception code to it on the fly) - ClassVisitor cv = new FilterClassAdapter(methods, cw); - for (int i = classTransformers.length - 1; i >= 0; --i) { - classTransformers[i].setClassVisitor(cv); - cv = classTransformers[i]; - } - try { - getClassReader(contentClass).accept(cv, false); - } catch (IOException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot read the '" + contentClass.getName() + "' class"); - } catch (VisitException e) { - throw e.getException(); - } - - // renames and copies the merged controller class into the generated class - cv = new FilterClassAdapter(null, cw); - try { - getClassReader(mergedControllerClass).accept(cv, false); - } catch (IOException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot read the '" + mergedControllerClass.getName() + "' class"); - } catch (VisitException e) { - throw e.getException(); - } - } else { - super.generateInterfaceMethods(); - } - for (int i = 0; i < codeGens.length; ++i) { - codeGens[i].close(); - } - } - - /** - * Generates the interception code for the given method. - */ - - protected void generateMethod (final Method m) - throws ClassGenerationException - { - // generates the header of the forwarder method - String itf = Type.getInternalName(m.getDeclaringClass()); - String mName = m.getName(); - String mDesc = Type.getMethodDescriptor(m); - Class[] params = m.getParameterTypes(); - Class result = m.getReturnType(); - Class[] exceptions = m.getExceptionTypes(); - String[] excepts = new String[exceptions.length]; - for (int i = 0; i < exceptions.length; ++i) { - excepts[i] = Type.getInternalName(exceptions[i]); - } - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, excepts, null); - - // creates the code adapter chain that will introduce the interception code - // in the original method code, i.e., in the code generated below - for (int i = 0; i < codeGens.length; ++i) { - mv = codeGens[i].generateInterceptionCode(m, mv); - } - - // step 1 : load the "impl" field - mv.visitVarInsn(ALOAD, 0); - if (!mergeAll) { - mv.visitFieldInsn(GETFIELD, name, implFieldName, implFieldDesc); - if (interfaces.size() > 1 || !superClass.equals("java/lang/Object")) { - mv.visitTypeInsn(CHECKCAST, itf); - } - } - // step 2 : push parameters p0,... - int offset = 1; - for (int i = 0; i < params.length; ++i) { - mv.visitVarInsn(ILOAD + getOpcodeOffset(params[i]), offset); - offset += getSize(params[i]); - } - // step 3 : invoke method m - if (mergeAll) { - mv.visitMethodInsn(INVOKESPECIAL, superClass, mName, mDesc); - } else { - mv.visitMethodInsn(INVOKEINTERFACE, itf, mName, mDesc); - } - // step 4 : return the result - if (result == Void.TYPE) { - mv.visitInsn(RETURN); - } else { - mv.visitInsn(IRETURN + getOpcodeOffset(result)); - } - - // maxStack and maxLocals are automatically computed - mv.visitMaxs(0, 0); - } - - /** - * Returns a {@link ClassReader} to analyze the given class. - * - * @param c a class. - * @return a {@link ClassReader} to analyze the given class. - * @throws IOException if the bytecode of the class cannot be found. - */ - - private ClassReader getClassReader (final Class c) throws IOException { - try { - return new ClassReader(c.getName()); - } catch (IOException e) { - // an exception can occur if c is a dynamically generated class; - // indeed, in this case, it can not be found by the system class loader. - String s = Type.getInternalName(c) + ".class"; - return new ClassReader(c.getClassLoader().getResourceAsStream(s)); - } - } - - /** - * A class adapter to rename a class, to add interception code to some - * methods. - */ - - private class FilterClassAdapter extends ClassAdapter { - - /** - * The methods to which interception code must be added. This map is null - * for a merged controller class. For a user component class, it associates - * Method objects to name+desc method keys. - */ - - private Map methods; - - /** - * True if the class that is being transformed is a user component class (or - * false if it is a merged controller class). - */ - - private boolean content; - - /** - * Old name of the class (and of its super class if the class is a merged - * controller class. - */ - - private List oldNames; - - public FilterClassAdapter (final Map methods, final ClassVisitor cv) { - super(cv); - this.methods = methods; - if (methods != null) { - content = true; - oldNames = Arrays.asList(new String[] { - Type.getInternalName(contentClass) - }); - } else { - content = false; - oldNames = Arrays.asList(new String[] { - Type.getInternalName(contentClass), - Type.getInternalName(mergedControllerClass) - }); - } - } - - public void visit ( - final int access, - final String name, - final String superName, - final String[] interfaces, - final String sourceFile) - { - // does nothing - } - - public CodeVisitor visitMethod ( - final int access, - final String name, - final String desc, - final String[] exceptions, - final Attribute attrs) - { - int newAccess = access; - String newName = name; - if (content) { - if (FRACTAL_METHODS.contains(name)) { - newAccess = ACC_PRIVATE; - newName = "super$" + name; - } - } else { - if (name.equals("") || name.equals("getFcGeneratorParameters")) { - return null; - } - } - CodeVisitor v = cv.visitMethod(newAccess, newName, desc, exceptions, attrs); - if (content) { - Method m = (Method)methods.get(name + desc); - if (m != null) { - for (int i = 0; i < codeGens.length; ++i) { - try { - v = codeGens[i].generateInterceptionCode(m, v); - } catch (ClassGenerationException e) { - throw new VisitException(e); - } - } - } - } - return new FilterCodeAdapter(oldNames, v); - } - - public void visitEnd () { - // does nothing - } - } - - - /** - * A code adapter to update class name references in a method. - */ - - private class FilterCodeAdapter extends CodeAdapter { - - /** - * Old name of the class (and, optionally, of its super class). - */ - - private List oldNames; - - public FilterCodeAdapter (final List oldNames, final CodeVisitor cv) { - super(cv); - this.oldNames = oldNames; - } - - public void visitFieldInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - String newOwner = owner; - if (oldNames.contains(owner)) { - newOwner = InterceptorClassGenerator.this.name; - } - cv.visitFieldInsn(opcode, newOwner, name, desc); - } - - public void visitMethodInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - String newOwner = owner; - String newName = name; - if (oldNames.contains(owner)) { - newOwner = InterceptorClassGenerator.this.name; - } - if (oldNames.size() == 2 && owner.equals(oldNames.get(0))) { - // call from merged controller class to content class - if (FRACTAL_METHODS.contains(name)) { - newName = "super$" + name; - } - } - cv.visitMethodInsn(opcode, newOwner, newName, desc); - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/InterceptorCodeAdapter.java b/julia/src/org/objectweb/fractal/julia/asm/InterceptorCodeAdapter.java deleted file mode 100644 index 7c7a6b8acc32333f48e7e7f068b109374dec6a07..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/InterceptorCodeAdapter.java +++ /dev/null @@ -1,280 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.asm.CodeAdapter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; - -import java.lang.reflect.Method; - -/** - * An abstract code adapter to ease the implementation of {@link CodeGenerator}. - * This code adapter can replace the return instructions it - * visits with goto or jsr instructions, in order to add a post code block after - * the original code of a method. This code adapter can also insert new local - * variables before the original local variables (which are therefore shifted), - * but after the actual parameters. This can be useful to use private local - * variables in the interception code. - */ - -public abstract class InterceptorCodeAdapter - extends CodeAdapter - implements Constants -{ - - /** - * Describes an empty post block. - */ - - public final static int EMPTY = 0; - - /** - * Describes a normal post code block. A normal post code block is not - * executed if the original code throws an exception. - */ - - public final static int NORMAL = 1; - - /** - * Describes a finally post block. A finally post code block is always - * executed, even if the original code throws an exception. - */ - - public final static int FINALLY = 2; - - /** - * The method for which this code adapter is used. - */ - - protected Method m; - - /** - * Size of the formal parameters of the method for which this code adapter is - * used. This size is also the index of the first inserted local variable. - */ - - protected int nbFormals; - - /** - * The inserted local variable used to store the result value. - */ - - protected int returnLocal; - - /** - * Total size of the inserted local variables. This total includes the local - * variable used to store the result value. - */ - - private int newLocals; - - /** - * Type of the post code block that will be added after the original code. - */ - - private int postBlockType; - - /** - * Beginning of the post code block added to the original code. - */ - - protected Label postBlockLabel; - - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - /** - * Constructs a new {@link InterceptorCodeAdapter}. - * - * @param cv the code visitor to which this adapter must delegate calls. - * @param m the method for which this code adapter is used. - * @param newLocals the number of new local variables that must be inserted - * in the original method code. This number does not include the local - * variable used to store the result value, which is automatically - * inserted. The inserted local variables are those between the {@link - * #nbFormals nbFormals} index, inclusive, and the {@link #nbFormals - * nbFormals} + newLocals index, exclusive. - * @param postBlockType the type of the post code block that will be added - * after the original code, i.e., either {@link #EMPTY EMPTY}, {@link - * #NORMAL NORMAL} or {@link #FINALLY FINALLY}. - */ - - public InterceptorCodeAdapter ( - final CodeVisitor cv, - final Method m, - final int newLocals, - final int postBlockType) - { - super(cv); - // computes the size of the formal parameters - int parameterSize = 1; - Class[] formals = m.getParameterTypes(); - for (int i = 0; i < formals.length; ++i) { - if (formals[i] == Long.TYPE || formals[i] == Double.TYPE) { - parameterSize += 2; - } else { - parameterSize += 1; - } - } - // computes the size of the return type - int returnSize; - Class result = m.getReturnType(); - if (result == Long.TYPE || result == Double.TYPE) { - returnSize = 2; - } else if (result != Void.TYPE) { - returnSize = 1; - } else { - returnSize = 0; - } - // initializes fields - this.m = m; - this.nbFormals = parameterSize; - this.returnLocal = parameterSize + newLocals; - this.newLocals = newLocals + returnSize; - this.postBlockType = postBlockType; - this.postBlockLabel = new Label(); - } - - // ------------------------------------------------------------------------- - // Overriden CodeAdapter methods - // ------------------------------------------------------------------------- - - /** - * Replaces returns with instructions to jump to the beginning of the post - * code block. More precisely, if the post code bock is empty, the returns - * are not replaced. If the post code block is normal they are replaced by - * sequences of the following form: - *
-   * xSTORE returnLocal
-   * GOTO postCodeLabel
-   * 
- * If the post code block is a finally block, they are replaced by sequences - * of the following form: - *
-   * xSTORE returnLocal
-   * JSR postCodeLabel
-   * xLOAD returnLocal
-   * xRETURN
-   * 
- * - * @param opcode the opcode of the visited instruction. - */ - - public void visitInsn (final int opcode) { - if (postBlockType == EMPTY) { - cv.visitInsn(opcode); - return; - } - switch (opcode) { - case IRETURN: - case LRETURN: - case FRETURN: - case DRETURN: - case ARETURN: - int opcOffset = opcode - IRETURN; - cv.visitVarInsn(ISTORE + opcOffset, returnLocal); - if (postBlockType == NORMAL) { - cv.visitJumpInsn(GOTO, postBlockLabel); - } else { - cv.visitJumpInsn(JSR, postBlockLabel); - cv.visitVarInsn(ILOAD + opcOffset, returnLocal); - cv.visitInsn(opcode); - } - break; - case RETURN: - if (postBlockType == NORMAL) { - cv.visitJumpInsn(GOTO, postBlockLabel); - } else { - cv.visitJumpInsn(JSR, postBlockLabel); - cv.visitInsn(RETURN); - } - break; - default: - cv.visitInsn(opcode); - } - } - - /** - * Shifts the original local variables to make room for the inserted ones. - * - * @param opcode the opcode of the visited instruction. - * @param var a local variable index. - */ - - public void visitVarInsn (final int opcode, final int var) { - cv.visitVarInsn(opcode, var >= nbFormals ? var + newLocals : var); - } - - /** - * Shifts the original local variables to make room for the inserted ones. - * - * @param var a local variable index. - * @param increment an increment value. - */ - - public void visitIincInsn (final int var, final int increment) { - cv.visitIincInsn(var >= nbFormals ? var + newLocals : var, increment); - } - - // ------------------------------------------------------------------------- - // Utility methods - // ------------------------------------------------------------------------- - - /** - * Generates the code to return the result value stored in the {@link - * #returnLocal returnLocal} local variable. More precisely, generates - * a sequence of the following form: - *
-   * xLOAD returnLocal
-   * xRETURN
-   * 
- */ - - protected void generateReturnCode () { - Class c = m.getReturnType(); - if (c.isPrimitive()) { - if (c == Void.TYPE) { - cv.visitInsn(RETURN); - } else if (c == Long.TYPE) { - cv.visitVarInsn(LLOAD, returnLocal); - cv.visitInsn(LRETURN); - } else if (c == Float.TYPE) { - cv.visitVarInsn(FLOAD, returnLocal); - cv.visitInsn(FRETURN); - } else if (c == Double.TYPE) { - cv.visitVarInsn(DLOAD, returnLocal); - cv.visitInsn(DRETURN); - } else { - cv.visitVarInsn(ILOAD, returnLocal); - cv.visitInsn(IRETURN); - } - } else { - cv.visitVarInsn(ALOAD, returnLocal); - cv.visitInsn(ARETURN); - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/InterfaceClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/InterfaceClassGenerator.java deleted file mode 100644 index b09ccd1768d8820b8dff1290a107f24dc2af8ded..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/InterfaceClassGenerator.java +++ /dev/null @@ -1,299 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Type; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; - -/** - * A class generator to generate {@link org.objectweb.fractal.api.Interface} - * classes. This class generator generates sub classes of a given - * {@link org.objectweb.fractal.api.Interface} class that - * implements the given set of interfaces. The super class must be a sub class - * of the {@link org.objectweb.fractal.julia.BasicComponentInterface} class. - *

- * The code generated for the I interface below is the following: - *

- * public interface I {
- *   void m ();
- * }
- *
- * public class XYZ extends superClass implements I, Generated {
- *
- *   private I impl;
- *
- *   public XYZ () {
- *   }
- *
- *   public XYZ (Component o, String n,  Type t, boolean b, Object impl) {
- *     super(o, n, t, b, impl);
- *   }
- *
- *   public void m () {
- *     impl.m();
- *   }
- *
- *   public Object getFcItfImpl () {
- *     return impl;
- *   }
- *
- *   public void setFcItfImpl (Object impl) {
- *     this.impl = (I)impl;
- *   }
- *
- *   public String getFcGeneratorParameters () {
- *     return "(... superClass (I))";
- *   }
- * }
- * 
- * If there is more than one interface, some additional casts are used: - *
- * public class XY extends superClass implements I, J, Generated {
- *
- *   private Object impl;
- *
- *   public XY () {
- *   }
- *
- *   public XY (Component o, String n,  Type t, boolean b, Object impl) {
- *     super(o, n, t, b, impl);
- *   }
- *
- *   public void m () {
- *     ((I)impl).m();
- *   }
- *
- *   public void n () {
- *     ((J)impl).n();
- *   }
- *
- *   public Object getFcItfImpl () {
- *     return impl;
- *   }
- *
- *   public void setFcItfImpl (Object impl) {
- *     this.impl = impl;
- *   }
- *
- *   public String getFcGeneratorParameters () {
- *     return "(... superClass (I J))";
- *   }
- * }
- * 
- */ - -public class InterfaceClassGenerator extends AbstractClassGenerator - implements Initializable -{ - - /** - * The 'impl' field descriptor. - */ - - private String implFieldDesc; - - /** - * Initializes this object with the given arguments. These arguments must be - * of the form "(superClassName)", where superClassName is the name of the - * super class to be used for the class generated by this class generator. - */ - - public void initialize (final Tree args) throws Exception { - this.superClass = args.getSubTree(0).toString().replace('.', '/'); - } - - /** - * Initializes this class generator with the given arguments. This method - * requires arguments of the form "(objectDescriptor (itfName1 ... - * itfNameN))", where itfName1 ... itfNameN are the names of the interfaces it - * must implement. - * - * @param args the descriptor of the class to be generated. - */ - - protected void parseArgs (final Tree args) { - interfaces = new ArrayList(Arrays.asList(args.getSubTree(1).getSubTrees())); - for (int i = 0; i < interfaces.size(); ++i) { - interfaces.set(i, interfaces.get(i).toString().replace('.', '/')); - } - } - - /** - * Returns the source of the class to be generated. This method returns - * "INTERFACE[...]", where "..." is the name of the interface implemented by - * the generated class. - */ - - protected String getSource () { - String s = interfaces.get(0).toString(); - if (s.lastIndexOf('/') != -1) { - s = s.substring(s.lastIndexOf('/') + 1); - } - return "INTERFACE[" + s + "]"; - } - - /** - * Generates the constructor of the class to be generated. This method - * generates a default constructor and a constructor similar to the - * constructor of the {@link - * org.objectweb.fractal.julia.BasicComponentInterface} class. - */ - - protected void generateConstructor () throws ClassGenerationException { - // default constructor needed for reflective instantiation in BasicLoader - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, superClass, "", "()V"); - mv.visitInsn(RETURN); - mv.visitMaxs(1, 1); - - // constructor of the BasicComponentInterface class - mv = cw.visitMethod( - ACC_PUBLIC, - "", - "(Lorg/objectweb/fractal/api/Component;" + - "Ljava/lang/String;" + - "Lorg/objectweb/fractal/api/Type;" + - "ZLjava/lang/Object;)V", - null, - null); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitVarInsn(ALOAD, 2); - mv.visitVarInsn(ALOAD, 3); - mv.visitVarInsn(ILOAD, 4); - mv.visitVarInsn(ALOAD, 5); - mv.visitMethodInsn( - INVOKESPECIAL, - superClass, - "", - "(Lorg/objectweb/fractal/api/Component;" + - "Ljava/lang/String;" + - "Lorg/objectweb/fractal/api/Type;" + - "ZLjava/lang/Object;)V"); - mv.visitInsn(RETURN); - mv.visitMaxs(6, 6); - } - - /** - * Calls the overriden method and generates the {@link - * org.objectweb.fractal.julia.ComponentInterface#getFcItfImpl getFcItfImpl} - * and {@link org.objectweb.fractal.julia.ComponentInterface#setFcItfImpl - * setFcItfImpl} methods. - */ - - protected void generateDefaultMethods () throws ClassGenerationException { - super.generateDefaultMethods(); - // adds the 'impl' field. its type depends on the number of interfaces - if (interfaces.size() == 1) { - implFieldDesc = "L" + (String)interfaces.get(0) + ";"; - } else { - implFieldDesc = "Ljava/lang/Object;"; - } - cw.visitField(ACC_PRIVATE, "impl", implFieldDesc, null, null); - // generates the getFcItfImpl method - String mName = "getFcItfImpl"; - String mDesc = "()Ljava/lang/Object;"; - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, name, "impl", implFieldDesc); - mv.visitInsn(ARETURN); - mv.visitMaxs(1, 1); - // generates the setFcItfImpl method - mName = "setFcItfImpl"; - mDesc = "(Ljava/lang/Object;)V"; - mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - if (interfaces.size() == 1) { - // adds a cast if there is only one interface - mv.visitTypeInsn(CHECKCAST, (String)interfaces.get(0)); - } - mv.visitFieldInsn(PUTFIELD, name, "impl", implFieldDesc); - mv.visitInsn(RETURN); - mv.visitMaxs(2, 2); - } - - /** - * Generates a method that forwards calls to the 'impl' object. - */ - - protected void generateMethod (final Method m) { - // generates the header of the forwarder method - String name = m.getName(); - String itf = Type.getInternalName(m.getDeclaringClass()); - String mDesc = Type.getMethodDescriptor(m); - Class[] exceptions = m.getExceptionTypes(); - String[] excepts = new String[exceptions.length]; - for (int i = 0; i < exceptions.length; ++i) { - excepts[i] = Type.getInternalName(exceptions[i]); - } - if (name.equals("hashCode") && m.getParameterTypes().length == 0) { - // "hashCode" already defined in super class - return; - } - if (name.equals("equals")) { - Class[] args = m.getParameterTypes(); - if (args.length == 1 && args[0].equals(Object.class)) { - // "equals" already defined in super class - return; - } - } - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, name, mDesc, excepts, null); - // step 1 : load the 'impl' field - mv.visitVarInsn(ALOAD, 0); - mv.visitFieldInsn(GETFIELD, this.name, "impl", implFieldDesc); - if (interfaces.size() > 1) { - // adds a cast if there is more than one interface - mv.visitTypeInsn(CHECKCAST, itf); - } - // step 2 : push parameters p0,... - Class[] params = m.getParameterTypes(); - int offset = 1; - for (int i = 0; i < params.length; ++i) { - mv.visitVarInsn(ILOAD + getOpcodeOffset(params[i]), offset); - offset += getSize(params[i]); - } - // step 3 : invoke method m - mv.visitMethodInsn(INVOKEINTERFACE, itf, name, mDesc); - // step 4 : return the result - Class result = m.getReturnType(); - if (result == Void.TYPE) { - mv.visitInsn(RETURN); - } else { - mv.visitInsn(IRETURN + getOpcodeOffset(result)); - } - // sets the maximum stack size and the maximum number of local variables - int maxStack = Math.max(offset, getSize(result)); - int maxLocals = Math.max(offset, getSize(result)); - mv.visitMaxs(maxStack, maxLocals); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/LifeCycleCodeGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/LifeCycleCodeGenerator.java deleted file mode 100644 index 7d0c4577e6e190abfcd27cb06ee4040163be02da..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/LifeCycleCodeGenerator.java +++ /dev/null @@ -1,250 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.InitializationContext; - -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Label; -import org.objectweb.asm.Type; - -import java.lang.reflect.Method; - -/** - * A {@link CodeGenerator} to generate pre and post code - * to enforce the component's lifecycle. More precisely the code adapters - * returned by the {@link #generateInterceptionCode generateInterceptionCode} - * method (see {@link CodeGenerator}) transform the original methods into - * methods of the following form: - *
- * <method signature> {
- *   synchronized (lc) {
- *     if (lc.fcState != 2)
- *       lc.incrementFcInvocationCounter();
- *     else
- *       lc.fcInvocationCounter++;
- *   }
- *   try {
- *     // original method code
- *   } finally {
- *     synchronized (lc) {
- *       if (lc.fcState != 2)
- *         lc.decrementFcInvocationCounter();
- *       else
- *         lc.fcInvocationCounter--;
- *     }
- *   }
- * }
- * 
- * The {@link #generateInitCode generateInitCode} method generates code blocks - * of the following form: - *
- * lc = (...)ic.getInterface("lifecycle-controller");
- * 
- * where lc is a field added to the class that is being generated (in - * fact, if the controller and interceptor classes are merged (see {@link - * InterceptorClassGenerator}), the lc field - * is not generated and replaced by this in the above code). - *

- * Note: as you can see the code generated by this code generator is - * specific to the {@link - * org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin} - * class (in fact the generated pre and post code blocks are a partially inlined - * version of the incrementFcInvocationCounter and decrementFcInvocationCounter - * methods of this class): it can not work if the lifecycle controller of the - * component, either merged or not with other controllers, does not include - * this mixin, or an equivalent (i.e. with a fcInvocationCounter field, and with - * the corresponding increment and decrement methods). - */ - -public class LifeCycleCodeGenerator extends AbstractCodeGenerator { - - /** - * The interceptor class generator to which this code generator belongs. - */ - - private InterceptorClassGenerator icg; - - /** - * The 'lc' field descriptor. - */ - - private String lcFieldDesc; - - /** - * The 'fcState' and 'fcInvocationCounter' fields owner. - */ - - private String scFieldsOwner; - - // ------------------------------------------------------------------------- - // Overriden methods - // ------------------------------------------------------------------------- - - public int init (final InterceptorClassGenerator icg) { - this.icg = icg; - return IN; - } - - public void generateInitCode (final CodeVisitor cv) - throws ClassGenerationException - { - // computes the internal name of the controller class - // that contains the 'fcInvocationCounter' field - String owner = null; - for (int i = 0; i < icg.controllerClasses.length; ++i) { - Class c = icg.controllerClasses[i]; - try { - c.getField("fcInvocationCounter"); - owner = c.getName(); - break; - } catch (Exception ignored) { - } - } - if (owner == null) { - throw new ClassGenerationException( - null, - icg.args.toString(), - "Cannot find a controller providing a 'fcInvocationCounter' field"); - } - owner = owner.replace('.', '/'); - - lcFieldDesc = "L" + owner + ";"; - scFieldsOwner = owner; - - icg.cw.visitField(ACC_PRIVATE, "lc", lcFieldDesc, null, null); - - cv.visitVarInsn(ALOAD, 0); - cv.visitVarInsn(ALOAD, 1); - cv.visitLdcInsn("lifecycle-controller"); - cv.visitMethodInsn( - INVOKEVIRTUAL, - Type.getInternalName(InitializationContext.class), - "getInterface", - "(Ljava/lang/String;)Ljava/lang/Object;"); - cv.visitTypeInsn(CHECKCAST, owner); - cv.visitFieldInsn(PUTFIELD, icg.name, "lc", lcFieldDesc); - } - - protected int getInterceptionType (final Method m) { - return InterceptorCodeAdapter.FINALLY; - } - - protected int getInterceptionCodeFormals (final Method m) { - // one local variable used to store the lock for the synchronized blocks - return 1; - } - - public void generateCloneCode (final CodeVisitor cv) { - cv.visitVarInsn(ALOAD, 1); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, icg.name, "lc", lcFieldDesc); - cv.visitFieldInsn(PUTFIELD, icg.name, "lc", lcFieldDesc); - } - - // ------------------------------------------------------------------------- - // Implementation of inherited abstract methods - // ------------------------------------------------------------------------- - - protected void generateInterceptionCodeBlock ( - final Method m, - final boolean pre, - final CodeVisitor cv, - final int formals) - { - if (scFieldsOwner == null) { - // if stateField is null this means generateInitCode was not called, - // i.e., the controller and interceptor classes are merged. We - // must therefore initialize stateField and counterField here, by using - // the fields of the generated class (in fact of its super class). - scFieldsOwner = icg.name; - } - - Label beginHandler = new Label(); - Label endHandler = new Label(); - Label ifLabel = new Label(); - Label endIfLabel = new Label(); - Label endLabel = new Label(); - - // generates the bytecode corresponding to 'synchronized (lc) {' - cv.visitVarInsn(ALOAD, 0); - // if controller and interceptor classes are merged, the generateInitCode - // method is not called, and the lcFieldDesc is therefore null. - if (lcFieldDesc != null) { - cv.visitFieldInsn(GETFIELD, icg.name, "lc", lcFieldDesc); - } - cv.visitInsn(DUP); - cv.visitVarInsn(ASTORE, formals); - cv.visitInsn(MONITORENTER); - cv.visitLabel(beginHandler); - - // generates the bytecode corresponding to 'if (lc.fcState != 2) {' - cv.visitVarInsn(ALOAD, 0); - if (lcFieldDesc != null) { - cv.visitFieldInsn(GETFIELD, icg.name, "lc", lcFieldDesc); - } - cv.visitFieldInsn(GETFIELD, scFieldsOwner, "fcState", "I"); - cv.visitInsn(ICONST_2); - cv.visitJumpInsn(IF_ICMPEQ, ifLabel); - - // generates the bytecode corresponding to 'lc.incrementInvocationCounter()' - cv.visitVarInsn(ALOAD, 0); - if (lcFieldDesc != null) { - cv.visitFieldInsn(GETFIELD, icg.name, "lc", lcFieldDesc); - } - cv.visitMethodInsn( - INVOKEVIRTUAL, - scFieldsOwner, - pre ? "incrementFcInvocationCounter" : "decrementFcInvocationCounter", - "()V"); - - // generates the bytecode corresponding to '} else {' - cv.visitJumpInsn(GOTO, endIfLabel); - cv.visitLabel(ifLabel); - - // generates the bytecode corresponding to '++lc.fcInvocationCounter' - cv.visitVarInsn(ALOAD, 0); - if (lcFieldDesc != null) { - cv.visitFieldInsn(GETFIELD, icg.name, "lc", lcFieldDesc); - } - cv.visitInsn(DUP); - cv.visitFieldInsn(GETFIELD, scFieldsOwner, "fcInvocationCounter", "I"); - cv.visitInsn(ICONST_1); - cv.visitInsn(pre ? IADD : ISUB); - cv.visitFieldInsn(PUTFIELD, scFieldsOwner, "fcInvocationCounter", "I"); - - // generates the bytecode corresponding to the end of the synchronized block - cv.visitLabel(endIfLabel); - cv.visitVarInsn(ALOAD, formals); - cv.visitInsn(MONITOREXIT); - cv.visitJumpInsn(GOTO, endLabel); - cv.visitLabel(endHandler); - cv.visitVarInsn(ALOAD, formals); - cv.visitInsn(MONITOREXIT); - cv.visitInsn(ATHROW); - cv.visitLabel(endLabel); - - cv.visitTryCatchBlock(beginHandler, endHandler, endHandler, null); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/MergeClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/MergeClassGenerator.java deleted file mode 100644 index 3113a2f6b2362d2a0be8afc757fcfdae57487a8f..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/MergeClassGenerator.java +++ /dev/null @@ -1,726 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; - -import org.objectweb.fractal.julia.control.binding.ContentBindingController; -import org.objectweb.fractal.julia.control.lifecycle.ContentLifeCycleController; -import org.objectweb.fractal.julia.loader.Generated; -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; -import org.objectweb.fractal.julia.loader.Initializable; - -import org.objectweb.asm.ClassAdapter; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.CodeAdapter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Type; -import org.objectweb.asm.Attribute; - -import java.io.IOException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * A class generator to merge several classes into a single one. This class - * generator copies all the non static fields and all the non static methods of - * the given classes (and of their super class, super super class, and so on) - * into a new class, with the following exceptions: - *

    - *
  • fields whose name begins with "weaveable" are replaced by this. - * One of the merged classes must implement the corresponding interface, - * otherwise an exception is thrown.
  • - *
  • fields whose name begins with "weaveableOpt" are replaced by - * this if the corresponding interface is implemented by one of the - * merged classes, or by null otherwise.
  • - *
  • the method of the {@link org.objectweb.fractal.julia.Controller} - * interface are merged into a single method.
  • - *
- * Notes: - *
    - *
  • since static fields and methods are not copied, and since the generated - * class will generally not be in the same package than the original classes, - * all the static fields and methods used by the non static methods must be - * public (but those that are used only by static methods may be private).
  • - *
  • the constructors are not copied (this limitation will perhaps be removed - * in future versions).
  • - *
- * Except for the "weaveable" fields, and for the {@link - * org.objectweb.fractal.julia.Controller} method, the fields and methods of the - * classes to be merged should all be distinct: otherwise the generated class - * will not be valid, because of duplicated field or method declarations. - *

- * As an example, the merging of the B and C classes below: - *

- * public class A {
- *   public int a;
- *   public void m () { ... }
- * }
- *
- * public class B extends A implements I {
- *   private int b;
- *   private J weaveableJ;
- *   private K weaveableOptK;
- *   public void m () { super.m(); ... }
- *   public void n () { weaveableJ.o(weaveableOptK); }
- * }
- *
- * public class C implement J {
- *   public void o (K k) { p(); }
- *   public static p () { q(); }
- *   private static q () { ... }
- * }
- * 
- * is the following class: - *
- * public class XYZ implements I, J, Generated {
- *   public int a;                  // copied from B's super class
- *   private int b;                 // copied from B
- *   // weaveableJ                  // NOT copied
- *   // weaveableOptK               // NOT copied
- *   private void m$0 () { ... }           // copied from B's super class
- *   public void m () { m$0(); ... }       // copied from B
- *   public void n () { o(null); }  // copied from B
- *   public void o (K k) { C.p(); } // copied from C
- *   // p                           // NOT copied (static)
- *   // q                           // NOT copied (static)
- *   public String getFcGeneratorParameters () {
- *     return "(...MergeClassGenerator java.lang.Object B C)";
- *   }
- * }
- * 
- */ - -public class MergeClassGenerator implements ClassGenerator, Constants { - - /** - * The class whose class loader must be used to generate the class. - * May be null. - */ - - public Loader loader; - - /** - * The parameters used to generate the merged class. - */ - - public String parameters; - - /** - * Internal name of the merged class generated by this generator. - */ - - String mergedClassName; - - /** - * The interfaces implemented by the classes to be merged. This list is a - * list of Class object. - */ - - List interfaces; - - /** - * Index of the class that is currently being merged into the merged class. - */ - - int currentClassIndex; - - /** - * Internal name of the class that is currently being merged into the merged - * class. - */ - - String currentClassName; - - /** - * The class that is currently being merged into the merged class. - */ - - Class currentClass; - - /** - * The super classes of the class that is currently being merged into the - * merged class. - */ - - List inheritedClasses; - - /** - * A map associating a counter to each method name and descriptor. These - * Integer counters are used to rename overriden methods with "$x" suffixes. - * Each counter corresponds to the number of time the corresponding method - * is overriden by the sub classes of its class, minus one. - */ - - Map counters; - - /** - * The code visitor used to generate the merged "initialize" method. - */ - - CodeVisitor inicv; - - /** - * The code visitor used to generate the merged "initFcController" method. - */ - - CodeVisitor icv; - - /** - * Generates a class by merging the given classes. - * - * @param name the name of the class to be generated. - * @param args a tree of the form "(objectDescriptor superClassName - * className1 ... classNameN)", where className1 ... classNameN are the - * names of the classes to be merged, and superClassName is the name of - * the super class to be used for the merged class. - * @param loader the loader to be used to load or generate auxiliary classes, - * if needed. - * @return a class constructed by merging the given classes. - * @throws ClassGenerationException if a problem occurs during the generation - * of the class. - */ - - public byte[] generateClass ( - final String name, - final Tree args, - final Loader loader) throws ClassGenerationException - { - this.loader = loader; - String superClassName = args.getSubTree(1).toString().replace('.', '/'); - mergedClassName = name.replace('.', '/'); - - Class[] classes = new Class[args.getSize() - 2]; - interfaces = new ArrayList(); - interfaces.add(Generated.class); - interfaces.add(Initializable.class); - for (int i = 0; i < classes.length; ++i) { - try { - classes[i] = loader.loadClass(args.getSubTree(i + 2)); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot load the '" + args.getSubTree(i + 2) + "' class"); - } - Class c = classes[i]; - while (c != Object.class) { - Class[] citfs = c.getInterfaces(); - for (int j = 0; j < citfs.length; ++j) { - if (!interfaces.contains(citfs[j])) { - interfaces.add(citfs[j]); - } - } - c = c.getSuperclass(); - } - } - // adds the ContentLifeCycleController interface if the super class - // implements LifeCycleController (see ContentLifeCycleController); - // likewise for ContentBindingController - Class superClass; - try { - superClass = loader.loadClass(args.getSubTree(1)); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot load the '" + args.getSubTree(1) + "' class"); - } - if (LifeCycleController.class.isAssignableFrom(superClass)) { - interfaces.add(ContentLifeCycleController.class); - } - if (BindingController.class.isAssignableFrom(superClass)) { - interfaces.add(ContentBindingController.class); - } - - // creates an empty class - ClassWriter cw = new ClassWriter(false); - String[] itfs = new String[interfaces.size()]; - for (int i = 0; i < itfs.length; ++i) { - itfs[i] = Type.getInternalName((Class)interfaces.get(i)); - } - cw.visit(ACC_PUBLIC, mergedClassName, superClassName, itfs, "MERGED"); - - // generates the default constructor - CodeVisitor mw = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); - mw.visitVarInsn(ALOAD, 0); - mw.visitMethodInsn(INVOKESPECIAL, superClassName, "", "()V"); - mw.visitInsn(RETURN); - mw.visitMaxs(1, 1); - - // generates the 'getFcGeneratorParameters' method - parameters = args.toString(); - String mName = "getFcGeneratorParameters"; - String mDesc = "()Ljava/lang/String;"; - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - mv.visitLdcInsn(parameters); - mv.visitInsn(ARETURN); - mv.visitMaxs(1, 1); - - // generates the 'initialize' method - inicv = cw.visitMethod( - ACC_PUBLIC, - "initialize", - "(Lorg/objectweb/fractal/julia/loader/Tree;)V", - null, - null); - - // generates the 'initFcController' method - icv = cw.visitMethod( - ACC_PUBLIC, - "initFcController", - "(Lorg/objectweb/fractal/julia/InitializationContext;)V", - null, - null); - - // merges all the classes - for (int i = 0; i < classes.length; ++i) { - inheritedClasses = new ArrayList(); - counters = new HashMap(); - - Class c = classes[i]; - while (c != Object.class) { - inheritedClasses.add(Type.getInternalName(c)); - c = c.getSuperclass(); - } - - c = classes[i]; - while (c != Object.class) { - currentClass = c; - currentClassIndex = i; - currentClassName = Type.getInternalName(c); - MergeClassAdapter mca = new MergeClassAdapter(cw); - try { - getClassReader(c).accept(mca, false); - } catch (IOException e) { - throw new ClassGenerationException( - e, args.toString(), "Cannot read the '" + c.getName() + "' class"); - } catch (VisitException e) { - throw e.getException(); - } - updateCounters(c); - c = c.getSuperclass(); - } - } - - inicv.visitInsn(RETURN); - inicv.visitMaxs(3, 2); - - icv.visitInsn(RETURN); - icv.visitMaxs(2, 2); - - // generates the ContentLifeCycleController interface if the super class - // implements LifeCycleController (see ContentLifeCycleController) - if (LifeCycleController.class.isAssignableFrom(superClass)) { - // generates the 'startFcContent' method - mName = "startFcContent"; - mv = cw.visitMethod(ACC_PUBLIC, mName, "()V", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, superClassName, "startFc", "()V"); - mv.visitInsn(RETURN); - mv.visitMaxs(1, 1); - // generates the 'stopFcContent' method - mName = "stopFcContent"; - mv = cw.visitMethod(ACC_PUBLIC, mName, "()V", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn(INVOKESPECIAL, superClassName, "stopFc", "()V"); - mv.visitInsn(RETURN); - mv.visitMaxs(1, 1); - } - - // generates the ContentBindingController interface if the super class - // implements BindingController (see ContentBindingController) - if (BindingController.class.isAssignableFrom(superClass)) { - // generates the 'listFcContent' method - mName = "listFcContent"; - mv = cw.visitMethod( - ACC_PUBLIC, mName, "()[Ljava/lang/String;", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitMethodInsn( - INVOKESPECIAL, superClassName, "listFc", "()[Ljava/lang/String;"); - mv.visitInsn(ARETURN); - mv.visitMaxs(1, 1); - // generates the 'lookupFcContent' method - mName = "lookupFcContent"; - mv = cw.visitMethod( - ACC_PUBLIC, mName, "(Ljava/lang/String;)Ljava/lang/Object;", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESPECIAL, - superClassName, - "lookupFc", - "(Ljava/lang/String;)Ljava/lang/Object;"); - mv.visitInsn(ARETURN); - mv.visitMaxs(2, 2); - // generates the 'bindFcContent' method - mName = "bindFcContent"; - mv = cw.visitMethod( - ACC_PUBLIC, mName, "(Ljava/lang/String;Ljava/lang/Object;)V", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitVarInsn(ALOAD, 2); - mv.visitMethodInsn( - INVOKESPECIAL, - superClassName, - "bindFc", - "(Ljava/lang/String;Ljava/lang/Object;)V"); - mv.visitInsn(RETURN); - mv.visitMaxs(3, 3); - // generates the 'unbindFcContent' method - mName = "unbindFcContent"; - mv = cw.visitMethod( - ACC_PUBLIC, mName, "(Ljava/lang/String;)V", null, null); - mv.visitVarInsn(ALOAD, 0); - mv.visitVarInsn(ALOAD, 1); - mv.visitMethodInsn( - INVOKESPECIAL, superClassName, "unbindFc", "(Ljava/lang/String;)V"); - mv.visitInsn(RETURN); - mv.visitMaxs(2, 2); - } - - // returns the merged class - return cw.toByteArray(); - } - - /** - * Returns a {@link ClassReader} to analyze the given class. - * - * @param c a class. - * @return a {@link ClassReader} to analyze the given class. - * @throws IOException if the bytecode of the class cannot be found. - */ - - ClassReader getClassReader (final Class c) throws IOException { - try { - return new ClassReader(c.getName()); - } catch (IOException e) { - // an exception can occur if c is a dynamically generated class; - // indeed, in this case, it can not be found by the system class loader. - String s = Type.getInternalName(c) + ".class"; - return new ClassReader(c.getClassLoader().getResourceAsStream(s)); - } - } - - /** - * Returns the counter associated to the given method. - * - * @param name the method's name. - * @param desc the method's descriptor. - * @return the counter associated to the given method. - */ - - int getCounter (final String name, final String desc) { - Integer value = (Integer)counters.get(name + desc); - return value == null ? -1 : value.intValue(); - } - - /** - * Updates the {@link #counters counters} map with the given class. This - * method increments the counter associated to each non static method of the - * given class. - * - * @param c a class. - */ - - void updateCounters (final Class c) { - Method[] meths = c.getDeclaredMethods(); - for (int i = 0; i < meths.length; ++i) { - Method meth = meths[i]; - if (!Modifier.isStatic(meth.getModifiers())) { - String key = meth.getName() + Type.getMethodDescriptor(meth); - Integer value = (Integer)counters.get(key); - int count = value == null ? 0 : value.intValue() + 1; - counters.put(key, new Integer(count)); - } - } - } - - /** - * Tests if the given method is declared in the given class. - * - * @param m the name and descriptor of a method. - * @param c a class. - * @return true if the c declares a method with same name, - * the same formal parameter types, and the same return type than - * m. - */ - - static boolean declares (final String m, final Class c) { - Method[] meths = c.getDeclaredMethods(); - for (int i = 0; i < meths.length; ++i) { - if (m.equals(meths[i].getName() + Type.getMethodDescriptor(meths[i]))) { - return true; - } - } - return false; - } - - /** - * A class adapter to remove some fields and methods in a class to be merged. - */ - - class MergeClassAdapter extends ClassAdapter implements Constants { - - /** - * Constructs a new {@link MergeClassGenerator.MergeClassAdapter} object. - * - * @param cv the class vistor to which this adapter must delegate calls. - */ - - public MergeClassAdapter (final ClassVisitor cv) { - super(cv); - } - - public void visit ( - final int access, - final String name, - final String superName, - final String[] interfaces, - final String sourceFile) - { - // does nothing - } - - public void visitField ( - final int access, - final String name, - final String desc, - final Object value, - final Attribute attrs) - { - if ((access & ACC_STATIC) == 0) { - if (!name.startsWith("weaveable")) { - super.visitField(access, name, desc, value, attrs); - } - } - } - - public CodeVisitor visitMethod ( - final int access, - final String name, - final String desc, - final String[] exceptions, - final Attribute attrs) - { - if ((access & ACC_STATIC) != 0 || - (access & ACC_ABSTRACT) != 0 || - name.equals("") || - name.startsWith("getFcGeneratorParameters")) - { - return null; - } - CodeVisitor mv; - int count = getCounter(name, desc); - if (count == -1) { - if (name.equals("initFcController")) { - icv.visitVarInsn(ALOAD, 0); - icv.visitVarInsn(ALOAD, 1); - icv.visitMethodInsn( - INVOKESPECIAL, - mergedClassName, - "$" + currentClassIndex + "$" + name, - "(Lorg/objectweb/fractal/julia/InitializationContext;)V"); - } - if (name.equals("initialize") - && desc.equals("(Lorg/objectweb/fractal/julia/loader/Tree;)V")) - { - inicv.visitVarInsn(ALOAD, 0); - inicv.visitVarInsn(ALOAD, 1); - inicv.visitIntInsn(SIPUSH, currentClassIndex); - inicv.visitMethodInsn( - INVOKEVIRTUAL, - "org/objectweb/fractal/julia/loader/Tree", - "getSubTree", - "(I)Lorg/objectweb/fractal/julia/loader/Tree;"); - inicv.visitMethodInsn( - INVOKESPECIAL, - mergedClassName, - "$" + currentClassIndex + "$" + name, - desc); - } - - if (name.startsWith("initFcController") - || (name.startsWith("initialize") - && desc.equals("(Lorg/objectweb/fractal/julia/loader/Tree;)V"))) - { - mv = cv.visitMethod( - ACC_PRIVATE, - "$" + currentClassIndex + "$" + name, - desc, - exceptions, - attrs); - } else { - mv = cv.visitMethod(access, name, desc, exceptions, attrs); - } - } else { - int newAccess = access & ~(ACC_PUBLIC | ACC_PROTECTED) | ACC_PRIVATE; - String newName = name + "$" + count; - if (name.startsWith("initFcController") - || (name.startsWith("initialize") - && desc.equals("(Lorg/objectweb/fractal/julia/loader/Tree;)V"))) - { - mv = cv.visitMethod( - ACC_PRIVATE, - "$" + currentClassIndex + "$" + newName, - desc, - exceptions, - attrs); - } else { - mv = cv.visitMethod(newAccess, newName, desc, exceptions, attrs); - } - } - return new MergeCodeAdapter(mv); - } - } - - /** - * A code adapter to replace access to removed fields in a class to be merged. - */ - - class MergeCodeAdapter extends CodeAdapter implements Constants { - - /** - * Constructs a new {@link MergeClassGenerator.MergeCodeAdapter} object. - * - * @param cv the code vistor to which this adapter must delegate calls. - */ - - public MergeCodeAdapter (final CodeVisitor cv) { - super(cv); - } - - public void visitFieldInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - if (opcode == GETFIELD) { - if (inheritedClasses.contains(owner)) { - boolean remove = false; - boolean replaceNull = false; - if (name.startsWith("weaveable")) { - remove = true; - String s = desc.substring(1, desc.length() - 1).replace('/', '.'); - Class c; - try { - c = loader.loadClass(s); - } catch (ClassNotFoundException e) { - throw new VisitException(new ClassGenerationException( - e, - parameters, - "Cannot load the '" + s + - "' interface required by one the classes to be merged")); - } - replaceNull = true; - for (int i = 0; i < interfaces.size(); ++i) { - if (c.isAssignableFrom((Class)interfaces.get(i))) { - replaceNull = false; - break; - } - } - if (!name.startsWith("weaveableOpt") && replaceNull) { - throw new VisitException(new ClassGenerationException( - null, - parameters, - "The required interface '" + name + - "' is not provided by any of the classes to be merged")); - } - } - if (remove) { - if (replaceNull) { - visitInsn(POP); - visitInsn(ACONST_NULL); - } - } else { - super.visitFieldInsn(opcode, mergedClassName, name, desc); - } - } else { - super.visitFieldInsn(opcode, owner, name, desc); - } - } else if (opcode == PUTFIELD) { - if (inheritedClasses.contains(owner)) { - if (name.startsWith("weaveable")) { - visitInsn(POP2); // TODO optimize this - } else { - super.visitFieldInsn(opcode, mergedClassName, name, desc); - } - } else { - super.visitFieldInsn(opcode, owner, name, desc); - } - } else { - super.visitFieldInsn(opcode, owner, name, desc); - } - } - - public void visitMethodInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - if (opcode != INVOKESTATIC && inheritedClasses.contains(owner)) { - // call to a method of the current class or of one of its super classes - if (opcode == INVOKESPECIAL && !owner.equals(currentClassName)) { - // call to an overriden method - String superName; - if (declares(name + desc, currentClass)) { - superName = name + "$" + (getCounter(name, desc) + 1); - } else if (getCounter(name, desc) >= 0) { - superName = name + "$" + getCounter(name, desc); - } else { - superName = name; - } - super.visitMethodInsn(opcode, mergedClassName, superName, desc); - } else { - if (name.startsWith("initFcController") - || (name.startsWith("initialize") - && desc.equals("(Lorg/objectweb/fractal/julia/loader/Tree;)V"))) - { - super.visitMethodInsn( - opcode, - mergedClassName, - "$" + currentClassIndex + "$" + name, - desc); - } else { - // call to a private method - super.visitMethodInsn(opcode, mergedClassName, name, desc); - } - } - } else { - super.visitMethodInsn(opcode, owner, name, desc); - } - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/MetaCodeGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/MetaCodeGenerator.java deleted file mode 100644 index 8460c33e4f99198afa076e771845cbd3fc1ba754..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/MetaCodeGenerator.java +++ /dev/null @@ -1,902 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.InitializationContext; -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; -import org.objectweb.asm.Type; -import org.objectweb.asm.Attribute; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -/** - * A {@link CodeGenerator} to generate interception code that - * reifies method calls. This abstract code generator can - * be used to easily generate interceptors of the following form, without - * knowing the Java bytecode instructions and ASM: - * - *
- *

- * Figure 1: an interceptor and an associated controller object (see also - * here) - *

- * - *

where the interceptor calls a void handleMethodCall - * (Method m, Object[] args) method on the controller object at each - * intercepted method. This abstract code generator can be configured in many - * ways: - *

    - *
  • The name N (see the above figure) can be configured with the - * {@link #getControllerInterfaceName getControllerInterfaceName} method.
  • - *
  • The name of the handleMethodCall method can be configured - * with the {@link #getHandleMethodCallMethodName getHandleMethodCallMethodName} - * method. This method must be defined in the C class. It can also be - * declared in the T interface, but this is not mandatory.
  • - *
  • the name of Fractal interface to which the interceptor is associated can - * be passed as parameter to the handleMethodCall method. For this you - * just need to override the {@link #reifyInterfaceName reifyInterfaceName} - * method, so that it returns true. The handleMethodCall - * method must then have an additional parameter of type String: - * Object handleMethodCall (String itf, Method m, Object[] args).
  • - *
  • the target object of the intercepted method call can be passed as - * parameter to the handleMethodCall method. For this you just need to - * override the {@link #reifyTargetObject reifyTargetObject} method, so that it - * returns true. The handleMethodCall method must then have an - * additional parameter of type Object: Object handleMethodCall - * (Object target, Method m, Object[] args) (if the previous option is also - * enabled, the parameters must be placed in the following order: Object - * handleMethodCall (String itf, Object target, Method m, Object[] args)). - *
  • - *
  • the {@link #intercept intercept} method can be overriden to intercept - * only some specific methods, while leaving the other unchanged.
  • - *
- * - *

The code adapters returned by the {@link #generateInterceptionCode - * generateInterceptionCode} method (see {@link CodeGenerator}) - * transform the original methods into methods of the following form: - * - *

- * method-signature {
- *   return (...)delegate.handleMethodCall(
- *     _Mid, new Object[] { ... });
- * }
- * 
- * - *

The _Mid static fields are initialized by a static - * initializer whose code is generated by this code generator. This initializer - * has the following form: - * - *

- * static {
- *   _M0 = Class.forName(...).getMethod(... , new Class[] { ... });
- *   _M1 = Class.forName(...).getMethod(... , new Class[] { ... });
- *  ...
- * }
- * 
- * - *

The {@link #generateInitCode generateInitCode} method adds a - * delegate field to the interceptor class, and adds a code fragment of - * the following form to the generated {@link #generateInitCode - * generateInitCode} method (recall that N can be configured with the - * {@link #getControllerInterfaceName getControllerInterfaceName} method): - * - *

- * delegate = (...)ic.getFcInterface(N);
- * 
- * - * Finally this code generator takes into account the Julia - * optimizations options. - * So, for example, if the interceptors and controller objects are merged, the - * delegate field is not generated, and this is used instead. - * Moreover, if the content, the controller and the interceptor classes are - * merged, then the interception code that is generated takes the following - * form: - * - *

- * method-signature {
- *   if (!isReflectedCall()) {
- *     return (...)handleMethodCall(
- *       _Mid, new Object[] { ... });
- *   } else {
- *     // original method code
- *   }
- * }
- * 
- * - * The first time this method is called the isReflectedCall method (which - * must be provided by the associated controller object) must return - * false. The call is therefore reifed and passed to the - * handleMethodCall method. This method will then call the method back, - * through the Java Reflection API, and this time the isReflectedCall - * must return true, so that the original method code is executed. The - * name of the isReflectedCall method can be configured - * with the {@link #getIsReflectedCallMethodName getIsReflectedCallMethodName} - * method. - */ - -public abstract class MetaCodeGenerator implements - Initializable, - CodeGenerator, - Constants -{ - - /** - * The arguments used to initialize this object. These arguments are the list - * of interface names, corresponding to the list of interface types in - * icg.interfaces. May be null. - */ - - private Tree args; - - /** - * The interceptor class generator to which this code generator belongs. - */ - - private InterceptorClassGenerator icg; - - /** - * The name of the 'delegate' field. - */ - - private String delegateFieldName; - - /** - * The descriptor of the 'delegate' field. - */ - - private String delegateFieldDesc; - - /** - * The name of the owner class of the 'delegate' field. - */ - - private String owner; - - /** - * The code visitor used to generate the static initializer. - */ - - private CodeVisitor clinit; - - /** - * Counter used to generate names for the static fields containing the Method - * objects. - */ - - private int counter; - - // ------------------------------------------------------------------------- - // Implementation of the Init interface - // ------------------------------------------------------------------------- - - public void initialize (Tree args) { - this.args = args.getSubTree(0); - } - - // ------------------------------------------------------------------------- - // Implementation of the CodeGenerator interface - // ------------------------------------------------------------------------- - - public int init (final InterceptorClassGenerator icg) { - this.icg = icg; - return IN; - } - - public void generateInitCode (final CodeVisitor cv) - throws ClassGenerationException - { - // computes the internal name of the controller class - // that contains the needed 'handleMethodCall' method - String owner = null; - for (int i = 0; i < icg.controllerClasses.length; ++i) { - Class c = icg.controllerClasses[i]; - List params = new ArrayList(); - if (reifyInterfaceName()) { - params.add(String.class); - } - if (reifyTargetObject()) { - params.add(Object.class); - } - params.add(Method.class); - params.add(Object[].class); - Class[] paramClasses = (Class[])params.toArray(new Class[params.size()]); - try { - c.getMethod(getHandleMethodCallMethodName(), paramClasses); - owner = c.getName(); - break; - } catch (Exception e) { - } - } - if (owner == null) { - throw new ClassGenerationException( - null, - icg.args.toString(), - "Cannot find a controller class providing a '" + - getHandleMethodCallMethodName() + "' method with the good arguments"); - } - owner = owner.replace('.', '/'); - - int hashcode = getControllerInterfaceName().hashCode(); - delegateFieldName = "d" + Integer.toHexString(hashcode); - delegateFieldDesc = "L" + owner + ";"; - - icg.cw.visitField( - ACC_PRIVATE, delegateFieldName, delegateFieldDesc, null, null); - - cv.visitVarInsn(ALOAD, 0); - cv.visitVarInsn(ALOAD, 1); - cv.visitLdcInsn(getControllerInterfaceName()); - cv.visitMethodInsn( - INVOKEVIRTUAL, - Type.getInternalName(InitializationContext.class), - "getInterface", - "(" + Type.getDescriptor(String.class) + ")" + - Type.getDescriptor(Object.class)); - cv.visitTypeInsn(CHECKCAST, owner); - cv.visitFieldInsn(PUTFIELD, icg.name, delegateFieldName, delegateFieldDesc); - } - - public CodeVisitor generateInterceptionCode ( - final Method m, - final CodeVisitor cv) - { - if (intercept(m)) { - return new MetaCodeAdapter(cv, m); - } else { - return cv; - } - } - - public void generateCloneCode (final CodeVisitor cv) { - cv.visitVarInsn(ALOAD, 1); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, icg.name, delegateFieldName, delegateFieldDesc); - cv.visitFieldInsn(PUTFIELD, icg.name, delegateFieldName, delegateFieldDesc); - } - - public void close () { - if (clinit != null) { - clinit.visitInsn(RETURN); - clinit.visitMaxs(0, 0); - } - } - - // ------------------------------------------------------------------------- - // Utility methods - // ------------------------------------------------------------------------- - - /** - * Returns the name of the interface provided by the controller object to be - * associated to the interceptor. - * - * @return the name of the interface provided by the controller object to be - * associated to the interceptor (called N in the above figure). - */ - - protected abstract String getControllerInterfaceName (); - - /** - * Returns true if this code generator must generate interception - * code for the given method. The default implementation of this method - * returns true for all methods. - * - * @param m a method object. - * @return true if this code generator must generate interception - * code for the given method, or false if the given method must - * be left unchanged. - */ - - protected boolean intercept (final Method m) { - return true; - } - - /** - * Returns the name of the method to be called on the associated controller - * object, for each intercepted call. - * - * @return the name of the method to be called on the associated controller - * object, for each intercepted call (called handleMethodCall - * above). - */ - - protected abstract String getHandleMethodCallMethodName (); - - /** - * Returns true if the target interface name must be passed as - * argument to the handleMethodCall method. The default implementation - * of this method returns false. - * - * @return true if the name of the fractal interface associated to - * the generated interceptor must be passed as argument to the - * handleMethodCall method. - */ - - protected boolean reifyInterfaceName () { - return false; - } - - /** - * Returns the name of the fractal interface in which the given method is - * defined. - * - * @param m a method. - * @return the name of the fractal interface in which the given method is - * defined. - */ - - private String getInterfaceName (Method m) { - if (args != null) { - String desc = m.getName()+Type.getMethodDescriptor(m); - List itfs = icg.interfaces; - for (int i = 0; i < itfs.size(); ++i) { - String itf = ((String)itfs.get(i)).replace('/', '.'); - Class c; - try { - c = icg.loader.loadClass(itf); - } catch (ClassNotFoundException e) { - continue; - } - Method[] meths = c.getMethods(); - for (int j = 0; j < meths.length; ++j) { - Method meth = meths[j]; - if (desc.equals(meth.getName()+Type.getMethodDescriptor(meth))) { - return args.getSubTree(i).toString(); - } - } - } - } - return null; - } - - /** - * Returns true if the target object must be passed as argument - * to the handleMethodCall method. The default implementation of this - * method returns false. - * - * @return true if the target object of intercepted method calls must - * be passed as argument to the handleMethodCall method. - */ - - protected boolean reifyTargetObject () { - return false; - } - - /** - * Returns the name of the method to be called on the associated controller - * object to identify reflected calls. - * - * @return the name of the method to be called on the associated controller - * object to identify reflected calls. (called isReflectedCall - * above). - */ - - protected abstract String getIsReflectedCallMethodName (); - - /** - * Generates code to initialize a static field containing the Method object. - * - * @param m the static field's value. - * @param owner the internal name of the owner class of the static field. - * @param field the static field's name. - * @param cv the class visitor to be used to generate the static field. - * @param mv the code visitor to be used to generate the static field's - * initialization code. - */ - - public static void generateMethodInitializerCode ( - final Method m, - final String owner, - final String field, - final ClassVisitor cv, - final CodeVisitor mv) - { - // adds the static field to the class that is being generated - cv.visitField( - ACC_PRIVATE + ACC_STATIC, - field, - "Ljava/lang/reflect/Method;", - null, - null); - - // generates "Class c = Class.forName(...);" - mv.visitLdcInsn(m.getDeclaringClass().getName()); - mv.visitMethodInsn( - INVOKESTATIC, - "java/lang/Class", - "forName", - "(Ljava/lang/String;)Ljava/lang/Class;"); - // generates code to push the method's name - mv.visitLdcInsn(m.getName()); - // generates code to push the method's argument types - Class[] formals = m.getParameterTypes(); - mv.visitIntInsn(SIPUSH, formals.length); - mv.visitTypeInsn(ANEWARRAY, "java/lang/Class"); - for (int i = 0; i < formals.length; ++i) { - mv.visitInsn(DUP); - mv.visitIntInsn(SIPUSH, i); - Class c = formals[i]; - if (c.isPrimitive()) { - String type; - if (c == Byte.TYPE) { - type = "java/lang/Byte"; - } else if (c == Integer.TYPE) { - type = "java/lang/Integer"; - } else if (c == Boolean.TYPE) { - type = "java/lang/Boolean"; - } else if (c == Double.TYPE) { - type = "java/lang/Double"; - } else if (c == Float.TYPE) { - type = "java/lang/Float"; - } else if (c == Long.TYPE) { - type = "java/lang/Long"; - } else if (c == Character.TYPE) { - type = "java/lang/Character"; - } else /*if (c == Short.TYPE)*/ { - type = "java/lang/Short"; - } - mv.visitFieldInsn( - GETSTATIC, type, "TYPE", "Ljava/lang/Class;"); - } else { - String name; - if (c.isArray()) { - name = Type.getDescriptor(c).replace('/', '.'); - } else { - name = c.getName(); - } - mv.visitLdcInsn(name); - mv.visitMethodInsn( - INVOKESTATIC, - "java/lang/Class", - "forName", - "(Ljava/lang/String;)Ljava/lang/Class;"); - } - mv.visitInsn(AASTORE); - } - // generates "_Mi = c.getMethod(name, formals);" - mv.visitMethodInsn( - INVOKEVIRTUAL, - "java/lang/Class", - "getMethod", - "(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;"); - mv.visitFieldInsn( - PUTSTATIC, - owner, - field, - "Ljava/lang/reflect/Method;"); - } - - /** - * Generates the code to reify the arguments of the given method. - * For a method "int m (int i, String s)", this code is the bytecode - * corresponding to the "new Object[] { new Integer(i), s}" expression. - * - * @param m a method object. - * @param cv the code visitor to be used to generate the bytecode. - */ - - public static void generateParameterReifierCode ( - final Method m, - final CodeVisitor cv) - { - Class[] params = m.getParameterTypes(); - cv.visitIntInsn(SIPUSH, params.length); - cv.visitTypeInsn(ANEWARRAY, "java/lang/Object"); - int localVarIndex = 1; - for (int i = 0; i < params.length; ++i) { - Class param = params[i]; - cv.visitInsn(DUP); - cv.visitIntInsn(SIPUSH, i); - if (param.isPrimitive()) { - int opcode = ILOAD; - String type; - String desc; - if (param == Byte.TYPE) { - type = "java/lang/Byte"; - desc = "B"; - } else if (param == Integer.TYPE) { - type = "java/lang/Integer"; - desc = "I"; - } else if (param == Boolean.TYPE) { - type = "java/lang/Boolean"; - desc = "Z"; - } else if (param == Double.TYPE) { - opcode = DLOAD; - type = "java/lang/Double"; - desc = "D"; - } else if (param == Float.TYPE) { - opcode = FLOAD; - type = "java/lang/Float"; - desc = "F"; - } else if (param == Long.TYPE) { - opcode = LLOAD; - type = "java/lang/Long"; - desc = "J"; - } else if (param == Character.TYPE) { - type = "java/lang/Character"; - desc = "C"; - } else /*if (param == Short.TYPE)*/ { - type = "java/lang/Short"; - desc = "S"; - } - cv.visitTypeInsn(NEW, type); - cv.visitInsn(DUP); - cv.visitVarInsn(opcode, localVarIndex); - cv.visitMethodInsn( - INVOKESPECIAL, type, "", "(" + desc + ")V"); - } else { - cv.visitVarInsn(ALOAD, localVarIndex); - } - cv.visitInsn(AASTORE); - localVarIndex += (param == Double.TYPE || param == Long.TYPE ? 2 : 1); - } - } - - /** - * Generates the code to unreify the result of the given method. - * For a method "int m (int i, String s)", this code is the bytecode - * corresponding to the "((Integer)...).intValue()" expression. - * - * @param m a method object. - * @param cv the code visitor to be used to generate the bytecode. - */ - - public static void generateReturnCode (final Method m, final CodeVisitor cv) { - Class result = m.getReturnType(); - if (result == Void.TYPE) { - cv.visitInsn(POP); - cv.visitInsn(RETURN); - } else if (result.isPrimitive()) { - int opcode = IRETURN; - String type; - String meth; - String desc; - if (result == Byte.TYPE) { - type = "java/lang/Byte"; - meth = "byteValue"; - desc = "B"; - } else if (result == Integer.TYPE) { - type = "java/lang/Integer"; - meth = "intValue"; - desc = "I"; - } else if (result == Boolean.TYPE) { - type = "java/lang/Boolean"; - meth = "booleanValue"; - desc = "Z"; - } else if (result == Double.TYPE) { - opcode = DRETURN; - type = "java/lang/Double"; - meth = "doubleValue"; - desc = "D"; - } else if (result == Float.TYPE) { - opcode = FRETURN; - type = "java/lang/Float"; - meth = "floatValue"; - desc = "F"; - } else if (result == Long.TYPE) { - opcode = LRETURN; - type = "java/lang/Long"; - meth = "longValue"; - desc = "J"; - } else if (result == Character.TYPE) { - type = "java/lang/Character"; - meth = "charValue"; - desc = "C"; - } else /*if (result == Short.TYPE)*/ { - type = "java/lang/Short"; - meth = "shortValue"; - desc = "S"; - } - cv.visitTypeInsn(CHECKCAST, type); - cv.visitMethodInsn(INVOKEVIRTUAL, type, meth, "()" + desc); - cv.visitInsn(opcode); - } else { - cv.visitTypeInsn(CHECKCAST, Type.getInternalName(result)); - cv.visitInsn(ARETURN); - } - } - - // ------------------------------------------------------------------------- - // Utility class - // ------------------------------------------------------------------------- - - /** - * A code adapter to insert a meta object related interception code block to - * the code of a method. - */ - - class MetaCodeAdapter implements CodeVisitor { - - /** - * The code visitor to which this code adapter delegates calls. - */ - - private final CodeVisitor cv; - - /** - * Indicates if the controller, interceptor and content classes are merged. - */ - - private final boolean mergeAll; - - /** - * Constructs a new {@link MetaCodeAdapter}. - * - * @param cv the code visitor to which this adapter must delegate calls. - * @param m the method for which this code adapter is used. - */ - - public MetaCodeAdapter ( - final CodeVisitor cv, - final Method m) - { - this.cv = cv; - this.mergeAll = icg.mergeAll; - - // computes the name of the owner class of the 'delegate' field. - if (owner == null) { - if (delegateFieldDesc == null) { - owner = icg.name; - } else { - owner = delegateFieldDesc.substring(1, delegateFieldDesc.length() - 1); - } - } - - Label endLabel = null; - - if (mergeAll) { - // generates code to test if the current call is a reflected call - cv.visitVarInsn(ALOAD, 0); - cv.visitMethodInsn( - INVOKEVIRTUAL, - owner, - getIsReflectedCallMethodName(), - "()Z"); - endLabel = new Label(); - cv.visitJumpInsn(IFNE, endLabel); - } - - // pushes the reference of the controller object associated to the - // interceptor. This reference is stored in the 'delegate' field, unless - // the controller and interceptor classes are merged (in this case the - // reference of the controller object is the reference of the interceptor, - // i.e., 'this') - cv.visitVarInsn(ALOAD, 0); - // if controller and interceptor classes are merged, the generateInitCode - // method is not called, and the delegateFieldName is therefore null. In - // this case we do not load the value of the 'delegate' field, which does - // not exist. - if (delegateFieldName != null) { - cv.visitFieldInsn( - GETFIELD, icg.name, delegateFieldName, delegateFieldDesc); - } - - // adds code to the static initializer to initialize the static field - // containing the Method object - // adds code to the static initializer to initialize this field - if (clinit == null) { - // creates the static initializer first, if does not exist yet - clinit = icg.cw.visitMethod(ACC_STATIC, "", "()V", null, null); - } - generateMethodInitializerCode(m, icg.name, "_M"+counter, icg.cw, clinit); - - if (reifyInterfaceName()) { - String name = getInterfaceName(m); - if (name == null) { - cv.visitInsn(ACONST_NULL); - } else { - cv.visitLdcInsn(name); - } - } - - if (reifyTargetObject()) { - // generates code to push the reference of the target object - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn( - GETFIELD, icg.name, icg.implFieldName, icg.implFieldDesc); - } - - // generates code to push the value of the static - // field containing the Method object - cv.visitFieldInsn( - GETSTATIC, icg.name, "_M" + counter, "Ljava/lang/reflect/Method;"); - - // generates code to push the reified method arguments - generateParameterReifierCode(m, cv); - - // generates code to call the 'handleMethodCall' method - String desc = - "Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;"; - if (reifyTargetObject()) { - desc = "Ljava/lang/Object;" + desc; - } - if (reifyInterfaceName()) { - desc = "Ljava/lang/String;" + desc; - } - cv.visitMethodInsn( - INVOKEVIRTUAL, - owner, - getHandleMethodCallMethodName(), - "(" + desc); - - // generates code to return result - generateReturnCode(m, cv); - - if (mergeAll) { - cv.visitLabel(endLabel); - } else { - cv.visitMaxs(0, 0); - } - - ++counter; - } - - // ------------------------------------------------------------------------- - // Implementation of the CodeVisitor interface - // ------------------------------------------------------------------------- - - public void visitInsn (final int opcode) { - if (mergeAll) { - cv.visitInsn(opcode); - } - } - - public void visitIntInsn (final int opcode, final int operand) { - if (mergeAll) { - cv.visitIntInsn(opcode, operand); - } - } - - public void visitVarInsn (final int opcode, final int var) { - if (mergeAll) { - cv.visitVarInsn(opcode, var); - } - } - - public void visitTypeInsn (final int opcode, final String desc) { - if (mergeAll) { - cv.visitTypeInsn(opcode, desc); - } - } - - public void visitFieldInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - if (mergeAll) { - cv.visitFieldInsn(opcode, owner, name, desc); - } - } - - public void visitMethodInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - if (mergeAll) { - cv.visitMethodInsn(opcode, owner, name, desc); - } - } - - public void visitJumpInsn (final int opcode, final Label label) { - if (mergeAll) { - cv.visitJumpInsn(opcode, label); - } - } - - public void visitLabel (final Label label) { - if (mergeAll) { - cv.visitLabel(label); - } - } - - public void visitLdcInsn (final Object cst) { - if (mergeAll) { - cv.visitLdcInsn(cst); - } - } - - public void visitIincInsn (final int var, final int increment) { - if (mergeAll) { - cv.visitIincInsn(var, increment); - } - } - - public void visitTableSwitchInsn ( - final int min, - final int max, - final Label dflt, - final Label labels[]) - { - if (mergeAll) { - cv.visitTableSwitchInsn(min, max, dflt, labels); - } - } - - public void visitLookupSwitchInsn ( - final Label dflt, - final int keys[], - final Label labels[]) - { - if (mergeAll) { - cv.visitLookupSwitchInsn(dflt, keys, labels); - } - } - - public void visitMultiANewArrayInsn (final String desc, final int dims) { - if (mergeAll) { - cv.visitMultiANewArrayInsn(desc, dims); - } - } - - public void visitTryCatchBlock ( - final Label start, - final Label end, - final Label handler, - final String type) - { - if (mergeAll) { - cv.visitTryCatchBlock(start, end, handler, type); - } - } - - public void visitMaxs (final int maxStack, final int maxLocals) { - if (mergeAll) { - cv.visitMaxs(maxStack, maxLocals); - } - } - - public void visitAttribute (final Attribute attribute) { - cv.visitAttribute(attribute); - } - - public void visitLocalVariable ( - final String name, - final String desc, - final Label start, - final Label end, - final int index) - { - if (mergeAll) { - cv.visitLocalVariable(name, desc, start, end, index); - } - } - - public void visitLineNumber (final int line, final Label start) { - if (mergeAll) { - cv.visitLineNumber(line, start); - } - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/MixinClassGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/MixinClassGenerator.java deleted file mode 100644 index f84c50c7c03f3bc54cd9e14d5a5a734b2e9b3a36..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/MixinClassGenerator.java +++ /dev/null @@ -1,602 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.loader.Generated; -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.ClassAdapter; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.CodeAdapter; -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Constants; -import org.objectweb.asm.Label; -import org.objectweb.asm.Type; -import org.objectweb.asm.Attribute; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/** - * A class generator to mix several mixin classes into a single class. A mixin - * class is a class of the following form: - *
- * public abstract class XMixin implements I {
- *
- *   // private constructor
- *   private XMixin () {}
- *
- *   // fields and methods added or overriden by the mixin class
- *   public int i;
- *   public void m (String s) {
- *     _this_n();
- *     _super_m(_this_header + s + i);
- *   }
- *   // ...
- *
- *   // fields and methods required by the mixin class in other mixins
- *   String _this_header;
- *   abstract void _this_n ();
- *   // original methods, overriden in this mixin class
- *   abstract void _super_m (String s);
- *   // ...
- * }
- * 
- * The mix of several mixin classes M1 ... Mn, in this order, is a class that is - * equivalent to a class Mn subclassing Mn-1 ... sub classing M1. For example, - * if YMixin is a mixin of the following form: - *
- * public abstract class YMixin {
- *
- *   // private constructor
- *   private YMixin () {}
- *
- *   // fields and methods added or overriden by the mixin class
- *   public String header;
- *   public void n () { ... }
- *   public void m (String s) {
- *     return header + s;
- *   }
- * }
- * 
- * then the mix of YMixin and XMixin, in this order, is the following class: - *
- * public class XYZ implements I, Generated {
- *   // from XMixin:
- *   public int i;
- *   public void m (String s) {
- *     n();
- *     return m$$0(header + s + i);
- *   }
- *   // from YMixin:
- *   public String header;
- *   public void n () { ... }
- *   private void m$$0 (String s) {
- *     return header + s;
- *   }
- *   // other methods
- *   public String getFcGeneratorParameters () {
- *     return "(...MixinClassGenerator source YMixin XMixin)";
- *   }
- * }
- * 
- * As can be seen, the code of the mixin classes is copied into the mixed class, - * with some small transformations: fields and methods that are static or whose - * name begins with _this_ or _super_ are not copied, and - * overriden methods are renamed with a "$$n" suffix to avoid name - * clashes. - *

- * Several mixin classes can be mixed, in a specific order, only if the fields - * and methods required by each mixin class are provided by previous mixins - * classes in the mixin class list. For example, the XMixin can only be used - * if one or more previous mixin classes, in the mixed class list, provide a - * header field, a void n () method, and a void m (String - * s) method. - *

- * Notes: - *

    - *
  • since static fields and methods are not copied, and since the generated - * class will generally not be in the same package than the original classes, - * all the static fields and methods used by the non static methods must be - * public (but those that are used only by static methods may be private).
  • - *
  • the constructors are not mixed (this limitation will perhaps be removed - * in future versions).
  • - *
- */ - -public class MixinClassGenerator implements ClassGenerator, Constants { - - /** - * Internal name of the mixed class generated by this generator. - */ - - String mixedClassName; - - /** - * The mixin classes to be mixed. This list is a list of Class objects. - */ - - List mixins; - - /** - * Index in {@link #mixins mixins} of the current mixin class that is being - * added to the mixed class. - */ - - int currentMixin; - - /** - * Internal name of the current mixin class that is being added to the mixed - * class. - */ - - String currentMixinClass; - - /** - * A map associating a counter to each method name and descriptor. These - * Integer counters are used to rename overriden methods with "$$x" suffixes. - * Each counter corresponds to the number of time the corresponding method - * is overriden by the following mixin classes, minus one. - */ - - Map counters; - - /** - * The prefix used in mixin classes to denote required fields and methods. - */ - - final static String THIS = "_this_"; - - /** - * The prefix used in mixin classes to denote overriden methods. - */ - - final static String SUPER = "_super_"; - - /** - * Generates a class by adding mixin classes to the given class. - * - * @param name the name of the class to be generated. - * @param args the descriptor of the class to be generated. This - * descriptor must be of the form (object descriptor source - * mixinClass1 ... mixinClassN), where source is a symbolic name to - * designate the mixed class - this name appears in stack traces, and - * where mixinClass1 ... mixinClassN are the class descriptors of the - * classes to be mixed. - * @param loader the loader to be used to load or generate auxiliary classes, - * if needed. - * @return a sub class of the given class constructed by adding the applicable - * mixins classes to it. - * @throws ClassGenerationException if any other problem occurs. - */ - - public byte[] generateClass ( - final String name, - final Tree args, - final Loader loader) throws ClassGenerationException - { - // checks the mixin classes - Set providedMethods = new HashSet(); - Set providedFields = new HashSet(); - Set interfaces = new HashSet(); - mixins = new ArrayList(); - - String source = args.getSubTree(1).toString(); - - for (int i = 2; i < args.getSize(); ++i) { - Class mixinClass; - try { - mixinClass = loader.loadClass(args.getSubTree(i)); - } catch (ClassNotFoundException e) { - throw new ClassGenerationException( - e, - args.toString(), - "Cannot load the '" + args.getSubTree(i) + "' mixin class"); - } - - // checks that each method of the mixin class whose name - // begins with the SUPER prefix is provided by a previous mixin class - Method[] meths = mixinClass.getDeclaredMethods(); - for (int j = 0; j < meths.length; ++j) { - String m = meths[j].getName() + Type.getMethodDescriptor(meths[j]); - if (m.startsWith(THIS)) { - if (!providedMethods.contains(m)) { - throw new ClassGenerationException( - null, - args.toString(), - "The method '" + m + "' required by the '" + - mixinClass.getName() + "' mixin is missing"); - } - } else if (m.startsWith(SUPER)) { - m = m.substring(SUPER.length()); - // checks that m is effectively overriden by this mixin - boolean overriden = false; - for (int k = 0; k < meths.length; ++k) { - String n = meths[k].getName() + Type.getMethodDescriptor(meths[k]); - if (n.equals(m)) { - overriden = true; - break; - } - } - if (!overriden) { - throw new ClassGenerationException( - null, - args.toString(), - "Illegal method '" + meths[j] + "' in '" + mixinClass.getName() + - "': this method is not overriden by this mixin class"); - } - if (!providedMethods.contains(THIS + m)) { - throw new ClassGenerationException( - null, - args.toString(), - "The method '" + meths[j] + "' overriden in '" + - mixinClass.getName() + - "' is not provided by the preceding mixins"); - } - } - } - for (int j = 0; j < meths.length; ++j) { - String m = meths[j].getName() + Type.getMethodDescriptor(meths[j]); - if (!m.startsWith(THIS) && !m.startsWith(SUPER)) { - providedMethods.add(THIS + m); - } - } - - // checks that each field of the mixin class whose name - // begins with the SUPER prefix is provided by a previous mixin class - Field[] fields = mixinClass.getDeclaredFields(); - for (int j = 0; j < fields.length; ++j) { - String f = fields[j].getName(); - if (f.startsWith(THIS)) { - if (!providedFields.contains(f)) { - throw new ClassGenerationException( - null, - args.toString(), - "The field '" + f + "' required by the '" + mixinClass.getName() + - "' mixin is missing"); - } - } else if (f.startsWith(SUPER)) { - throw new ClassGenerationException( - null, - args.toString(), - "Illegal field '" + f + "' in '" + mixinClass.getName() + - "': " + SUPER + " must not be used for fields"); - } else { - if (providedFields.contains(THIS + f)) { - throw new ClassGenerationException( - null, - args.toString(), - "The field '" + f + "' provided by the '" + mixinClass.getName() + - "': mixin is already provided by a preceding mixin"); - } - providedFields.add(THIS + f); - } - } - - mixins.add(mixinClass); - Class[] itfs = mixinClass.getInterfaces(); - for (int j = 0; j < itfs.length; ++j) { - interfaces.add(Type.getInternalName(itfs[j])); - } - } - - // creates the mixed class - mixedClassName = name.replace('.', '/'); - ClassWriter cw = new ClassWriter(false); - interfaces.add(Type.getInternalName(Generated.class)); - cw.visit( - ACC_PUBLIC, - mixedClassName, - "java/lang/Object", - (String[])interfaces.toArray(new String[interfaces.size()]), - "MIXIN["+source+']'); - - // generates the default constructor - CodeVisitor mw = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); - mw.visitVarInsn(ALOAD, 0); - mw.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V"); - mw.visitInsn(RETURN); - mw.visitMaxs(1, 1); - - // generates the 'getFcGeneratorParameters' method - String mName = "getFcGeneratorParameters"; - String mDesc = "()Ljava/lang/String;"; - CodeVisitor mv = cw.visitMethod(ACC_PUBLIC, mName, mDesc, null, null); - mv.visitLdcInsn(args.toString()); - mv.visitInsn(ARETURN); - mv.visitMaxs(1, 1); - - // adds the mixin classes, in reverse order - counters = new HashMap(); - for (currentMixin = mixins.size() - 1; currentMixin >= 0; --currentMixin) { - Class c = (Class)mixins.get(currentMixin); - currentMixinClass = Type.getInternalName(c); - MixinClassAdapter mca = new MixinClassAdapter(cw); - try { - getClassReader(c).accept(mca, false); - } catch (IOException e) { - throw new ClassGenerationException( - e, args.toString(), "Cannot read the mixin class " + c.getName()); - } - updateCounters(c); - } - - // returns the mixed class - return cw.toByteArray(); - } - - /** - * Returns a {@link ClassReader} to analyze the given class. - * - * @param c a class. - * @return a {@link ClassReader} to analyze the given class. - * @throws IOException if the bytecode of the class cannot be found. - */ - - ClassReader getClassReader (final Class c) throws IOException { - try { - return new ClassReader(c.getName()); - } catch (IOException e) { - // an exception can occur if c is a dynamically generated class; - // indeed, in this case, it can not be found by the system class loader. - String s = Type.getInternalName(c) + ".class"; - return new ClassReader(c.getClassLoader().getResourceAsStream(s)); - } - } - - /** - * Returns the counter associated to the given method. - * - * @param name the method's name. - * @param desc the method's descriptor. - * @return the counter associated to the given method. - */ - - int getCounter (final String name, final String desc) { - Integer value = (Integer)counters.get(name + desc); - return value == null ? -1 : value.intValue(); - } - - /** - * Updates the {@link #counters counters} map with the given class. This - * method increments the counter associated to each non static method of the - * given class. - * - * @param c a class. - */ - - void updateCounters (final Class c) { - Method[] meths = c.getDeclaredMethods(); - for (int i = 0; i < meths.length; ++i) { - Method meth = meths[i]; - String key = meth.getName(); - if (key.startsWith(SUPER) || - key.startsWith(THIS) || - (meth.getModifiers() & (ACC_STATIC | ACC_ABSTRACT)) == 0) - { - key += Type.getMethodDescriptor(meth); - Integer value = (Integer)counters.get(key); - int count = value == null ? 0 : value.intValue() + 1; - counters.put(key, new Integer(count)); - } - } - } - - /** - * Tests if the given method is provided by the given class. - * - * @param m the name and descriptor of a method. The name of this method is - * supposed to start with the {@link #SUPER SUPER} prefix. - * @param c a class. - * @return true if c provides a method with same name - * (excluding the {@link #SUPER SUPER} prefix), the same formal - * parameter types, and the same return type as m. - */ - - static boolean providesMethod (final String m, final Class c) { - Method[] meths = c.getMethods(); - for (int i = 0; i < meths.length; ++i) { - if (equals(m, meths[i])) { - return true; - } - } - return false; - } - - /** - * Tests if the given field is provided by the given class. - * - * @param f the name of a field. - * @param c a class. - * @return true if c provides a field with same name - * as f. - */ - - static boolean providesField (final String f, final Class c) { - Field[] fields = c.getFields(); - for (int i = 0; i < fields.length; ++i) { - if (f.equals(fields[i].getName())) { - return true; - } - } - return false; - } - - /** - * Tests if two methods have the same name and the same signature. - * - * @param m the name and descriptor of a method. The name of this method is - * supposed to start with the {@link #SUPER SUPER} prefix. - * @param n the method to be compared to m. The name of this method - * is supposed not to start with the {@link #SUPER SUPER} - * prefix. - * @return true if the two methods have the same name (excluding the - * {@link #SUPER SUPER} prefix), the same formal parameter types, and the - * same return type. - */ - - static boolean equals (final String m, final Method n) { - String ms = m.substring(SUPER.length()); - String ns = n.getName() + Type.getMethodDescriptor(n); - return ms.equals(ns); - } - - /** - * A class adapter to rename methods in a mixin class. - */ - - class MixinClassAdapter extends ClassAdapter implements Constants { - - /** - * Constructs a new {@link MixinClassGenerator.MixinClassAdapter} object. - * - * @param cv the class vistor to which this adapter must delegate calls. - */ - - public MixinClassAdapter (final ClassVisitor cv) { - super(cv); - } - - public void visit ( - final int access, - final String name, - final String superName, - final String[] interfaces, - final String sourceFile) - { - // does nothing - } - - public void visitField ( - final int access, - final String name, - final String desc, - final Object value, - final Attribute attrs) - { - if (!name.startsWith(THIS) && (access & ACC_STATIC) == 0) { - super.visitField(access, name, desc, value, attrs); - } - } - - public CodeVisitor visitMethod ( - final int access, - final String name, - final String desc, - final String[] exceptions, - final Attribute attrs) - { - if ((access & (ACC_NATIVE | ACC_STATIC | ACC_ABSTRACT)) != 0) { - return null; - } - if (name.equals("") || - name.startsWith(SUPER) || - name.startsWith(THIS)) - { - return null; - } - int count = getCounter(name, desc); - CodeVisitor mv; - if (count == -1) { - mv = cv.visitMethod(access, name, desc, exceptions, attrs); - } else { - int newAccess = access & ~(ACC_PUBLIC | ACC_PROTECTED) | ACC_PRIVATE; - String newName = name + "$$" + count; - mv = cv.visitMethod(newAccess, newName, desc, exceptions, attrs); - } - return new MixinCodeAdapter(mv); - } - } - - /** - * A code adapter to update method calls in methods of mixin classes. - */ - - class MixinCodeAdapter extends CodeAdapter implements Constants { - - /** - * Constructs a new {@link MixinClassGenerator.MixinCodeAdapter} object. - * - * @param cv the code vistor to which this adapter must delegate calls. - */ - - public MixinCodeAdapter (final CodeVisitor cv) { - super(cv); - } - - public void visitFieldInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - if (name.startsWith(THIS)) { - String normalName = name.substring(THIS.length()); - cv.visitFieldInsn(opcode, mixedClassName, normalName, desc); - } else if ( - opcode != GETSTATIC && - opcode != PUTSTATIC && - owner.equals(currentMixinClass)) - { - cv.visitFieldInsn(opcode, mixedClassName, name, desc); - } else { - cv.visitFieldInsn(opcode, owner, name, desc); - } - } - - public void visitMethodInsn ( - final int opcode, - final String owner, - final String name, - final String desc) - { - if (name.startsWith(THIS)) { - String normalName = name.substring(THIS.length()); - cv.visitMethodInsn(opcode, mixedClassName, normalName, desc); - } else if (name.startsWith(SUPER)) { - String normalName = name.substring(SUPER.length()); - String superName = normalName + "$$" + (getCounter(name, desc) + 1); - cv.visitMethodInsn(INVOKESPECIAL, mixedClassName, superName, desc); - } else if (opcode != INVOKESTATIC && owner.equals(currentMixinClass)) { - cv.visitMethodInsn(opcode, mixedClassName, name, desc); - } else { - cv.visitMethodInsn(opcode, owner, name, desc); - } - } - - public void visitLineNumber (int i, Label label) { - cv.visitLineNumber((currentMixin + 1) * 1000 + i, label); - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/SimpleCodeGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/SimpleCodeGenerator.java deleted file mode 100644 index d2aeec0f84da2691247d1b0c6f7373979e56ff31..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/SimpleCodeGenerator.java +++ /dev/null @@ -1,484 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.InitializationContext; -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.CodeVisitor; -import org.objectweb.asm.Type; - -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; - -/** - * A {@link CodeGenerator} to generate pre and post code - * to call an associated controller object. This abstract code generator can - * be used to easily generate interceptors of the following form, without - * knowing the Java bytecode instructions and ASM: - * - *
- *

- * Figure 1: an interceptor and an associated controller object (see also - * here) - *

- * - *

where the interceptor calls a void prem (String - * s) method and a void postm (String s) method on - * the controller object before and after each intercepted method. This abstract - * code generator can be configured in many ways: - *

    - *
  • The name N (see the above figure) can be configured with the - * {@link #getControllerInterfaceName getControllerInterfaceName} method.
  • - *
  • The names of the prem and postm methods can be configured - * with the {@link #getPreMethodName getPreMethodName} and {@link - * #getPostMethodName getPostMethodName} methods. These methods must be defined - * in the C class. They can also be declared in the T - * interface, but this is not mandatory.
  • - *
  • the prem and postm methods take as argument a String that - * is computed from the description of the intercepted method by the {@link - * #getMethodName getMethodName} method.
  • - *
  • a context can be returned by the prem method and passed back to - * the postm method (this can be useful to avoid mixin the start of a - * method call with the end of another, concurrent, method call). The type of - * this context can be configured with the {@link #getContextType - * getContextType} method. It can be a primitive type, an object type, or void - * if no context is required. If a context is used, then the prem and - * postm methods defined in C must have the following - * signatures (where I is the type of the context): I prem - * (String s) and void postm (String s, I ctxt).
  • - *
  • the name of fractal interface to which the interceptor is associated can - * be passed as parameter in the prem and postm methods. For - * this you just need to override the {@link #needsInterfaceName - * needsInterfaceName} method, so that it returns true. The prem - * and postm methods must then have an additional parameter of type - * String: I prem (String itf, String s) and void postm - * (String itf, String s, I ctxt).
  • - *
  • the target object of the intercepted method call can be passed as - * parameter in the prem and postm methods. For - * this you just need to override the {@link #needsTargetObject - * needsTargetObject} method, so that it returns true. The prem - * and postm methods must then have an additional parameter of type - * Object: I prem (Object target, String s) and void postm - * (Object target, String s, I ctxt) (if the previous option is also - * enabled, the parameters must be placed in the following order: I prem - * (String itf, Object target, String s) and void postm (String itf, - * Object target, String s, I ctxt)).
  • - *
  • the {@link #getInterceptionType getInterceptionType} method can be - * overriden to choose between three type of pre/post semantics. See {@link - * AbstractCodeGenerator}.
  • - *
  • the {@link #intercept intercept} method can be overriden to intercept - * only some specific methods, while leaving the other unchanged.
  • - *
- * - *

The code adapters returned by the {@link #generateInterceptionCode - * generateInterceptionCode} method (see {@link CodeGenerator}) - * transform the original methods into methods of the following form (assuming - * a context is used): - * - *

- * method-signature {
- *   delegate.prem(id);
- *   // original method code
- * }
- * 
- * - * if {@link #getInterceptionType getInterceptionType} returns - * {@link InterceptorCodeAdapter#EMPTY EMPTY}, - * - *

- * method-signature {
- *   return-type result;
- *   I context = delegate.prem(id);
- *   // original method code, where returns are replaced with gotos
- *   delegate.postm(id, context);
- *   return result;
- * }
- * 
- * - * if {@link #getInterceptionType getInterceptionType} returns - * {@link InterceptorCodeAdapter#NORMAL NORMAL}, - * - *

- * method signature {
- *   I context = delegate.prem(id);
- *   try {
- *     // original method code
- *   } finally {
- *     delegate.postm(id, context);
- *   }
- * }
- * 
- * - * if {@link #getInterceptionType getInterceptionType} returns - * {@link InterceptorCodeAdapter#FINALLY FINALLY}. - * - *

The {@link #generateInitCode generateInitCode} method adds a - * delegate field to the interceptor class, and adds a code fragment of - * the following form to the generated {@link #generateInitCode - * generateInitCode} method (recall that N can be configured with the - * {@link #getControllerInterfaceName getControllerInterfaceName} method): - * - *

- * delegate = (...)ic.getFcInterface(N);
- * 
- * - * Finally this code generator takes into account the Julia - * optimizations options. - * So, for example, if the interceptors and controller objects are merged, the - * delegate field is not generated, and this is used instead. - */ - -public abstract class SimpleCodeGenerator - extends AbstractCodeGenerator - implements Initializable -{ - - /** - * The arguments used to initialize this object. These arguments are the list - * of interface names, corresponding to the list of interface types in - * icg.interfaces. May be null. - */ - - private Tree args; - - /** - * The interceptor class generator to which this code generator belongs. - */ - - private InterceptorClassGenerator icg; - - /** - * The name of the 'delegate' field. - */ - - private String delegateFieldName; - - /** - * The descriptor of the 'delegate' field. - */ - - private String delegateFieldDesc; - - /** - * The name of the owner class of the 'delegate' field. - */ - - private String owner; - - // ------------------------------------------------------------------------- - // Implementation of the Init interface - // ------------------------------------------------------------------------- - - public void initialize (final Tree args) { - this.args = args.getSubTree(0); - } - - // ------------------------------------------------------------------------- - // Overriden methods - // ------------------------------------------------------------------------- - - public int init (final InterceptorClassGenerator icg) { - this.icg = icg; - return IN; - } - - public void generateInitCode (final CodeVisitor cv) - throws ClassGenerationException - { - // computes the internal name of the controller class - // that contains the needed 'preMethod' method - String owner = null; - for (int i = 0; i < icg.controllerClasses.length; ++i) { - Class c = icg.controllerClasses[i]; - List params = new ArrayList(); - if (needsInterfaceName()) { - params.add(String.class); - } - if (needsTargetObject()) { - params.add(Object.class); - } - params.add(String.class); - Class[] paramClasses = (Class[])params.toArray(new Class[params.size()]); - try { - c.getMethod(getPreMethodName(), paramClasses); - owner = c.getName(); - break; - } catch (Exception e) { - } - } - if (owner == null) { - throw new ClassGenerationException( - null, - icg.args.toString(), - "Cannot find a controller class providing a '" + - getPreMethodName() + "' method with the good arguments"); - } - owner = owner.replace('.', '/'); - - int hashcode = getControllerInterfaceName().hashCode(); - delegateFieldName = "d" + Integer.toHexString(hashcode); - delegateFieldDesc = "L" + owner + ";"; - - icg.cw.visitField( - ACC_PRIVATE, delegateFieldName, delegateFieldDesc, null, null); - - cv.visitVarInsn(ALOAD, 0); - cv.visitVarInsn(ALOAD, 1); - cv.visitLdcInsn(getControllerInterfaceName()); - cv.visitMethodInsn( - INVOKEVIRTUAL, - Type.getInternalName(InitializationContext.class), - "getInterface", - "(" + Type.getDescriptor(String.class) + ")" + - Type.getDescriptor(Object.class)); - cv.visitTypeInsn(CHECKCAST, owner); - cv.visitFieldInsn(PUTFIELD, icg.name, delegateFieldName, delegateFieldDesc); - } - - protected int getInterceptionCodeFormals (final Method m) { - // local variable to store the context, if a context is used - return AbstractClassGenerator.getSize(getContextType()); - } - - public void generateCloneCode (final CodeVisitor cv) { - cv.visitVarInsn(ALOAD, 1); - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn(GETFIELD, icg.name, delegateFieldName, delegateFieldDesc); - cv.visitFieldInsn(PUTFIELD, icg.name, delegateFieldName, delegateFieldDesc); - } - - // ------------------------------------------------------------------------- - // Implementation of inherited abstract methods - // ------------------------------------------------------------------------- - - protected void generateInterceptionCodeBlock ( - final Method m, - final boolean pre, - final CodeVisitor cv, - final int formals) - { - Class c = getContextType(); - String desc = Type.getDescriptor(c); - - // pushes the reference of the controller object associated to the - // interceptor. This reference is stored in the 'delegate' field, unless - // the controller and interceptor classes are merged (in this case the - // reference of the controller object is the reference of the interceptor, - // i.e., 'this') - cv.visitVarInsn(ALOAD, 0); - // if controller and interceptor classes are merged, the generateInitCode - // method is not called, and the delegateFieldName is therefore null. In - // this case we do not load the value of the 'delegate' field, which does - // not exist. - if (delegateFieldName != null) { - cv.visitFieldInsn( - GETFIELD, icg.name, delegateFieldName, delegateFieldDesc); - } - - if (needsInterfaceName()) { - String name = getInterfaceName(m); - if (name == null) { - cv.visitInsn(ACONST_NULL); - } else { - cv.visitLdcInsn(name); - } - } - - if (needsTargetObject()) { - // generates code to push the reference of the target object - cv.visitVarInsn(ALOAD, 0); - cv.visitFieldInsn( - GETFIELD, icg.name, icg.implFieldName, icg.implFieldDesc); - } - - // generates code to push the name of the intercepted method - cv.visitLdcInsn(getMethodName(m)); - - // if we are generating the post code block, and if a context is passed from - // the pre method to the post method, then we push this context, which has - // been stored in the 'formals' local variable in the pre code block. - if (!pre && c != Void.TYPE) { - cv.visitVarInsn( - ILOAD + AbstractClassGenerator.getOpcodeOffset(c), formals); - } - - // we then generate the code to call the pre or post method - - // we first compute the name of the owner class of this method. - if (owner == null) { - if (delegateFieldDesc == null) { - owner = icg.name; - } else { - owner = delegateFieldDesc.substring(1, delegateFieldDesc.length() - 1); - } - } - - // we then compute the name of the pre or post method itself - String name = pre ? getPreMethodName() : getPostMethodName(); - - // and we compute the signature of this method - if (pre) { - desc = "Ljava/lang/String;)" + desc; - } else if (c != Void.TYPE) { - desc = "Ljava/lang/String;" + desc + ")V"; - } else { - desc = "Ljava/lang/String;)V"; - } - if (needsTargetObject()) { - desc = "Ljava/lang/Object;" + desc; - } - if (needsInterfaceName()) { - desc = "Ljava/lang/String;" + desc; - } - - // we can finally generate the code to invoke the pre or post method - cv.visitMethodInsn(INVOKEVIRTUAL, owner, name, "(" + desc); - - // if we are generating the pre code block, and if a context is passed from - // the pre method to the post method, then we store this context, which has - // in the 'formals' local variable. - if (pre && c != Void.TYPE) { - cv.visitVarInsn( - ISTORE + AbstractClassGenerator.getOpcodeOffset(c), formals); - } - } - - // ------------------------------------------------------------------------- - // Utility methods - // ------------------------------------------------------------------------- - - /** - * Returns the name of the interface provided by the controller object to be - * associated to the interceptor. - * - * @return the name of the interface provided by the controller object to be - * associated to the interceptor (called N in the above figure). - */ - - protected abstract String getControllerInterfaceName (); - - /** - * Returns the name of the method to be called on the associated controller - * object, before each intercepted call. - * - * @return the name of the method to be called on the associated controller - * object, before each intercepted call (called prem above). - */ - - protected abstract String getPreMethodName (); - - /** - * Returns the name of the method to be called on the associated controller - * object, after each intercepted call. - * - * @return the name of the method to be called on the associated controller - * object, after each intercepted call (called postm above). - */ - - protected abstract String getPostMethodName (); - - /** - * Returns the type of the context to be passed from the "pre method" to the - * "post method". - * - * @return the type of the context to be passed from the "pre method" to the - * "post method" (called I above). - */ - - protected abstract Class getContextType (); - - /** - * Returns the String to be passed as argument to the pre and post methods, - * for the given method. - * - * @param m a method object. - * @return the String to be passed as argument to the pre and post methods, - * for the given method. - */ - - protected abstract String getMethodName (Method m); - - /** - * Returns true if the target interface name must be passed as - * argument to the pre and post methods. The default implementation of this - * method returns false. - * - * @return true if the name of the fractal interface associated to - * the generated interceptor must be passed as argument in the pre and - * post methods. - */ - - protected boolean needsInterfaceName () { - return false; - } - - /** - * Returns the name of the fractal interface in which the given method is - * defined. - * - * @param m a method. - * @return the name of the fractal interface in which the given method is - * defined. - */ - - private String getInterfaceName (Method m) { - if (args != null) { - String desc = m.getName()+Type.getMethodDescriptor(m); - List itfs = icg.interfaces; - for (int i = 0; i < itfs.size(); ++i) { - String itf = ((String)itfs.get(i)).replace('/', '.'); - Class c; - try { - c = icg.loader.loadClass(itf); - } catch (ClassNotFoundException e) { - continue; - } - Method[] meths = c.getMethods(); - for (int j = 0; j < meths.length; ++j) { - Method meth = meths[j]; - if (desc.equals(meth.getName()+Type.getMethodDescriptor(meth))) { - return args.getSubTree(i).toString(); - } - } - } - } - return null; - } - - /** - * Returns true if the target object must be passed as argument - * to the pre and post methods. The default implementation of this method - * returns false. - * - * @return true if the target object of intercepted method calls must - * be passed as argument in the pre and post methods. - */ - - protected boolean needsTargetObject () { - return false; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/TraceCodeGenerator.java b/julia/src/org/objectweb/fractal/julia/asm/TraceCodeGenerator.java deleted file mode 100644 index 67ffcc68234c05d500e0c88a8567c70d20b1c1eb..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/TraceCodeGenerator.java +++ /dev/null @@ -1,117 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.asm.CodeVisitor; - -import java.lang.reflect.Method; - -/** - * A {@link CodeGenerator} to generate pre and post code to trace - * method calls. More precisely the code adapters returned by the {@link - * #generateInterceptionCode generateInterceptionCode} method (see {@link - * CodeGenerator}) transform the original methods into methods of - * the following form: - *
- * <method signature> {
- *   <return type> result;
- *   System.err.println("Entering <method signature>");
- *   // original method code, where returns are replaced with gotos
- *   System.err.println("Leaving <method signature>");
- *   return result;
- * }
- * 
- */ - -public class TraceCodeGenerator extends AbstractCodeGenerator - implements Initializable -{ - - /** - * The type of this code generator. - */ - - private int type = IN; - - // ------------------------------------------------------------------------- - // Implementation of the Init interface - // ------------------------------------------------------------------------- - - /** - * Initializes this object with the given arguments. - * - * @param args the type of this code generator. This tree must be of the form - * "(in|out|inout)". - */ - - public void initialize (final Tree args) { - String type = args.getSubTree(0).toString(); - if (type.equals("in")) { - this.type = IN; - } else if (type.equals("out")) { - this.type = OUT; - } else if (type.equals("inout")) { - this.type = IN_OUT; - } - } - - // ------------------------------------------------------------------------- - // Overriden methods - // ------------------------------------------------------------------------- - - public int init (final InterceptorClassGenerator icg) { - return type; - } - - // ------------------------------------------------------------------------- - // Implementation of inherited abstract methods - // ------------------------------------------------------------------------- - - protected void generateInterceptionCodeBlock ( - final Method m, - final boolean pre, - final CodeVisitor cv, - final int formals) - { - // pushes the System.err static field - cv.visitFieldInsn( - GETSTATIC, "java/lang/System", "err", "Ljava/io/PrintStream;"); - if (pre) { - // pushes the "Entering ..." String constant - cv.visitLdcInsn("Entering " + m); - } else { - // pushes the "Leaving ..." String constant - cv.visitLdcInsn("Leaving " + m); - } - // invokes the 'println' method (defined in the PrintStream class) - cv.visitMethodInsn( - INVOKEVIRTUAL, - "java/io/PrintStream", - "println", - "(Ljava/lang/String;)V"); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/VisitException.java b/julia/src/org/objectweb/fractal/julia/asm/VisitException.java deleted file mode 100644 index 8adc9aeba320b0759f417394f3e30466db8603bd..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/VisitException.java +++ /dev/null @@ -1,62 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.asm; - -/** - * Thrown if a problem occurs during the visit of a class or of a method. Since - * the methods of the {@link org.objectweb.asm.ClassVisitor} and - * {@link org.objectweb.asm.CodeVisitor} interfaces do not declare - * exceptions, it is not possible to throw checked exceptions during a visit. - * But it is possible to throw a {@link RuntimeException} that - * wraps a checked exception. Hence this class. - */ - -class VisitException extends RuntimeException { - - /** - * The exception wrapped in this exception. - */ - - private final ClassGenerationException exception; - - /** - * Constructs a new {@link VisitException} object. - * - * @param exception the exception to be wrapped in this exception. - */ - - public VisitException (final ClassGenerationException exception) { - this.exception = exception; - } - - /** - * Returns the exception wrapped in this exception. - * - * @return the exception wrapped in this exception. - */ - - public ClassGenerationException getException () { - return exception; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/asm/package.html b/julia/src/org/objectweb/fractal/julia/asm/package.html deleted file mode 100644 index 756f9b3941c969e62ad0bc3a17cf8a6b4019d1e3..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/asm/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides some class generators based on -ASM. -@since Julia 0.8.0 - - diff --git a/julia/src/org/objectweb/fractal/julia/control/attribute/CloneableAttributeController.java b/julia/src/org/objectweb/fractal/julia/control/attribute/CloneableAttributeController.java deleted file mode 100644 index 18a00057ceb138bc8c793a7c5ad8eb2371dbb56d..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/attribute/CloneableAttributeController.java +++ /dev/null @@ -1,42 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.attribute; - -import org.objectweb.fractal.api.control.AttributeController; - -/** - * An extended {@link AttributeController} interface. - */ - -public interface CloneableAttributeController extends AttributeController { - - /** - * Copies the attributes controlled by this controller into another one. - * - * @param controller the destination attribute controller. This attribute - * controller should have at least the same attributes as this one. - */ - - void cloneFcAttributes (AttributeController controller); -} diff --git a/julia/src/org/objectweb/fractal/julia/control/attribute/UseCloneableAttributeControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/attribute/UseCloneableAttributeControllerMixin.java deleted file mode 100644 index 2ec6170b25311353ec5d39c5679d1ea2d61d5c12..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/attribute/UseCloneableAttributeControllerMixin.java +++ /dev/null @@ -1,89 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.attribute; - -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a {@link CloneableAttributeController} field to a {@link - * Controller}. - *
- *
- * Requirements - *
    - *
  • none (the component may provide a {@link CloneableAttributeController} - * interface, but this is not mandatory).
  • - *
- */ - -public abstract class UseCloneableAttributeControllerMixin - implements Controller -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseCloneableAttributeControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The {@link CloneableAttributeController} interface of the component to - * which this controller object belongs. - */ - - public CloneableAttributeController weaveableOptCAC; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableOptCAC = - (CloneableAttributeController)ic.getOptionalInterface( - "/cloneable-attribute-controller"); - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/attribute/package.html b/julia/src/org/objectweb/fractal/julia/control/attribute/package.html deleted file mode 100644 index 6fd5fb21fd21d09c8a8ca98da1486b8bfdf7b447..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/attribute/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides mixins to implement the {@link -org.objectweb.fractal.api.control.AttributeController} interface. -@since Julia 1.0.6 - - diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/BasicBindingControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/BasicBindingControllerMixin.java deleted file mode 100644 index 75784220b3437bd236feb9af001f8df3c600be9e..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/BasicBindingControllerMixin.java +++ /dev/null @@ -1,112 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -import java.util.HashMap; -import java.util.Map; - -/** - * Provides a basic implementation of the {@link BindingController} interface. - * This mixin uses a map to store the bindings of the component. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class BasicBindingControllerMixin implements BindingController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicBindingControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The bindings of the component to which this controller object belongs. - * This map associates to each client interface name the server interface to - * which it is bound. If a client interface is not bound, its name is not - * associated to null, but to the {@link #fcBindings} map itself. - * This way the {@link #listFc listFc} method returns the names of all the - * client interfaces of the component, and not only the names of the - * interfaces that are bound. - */ - - public Map fcBindings; - - public String[] listFc () { - if (fcBindings == null) { - return new String[0]; - } - return (String[])fcBindings.keySet().toArray(new String[fcBindings.size()]); - } - - public Object lookupFc (final String clientItfName) - throws NoSuchInterfaceException - { - if (fcBindings == null) { - return null; - } - Object serverItf = fcBindings.get(clientItfName); - return serverItf == fcBindings ? null : serverItf; - } - - public void bindFc (final String clientItfName, final Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - if (fcBindings == null) { - fcBindings = new HashMap(); - } - fcBindings.put(clientItfName, serverItf); - } - - public void unbindFc (final String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - if (fcBindings != null) { - fcBindings.put(clientItfName, fcBindings); - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/ChainedIllegalBindingException.java b/julia/src/org/objectweb/fractal/julia/control/binding/ChainedIllegalBindingException.java deleted file mode 100644 index 099283f49ec19ff3ca49d892f4cddbe26c0c236c..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/ChainedIllegalBindingException.java +++ /dev/null @@ -1,250 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.IllegalBindingException; - -import org.objectweb.fractal.julia.Util; - -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.ObjectOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; - -/** - * A sub class of the {@link IllegalBindingException} class. - */ - -public class ChainedIllegalBindingException extends IllegalBindingException { - - /** - * The exception that caused this exception. May be null. - */ - - private final Throwable exception; - - /** - * The client side component of the illegal binding. - */ - - private transient Component clientComp; - - /** - * The server side component of the illegal binding. May be null. - */ - - private transient Component serverComp; - - /** - * The name of the client interface of the illegal binding. - */ - - private final String clientItf; - - /** - * The name of the server interface of the illegal binding. May be - * null. - */ - - private final String serverItf; - - /** - * Constructs a new {@link ChainedIllegalBindingException} exception. - * - * @param exception the cause of this exception. May be null. - * @param clientComponent the client side component of the illegal binding. - * @param serverComponent the server side component of the illegal binding. - * May be null. - * @param clientItf the name of the client interface of the illegal binding. - * @param serverItf the name of the server interface of the illegal binding. - * May be null. - * @param message a detailed error message. - */ - - public ChainedIllegalBindingException ( - final Throwable exception, - final Component clientComponent, - final Component serverComponent, - final String clientItf, - final String serverItf, - final String message) - { - super(message); - this.exception = exception; - this.clientComp = clientComponent; - this.serverComp = serverComponent; - this.clientItf = clientItf; - this.serverItf = serverItf; - } - - /** - * Returns the exception that caused in this exception. - * - * @return the exception that caused this exception. May be null. - */ - - public Throwable getException () { - return exception; - } - - /** - * Returns the client side component of the illegal binding. - * - * @return the client side component of the illegal binding. - */ - - public Component getClientComponent () { - if (clientComp != null && !(clientComp instanceof Interface)) { - try { - return (Component)clientComp.getFcInterface("component"); - } catch (NoSuchInterfaceException ignored) { - } - } - return clientComp; - } - - /** - * Returns the server side component of the illegal binding. - * - * @return the server side component of the illegal binding. May be - * null. - */ - - public Component getServerComponent () { - if (serverComp != null && !(serverComp instanceof Interface)) { - try { - return (Component)serverComp.getFcInterface("component"); - } catch (NoSuchInterfaceException ignored) { - } - } - return serverComp; - } - - /** - * Returns the name of the client interface of the illegal binding. - * - * @return the name of the client interface of the illegal binding. - */ - - public String getClientInterface () { - return clientItf; - } - - /** - * Returns he name of the server interface of the illegal binding. - * - * @return the name of the server interface of the illegal binding. May be - * null. - */ - - public String getServerInterface () { - return serverItf; - } - - // ------------------------------------------------------------------------- - // Overriden Exception methods - // ------------------------------------------------------------------------- - - /** - * Returns a String representation of this exception. - * - * @return a String representation of this exception. - */ - - public String toString () { - StringBuffer buf = new StringBuffer(); - buf.append("IllegalBindingException: "); - buf.append(getMessage()); - buf.append(" (client interface = "); - Util.toString(getClientComponent(), buf); - buf.append('.'); - buf.append(getClientInterface()); - if (getServerComponent() != null) { - buf.append(", server interface = "); - Util.toString(getServerComponent(), buf); - buf.append('.'); - buf.append(getClientInterface()); - } - buf.append(')'); - return buf.toString(); - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - exception.printStackTrace(); - } - super.printStackTrace(); - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - private void writeObject (final ObjectOutputStream out) throws IOException { - out.defaultWriteObject(); - Component c = getClientComponent(); - out.writeObject(c instanceof Interface ? c : null); - c = getServerComponent(); - out.writeObject(c instanceof Interface ? c : null); - } - - private void readObject (final ObjectInputStream in) - throws IOException, ClassNotFoundException - { - in.defaultReadObject(); - clientComp = (Component)in.readObject(); - serverComp = (Component)in.readObject(); - } -} - diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/CheckBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/CheckBindingMixin.java deleted file mode 100644 index 6f37e58fad3f72f138399d59be3d82f0b99e4525..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/CheckBindingMixin.java +++ /dev/null @@ -1,135 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -/** - * Provides basic checks to a {@link BindingController}. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class CheckBindingMixin implements BindingController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private CheckBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks that the given interface is unbound, and then calls the overriden - * method. - */ - - public void bindFc (final String clientItfName, final Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - if (_this_lookupFc(clientItfName) != null) { - throw new ChainedIllegalBindingException( - null, - _this_weaveableOptC, - null, - clientItfName, - null, - "Already bound"); - } - _super_bindFc(clientItfName, serverItf); - } - - /** - * Checks that the given interface is bound, and then calls the overriden - * method. - */ - - public void unbindFc (final String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - if (_this_lookupFc(clientItfName) == null) { - throw new ChainedIllegalBindingException(null, - _this_weaveableOptC, - null, - clientItfName, - null, - "Not bound"); - } - _super_unbindFc(clientItfName); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableOptC; - - /** - * The {@link BindingController#listFc listFc} method required by this mixin. - */ - - public abstract Object _this_lookupFc (String clientItfName) throws - NoSuchInterfaceException; - - /** - * The {@link BindingController#bindFc bindFc} method overriden by this mixin. - */ - - public abstract void _super_bindFc (String clientItfName, Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * The {@link BindingController#unbindFc unbindFc} method overriden by this - * mixin. - */ - - public abstract void _super_unbindFc (String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/CompositeBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/CompositeBindingMixin.java deleted file mode 100644 index 9dc0d364dd9e1c163b6388c108e2828710ef4c9e..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/CompositeBindingMixin.java +++ /dev/null @@ -1,176 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.ComponentInterface; -import org.objectweb.fractal.julia.Interceptor; - -/** - * Provides {@link ComponentInterface} management to a {@link - * org.objectweb.fractal.api.control.BindingController}. - *
- *
- * Requirements - *
    - *
  • the component to which this component belongs must provide the {@link - * Component} and {@link ContentController} interfaces. Its type must be an - * instance of {@link org.objectweb.fractal.api.type.ComponentType}, and its - * interfaces must implement {@link ComponentInterface}.
  • - *
- */ - -public abstract class CompositeBindingMixin { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private CompositeBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Calls the overriden method and then updates the {@link - * ComponentInterface#getFcItfImpl getFcItfImpl} link (or the {@link - * Interceptor#getFcItfDelegate getFcItfDelegate} link of the corresponding - * interceptor) of the clientItfName interface to serverItf. - */ - - public void bindFc ( - final InterfaceType clientItfType, - final String clientItfName, - final Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - _super_bindFc(clientItfType, clientItfName, serverItf); - Object complementaryItf; - if (clientItfType.isFcClientItf()) { - complementaryItf = - _this_weaveableCC.getFcInternalInterface(clientItfName); - } else { - complementaryItf = - _this_weaveableC.getFcInterface(clientItfName); - } - ComponentInterface itf = (ComponentInterface)complementaryItf; - if (itf.hasFcInterceptor()) { - Object newImpl = itf.getFcItfImpl(); - ((Interceptor)newImpl).setFcItfDelegate(serverItf); - } else { - itf.setFcItfImpl(serverItf); - } - } - - /** - * Calls the overriden method and then updates the {@link - * ComponentInterface#getFcItfImpl getFcItfImpl} link (or the {@link - * Interceptor#getFcItfDelegate getFcItfDelegate} link of the corresponding - * interceptor) of the clientItfName interface to null. - */ - - public void unbindFc ( - final InterfaceType clientItfType, - final String clientItfName) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - _super_unbindFc(clientItfType, clientItfName); - Object complementaryItf; - if (clientItfType.isFcClientItf()) { - complementaryItf = - _this_weaveableCC.getFcInternalInterface(clientItfName); - } else { - complementaryItf = - _this_weaveableC.getFcInterface(clientItfName); - } - ComponentInterface itf = (ComponentInterface)complementaryItf; - if (itf.hasFcInterceptor()) { - Object newImpl = itf.getFcItfImpl(); - ((Interceptor)newImpl).setFcItfDelegate(null); - } else { - itf.setFcItfImpl(null); - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The weaveableCC field required by this mixin. This field is - * supposed to reference the {@link ContentController} interface of the - * component to which this controller object belongs. - */ - - public ContentController _this_weaveableCC; - - /** - * The {@link TypeBindingMixin#bindFc(InterfaceType,String,Object) bindFc} - * method overriden by this mixin. - */ - - public abstract void _super_bindFc ( - InterfaceType clientItfType, - String clientItfName, - Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * The {@link TypeBindingMixin#unbindFc(InterfaceType,String) unbindFc} - * method overriden by this mixin. - */ - - public abstract void _super_unbindFc ( - InterfaceType clientItfType, - String clientItfName) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/ContainerBindingControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/ContainerBindingControllerMixin.java deleted file mode 100644 index 625a95c39d6d5cf913b601d7f6276cc8450bb047..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/ContainerBindingControllerMixin.java +++ /dev/null @@ -1,157 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a container based implementation of the {@link BindingController} - * interface. This mixin implements the {@link BindingController} methods - * through delegation to the encapsulated "user component". - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class ContainerBindingControllerMixin - implements Controller, BindingController -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private ContainerBindingControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The "user component" encapsulated in this container component. - */ - - public Object fcContent; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - fcContent = ic.content; - Component owner = (Component)ic.getOptionalInterface("component"); - if (owner != null) { - try { - owner = (Component)owner.getFcInterface("component"); - if (fcContent == this) { - // case of merge...AndContent options - if (this instanceof ContentBindingController) { - ((ContentBindingController)this).bindFcContent("component", owner); - } - } else if (fcContent instanceof BindingController) { - ((BindingController)fcContent).bindFc("component", owner); - } - } catch (Exception ignored) { - } - } - _super_initFcController(ic); - } - - public String[] listFc () { - if (fcContent == this) { - // case of merge...AndContent options - if (this instanceof ContentBindingController) { - return ((ContentBindingController)this).listFcContent(); - } - } else if (fcContent instanceof BindingController) { - return ((BindingController)fcContent).listFc(); - } - return new String[0]; - } - - public Object lookupFc (final String clientItfName) - throws NoSuchInterfaceException - { - if (fcContent == this) { - // case of merge...AndContent options - ContentBindingController cbc = (ContentBindingController)this; - return cbc.lookupFcContent(clientItfName); - } else { - BindingController bc = (BindingController)fcContent; - return bc.lookupFc(clientItfName); - } - } - - public void bindFc (final String clientItfName, final Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - if (fcContent == this) { - // case of merge...AndContent options - ((ContentBindingController)this).bindFcContent(clientItfName, serverItf); - } else { - ((BindingController)fcContent).bindFc(clientItfName, serverItf); - } - } - - public void unbindFc (final String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - if (fcContent == this) { - // case of merge...AndContent options - ((ContentBindingController)this).unbindFcContent(clientItfName); - } else { - ((BindingController)fcContent).unbindFc(clientItfName); - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/ContentBindingController.java b/julia/src/org/objectweb/fractal/julia/control/binding/ContentBindingController.java deleted file mode 100644 index 2e0755e2539a98cf9213d64ab3489827ba13eac3..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/ContentBindingController.java +++ /dev/null @@ -1,83 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -/** - * A component interface to control the bindings of the content of container - * components. This interface is useful when a container and its encapsulated - * "user" component are merged into a single class. Indeed, in this case, the - * container class is generated as a sub class of the user component class, and - * may therefore override the binding management methods that may be provided by - * the user component (because both classes may implement the same {@link - * org.objectweb.fractal.api.control.BindingController} interface). In order to - * still be able to call the user component binding management methods from - * outside the component, four new methods are generated in the container class, - * that just calls the corresponding methods in the user component class (i.e., - * in the super class) with the super keyword. - */ - -public interface ContentBindingController { - - /** - * Calls the {@link - * org.objectweb.fractal.api.control.BindingController#listFc listFc} - * method on the component encapsulated in this container. - */ - - String[] listFcContent (); - - /** - * Calls the {@link - * org.objectweb.fractal.api.control.BindingController#lookupFc lookupFc} - * method on the component encapsulated in this container. - */ - - Object lookupFcContent (String clientItfName) throws NoSuchInterfaceException; - - /** - * Calls the {@link - * org.objectweb.fractal.api.control.BindingController#bindFc bindFc} method - * on the component encapsulated in this container. - */ - - void bindFcContent (String clientItfName, Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * Calls the {@link - * org.objectweb.fractal.api.control.BindingController#unbindFc unbindFc} - * method on the component encapsulated in this container. - */ - - void unbindFcContent (String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/ContentBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/ContentBindingMixin.java deleted file mode 100644 index 3999838073818c59b005523c2c6c6d9bc514a4bf..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/ContentBindingMixin.java +++ /dev/null @@ -1,217 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.api.type.InterfaceType; - -/** - * Provides component hierarchy related checks to a {@link BindingController}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} and {@link SuperController} interfaces.
  • - *
  • the type of the component to which this controller object belongs must be - * an instance of {@link org.objectweb.fractal.api.type.ComponentType}.
  • - *
  • in order to be able to check bindings, this mixin needs the components to - * which this component is bound to provide interface introspection, and to - * provide the {@link SuperController} interface: if this component is bound to - * a component that does not satisfy these requirements, the binding will not be - * checked (and no error will be thrown).
  • - *
- */ - -public abstract class ContentBindingMixin implements BindingController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private ContentBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Calls the {@link #checkFcLocalBinding checkFcLocalBinding} method and then - * calls the overriden method. - */ - - public void bindFc ( - final InterfaceType clientItfType, - final String clientItfName, - final Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - checkFcLocalBinding(clientItfType, clientItfName, serverItf); - _super_bindFc(clientItfType, clientItfName, serverItf); - } - - /** - * Checks that the given binding is a local binding. - * - * @param clientItfType the type of the clientItfName interface. - * @param clientItfName the name of a client interface. - * @param serverItf a server interface. - * @throws IllegalBindingException if the given binding is not a local - * binding. - */ - - public void checkFcLocalBinding ( - final InterfaceType clientItfType, - final String clientItfName, - final Object serverItf) throws IllegalBindingException - { - Interface sItf; - Component sComp; - try { - sItf = (Interface)serverItf; - sComp = sItf.getFcItfOwner(); - } catch (ClassCastException e) { - // if the server interface does not provide interface introspection - // functions, the checks below cannot be performed - return; - } - - Component[] cParents = _this_weaveableSC.getFcSuperComponents(); - - String msg; - if (!clientItfType.isFcClientItf()) { - // internal client interface - ContentController cc; - try { - cc = (ContentController)_this_weaveableC. - getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - return; - } - // yes, check export binding: - // server component must be a sub component of client component... - Component[] cSubComps = cc.getFcSubComponents(); - for (int i = 0; i < cSubComps.length; ++i) { - if (cSubComps[i].equals(sComp)) { - return; - } - } - // ...or equal to client component - Component thisComp; - try { - thisComp = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalBindingException( - e, _this_weaveableC, - sItf.getFcItfOwner(), - clientItfName, - sItf.getFcItfName(), - "Cannot get the Component interface of the client component"); - } - if (sComp.equals(thisComp) && sItf.isFcInternalItf()) { - return; - } - msg = "Invalid export binding"; - } else if (sItf.isFcInternalItf()) { - // checks that the server component is a parent of the client component - for (int i = 0; i < cParents.length; ++i) { - if (sComp.equals(cParents[i])) { - return; - } - } - msg = "Invalid import binding"; - } else { - SuperController sCompSC; - try { - sCompSC = (SuperController)sComp.getFcInterface("super-controller"); - } catch (NoSuchInterfaceException e) { - // if the server component does not have a SuperController interface, - // the checks below cannot be performed - return; - } - Component[] sParents = sCompSC.getFcSuperComponents(); - // checks that the client and server components have a common parent - for (int i = 0; i < cParents.length; ++i) { - for (int j = 0; j < sParents.length; ++j) { - if (cParents[i].equals(sParents[j])) { - return; - } - } - } - msg = "Not a local binding"; - } - throw new ChainedIllegalBindingException( - null, - _this_weaveableC, - sItf.getFcItfOwner(), - clientItfName, - sItf.getFcItfName(), - msg); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The weaveableSC field required by this mixin. This field is - * supposed to reference the {@link SuperController} interface of the - * component to which this controller object belongs. - */ - - public SuperController _this_weaveableSC; - - /** - * The {@link TypeBindingMixin#bindFc(InterfaceType,String,Object) bindFc} - * method overriden by this mixin. - */ - - public abstract void _super_bindFc ( - InterfaceType clientItfType, - String clientItfName, - Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/InterceptorBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/InterceptorBindingMixin.java deleted file mode 100644 index e82be34b5dd63ca25d3b171ff0d1da271dc5dba7..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/InterceptorBindingMixin.java +++ /dev/null @@ -1,165 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -import org.objectweb.fractal.julia.ComponentInterface; -import org.objectweb.fractal.julia.Interceptor; - -/** - * Provides output interceptors management to a {@link BindingController}. This - * mixin is only useful for the {@link ContainerBindingControllerMixin}, since - * the {@link CompositeBindingMixin} and the {@link OptimizedCompositeBindingMixin} - * already manage interceptors. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} interface. Moreover this mixin does nothing if the - * component does not provide interface introspection functions.
  • - *
- */ - -public abstract class InterceptorBindingMixin implements BindingController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private InterceptorBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Calls the overriden method and returns the corresponding {@link - * Interceptor#getFcItfDelegate getFcItfDelegate} (if the result is an {@link - * Interceptor}). - */ - - public Object lookupFc (final String clientItfName) - throws NoSuchInterfaceException - { - Object o = _super_lookupFc(clientItfName); - if (o instanceof Interceptor) { - // skips the output interceptor, if there is one - o = ((Interceptor)o).getFcItfDelegate(); - } - return o; - } - - /** - * Gets the interceptor of the given client interface, updates its {@link - * Interceptor#getFcItfDelegate getFcItfDelegate}, and then calls the - * overriden method with the interceptor as server interface (if there is - * an interceptor for the client interface). - */ - - public void bindFc (final String clientItfName, final Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - Object o = _this_weaveableC.getFcInterface(clientItfName); - if (o instanceof ComponentInterface) { - o = ((ComponentInterface)o).getFcItfImpl(); - if (o instanceof Interceptor) { - ((Interceptor)o).setFcItfDelegate(serverItf); - } else { - o = serverItf; - } - } else { - o = serverItf; - } - _super_bindFc(clientItfName, o); - } - - /** - * Gets the interceptor of the given client interface, updates its {@link - * Interceptor#getFcItfDelegate getFcItfDelegate}, and then calls the - * overriden method (if there is an interceptor for the client interface). - */ - - public void unbindFc (final String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - Object o = _this_weaveableC.getFcInterface(clientItfName); - if (o instanceof ComponentInterface) { - o = ((ComponentInterface)o).getFcItfImpl(); - if (o instanceof Interceptor) { - ((Interceptor)o).setFcItfDelegate(null); - } - } - _super_unbindFc(clientItfName); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The {@link BindingController#lookupFc lookupFc} method overriden by this - * mixin. - */ - - public abstract Object _super_lookupFc (String clientItfName) throws - NoSuchInterfaceException; - - /** - * The {@link BindingController#bindFc bindFc} method overriden by this mixin. - */ - - public abstract void _super_bindFc (String clientItfName, Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * The {@link BindingController#unbindFc unbindFc} method overriden by this - * mixin. - */ - - public abstract void _super_unbindFc (String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/LifeCycleBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/LifeCycleBindingMixin.java deleted file mode 100644 index 393a10d3fe70ac4085b61590773a7015bd695899..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/LifeCycleBindingMixin.java +++ /dev/null @@ -1,107 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.LifeCycleController; - -import org.objectweb.fractal.julia.control.lifecycle.ChainedIllegalLifeCycleException; - -/** - * Provides life cycle related checks to a {@link BindingController}. - *
- *
- * Requirements - *
    - *
  • none (the component may provide a {@link LifeCycleController} interface, - * but this is not mandatory - in this case this binding does nothing).
  • - *
- */ - -public abstract class LifeCycleBindingMixin implements BindingController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private LifeCycleBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks that the component is stopped and then calls the overriden method. - */ - - public void unbindFc (final String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - if (_this_weaveableOptLC != null) { - String state = _this_weaveableOptLC.getFcState(); - if (!LifeCycleController.STOPPED.equals(state)) { - throw new ChainedIllegalLifeCycleException( - null, _this_weaveableOptC, "The component is not stopped"); - } - } - _super_unbindFc(clientItfName); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableOptC; - - /** - * The weaveableOptLC field required by this mixin. This field is - * supposed to reference the {@link LifeCycleController} interface of the - * component to which this controller object belongs. - */ - - public LifeCycleController _this_weaveableOptLC; - - /** - * The {@link BindingController#unbindFc unbindFc} method overriden by this - * mixin. - */ - - public abstract void _super_unbindFc (String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/OptimizedCompositeBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/OptimizedCompositeBindingMixin.java deleted file mode 100644 index 2f75ff8f69590a1d8ccb422a447c67a2c8cc4104..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/OptimizedCompositeBindingMixin.java +++ /dev/null @@ -1,389 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.ComponentInterface; -import org.objectweb.fractal.julia.Interceptor; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.ArrayList; - -/** - * Provides optimized {@link ComponentInterface} management to a {@link - * BindingController}. This mixin uses shortcut links between component - * interfaces where possible, i.e. when some interfaces do not have associated - * interceptors. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} and {@link ContentController} interfaces.
  • - *
  • TODO.
  • - *
- */ - -public abstract class OptimizedCompositeBindingMixin - implements BindingController -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private OptimizedCompositeBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Sets the shortcuts for the given binding and then calls the overriden - * method. - */ - - public void bindFc ( - final InterfaceType clientItfType, - final String clientItfName, - final Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - _super_bindFc(clientItfType, clientItfName, serverItf); - setFcShortcuts(clientItfType, clientItfName, serverItf); - } - - /** - * Updates the shortcuts for the given binding and then calls the overriden - * method. - */ - - public void unbindFc ( - final InterfaceType clientItfType, - final String clientItfName) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - _super_unbindFc(clientItfType, clientItfName); - setFcShortcuts(clientItfType, clientItfName, null); - } - - // ------------------------------------------------------------------------- - // Utility methods: algorithm to compute of shortcut links - // ------------------------------------------------------------------------- - - /** - * Creates the given binding and updates the shortcuts links accordingly. - * - * @param clientItfName a client interface name. - * @param serverItf the server interface to which the client interface must - * be bound, or null if it must be unbound. - * @throws IllegalBindingException if a problem occurs. - */ - - public void setFcShortcuts ( - final InterfaceType clientItfType, - final String clientItfName, - final Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException - { - Interface clientItf; - if (clientItfType.isFcClientItf()) { - clientItf = - (Interface)_this_weaveableC.getFcInterface(clientItfName); - } else { - clientItf = - (Interface)_this_weaveableCC.getFcInternalInterface(clientItfName); - } - - Set visited = new HashSet(); - List shortcutItfs = new ArrayList(); - List shortcutImpls = new ArrayList(); - - // 'forward' step - Object itf = serverItf; - while (true) { - ComponentInterface citf; - if (itf instanceof ComponentInterface) { - citf = (ComponentInterface)itf; - } else { - break; - } - if (citf.getFcItfImpl() instanceof Interceptor) { - break; - } - try { - Component owner = citf.getFcItfOwner(); - owner.getFcInterface("content-controller"); - BindingController bc = - (BindingController)owner.getFcInterface("binding-controller"); - itf = bc.lookupFc(citf.getFcItfName()); - } catch (NoSuchInterfaceException e) { - break; - } - } - Object impl; - if (itf == null) { - impl = null; - } else { - if (itf instanceof ComponentInterface) { - impl = ((ComponentInterface)itf).getFcItfImpl(); - } else { - // cannot create complete shortcut: uses itf as 'impl' - impl = itf; - } - } - - // 'backward' step : creates the shortcuts - try { - setFcClientShortcuts(clientItf, impl, visited, shortcutItfs, shortcutImpls); - } catch (Exception e) { - Interface sItf; - sItf = serverItf instanceof Interface ? (Interface)serverItf : null; - throw new ChainedIllegalBindingException( - e, - clientItf.getFcItfOwner(), - sItf == null ? null : sItf.getFcItfOwner(), - clientItf.getFcItfName(), - sItf == null ? null : sItf.getFcItfName(), - "Cannot create shortcut links"); - } - - // sets the shortcuts - for (int i = 0; i < shortcutItfs.size(); ++i) { - Interface shortcutItf = (Interface)shortcutItfs.get(i); - Object shortcutImpl = shortcutImpls.get(i); - Component c = shortcutItf.getFcItfOwner(); - ContentController cc; - try { - cc = (ContentController)c.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - cc = null; - } - - if (cc != null) { - ComponentInterface cShortcutItf = (ComponentInterface)shortcutItf; - if (cShortcutItf.hasFcInterceptor()) { - Object newImpl = cShortcutItf.getFcItfImpl(); - ((Interceptor)newImpl).setFcItfDelegate(shortcutImpl); - } else { - cShortcutItf.setFcItfImpl(shortcutImpl); - } - } else { - BindingController bc; - try { - bc = (BindingController)c.getFcInterface("binding-controller"); - } catch (NoSuchInterfaceException e) { - continue; - } - try { - String itfName = shortcutItf.getFcItfName(); - Object o = bc.lookupFc(itfName); - // following code not needed if refresh done in lookup - if (o != null) { - bc.unbindFc(itfName); - bc.bindFc(itfName, o); - } - } catch (Exception e) { - Interface sItf; - sItf = serverItf instanceof Interface ? (Interface)serverItf : null; - throw new ChainedIllegalBindingException( - e, - clientItf.getFcItfOwner(), - sItf == null ? null : sItf.getFcItfOwner(), - clientItf.getFcItfName(), - sItf == null ? null : sItf.getFcItfName(), - "Cannot create shortcut links"); - } - } - } - } - - /** - * Finds the shortcut links to be updated by following the bindings backwards - * from the given client interface. - * - * @param clientItf the client interface from which the bindings must be - * followed backward. - * @param impl the object to be used to update the shortcut links with {@link - * ComponentInterface#getFcItfImpl getFcItfImpl}. - * @param visited the already visited interfaces. - * @param shortcutItfs TODO. - * @param shortcutImpls TODO. - * @throws Exception if a problem occurs. - */ - - public void setFcClientShortcuts ( - final Interface clientItf, - final Object impl, - final Set visited, - final List shortcutItfs, - final List shortcutImpls) throws Exception - { - Component clientComp = clientItf.getFcItfOwner(); - ContentController cc; - try { - cc = (ContentController)clientComp.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - cc = null; - } - - if (cc != null) { - ComponentInterface itf; - try { - String name = clientItf.getFcItfName(); - if (clientItf.isFcInternalItf()) { - // clientItf is an internal client interface: continue to follow the - // bindings backwards from the corresponding external server interface - itf = (ComponentInterface)clientComp.getFcInterface(name); - } else { - // clientItf is an external client interface: continue to follow the - // bindings backwards from the corresponding internal server interface - itf = (ComponentInterface)cc.getFcInternalInterface(name); - } - } catch (NoSuchInterfaceException e) { - throw new Exception("Cannot create shortcut links"); - } catch (ClassCastException e) { - throw new Exception("Cannot create shortcut links"); - } - - if (!visited.contains(itf)) { - visited.add(itf); - shortcutItfs.add(itf); - shortcutImpls.add(impl); - if (itf.hasFcInterceptor()) { - Object newImpl = itf.getFcItfImpl(); - setFcServerShortcuts(itf, newImpl, visited, shortcutItfs, shortcutImpls); - } else { - setFcServerShortcuts(itf, impl, visited, shortcutItfs, shortcutImpls); - } - } - } else if (!visited.contains(clientItf)) { - visited.add(clientItf); - shortcutItfs.add(clientItf); - shortcutImpls.add(impl); - } - } - - /** - * Finds the shortcut links to be updated by followng the bindings backwards - * from the given server interface. - * - * @param serverItf the server interface from which the bindings must be - * followed backward. - * @param impl the object to be used to update the shortcut links with {@link - * ComponentInterface#getFcItfImpl getFcItfImpl}. - * @param visited the already visited interfaces. - * @param shortcutItfs TODO. - * @param shortcutImpls TODO. - * @throws Exception if a problem occurs. - */ - - public void setFcServerShortcuts ( - final Interface serverItf, - final Object impl, - final Set visited, - final List shortcutItfs, - final List shortcutImpls) throws Exception - { - Object[] comps = Util.getFcPotentialClientsOf(serverItf).toArray(); - for (int i = 0; i < comps.length; ++i) { - Component comp = (Component)comps[i]; - List clientItfs = Util.getFcClientItfsBoundTo(comp, serverItf); - for (int j = 0; j < clientItfs.size(); ++j) { - setFcClientShortcuts( - (Interface)clientItfs.get(j), - impl, - visited, - shortcutItfs, - shortcutImpls); - } - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The weaveableCC field required by this mixin. This field is - * supposed to reference the {@link ContentController} interface of the - * component to which this controller object belongs. - */ - - public ContentController _this_weaveableCC; - - /** - * The {@link TypeBindingMixin#bindFc(InterfaceType,String,Object) bindFc} - * method overriden by this mixin. - */ - - public abstract void _super_bindFc ( - InterfaceType clientItfType, - String clientItfName, - Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * The {@link TypeBindingMixin#unbindFc(InterfaceType,String) unbindFc} - * method overriden by this mixin. - */ - - public abstract void _super_unbindFc ( - InterfaceType clientItfType, - String clientItfName) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/OptimizedContainerBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/OptimizedContainerBindingMixin.java deleted file mode 100644 index 170437cf97c362b9b5dbd7053f45a5f24ed47f91..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/OptimizedContainerBindingMixin.java +++ /dev/null @@ -1,174 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.NoSuchInterfaceException; - -import org.objectweb.fractal.julia.ComponentInterface; - -import java.util.Map; -import java.util.HashMap; - -/** - * TODO. - *
- *
- * Requirements - *
    - *
  • TODO.
  • - *
- */ - -public abstract class OptimizedContainerBindingMixin - implements BindingController -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private OptimizedContainerBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * TODO. - */ - - public Map fcBindings; - - public String[] listFc () { - Map fcBindings = getFcBindings(); - return (String[])fcBindings.keySet().toArray(new String[fcBindings.size()]); - } - - /** - * TODO. - */ - - public Object lookupFc (final String clientItfName) - throws NoSuchInterfaceException - { - Map fcBindings = getFcBindings(); - Object result = fcBindings.get(clientItfName); - if (result == fcBindings) { - result = null; - } - return result; - } - - /** - * TODO. - */ - - public void bindFc (final String clientItfName, final Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - Object o = serverItf; - if (o instanceof ComponentInterface) { - o = ((ComponentInterface)o).getFcItfImpl(); - } - if (o != null) { - _super_bindFc(clientItfName, o); - } - Map fcBindings = getFcBindings(); - fcBindings.put(clientItfName, serverItf); - } - - /** - * TODO. - */ - - public void unbindFc (final String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - _super_unbindFc(clientItfName); - if (fcBindings != null) { - fcBindings.put(clientItfName, fcBindings); - } - } - - /** - * TODO. - */ - - private Map getFcBindings () { - if (fcBindings == null) { - fcBindings = new HashMap(); - String[] names = _super_listFc(); - for (int i = 0; i < names.length; ++i) { - fcBindings.put(names[i], fcBindings); - } - } - return fcBindings; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link BindingController#listFc listFc} method overriden by this - * mixin. - */ - - public abstract String[] _super_listFc (); - - /** - * The {@link BindingController#lookupFc lookupFc} method overriden by this - * mixin. - */ - - public abstract Object _super_lookupFc (String clientItfName) throws - NoSuchInterfaceException; - - /** - * The {@link BindingController#bindFc bindFc} method overriden by this mixin. - */ - - public abstract void _super_bindFc (String clientItfName, Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * The {@link BindingController#unbindFc unbindFc} method overriden by this - * mixin. - */ - - public abstract void _super_unbindFc (String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/TypeBasicBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/TypeBasicBindingMixin.java deleted file mode 100644 index 83f907add4a8f92c3d12c34608f3c41fa99c9eb8..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/TypeBasicBindingMixin.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -import java.util.HashMap; -import java.util.Map; - -/** - * Provides a basic type system based initializer to a {@link - * org.objectweb.fractal.api.control.BindingController}. - *
- *
- * Requirements - *
    - *
  • the type of the component to which this controller object belongs must be - * an instance of {@link ComponentType}.
  • - *
- */ - -public abstract class TypeBasicBindingMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private TypeBasicBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Initializes the {@link #_this_fcBindings} map, and then calls the overriden - * method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - ComponentType compType = (ComponentType)ic.type; - InterfaceType[] itfTypes = compType.getFcInterfaceTypes(); - boolean isComposite = ic.getOptionalInterface("content-controller") != null; - - // initializes the fcBindings map with empty bindings for all the - // interfaces in the component's type - for (int j = 0; j < itfTypes.length; j++) { - InterfaceType itfType = itfTypes[j]; - if (!itfType.isFcCollectionItf() && - !itfType.getFcItfName().equals("component") && - !itfType.getFcItfName().endsWith("-controller") && - (itfType.isFcClientItf() || isComposite)) - { - if (_this_fcBindings == null) { - _this_fcBindings = new HashMap(); - } - _this_fcBindings.put(itfType.getFcItfName(), _this_fcBindings); - } - } - - // calls the overriden method - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The fcBindings field required by this mixin. This field is - * supposed to store the bindings of the component to which this controller - * object belongs. - */ - - public Map _this_fcBindings; - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/TypeBindingMixin.java b/julia/src/org/objectweb/fractal/julia/control/binding/TypeBindingMixin.java deleted file mode 100644 index aa37426035257dff1f3baf7a17a709c206178618..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/TypeBindingMixin.java +++ /dev/null @@ -1,338 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.ChainedNoSuchInterfaceException; - -/** - * Provides basic type system related checks to a {@link BindingController}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} interface.
  • - *
  • the type of the component to which this controller object belongs must be - * an instance of {@link ComponentType}.
  • - *
- */ - -public abstract class TypeBindingMixin implements BindingController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private TypeBindingMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks the interface name with the component's type and then calls the - * {@link #lookupFc(InterfaceType,String) lookupFc} method. - */ - - public Object lookupFc (final String clientItfName) - throws NoSuchInterfaceException - { - ComponentType compType = (ComponentType)_this_weaveableC.getFcType(); - InterfaceType clientItfType; - try { - clientItfType = compType.getFcInterfaceType(clientItfName); - } catch (NoSuchInterfaceException e) { - throw new ChainedNoSuchInterfaceException( - null, _this_weaveableC, clientItfName); - } - checkFcClientInterface(clientItfType); - return lookupFc(clientItfType, clientItfName); - } - - /** - * Checks the interface name with the component's type and then calls the - * {@link #bindFc(InterfaceType,String,Object) bindFc} method. If the server - * interface implements {@link Interface}, and if its type is an instance of - * {@link InterfaceType}, this method also checks the compatibility between - * the client and server interface types. - */ - - public void bindFc (final String clientItfName, final Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - ComponentType compType = (ComponentType)_this_weaveableC.getFcType(); - InterfaceType cItfType; - try { - cItfType = compType.getFcInterfaceType(clientItfName); - } catch (NoSuchInterfaceException e) { - throw new ChainedNoSuchInterfaceException( - null, _this_weaveableC, clientItfName); - } - checkFcClientInterface(cItfType); - - ContentController cc; - try { - cc = (ContentController)_this_weaveableC. - getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - cc = null; - } - - // for lazy creation of collection interfaces - if (cItfType.isFcClientItf()) { - _this_weaveableC.getFcInterface(clientItfName); - } else { - cc.getFcInternalInterface(clientItfName); - } - - Interface sItf; - InterfaceType sItfType; - try { - sItf = (Interface)serverItf; - sItfType = (InterfaceType)sItf.getFcItfType(); - } catch (ClassCastException e) { - // if the server interface does not provide interface introspection - // functions, or if its type is not an InterfaceType, the checks below - // cannot be performed, so we create the binding directly: - bindFc(cItfType, clientItfName, serverItf); - return; - } - - if (sItfType.isFcClientItf()) { - throw new ChainedIllegalBindingException( - null, - _this_weaveableC, - sItf.getFcItfOwner(), - clientItfName, - sItf.getFcItfName(), - "Cannot bind two client interfaces together"); - } - - try { - Class s = Class.forName(sItfType.getFcItfSignature()); - Class c = Class.forName(cItfType.getFcItfSignature()); - if (!c.isAssignableFrom(s)) { - throw new ChainedIllegalBindingException( - null, - _this_weaveableC, - sItf.getFcItfOwner(), - clientItfName, - sItf.getFcItfName(), - "The server interface type is not a subtype " + - "of the client interface type"); - } - } catch (ClassNotFoundException ignored) { - } - - if (!cItfType.isFcOptionalItf() && sItfType.isFcOptionalItf()) { - throw new ChainedIllegalBindingException( - null, - _this_weaveableC, - ((Interface)serverItf).getFcItfOwner(), - clientItfName, - ((Interface)serverItf).getFcItfName(), - "A mandatory interface cannot be bound to an optional interface"); - } - - bindFc(cItfType, clientItfName, sItf); - } - - /** - * Checks the interface name with the component's type and then calls the - * {@link #unbindFc(InterfaceType,String) unbindFc} method. - */ - - public void unbindFc (final String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - ComponentType compType = (ComponentType)_this_weaveableC.getFcType(); - InterfaceType clientItfType; - try { - clientItfType = compType.getFcInterfaceType(clientItfName); - } catch (NoSuchInterfaceException e) { - throw new ChainedNoSuchInterfaceException( - null, _this_weaveableC, clientItfName); - } - checkFcClientInterface(clientItfType); - unbindFc(clientItfType, clientItfName); - } - - /** - * Returns the interface to which the given client interface is bound. More - * precisely, returns the server interface to which the client interface whose - * name is given is bound. - * - * @param clientItfType the type of the clientItfName interface. - * @param clientItfName the name of a client interface of the component to - * which this interface belongs. - * @return the server interface to which the given interface is bound, or - * null if it is not bound. - * @throws NoSuchInterfaceException if the component to which this interface - * belongs does not have a client interface whose name is equal to the - * given name. - */ - - public Object lookupFc ( - final InterfaceType clientItfType, - final String clientItfName) - throws - NoSuchInterfaceException - { - return _super_lookupFc(clientItfName); - } - - /** - * Binds the client interface whose name is given to a server interface. More - * precisely, binds the client interface of the component to which this - * interface belongs, and whose name is equal to the given name, to the given - * server interface. - * - * @param clientItfType the type of the clientItfName interface. - * @param clientItfName the name of a client interface of the component to - * which this interface belongs. - * @param serverItf a server interface. - * @throws NoSuchInterfaceException if there is no such client interface. - * @throws IllegalBindingException if the binding cannot be created. - * @throws IllegalLifeCycleException if this component has a {@link - * org.objectweb.fractal.api.control.LifeCycleController} interface, but - * it is not in an appropriate state to perform this operation. - */ - - public void bindFc ( - final InterfaceType clientItfType, - final String clientItfName, - final Object serverItf) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - _super_bindFc(clientItfName, serverItf); - } - - /** - * Unbinds the given client interface. More precisely, unbinds the client - * interface of the component to which this interface belongs, and whose name - * is equal to the given name. - * - * @param clientItfType the type of the clientItfName interface. - * @param clientItfName the name of a client interface of the component to - * which this interface belongs. - * @throws NoSuchInterfaceException if there is no such client interface. - * @throws IllegalBindingException if the binding cannot be removed. - * @throws IllegalLifeCycleException if this component has a {@link - * org.objectweb.fractal.api.control.LifeCycleController} interface, but - * it is not in an appropriate state to perform this operation. - */ - - public void unbindFc ( - final InterfaceType clientItfType, - final String clientItfName) - throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException - { - _super_unbindFc(clientItfName); - } - - /** - * TODO. - * - * @param itfType - */ - - private void checkFcClientInterface (InterfaceType itfType) - throws NoSuchInterfaceException - { - try { - _this_weaveableC.getFcInterface("content-controller"); - String name = itfType.getFcItfName(); - if (!name.equals("component") && !name.endsWith("-controller")) { - return; - } - } catch (NoSuchInterfaceException e) { - if (itfType.isFcClientItf()) { - return; - } - } - throw new ChainedNoSuchInterfaceException( - null, _this_weaveableC, itfType.getFcItfName()); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The {@link BindingController#lookupFc lookupFc} method overriden by this - * mixin. - */ - - public abstract Object _super_lookupFc (String clientItfName) throws - NoSuchInterfaceException; - - /** - * The {@link BindingController#bindFc bindFc} method overriden by this - * mixin. - */ - - public abstract void _super_bindFc (String clientItfName, Object serverItf) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; - - /** - * The {@link BindingController#unbindFc unbindFc} method overriden by this - * mixin. - */ - - public abstract void _super_unbindFc (String clientItfName) throws - NoSuchInterfaceException, - IllegalBindingException, - IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/Util.java b/julia/src/org/objectweb/fractal/julia/control/binding/Util.java deleted file mode 100644 index 55141653460053cfe57404bedfb07bbdd68d3352..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/Util.java +++ /dev/null @@ -1,211 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.api.type.InterfaceType; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * Provides static utility methods related to {@link BindingController}. - */ - -public class Util { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private Util () { - } - - // ------------------------------------------------------------------------- - // Static methods - // ------------------------------------------------------------------------- - - /** - * TODO. - * - * @param serverItf TODO. - * @return TODO. - * @throws Exception - */ - - public static Set getFcClientItfsBoundTo (final Interface serverItf) - throws Exception - { - Set result = new HashSet(); - Object[] comps = getFcPotentialClientsOf(serverItf).toArray(); - for (int i = 0; i < comps.length; ++i) { - Component comp = (Component)comps[i]; - List clientItfs = getFcClientItfsBoundTo(comp, serverItf); - for (int j = 0; j < clientItfs.size(); ++j) { - result.add(clientItfs.get(j)); - } - } - return result; - } - - /** - * Returns the potential client components of the given server interface. - * - * @param serverItf a server interface. - * @return the potential client components of the given server interface. - * @throws Exception if a problem occurs. - */ - - public static Set getFcPotentialClientsOf (final Interface serverItf) - throws Exception - { - Set compSet = new HashSet(); - Component serverComp = serverItf.getFcItfOwner(); - if (serverItf.isFcInternalItf()) { - ContentController cc; - try { - cc = (ContentController)serverComp.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - throw new Exception("Cannot create shortcuts"); - } - Component[] comps = cc.getFcSubComponents(); - for (int i = 0; i < comps.length; ++i) { - compSet.add(comps[i]); - } - compSet.add(serverComp); - } else { - SuperController sc; - try { - sc = (SuperController)serverComp.getFcInterface("super-controller"); - } catch (NoSuchInterfaceException e) { - throw new Exception("Cannot create shortcuts"); - } - Component[] superComps = sc.getFcSuperComponents(); - for (int i = 0; i < superComps.length; ++i) { - compSet.add(superComps[i]); - ContentController cc; - try { - cc = (ContentController)superComps[i]. - getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - throw new Exception("Cannot create shortcuts"); - } - Component[] subComps = cc.getFcSubComponents(); - for (int j = 0; j < subComps.length; ++j) { - compSet.add(subComps[j]); - } - } - } - return compSet; - } - - /** - * Returns the client interfaces of the given component that are bound to - * the given server interface. - * - * @param component a component. - * @param serverItf a server interface. - * @return the client interfaces of component that are bound to - * serverItf. - * @throws Exception if a problem occurs. - */ - - public static List getFcClientItfsBoundTo ( - final Component component, - final Interface serverItf) throws Exception - { - List itfList = new ArrayList(); - BindingController bc; - try { - bc = (BindingController)component.getFcInterface("binding-controller"); - } catch (NoSuchInterfaceException e) { - return itfList; - } - - // search in external client interfaces - Object[] itfs = component.getFcInterfaces(); - for (int i = 0; i < itfs.length; ++i) { - Interface itf; - InterfaceType itfType; - try { - itf = (Interface)itfs[i]; - itfType = (InterfaceType)itf.getFcItfType(); - } catch (ClassCastException e) { - throw new Exception("Cannot create shortcuts"); - } - if (!itfType.isFcClientItf()) { - continue; - } - Object sItf; - try { - sItf = bc.lookupFc(itf.getFcItfName()); - } catch (NoSuchInterfaceException e) { - continue; - } - if (serverItf.equals(sItf)) { - itfList.add(itf); - } - } - - ContentController cc; - try { - cc = (ContentController)component.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - return itfList; - } - - // search in internal client interfaces - itfs = cc.getFcInternalInterfaces(); - for (int i = 0; i < itfs.length; ++i) { - Interface itf; - InterfaceType itfType; - try { - itf = (Interface)itfs[i]; - itfType = (InterfaceType)itf.getFcItfType(); - } catch (ClassCastException e) { - throw new Exception("Cannot create shortcuts"); - } - if (!itfType.isFcClientItf()) { - continue; - } - Object sItf; - try { - sItf = bc.lookupFc(itf.getFcItfName()); - } catch (NoSuchInterfaceException e) { - continue; - } - if (serverItf.equals(sItf)) { - itfList.add(itf); - } - } - return itfList; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/control/binding/package.html b/julia/src/org/objectweb/fractal/julia/control/binding/package.html deleted file mode 100644 index d1fb9a3af1d8e8a9d9f7d187d7d15cf9c7ad14e9..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/binding/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides mixins to implement the {@link -org.objectweb.fractal.api.control.BindingController} interface. -@since Julia 1.0.6 - - diff --git a/julia/src/org/objectweb/fractal/julia/control/content/BasicContentControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/BasicContentControllerMixin.java deleted file mode 100644 index afa34a7c116c05e2e3c271cd4a9a0421dfa5daa4..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/BasicContentControllerMixin.java +++ /dev/null @@ -1,175 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.ChainedNoSuchInterfaceException; -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * Provides a basic implementation of the {@link ContentController} interface. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class BasicContentControllerMixin - implements Controller, ContentController -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicContentControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The internal interfaces of the component to which this controller object - * belongs. - */ - - public Map fcInternalInterfaces; - - /** - * The sub components of the component to which this controller object - * belongs. - */ - - public List fcSubComponents; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - fcInternalInterfaces = ic.internalInterfaces; - _super_initFcController(ic); - } - - public Object[] getFcInternalInterfaces () { - if (fcInternalInterfaces == null) { - return new Object[0]; - } - // returns the names of all the public interfaces in fcInternalInterfaces - // interfaces whose name begins with '/' are private - int size = 0; - String[] names = new String[fcInternalInterfaces.size()]; - names = (String[])fcInternalInterfaces.keySet().toArray(names); - for (int i = 0; i < names.length; ++i) { - if (names[i].charAt(0) != '/') { - ++size; - } - } - int index = 0; - Object[] itfs = new Object[size]; - for (int i = 0; i < names.length; ++i) { - if (names[i].charAt(0) != '/') { - itfs[index++] = fcInternalInterfaces.get(names[i]); - } - } - return itfs; - } - - public Object getFcInternalInterface (final String interfaceName) - throws NoSuchInterfaceException - { - Object itf; - if (fcInternalInterfaces == null) { - itf = null; - } else { - itf = fcInternalInterfaces.get(interfaceName); - } - if (itf == null) { - throw new ChainedNoSuchInterfaceException( - null, _this_weaveableOptC, interfaceName); - } - return itf; - } - - public Component[] getFcSubComponents () { - if (fcSubComponents == null) { - return new Component[0]; - } - return (Component[])fcSubComponents.toArray( - new Component[fcSubComponents.size()]); - } - - public void addFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - if (fcSubComponents == null) { - fcSubComponents = new ArrayList(); - } - fcSubComponents.add(subComponent); - } - - public void removeFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - if (fcSubComponents != null) { - fcSubComponents.remove(subComponent); - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableOptC; - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/BasicSuperControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/BasicSuperControllerMixin.java deleted file mode 100644 index 8e4befd9fc0ac7f189ac7fbcca825031be1b391f..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/BasicSuperControllerMixin.java +++ /dev/null @@ -1,93 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; - -/** - * Provides a basic implementation of the {@link SuperControllerNotifier} - * interface. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class BasicSuperControllerMixin - implements SuperControllerNotifier -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicSuperControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The parents of the component to which this controller object belongs. - */ - - public Component[] fcParents; - - public Component[] getFcSuperComponents () { - if (fcParents == null) { - return new Component[0]; - } else { - return fcParents; - } - } - - public void addedToFc (final Component parent) { - int length = fcParents == null ? 1 : fcParents.length + 1; - Component[] parents = new Component[length]; - if (fcParents != null) { - System.arraycopy(fcParents, 0, parents, 1, fcParents.length); - } - parents[0] = parent; - fcParents = parents; - } - - public void removedFromFc (final Component parent) { - int length = fcParents.length - 1; - if (length == 0) { - fcParents = null; - } else { - Component[] parents = new Component[length]; - int i = 0; - for (int j = 0; j < fcParents.length; ++j) { - if (!fcParents[j].equals(parent)) { - parents[i++] = fcParents[j]; - } - } - fcParents = parents; - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/BindingContentMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/BindingContentMixin.java deleted file mode 100644 index d012c97a6d3cdfd96bd20a7e4a9a566a4864363e..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/BindingContentMixin.java +++ /dev/null @@ -1,282 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.control.binding.ChainedIllegalBindingException; -import org.objectweb.fractal.julia.control.binding.Util; - -import java.util.List; - -/** - * Provides binding related checks to a {@link ContentController}. - *
- *
- * Requirements - *
    - *
  • the types of the sub components of this component must be instances of - * {@link org.objectweb.fractal.api.type.ComponentType}.
  • - *
  • the sub components of this component must support interface - * introspection, i.e. their interfaces must implement {@link Interface}.
  • - *
  • TODO requirements pour parents, pour composants clients et servers des sous composants
  • - *
- */ - -public abstract class BindingContentMixin implements ContentController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BindingContentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks that this operation will not create non local bindings, and then - * calls the overriden method. - */ - - public void removeFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - try { - checkFcRemoveSubComponent(subComponent); - } catch (IllegalBindingException e) { - throw new ChainedIllegalContentException( - e, - _this_weaveableOptC, - subComponent, - "Would create non local bindings"); - } - _super_removeFcSubComponent(subComponent); - } - - /** - * Checks that the removal of the given sub component will not create non - * local bindings. - * - * @param subComponent a sub component that will be removed from this - * component. - * @throws IllegalBindingException if the removal of the given sub component - * would create non local bindings. - */ - - public void checkFcRemoveSubComponent (final Component subComponent) - throws IllegalBindingException - { - Component parent; - try { - parent = (Component)_this_weaveableOptC.getFcInterface("component"); - if (parent == null) { - return; - } - } catch (NoSuchInterfaceException e) { - return; - } - BindingController bc; - try { - bc = (BindingController)subComponent.getFcInterface("binding-controller"); - } catch (NoSuchInterfaceException e) { - bc = null; - } - Object[] itfs = subComponent.getFcInterfaces(); - for (int i = 0; i < itfs.length; ++i) { - Interface itf; - InterfaceType itfType; - try { - itf = (Interface)itfs[i]; - itfType = (InterfaceType)itf.getFcItfType(); - } catch (ClassCastException e) { - continue; - } - if (itfType.isFcClientItf()) { - if (bc != null) { - Interface sItf; - try { - sItf = (Interface)bc.lookupFc(itf.getFcItfName()); - } catch (NoSuchInterfaceException e) { - continue; - } catch (ClassCastException e) { - continue; - } - if (sItf != null) { - checkFcLocalBinding(itf, parent, sItf, null); - } - } - } else { - Object[] potentialClients; - try { - potentialClients = Util.getFcPotentialClientsOf(itf).toArray(); - } catch (Exception e) { - continue; - } - for (int j = 0; j < potentialClients.length; ++j) { - Component c = (Component)potentialClients[j]; - List clientItfs; - try { - clientItfs = Util.getFcClientItfsBoundTo(c, itf); - } catch (Exception e) { - continue; - } - if (clientItfs.size() > 0) { - checkFcLocalBinding((Interface)clientItfs.get(0), null, itf, parent); - } - } - } - } - } - - /** - * Checks that a given binding is a local binding. - * - * @param cItf a client interface. - * @param cId the parent from which the client component has been removed, or - * null if the client component has not been removed from a - * parent component. - * @param sItf the server interface to which the client interface is bound. - * @param sId the parent from which the server component has been removed, or - * null if the server component has not been removed from a - * parent component. - * @throws IllegalBindingException if the given binding is not a local - * binding. - */ - - private void checkFcLocalBinding ( - final Interface cItf, - final Component cId, - final Interface sItf, - final Component sId) throws IllegalBindingException - { - Component client = cItf.getFcItfOwner(); - Component server = sItf.getFcItfOwner(); - if (client.equals(server)) { - return; - } - SuperController cSc = null; - SuperController sSc = null; - try { - cSc = (SuperController)client.getFcInterface("super-controller"); - } catch (NoSuchInterfaceException ignored) { - } - try { - sSc = (SuperController)server.getFcInterface("super-controller"); - } catch (NoSuchInterfaceException ignored) { - } - if (cItf.isFcInternalItf()) { - // check client component is a parent of server component - if (cSc != null) { - Component[] sP = sSc.getFcSuperComponents(); - for (int i = 0; i < sP.length; ++i) { - Component p = sP[i]; - if (sId == null || !p.equals(sId)) { - if (p.equals(client)) { - return; - } - } - } - } else { - return; - } - } else { - if (sItf.isFcInternalItf()) { - // check server component is a parent of client component - if (cSc != null) { - Component[] cP = cSc.getFcSuperComponents(); - for (int i = 0; i < cP.length; ++i) { - Component p = cP[i]; - if (cId == null || !p.equals(cId)) { - if (p.equals(server)) { - return; - } - } - } - } else { - return; - } - } else { - // check client and server components have a common parent - if (cSc != null && sSc != null) { - Component[] cP = cSc.getFcSuperComponents(); - Component[] sP = sSc.getFcSuperComponents(); - for (int i = 0; i < cP.length; ++i) { - Component p = cP[i]; - if (cId == null || !p.equals(cId)) { - for (int j = 0; j < sP.length; ++j) { - Component q = sP[j]; - if (sId == null || !q.equals(sId)) { - if (p.equals(q)) { - return; - } - } - } - } - } - } else { - return; - } - } - } - throw new ChainedIllegalBindingException( - null, - _this_weaveableOptC, - sId, - cItf.getFcItfName(), - sItf.getFcItfName(), - "Not a local binding"); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableOptC; - - /** - * The {@link ContentController#removeFcSubComponent removeFcSubComponent} - * method overriden by this mixin. - */ - - public abstract void _super_removeFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/ChainedIllegalContentException.java b/julia/src/org/objectweb/fractal/julia/control/content/ChainedIllegalContentException.java deleted file mode 100644 index f3e61895254b84adc2f53352d83ffd0f716a164f..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/ChainedIllegalContentException.java +++ /dev/null @@ -1,208 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.IllegalContentException; - -import org.objectweb.fractal.julia.Util; - -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.ObjectOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; - -/** - * A sub class of the {@link IllegalContentException} class. - */ - -public class ChainedIllegalContentException extends IllegalContentException { - - /** - * The exception that caused this exception. May be null. - */ - - private final Throwable exception; - - /** - * The component whose content is or would become illegal. - */ - - private transient Component component; - - /** - * The component that makes the content of {@link #getComponent - * getComponent} illegal. May be null. - */ - - private transient Component content; - - /** - * Constructs a new {@link ChainedIllegalContentException} exception. - * - * @param exception the cause of this exception. May be null. - * @param component the component whose content is or would become illegal. - * @param content the component that makes the content of component - * illegal. May be null. - * @param message a detailed error message. - */ - - public ChainedIllegalContentException ( - final Throwable exception, - final Component component, - final Component content, - final String message) - { - super(message); - this.exception = exception; - this.component = component; - this.content = content; - } - - /** - * Returns the exception that caused in this exception. - * - * @return the exception that caused this exception. May be null. - */ - - public Throwable getException () { - return exception; - } - - /** - * Returns the component whose content is or would become illegal. - * - * @return the component whose content is or would become illegal. - */ - - public Component getComponent () { - if (component != null && !(component instanceof Interface)) { - try { - return (Component)component.getFcInterface("component"); - } catch (NoSuchInterfaceException ignored) { - } - } - return component; - } - - /** - * Returns the component that makes the content of {@link #getComponent - * getComponent} illegal. More precisely, this method returns the component - * that would make the content of {@link #getComponent getComponent} illegal - * if it were added or removed from it. - * - * @return the component that makes the content of {@link #getComponent - * getComponent} illegal. May be null. - */ - - public Component getContent () { - if (content != null && !(content instanceof Interface)) { - try { - return (Component)content.getFcInterface("component"); - } catch (NoSuchInterfaceException ignored) { - } - } - return content; - } - - // ------------------------------------------------------------------------- - // Overriden Exception methods - // ------------------------------------------------------------------------- - - /** - * Returns a String representation of this exception. - * - * @return a String representation of this exception. - */ - - public String toString () { - StringBuffer buf = new StringBuffer(); - buf.append("IllegalContentException: "); - buf.append(getMessage()); - buf.append(" (super component = "); - Util.toString(getComponent(), buf); - if (getContent() != null) { - buf.append(", sub component = "); - Util.toString(getContent(), buf); - } - buf.append(')'); - return buf.toString(); - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - exception.printStackTrace(); - } - super.printStackTrace(); - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - private void writeObject (final ObjectOutputStream out) throws IOException { - out.defaultWriteObject(); - Component c = getComponent(); - out.writeObject(c instanceof Interface ? c : null); - c = getContent(); - out.writeObject(c instanceof Interface ? c : null); - } - - private void readObject (final ObjectInputStream in) - throws IOException, ClassNotFoundException - { - in.defaultReadObject(); - component = (Component)in.readObject(); - content = (Component)in.readObject(); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/CheckContentMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/CheckContentMixin.java deleted file mode 100644 index 2d7af4737afb15cff526adb81696bfee0ae71b55..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/CheckContentMixin.java +++ /dev/null @@ -1,173 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -import java.util.List; - -/** - * Provides basic checks to a {@link ContentController}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} interface.
  • - *
- */ - -public abstract class CheckContentMixin implements ContentController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private CheckContentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks that the given component is not already a sub component, and then - * calls the overriden method. This method also checks that the addition of - * this sub component will not create a cycle in the component hierarchy. - */ - - public void addFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - if (containsFcSubComponent(subComponent)) { - throw new ChainedIllegalContentException( - null, _this_weaveableC, subComponent, "Already a sub component"); - } - - // gets the Component interface of this component, - // and checks that it is not equal to 'subComponent' - Component thisComponent; - try { - thisComponent = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalContentException( - e, _this_weaveableC, subComponent, "Cannot check this operation"); - } - if (subComponent.equals(thisComponent)) { - throw new ChainedIllegalContentException( - null, - _this_weaveableC, - subComponent, - "A component cannot be a sub component of itself"); - } - - // finds all the direct and indirect sub components of 'subComponent' and, - // for each sub component checks that it is not equal to 'thisComponent' - List allSubComponents = Util.getAllSubComponents(subComponent); - for (int i = 0; i < allSubComponents.size(); ++i) { - if (allSubComponents.get(i).equals(thisComponent)) { - throw new ChainedIllegalContentException( - null, - _this_weaveableC, - subComponent, - "Would create a cycle in the component hierarchy"); - } - } - - // calls the overriden method - _super_addFcSubComponent(subComponent); - } - - /** - * Checks that the given component is really a sub component, and then - * calls the overriden method. - */ - - public void removeFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - if (!containsFcSubComponent(subComponent)) { - throw new ChainedIllegalContentException( - null, _this_weaveableC, subComponent, "Not a sub component"); - } - _super_removeFcSubComponent(subComponent); - } - - /** - * Tests if this component contains the given sub component. - * - * @param subComponent a component. - * @return true if this component contains the given sub component, - * or false otherwise. - */ - - public boolean containsFcSubComponent (final Component subComponent) { - Component[] subComponents = _this_getFcSubComponents(); - for (int i = 0; i < subComponents.length; ++i) { - if (subComponents[i].equals(subComponent)) { - return true; - } - } - return false; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The {@link ContentController#getFcSubComponents getFcSubComponents} method - * required by this mixin. - */ - - public abstract Component[] _this_getFcSubComponents (); - - /** - * The {@link ContentController#addFcSubComponent addFcSubComponent} method - * overriden by this mixin. - */ - - public abstract void _super_addFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; - - /** - * The {@link ContentController#removeFcSubComponent removeFcSubComponent} - * method overriden by this mixin. - */ - - public abstract void _super_removeFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/LifeCycleContentMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/LifeCycleContentMixin.java deleted file mode 100644 index f5cb50a4a2ea1675e000db07f7649baefac2e66b..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/LifeCycleContentMixin.java +++ /dev/null @@ -1,102 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.LifeCycleController; - -import org.objectweb.fractal.julia.control.lifecycle.ChainedIllegalLifeCycleException; - -/** - * Provides lifecycle related checks to a {@link ContentController}. - *
- *
- * Requirements - *
    - *
  • none (the component may provide a {@link LifeCycleController} interface, - * but this is not mandatory - in this case this mixin does nothing).
  • - *
- */ - -public abstract class LifeCycleContentMixin implements ContentController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private LifeCycleContentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks that the component is stopped and then calls the overriden method. - */ - - public void removeFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - if (_this_weaveableOptLC != null) { - String state = _this_weaveableOptLC.getFcState(); - if (!LifeCycleController.STOPPED.equals(state)) { - throw new ChainedIllegalLifeCycleException( - null, _this_weaveableOptC, "The component is not stopped"); - } - } - _super_removeFcSubComponent(subComponent); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableOptC; - - /** - * The weaveableOptLC field required by this mixin. This field is - * supposed to reference the {@link LifeCycleController} interface of the - * component to which this controller object belongs. - */ - - public LifeCycleController _this_weaveableOptLC; - - /** - * The {@link ContentController#removeFcSubComponent removeFcSubComponent} - * method overriden by this mixin. - */ - - public abstract void _super_removeFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/SuperContentMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/SuperContentMixin.java deleted file mode 100644 index 72ae26e8496bad272f6a8b38caa4bd39086f47d3..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/SuperContentMixin.java +++ /dev/null @@ -1,145 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -/** - * Provides {@link SuperControllerNotifier notification} functions to a {@link - * ContentController}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} interface.
  • - *
- */ - -public abstract class SuperContentMixin implements ContentController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private SuperContentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Calls the overriden method and then notifies the given component it has - * been added in this component. This method does nothing if the given sub - * component does not provide the {@link SuperControllerNotifier} interface. - */ - - public void addFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - _super_addFcSubComponent(subComponent); - SuperControllerNotifier scn = getFcSuperControllerNotifier(subComponent); - if (scn != null) { - try { - Component c = (Component)_this_weaveableC.getFcInterface("component"); - scn.addedToFc(c); - } catch (NoSuchInterfaceException ignored) { - } - } - } - - /** - * Calls the overriden method and then notifies the given component it has - * been removed from in this component. This method does nothing if the given - * sub component does not provide the {@link SuperControllerNotifier} - * interface. - */ - - public void removeFcSubComponent (final Component subComponent) - throws IllegalContentException, IllegalLifeCycleException - { - _super_removeFcSubComponent(subComponent); - SuperControllerNotifier scn = getFcSuperControllerNotifier(subComponent); - if (scn != null) { - try { - Component c = (Component)_this_weaveableC.getFcInterface("component"); - scn.removedFromFc(c); - } catch (NoSuchInterfaceException ignored) { - } - } - } - - /** - * TODO. - * @param c - * @return - */ - - private SuperControllerNotifier getFcSuperControllerNotifier ( - final Component c) - { - try { - return (SuperControllerNotifier)c.getFcInterface("super-controller"); - } catch (Exception e) { - try { - return (SuperControllerNotifier)c. - getFcInterface("/super-controller-notifier"); - } catch (NoSuchInterfaceException ignored) { - return null; - } - } - } - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The {@link ContentController#addFcSubComponent addFcSubComponent} method - * overriden by this mixin. - */ - - public abstract void _super_addFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; - - /** - * The {@link ContentController#removeFcSubComponent removeFcSubComponent} - * method overriden by this mixin. - */ - - public abstract void _super_removeFcSubComponent (Component subComponent) - throws IllegalContentException, IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/SuperControllerNotifier.java b/julia/src/org/objectweb/fractal/julia/control/content/SuperControllerNotifier.java deleted file mode 100644 index 9f8187a03ecd43bdf5859ba9fe45cc00ba504159..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/SuperControllerNotifier.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.SuperController; - -/** - * An interface used to notify a component when it is added or removed from a - * component. - */ - -public interface SuperControllerNotifier extends SuperController { - - /** - * Notifies this component that it has been added in the given component. - * - * @param parent the component into which this component has been added. - */ - - void addedToFc (Component parent); - - /** - * Notifies this component that it has been removed from the given component. - * - * @param parent the component from which this component has been removed. - */ - - void removedFromFc (Component parent); -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/TypeContentMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/TypeContentMixin.java deleted file mode 100644 index d1a59a044017e80214f56597ceb4257d6c0a0454..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/TypeContentMixin.java +++ /dev/null @@ -1,123 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.ChainedNoSuchInterfaceException; -import org.objectweb.fractal.julia.ComponentInterface; - -import java.util.Map; - -/** - * Provides basic type system related checks to a {@link ContentController}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} interface.
  • - *
  • the type of the component in which this mixin is used must be an instance - * of {@link ComponentType}.
  • - *
- */ - -public abstract class TypeContentMixin implements ContentController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private TypeContentMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks the interface name against the component's type and then calls the - * overriden method. This method also creates the collection interfaces - * when needed, and puts them in the {@link #_this_fcInternalInterfaces} map. - */ - - public Object getFcInternalInterface (final String interfaceName) - throws NoSuchInterfaceException - { - ComponentType compType = (ComponentType)_this_weaveableC.getFcType(); - InterfaceType itfType; - try { - itfType = compType.getFcInterfaceType(interfaceName); - } catch (NoSuchInterfaceException e) { - throw new ChainedNoSuchInterfaceException( - null, _this_weaveableC, interfaceName); - } - Object result; - try { - result = _super_getFcInternalInterface(interfaceName); - } catch (NoSuchInterfaceException e) { - if (itfType.isFcCollectionItf()) { - String collectionName = "/collection/" + itfType.getFcItfName(); - result = _super_getFcInternalInterface(collectionName); - result = ((ComponentInterface)result).clone(); - ((ComponentInterface)result).setFcItfName(interfaceName); - _this_fcInternalInterfaces.put(interfaceName, result); - } else { - throw e; - } - } - return result; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The fcInterfaces field required by this mixin. This field is - * supposed to store the internal interfaces of the component. - */ - - public Map _this_fcInternalInterfaces; - - /** - * The {@link ContentController#getFcInternalInterface getFcInternalInterface} - * method overriden by this mixin. - */ - - public abstract Object _super_getFcInternalInterface (String interfaceName) - throws NoSuchInterfaceException ; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/UseContentControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/UseContentControllerMixin.java deleted file mode 100644 index 15040ec43f9fa9e22826ca7a2670667b9e83528c..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/UseContentControllerMixin.java +++ /dev/null @@ -1,85 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a {@link ContentController} field to a {@link Controller}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller belongs must provide the {@link - * ContentController} interface.
  • - *
- */ - -public abstract class UseContentControllerMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseContentControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The {@link ContentController} interface of the component to which this - * controller object belongs. - */ - - public ContentController weaveableCC; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableCC = (ContentController)ic.getInterface("content-controller"); - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/UseSuperControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/content/UseSuperControllerMixin.java deleted file mode 100644 index 9b24d493c2430ef409a6cdc0518921ee1ea836a0..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/UseSuperControllerMixin.java +++ /dev/null @@ -1,84 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a {@link SuperController} field to a {@link Controller}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller belongs must provide the {@link - * SuperController} interface.
  • - *
- */ - -public abstract class UseSuperControllerMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseSuperControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - /** - * The {@link SuperController} interface of the component to which this - * controller object belongs. - */ - - public SuperController weaveableSC; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableSC = (SuperController)ic.getInterface("super-controller"); - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/Util.java b/julia/src/org/objectweb/fractal/julia/control/content/Util.java deleted file mode 100644 index a626f40f58aa6da77dbff2130a59443e89328f50..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/Util.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.objectweb.fractal.julia.control.content; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; - -import java.util.ArrayList; -import java.util.List; - -/** - * Provides static utility methods related to {@link ContentController}. - */ - -public class Util { - - private Util () { - } - - /** - * Returns all the direct and indirect sub components of the given component. - * - * @param component a component. - * @return all the direct and indirect sub components of the given component. - */ - - public static List getAllSubComponents (final Component component) { - List allSubComponents = new ArrayList(); - List stack = new ArrayList(); - stack.add(component); - while (stack.size() > 0) { - int index = stack.size() - 1; - Component c = (Component)stack.get(index); - stack.remove(index); - if (!allSubComponents.contains(c)) { - try { - ContentController cc = - (ContentController)c.getFcInterface("content-controller"); - Component[] subComponents = cc.getFcSubComponents(); - for (int i = subComponents.length - 1; i >= 0; --i) { - stack.add(subComponents[i]); - } - } catch (NoSuchInterfaceException ignored) { - // c is not a composite component: nothing to do - } - allSubComponents.add(c); - } - } - return allSubComponents; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/control/content/package.html b/julia/src/org/objectweb/fractal/julia/control/content/package.html deleted file mode 100644 index 0ad9d77204ffd92f0ded3130ffbc9829d72068cc..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/content/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides mixins to implement the {@link -org.objectweb.fractal.api.control.ContentController} interface. -@since Julia 1.0.6 - - diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/BasicLifeCycleControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/BasicLifeCycleControllerMixin.java deleted file mode 100644 index 59dba53fa1d3ffc60cba25570a4ee0aef299bb46..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/BasicLifeCycleControllerMixin.java +++ /dev/null @@ -1,303 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; -import org.objectweb.fractal.julia.factory.ChainedInstantiationException; - -/** - * Provides a basic implementation of the {@link - * org.objectweb.fractal.api.control.LifeCycleController} interface. - * This implementation is based on a counter managed by interceptors. This - * controller needs associated interceptor objects, such as those generated by - * the {@link org.objectweb.fractal.julia.asm.InterceptorClassGenerator} with a - * {@link org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator}, in order to - * work properly (these interceptors are only needed on external server - * interfaces). - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} interface and the {@link LifeCycleCoordinator} - * interface.
  • - *
- */ - -public abstract class BasicLifeCycleControllerMixin - implements Controller, LifeCycleCoordinator -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicLifeCycleControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The life cycle state of this component. Zero means stopped, one means - * stopping and two means started. - */ - - public int fcState; - - /** - * The number of currently executing method calls in this component. - */ - - public int fcInvocationCounter; - - /** - * The coordinator used to stop this component with other components - * simultaneously. - */ - - public LifeCycleCoordinator fcCoordinator; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - try { - // do not remove the cast! - Object o = (LifeCycleCoordinator)ic.getInterface("lifecycle-controller"); - } catch (Exception e) { - try { - ic.getInterface("/lifecycle-coordinator"); - } catch (Exception f) { - throw new ChainedInstantiationException( - f, null, "The component must provide a LifeCycleCoordinator interface"); - } - } - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Implementation of the LifeCycleController interface - // ------------------------------------------------------------------------- - - public String getFcState () { - return fcState == 0 ? STOPPED : STARTED; - } - - public void startFc () throws IllegalLifeCycleException { - if (fcState != 2) { - _this_setFcState(true); - } - } - - public void stopFc () throws IllegalLifeCycleException { - if (fcState == 2) { - _this_stopFc(new LifeCycleCoordinator[] { getFcCoordinator() }); - _this_setFcState(false); - } - } - - // ------------------------------------------------------------------------- - // Implementation of the LifeCycleCoordinator interface - // ------------------------------------------------------------------------- - - public boolean setFcStarted () throws IllegalLifeCycleException { - synchronized (this) { - if (fcState == 2) { - return false; - } - fcState = 2; - /** - * The following line unblock the threads that may be blocked in the - * component, in the incrementFcInvocationCounter method. - */ - notifyAll(); - return true; - } - } - - public void setFcStopping (final LifeCycleCoordinator coordinator) - throws IllegalLifeCycleException - { - synchronized (this) { - fcState = 1; - fcCoordinator = coordinator; - if (fcInvocationCounter == 0) { - fcCoordinator.fcInactivated(getFcCoordinator()); - } - } - } - - public boolean setFcStopped () throws IllegalLifeCycleException { - synchronized (this) { - if (fcState == 0) { - return false; - } - fcState = 0; - fcCoordinator = null; - return true; - } - } - - // ------------------------------------------------------------------------- - // Methods called by the associated interceptor - // ------------------------------------------------------------------------- - - /** - * Increments the number of currently executing method calls in this - * component. If the component is started this method just increments this - * counter. If the component is stopped, it waits until the component is - * restarted, and then increments the counter. Finally, if the component is - * stopping, there are two cases. If the counter is not null, it is just - * incremented. If it is null, this method asks the coordinator if the method - * call can be executed, or if it should be delayed until the component is - * restarted. The method then blocks or not, depending on the coordinator's - * response, before incrementing the counter. - */ - - public void incrementFcInvocationCounter () { - /* this code is inlined in the interceptor objects - synchronized (this) { - if (fcState == 2) { - ++fcInvocationCounter; - return; - } */ - boolean ok; - do { - if (fcState == 0) { - ok = false; - } else if (fcState == 1) { - if (fcInvocationCounter == 0) { - ok = fcCoordinator.fcActivated(getFcCoordinator()); - } else { - ok = true; - } - } else { - ok = true; - } - if (!ok) { - try { - wait(); - } catch (final InterruptedException e) { - } - } - } while (!ok); - ++fcInvocationCounter; - /* } */ - } - - /** - * Decrements the number of currently executing method calls in this - * component. If the component is stopping, and if the counter of currently - * executing method calls becomes null after being decremented, this method - * notifies the coordinator that the component has become inactive. - */ - - public void decrementFcInvocationCounter () { - /* this code is inlined in the interceptor objects - synchronized (this) { - if (fcState == 2) { - --fcInvocationCounter; - return; - } */ - --fcInvocationCounter; - if (fcInvocationCounter == 0) { - fcCoordinator.fcInactivated(getFcCoordinator()); - } - /* } */ - } - - // ------------------------------------------------------------------------- - // Utility methods - // ------------------------------------------------------------------------- - - /** - * Returns the {@link LifeCycleCoordinator} interface of this component. - * - * @return the {@link LifeCycleCoordinator} interface of the component to - * which this controller object belongs. - */ - - public LifeCycleCoordinator getFcCoordinator () { - try { - return (LifeCycleCoordinator)_this_weaveableC. - getFcInterface("lifecycle-controller"); - } catch (Exception e) { - try { - return (LifeCycleCoordinator)_this_weaveableC. - getFcInterface("/lifecycle-coordinator"); - } catch (NoSuchInterfaceException f) { - throw new Error("Internal error"); // should not happen - } - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The setFcState method required by this mixin. This method is - * supposed to work as this {@link BasicLifeCycleCoordinatorMixin#setFcState - * setFcState} method. - */ - - public abstract void _this_setFcState (boolean started) - throws IllegalLifeCycleException; - - /** - * The stopFc method required by this mixin. This method is - * supposed to work as this {@link BasicLifeCycleCoordinatorMixin#stopFc - * stopFc} method. - */ - - public abstract void _this_stopFc (LifeCycleCoordinator[] components) - throws IllegalLifeCycleException; - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/BasicLifeCycleCoordinatorMixin.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/BasicLifeCycleCoordinatorMixin.java deleted file mode 100644 index aa25625184bf00ed55bf74494c66651148f8703d..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/BasicLifeCycleCoordinatorMixin.java +++ /dev/null @@ -1,204 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -import org.objectweb.fractal.julia.control.content.Util; - -import java.util.ArrayList; -import java.util.List; - -/** - * Provides an abstract implementation of the {@link LifeCycleCoordinator} - * interface. - *
- *
- * Requirements - *
    - *
  • the component to which this controller object belongs must provide the - * {@link Component} interface.
  • - *
- */ - -public abstract class BasicLifeCycleCoordinatorMixin - implements LifeCycleCoordinator -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicLifeCycleCoordinatorMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The components that are currently active. - */ - - public List fcActive; - - /** - * Sets the lifecycle state of this component and of all its direct and - * indirect sub components that have a {@link LifeCycleCoordinator} interface. - * - * @param started true to set the lifecycle state of the components - * to {@link #STARTED STARTED}, or false to set this state to - * {@link #STOPPED STOPPED}. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - public void setFcState (final boolean started) - throws IllegalLifeCycleException - { - // finds all the direct and indirect sub components of this component - Component thisComponent; - try { - thisComponent = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalLifeCycleException( - e, _this_weaveableC, "Cannot set the lifecycle state"); - } - List allSubComponents = Util.getAllSubComponents(thisComponent); - - // sets the state of these components - for (int i = 0; i < allSubComponents.size(); ++i) { - Component c = (Component)allSubComponents.get(i); - LifeCycleCoordinator lc; - try { - lc = (LifeCycleCoordinator)c.getFcInterface("lifecycle-controller"); - } catch (Exception e) { - try { - lc = (LifeCycleCoordinator)c.getFcInterface("/lifecycle-coordinator"); - } catch (NoSuchInterfaceException f) { - continue; - } - } - if (started) { - lc.setFcStarted(); - } else { - lc.setFcStopped(); - } - } - } - - public boolean fcActivated (final LifeCycleCoordinator component) { - synchronized (fcActive) { - // a component can become active iff another component is already active - if (fcActive.size() > 0) { - if (!fcActive.contains(component)) { - fcActive.add(component); - } - return true; - } - return false; - } - } - - public void fcInactivated (final LifeCycleCoordinator component) { - synchronized (fcActive) { - fcActive.remove(component); - // notifies the thread that may be blocked in stopFc - fcActive.notifyAll(); - } - } - - /** - * Stops the given components simultaneously. This method sets the state of - * the components to "STOPPING", waits until all the components - * are simultaneoulsy inactive (their state is known thanks to the {@link - * #fcActivated fcActivated} and {@link #fcInactivated fcInactivated} callback - * methods), and then sets the state of the components to {@link #STOPPED - * STOPPED}. - * - * @param components the {@link LifeCycleCoordinator} interface of the - * components to be stopped. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - public void stopFc (final LifeCycleCoordinator[] components) - throws IllegalLifeCycleException - { - // initializes the fcActive list - fcActive = new ArrayList(); - for (int i = 0; i < components.length; ++i) { - if (components[i].getFcState().equals(STARTED)) { - fcActive.add(components[i]); - } - } - // sets the state of the components to STOPPING - LifeCycleCoordinator c; - try { - c = (LifeCycleCoordinator)_this_weaveableC. - getFcInterface("lifecycle-controller"); - } catch (Exception e) { - try { - c = (LifeCycleCoordinator)_this_weaveableC. - getFcInterface("/lifecycle-coordinator"); - } catch (NoSuchInterfaceException f) { - throw new ChainedIllegalLifeCycleException( - f, _this_weaveableC, "Cannot stop components"); - } - } - for (int i = 0; i < components.length; ++i) { - if (components[i].getFcState().equals(STARTED)) { - components[i].setFcStopping(c); - } - } - // waits until all the components are simultaneously inactive - synchronized (fcActive) { - while (fcActive.size() > 0) { - try { - fcActive.wait(); - } catch (InterruptedException e) { - } - } - } - // sets the state of the components to STOPPED - for (int i = 0; i < components.length; ++i) { - if (components[i].getFcState().equals(STARTED)) { - components[i].setFcStopped(); - } - } - fcActive = null; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/ChainedIllegalLifeCycleException.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/ChainedIllegalLifeCycleException.java deleted file mode 100644 index 5409d1c267d2f5824a28b84d77e42d0b4ab33c50..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/ChainedIllegalLifeCycleException.java +++ /dev/null @@ -1,174 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -import org.objectweb.fractal.julia.Util; - -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.ObjectOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; - -/** - * A sub class of the {@link IllegalLifeCycleException} class. - */ - -public class ChainedIllegalLifeCycleException - extends IllegalLifeCycleException -{ - - /** - * The exception that caused this exception. May be null. - */ - - private final Throwable exception; - - /** - * The component whose life cycle state is illegal. - */ - - private transient Component component; - - /** - * Constructs a new {@link ChainedIllegalLifeCycleException} exception. - * - * @param exception the cause of this exception. May be null. - * @param component the component whose life cycle state is illegal. - * @param message a detailed error message. - */ - - public ChainedIllegalLifeCycleException ( - final Throwable exception, - final Component component, - final String message) - { - super(message); - this.exception = exception; - this.component = component; - } - - /** - * Returns the exception that caused in this exception. - * - * @return the exception that caused this exception. May be null. - */ - - public Throwable getException () { - return exception; - } - - /** - * Returns the component whose life cycle state is illegal. - * - * @return the component whose life cycle state is illegal. - */ - - public Component getComponent () { - if (component != null && !(component instanceof Interface)) { - try { - return (Component)component.getFcInterface("component"); - } catch (NoSuchInterfaceException ignored) { - } - } - return component; - } - - // ------------------------------------------------------------------------- - // Overriden Exception methods - // ------------------------------------------------------------------------- - - /** - * Returns a String representation of this exception. - * - * @return a String representation of this exception. - */ - - public String toString () { - StringBuffer buf = new StringBuffer(); - buf.append("IllegalLifeCycleException: "); - buf.append(getMessage()); - if (getComponent() != null) { - buf.append(" (component = "); - Util.toString(getComponent(), buf); - buf.append(')'); - } - return buf.toString(); - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - exception.printStackTrace(); - } - super.printStackTrace(); - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - private void writeObject (final ObjectOutputStream out) throws IOException { - out.defaultWriteObject(); - Component c = getComponent(); - out.writeObject(c instanceof Interface ? c : null); - } - - private void readObject (final ObjectInputStream in) - throws IOException, ClassNotFoundException - { - in.defaultReadObject(); - component = (Component)in.readObject(); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/ContainerLifeCycleMixin.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/ContainerLifeCycleMixin.java deleted file mode 100644 index a819cfc2a1ab25b50e74c080e478019c80e158fd..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/ContainerLifeCycleMixin.java +++ /dev/null @@ -1,154 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.LifeCycleController; - -/** - * Provides container related functions to a {@link LifeCycleController}. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class ContainerLifeCycleMixin - implements LifeCycleCoordinator -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private ContainerLifeCycleMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Calls the overriden method and then calls the {@link #setFcContentState - * setFcContentState} method. - */ - - public boolean setFcStarted () throws IllegalLifeCycleException { - synchronized (this) { - if (_super_setFcStarted()) { - setFcContentState(true); - return true; - } - return false; - } - } - - /** - * Calls the overriden method and then calls the {@link #setFcContentState - * setFcContentState} method. - */ - - public boolean setFcStopped () throws IllegalLifeCycleException { - synchronized (this) { - if (_super_setFcStopped()) { - setFcContentState(false); - return true; - } - return false; - } - } - - /** - * Calls the {@link LifeCycleController#startFc startFc} or {@link - * LifeCycleController#stopFc stopFc} method on the encapsulated component. - * This method does nothing if there is no encapsulated component, or if it - * does not implement the {@link LifeCycleController} interface. - * - * @param started true to call the {@link LifeCycleController#startFc - * startFc}, or false to call the {@link - * LifeCycleController#stopFc stopFc} method. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - public void setFcContentState (final boolean started) - throws IllegalLifeCycleException - { - Object content; - try { - content = _this_weaveableOptC.getFcInterface("/content"); - } catch (NullPointerException e) { - return; - } catch (NoSuchInterfaceException e) { - return; - } - if (content == this) { - // case of merge...AndContent options - if (this instanceof ContentLifeCycleController) { - if (started) { - ((ContentLifeCycleController)this).startFcContent(); - } else { - ((ContentLifeCycleController)this).stopFcContent(); - } - } - } else if (content instanceof LifeCycleController) { - if (started) { - ((LifeCycleController)content).startFc(); - } else { - ((LifeCycleController)content).stopFc(); - } - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableOptC; - - /** - * The {@link LifeCycleCoordinator#setFcStarted setFcStarted} method overriden - * by this mixin. - */ - - public abstract boolean _super_setFcStarted () - throws IllegalLifeCycleException; - - /** - * The {@link LifeCycleCoordinator#setFcStopped setFcStopped} method overriden - * by this mixin. - */ - - public abstract boolean _super_setFcStopped () - throws IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/ContentLifeCycleController.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/ContentLifeCycleController.java deleted file mode 100644 index 19271ba45357792bae7932a1a42d7c3acdd5271f..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/ContentLifeCycleController.java +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -/** - * A component interface to control the life cycle of the content of container - * components. This interface is useful when a container and its encapsulated - * "user" component are merged into a single class. Indeed, in this case, the - * container class is generated as a sub class of the user component class, and - * may therefore override the life cycle management methods that may be provided - * by the user component (because both classes may implement the same {@link - * org.objectweb.fractal.api.control.LifeCycleController} interface). In order - * to still be able to call the user component life cycle management methods - * from outside the component, two new methods are generated in the container - * class, that just calls the corresponding methods in the user component class - * (i.e., in the super class) with the super keyword. - */ - -public interface ContentLifeCycleController { - - /** - * Calls the {@link - * org.objectweb.fractal.api.control.LifeCycleController#startFc startFc} - * method on the component encapsulated in this container. - */ - - void startFcContent () throws IllegalLifeCycleException; - - /** - * Calls the {@link - * org.objectweb.fractal.api.control.LifeCycleController#stopFc stopFc} - * method on the component encapsulated in this container. - */ - - void stopFcContent () throws IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/LifeCycleCoordinator.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/LifeCycleCoordinator.java deleted file mode 100644 index 8d5d797337976c50845f8245d06a20cfbd49d1bd..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/LifeCycleCoordinator.java +++ /dev/null @@ -1,129 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.LifeCycleController; - -/** - * An extended {@link LifeCycleController} interface. This interface is - * used to stop several components simultaneously, in order to avoid the - * deadlocks that can occur when several components are stopped one by one - * (for example, if a component C is stopped after a component S, and if a - * thread T is executing a method m1 in C which calls a method m2 in S, then T - * can be blocked in m2 just after S is stopped but before C is stopped, in - * which case C can not be stopped, and a deadlock occurs). - */ - -public interface LifeCycleCoordinator extends LifeCycleController { - - /** - * Sets the state of this component, but not of its sub components, to - * {@link #STARTED STARTED}. Because of component sharing, the {@link - * #startFc startFc} method cannot be implemented by just calling - * itself recursively on the sub components of this componets (otherwise some - * sub components may be started several times). Hence this method. - * - * @return true if the execution state has changed, or false - * if it had already the {@link #STARTED STARTED} value. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - boolean setFcStarted () throws IllegalLifeCycleException; - - /** - * Sets the state of this component, but not of its sub components, to - * "STOPPING". After this method has been called, and while the - * {@link #setFcStopped setFcStopped} has not been called, this component must - * notify the given coordinator when it becomes inactive, and when it is about - * to become active, with the {@link #fcInactivated fcInactivated} and {@link - * #fcActivated fcActivated} methods. - *
- * Note: the "STOPPING" state is an internal state that is not - * visible from the outside. Indeed, in this state, the {@link #getFcState - * getFcState} method should return {@link #STARTED STARTED}, as the component - * is not yet stopped. - * - * @param coordinator the coordinator that must be notified when this - * component becomes inactive, and when it is about to become active. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - void setFcStopping (LifeCycleCoordinator coordinator) - throws IllegalLifeCycleException; - - /** - * Sets the state of this component, but not of its sub components, to - * {@link #STOPPED STOPPED}. Because of component sharing, the {@link - * #stopFc stopFc} method cannot be implemented by just calling - * itself recursively on the sub components of this componets (otherwise some - * sub components may be stopped several times). Hence this method. - * - * @return true if the execution state has changed, or false - * if it had already the {@link #STOPPED STOPPED} value. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - boolean setFcStopped () throws IllegalLifeCycleException; - - /** - * Notifies this component that the given component is about to become active. - * This method must be called by a component when the following conditions are - * met: - *
    - *
  • the component is stopping, i.e., its {@link #setFcStopping - * setFcStopping} method has been called.
  • - *
  • the component is not yet stopped, i.e., its {@link #setFcStopped - * setFcStopped} method has not been called yet.
  • - *
  • the component is currently inactive, but a new activity is about to - * start in this component.
  • - *
- * - * @param component the {@link LifeCycleCoordinator} interface of a component - * that is about to become active. - * @return true if the given component can become active, or - * false if the new activity must be delayed until the component - * is restarted. - */ - - boolean fcActivated (LifeCycleCoordinator component); - - /** - * Notifies this component that the given component has become inactive. - * This method must be called by a component when the following conditions are - * met: - *
    - *
  • the component is stopping, i.e., its {@link #setFcStopping - * setFcStopping} method has been called.
  • - *
  • the component is not yet stopped, i.e., its {@link #setFcStopped - * setFcStopped} method has not been called yet.
  • - *
  • the component has become inactive.
  • - *
- * - * @param component the {@link LifeCycleCoordinator} interface of a component - * that has become inactive. - */ - - void fcInactivated (LifeCycleCoordinator component); -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/OptimizedLifeCycleControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/OptimizedLifeCycleControllerMixin.java deleted file mode 100644 index 52fedb28417527e00c7181922c81c82bffabcf09..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/OptimizedLifeCycleControllerMixin.java +++ /dev/null @@ -1,342 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.control.binding.Util; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.ArrayList; - -/** - * Provides an optimized implementation of the {@link - * org.objectweb.fractal.api.control.LifeCycleController} interface. This - * implementation does not need interceptors. This life cycle controller - * works by stopping all the direct and indirect primitive sub components that - * have a {@link LifeCycleCoordinator} interface, and the primitive client - * components of these components (these clients must also have a {@link - * LifeCycleCoordinator} interface). These components are stopped - * simultaneously, by using the coordinator interface provided by this - * component. - *
- *
- * Requirements - *
    - *
  • TODO.
  • - *
- */ - -public abstract class OptimizedLifeCycleControllerMixin - implements LifeCycleCoordinator -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private OptimizedLifeCycleControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Indicates if this component is started or not. - */ - - public boolean fcStarted; - - // ------------------------------------------------------------------------- - // Implementation of the LifeCycleController interface - // ------------------------------------------------------------------------- - - public String getFcState () { - return fcStarted ? STARTED : STOPPED; - } - - public void startFc () throws IllegalLifeCycleException { - Component id; - try { - id = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalLifeCycleException( - e, _this_weaveableC, "Cannot start component"); - } - LifeCycleCoordinator[] clccs = getFcLifeCycleControllers(id); - for (int i = 0; i < clccs.length; ++i) { - clccs[i].setFcStarted(); - } - _this_setFcState(true); - } - - public void stopFc () throws IllegalLifeCycleException { - Component id; - try { - id = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalLifeCycleException( - e, _this_weaveableC, "Cannot stop component"); - } - LifeCycleCoordinator[] clccs = getFcLifeCycleControllers(id); - _this_stopFc(clccs); - _this_setFcState(false); - } - - // ------------------------------------------------------------------------- - // Implementation of the CoordinatorLifeCycleController interface - // ------------------------------------------------------------------------- - - public boolean setFcStarted () { - if (!fcStarted) { - fcStarted = true; - return true; - } - return false; - } - - public void setFcStopping (final LifeCycleCoordinator coordinator) - throws IllegalLifeCycleException - { - throw new Error("Internal error"); // TODO - } - - public boolean setFcStopped () { - if (fcStarted) { - fcStarted = false; - return true; - } - return false; - } - - // ------------------------------------------------------------------------- - // Utility methods - // ------------------------------------------------------------------------- - - /** - * Returns the components that must be stopped in order to stop the given - * component. These components are the direct or indirect primitive sub - * components of this component that provide a {@link LifeCycleCoordinator} - * interface, as well as the primitive client components of these components. - * - * @param id a composite component. - * @return the components that must be stopped in order to stop the given - * component. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - public LifeCycleCoordinator[] getFcLifeCycleControllers ( - final Component id) throws IllegalLifeCycleException - { - List clccList = getFcInternalLifeCycleControllers(); - Object[] sItfs = id.getFcInterfaces(); - Set visited = new HashSet(); - for (int i = 0; i < sItfs.length; ++i) { - Interface sItf = (Interface)sItfs[i]; - if (!((InterfaceType)sItf.getFcItfType()).isFcClientItf()) { - getSExtLifeCycleControllers(sItf, clccList, visited); - } - } - LifeCycleCoordinator[] clccs; - clccs = new LifeCycleCoordinator[clccList.size()]; - return (LifeCycleCoordinator[])clccList.toArray(clccs); - } - - /** - * Finds the primitive client components that are bound to the given server - * interface. - * - * @param serverItf a server interface. - * @param clccList where to put the {@link LifeCycleCoordinator} - * interfaces of the primitive client components that are found. - * @param visited the already visited interfaces. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - private void getSExtLifeCycleControllers ( - final Interface serverItf, - final List clccList, - final Set visited) throws IllegalLifeCycleException - { - Object[] comps; - try { - comps = Util.getFcPotentialClientsOf(serverItf).toArray(); - } catch (Exception e) { - throw new ChainedIllegalLifeCycleException( - e, - serverItf.getFcItfOwner(), - "Cannot get the LifeCycleCoordinator interfaces"); - } - for (int i = 0; i < comps.length; ++i) { - Component comp = (Component)comps[i]; - Interface[] clientItfs; - try { - List l = Util.getFcClientItfsBoundTo(comp, serverItf); - clientItfs = (Interface[])l.toArray(new Interface[l.size()]); - } catch (Exception e) { - throw new ChainedIllegalLifeCycleException( - e, - serverItf.getFcItfOwner(), - "Cannot get the LifeCycleCoordinator interfaces"); - } - for (int j = 0; j < clientItfs.length; ++j) { - getCExtLifeCycleControllers(clientItfs[j], clccList, visited); - } - } - } - - /** - * Finds the primitive client components that are bound to the given client - * interface. - * - * @param clientItf a client interface. - * @param clccList where to put the {@link LifeCycleCoordinator} interfaces of - * the primitive client components that are found. - * @param visited the already visited interfaces. - * @throws IllegalLifeCycleException if a problem occurs. - */ - - private void getCExtLifeCycleControllers ( - final Interface clientItf, - final List clccList, - final Set visited) throws IllegalLifeCycleException - { - Component component = clientItf.getFcItfOwner(); - ContentController cc = null; - try { - cc = (ContentController)component.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - } - if (cc != null) { - Interface itf; - String name = clientItf.getFcItfName(); - try { - if (!clientItf.isFcInternalItf()) { - itf = (Interface)cc.getFcInternalInterface(name); - } else { - itf = (Interface)component.getFcInterface(name); - } - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalLifeCycleException( - e, - component, - "Cannot find the LifeCycleCoordinator interfaces"); - } - if (!visited.contains(itf)) { - visited.add(itf); - getSExtLifeCycleControllers(itf, clccList, visited); - } - } else if (!visited.contains(clientItf)) { - visited.add(clientItf); - Component c = clientItf.getFcItfOwner(); - LifeCycleCoordinator lcc; - try { - lcc = (LifeCycleCoordinator)c.getFcInterface("lifecycle-controller"); - } catch (Exception e) { - try { - lcc = (LifeCycleCoordinator)c.getFcInterface("/lifecycle-coordinator"); - } catch (NoSuchInterfaceException f) { - throw new ChainedIllegalLifeCycleException( - f, component, "Primitive client without a LifeCycleCoordinator"); - } - } - if (!clccList.contains(lcc)) { - clccList.add(lcc); - } - } - } - - public List getFcInternalLifeCycleControllers () - throws IllegalLifeCycleException - { - // finds all the direct and indirect sub components of this component - Component thisComponent; - try { - thisComponent = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalLifeCycleException( - e, _this_weaveableC, "Cannot TODO"); // TODO - } - List allSubComponents = org.objectweb.fractal.julia.control.content.Util. - getAllSubComponents(thisComponent); - - List result = new ArrayList(); - for (int i = 0; i < allSubComponents.size(); ++i) { - Component c = (Component)allSubComponents.get(i); - try { - c.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - try { - // do not remove the cast! - result.add( - (LifeCycleCoordinator)c.getFcInterface("lifecycle-controller")); - } catch (Exception f) { - try { - result.add(c.getFcInterface("/lifecycle-coordinator")); - } catch (NoSuchInterfaceException ignored) { - } - } - } - } - return result; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The setFcState method required by this mixin. This method is - * supposed to work as this {@link BasicLifeCycleCoordinatorMixin#setFcState - * setFcState} method. - */ - - public abstract void _this_setFcState (boolean started) - throws IllegalLifeCycleException; - - /** - * The stopFc method required by this mixin. This method is - * supposed to work as this {@link BasicLifeCycleCoordinatorMixin#stopFc - * stopFc} method. - */ - - public abstract void _this_stopFc (LifeCycleCoordinator[] components) - throws IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/TypeLifeCycleMixin.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/TypeLifeCycleMixin.java deleted file mode 100644 index e51d8333bd1b4f9cd5f6f6442516812ed99dcbad..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/TypeLifeCycleMixin.java +++ /dev/null @@ -1,161 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.control.binding.ChainedIllegalBindingException; -import org.objectweb.fractal.julia.control.content.Util; - -import java.util.List; - -/** - * Provides basic type system related checks to a {@link LifeCycleController}. - *
- *
- * Requirements - *
    - *
  • the type of each direct and indirect sub component of this component - * (included) that has a {@link BindingController} interface must be an instance - * of {@link org.objectweb.fractal.api.type.ComponentType}.
  • - *
- */ - -public abstract class TypeLifeCycleMixin implements LifeCycleController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private TypeLifeCycleMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks the mandatory client interfaces of the component (and of all its sub - * components) and then calls the overriden method. - */ - - public void startFc () throws IllegalLifeCycleException { - // finds all the direct and indirect sub components of this component - Component thisComponent; - try { - thisComponent = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedIllegalLifeCycleException( - e, _this_weaveableC, "Cannot start the component"); - } - List allSubComponents = Util.getAllSubComponents(thisComponent); - - // checks that the mandatory client interfaces of these components are bound - for (int i = 0; i < allSubComponents.size(); ++i) { - Component subComponent = (Component)allSubComponents.get(i); - try { - checkFcMandatoryInterfaces(subComponent); - } catch (IllegalBindingException e) { - throw new ChainedIllegalLifeCycleException( - e, _this_weaveableC, "Cannot start the component"); - } - } - - // calls the overriden method - _super_startFc(); - } - - /** - * Checks that all the mandatory client interface of the given component are - * bound. - * - * @param c a component. - * @throws IllegalBindingException if a mandatory client interface of the - * given component is not bound. - */ - - public void checkFcMandatoryInterfaces (final Component c) - throws IllegalBindingException - { - BindingController bc; - try { - bc = (BindingController)c.getFcInterface("binding-controller"); - } catch (NoSuchInterfaceException e) { - return; - } - ComponentType compType = (ComponentType)c.getFcType(); - String[] names = bc.listFc(); - for (int i = 0; i < names.length; ++i) { - InterfaceType itfType; - try { - itfType = compType.getFcInterfaceType(names[i]); - } catch (NoSuchInterfaceException e) { - continue; - } - if (itfType.isFcClientItf() && !itfType.isFcOptionalItf()) { - Object sItf; - try { - sItf = bc.lookupFc(names[i]); - } catch (NoSuchInterfaceException e) { - continue; - } - if (sItf == null) { - throw new ChainedIllegalBindingException( - null, - c, - null, - names[i], - null, - "Mandatory client interface unbound"); - } - } - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The {@link LifeCycleController#startFc startFc} method overriden by this - * mixin. - */ - - public abstract void _super_startFc () throws IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/UseLifeCycleControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/lifecycle/UseLifeCycleControllerMixin.java deleted file mode 100644 index da10cdd752762504bd464ad0b1380fad8dd80fa6..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/UseLifeCycleControllerMixin.java +++ /dev/null @@ -1,86 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.lifecycle; - -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a {@link LifeCycleController} field to a {@link Controller}. - *
- *
- * Requirements - *
    - *
  • none (the component to which this controller belongs may provide the - * {@link LifeCycleController} interface, but this is not mandatory).
  • - *
- */ - -public abstract class UseLifeCycleControllerMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseLifeCycleControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The {@link LifeCycleController} interface of the component to which this - * controller object belongs. - */ - - public LifeCycleController weaveableOptLC; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableOptLC = - (LifeCycleController)ic.getOptionalInterface("lifecycle-controller"); - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/lifecycle/package.html b/julia/src/org/objectweb/fractal/julia/control/lifecycle/package.html deleted file mode 100644 index 8e6ba7971d844c48eb476424ecaf20fe6ec3b387..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/lifecycle/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides mixins to implement the {@link -org.objectweb.fractal.api.control.LifeCycleController} interface. -@since Julia 1.0.6 - - diff --git a/julia/src/org/objectweb/fractal/julia/control/name/BasicNameControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/name/BasicNameControllerMixin.java deleted file mode 100644 index 6c7d29125029b46c3596e4f496d83dbbb29122a4..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/name/BasicNameControllerMixin.java +++ /dev/null @@ -1,64 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.name; - -import org.objectweb.fractal.api.control.NameController; - -/** - * Provides a basic implementation of the {@link NameController} interface. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class BasicNameControllerMixin implements NameController { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicNameControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The name of the component to which this controller object belongs. - */ - - public String name; - - public String getFcName () { - return name; - } - - public void setFcName (final String name) { - this.name = name; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/control/name/UseNameControllerMixin.java b/julia/src/org/objectweb/fractal/julia/control/name/UseNameControllerMixin.java deleted file mode 100644 index 255a5d39ee8599bee026a45f58b202f84f17f35c..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/name/UseNameControllerMixin.java +++ /dev/null @@ -1,81 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.control.name; - -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a {@link NameController} field to a {@link Controller}. - *
- *
- * Requirements - *
    - *
  • none (the component may provide a {@link NameController} interface, but - * this is not mandatory).
  • - *
- */ - -public abstract class UseNameControllerMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseNameControllerMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The {@link NameController} interface of the component to which this - * controller object belongs. - */ - - public NameController weaveableOptNC; - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableOptNC = (NameController)ic.getOptionalInterface("name-controller"); - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/control/name/package.html b/julia/src/org/objectweb/fractal/julia/control/name/package.html deleted file mode 100644 index a53e46446f8d2a36938a039131e4a166a92f8fb6..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/control/name/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides mixins to implement the {@link -org.objectweb.fractal.api.control.NameController} interface. -@since Julia 1.0.6 - - diff --git a/julia/src/org/objectweb/fractal/julia/factory/AttributeTemplateMixin.java b/julia/src/org/objectweb/fractal/julia/factory/AttributeTemplateMixin.java deleted file mode 100644 index 2481fbc742f13531dc2934974cff27dfa8e5c87a..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/AttributeTemplateMixin.java +++ /dev/null @@ -1,97 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.AttributeController; - -import org.objectweb.fractal.julia.control.attribute.CloneableAttributeController; - -/** - * Provides an attribute copy function to a {@link Template}. - *
- *
- * Requirements - *
    - *
  • none (the template component may provide a {@link - * CloneableAttributeController} interface, but this is not mandatory - in this - * case this mixin does nothing).
  • - *
- */ - -public abstract class AttributeTemplateMixin implements Template { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private AttributeTemplateMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Calls the overriden method and then sets the attributes of the created - * component. The attributes of the created component are initialized from the - * attributes name of this template, if the template has a {@link - * CloneableAttributeController} interface, and if the created component has - * an {@link org.objectweb.fractal.api.control.AttributeController} interface - * (otherwise this mixin does nothing). - */ - - public Component newFcControllerInstance () { - Component comp = _super_newFcControllerInstance(); - if (_this_weaveableOptCAC != null) { - // copies the template's attributes into the component, if applicable - try { - _this_weaveableOptCAC.cloneFcAttributes( - (AttributeController)comp.getFcInterface("attribute-controller")); - } catch (NoSuchInterfaceException ignored) { - } - } - return comp; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptcCAC field required by this mixin. This field is - * supposed to reference the {@link CloneableAttributeController} interface - * of the component to which this controller object belongs. - */ - - public CloneableAttributeController _this_weaveableOptCAC; - - /** - * The {@link Template#newFcControllerInstance newFcControllerInstance} - * overriden by this mixin. - */ - - public abstract Component _super_newFcControllerInstance (); -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/BasicGenericFactoryMixin.java b/julia/src/org/objectweb/fractal/julia/factory/BasicGenericFactoryMixin.java deleted file mode 100644 index f6514f106a781861cac56c9c237698464338f33e..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/BasicGenericFactoryMixin.java +++ /dev/null @@ -1,256 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; -import org.objectweb.fractal.julia.loader.Loader; -import org.objectweb.fractal.julia.loader.Tree; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Provides a basic implementation of the {@link GenericFactory} interface. - *
- *
- * Requirements - *
    - *
  • the types used in the {@link #newFcInstance newFcInstance} method must - * be instances of {@link ComponentType}.
  • - *
  • the controller descriptors used in the {@link #newFcInstance - * newFcInstance} method must be strings referencing "true descriptors", which - * are loaded with the {@link #_this_weaveableL} loader. Here "true descriptors" - * means controller descriptors as specified in {@link - * org.objectweb.fractal.julia.asm.ContextClassGenerator}.
  • - *
- */ - -public class BasicGenericFactoryMixin implements GenericFactory { - - // ------------------------------------------------------------------------- - // PUBLIC constructor (needed for bootstrap) - // ------------------------------------------------------------------------- - - public BasicGenericFactoryMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - public Component newFcInstance ( - final Type type, - final Object controllerDesc, - final Object contentDesc) throws InstantiationException - { - // generates the component descriptor - Tree typeTree = getFcTypeDescriptor(type); - Tree controllerTree = getFcControllerDescriptor(controllerDesc); - Tree contentTree = getFcContentDescriptor(contentDesc); - Tree componentTree = new Tree(new Tree[] { - new Tree("org.objectweb.fractal.julia.asm.ContextClassGenerator"), - typeTree, - controllerTree, - contentTree - }); - - // creates an instance of the corresponding class - // (a specific InitializationContext class for components of this kind) - Class initializationContextClass; - try { - initializationContextClass = _this_weaveableL.loadClass(componentTree); - } catch (Exception e) { - throw new ChainedInstantiationException( - e, - null, - "Cannot load the specific InitializationContext sub class " + - "needed to create the component"); - } - InitializationContext initializationContext; - try { - initializationContext = - (InitializationContext)initializationContextClass.newInstance(); - } catch (Exception e) { - throw new ChainedInstantiationException( - e, - null, - "Cannot create the specific InitializationContext object " + - "needed to create the component"); - } - - // initializes the initialization context itself - if (!(contentDesc instanceof String)) { - initializationContext.content = contentDesc; - } - initializationContext.hints = _this_weaveableTF; - initializationContext.create(); - - // initializes all the controller objects of the component - List controllers = initializationContext.controllers; - for (int i = 0; i < controllers.size(); ++i) { - Object o = controllers.get(i); - if (o instanceof Controller) { - ((Controller)o).initFcController(initializationContext); - } - } - - // returns the Component interface of the component - try { - Component c = (Component)initializationContext.getInterface("component"); - return (Component)c.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - null, - "The created component does not provide the Component interface"); - } - } - - /** - * Returns a tree representing the given component type. This tree has the - * format specified in {@link - * org.objectweb.fractal.julia.asm.ContextClassGenerator} - * - * @param type a component type, must be instance of {@link ComponentType}. - * @return a tree representing the given component type. - * @throws InstantiationException if the given type is not an instance of - * {@link ComponentType}, or if it contains control interface types. - */ - - public Tree getFcTypeDescriptor (final Type type) - throws InstantiationException - { - // checks the type system - ComponentType compType; - try { - compType = (ComponentType)type; - } catch (ClassCastException e) { - throw new ChainedInstantiationException( - e, null, "The component type must be an instance of ComponentType"); - } - - // checks the component type - InterfaceType[] itfTypes = compType.getFcInterfaceTypes(); - Tree[] itfTrees = new Tree[itfTypes.length]; - for (int i = 0; i < itfTypes.length; i++) { - InterfaceType itfType = itfTypes[i]; - String itfName = itfType.getFcItfName(); - if (!itfName.equals("attribute-controller")) { - if (itfName.equals("component") || itfName.endsWith("-controller")) { - throw new ChainedInstantiationException( - null, - null, - "The component type must not contain control interface types"); - } - } - itfTrees[i] = new Tree(new Tree[] { - new Tree(itfName), - new Tree(itfType.getFcItfSignature()), - new Tree(itfType.isFcClientItf() ? "true" : "false"), - new Tree(itfType.isFcOptionalItf() ? "true" : "false"), - new Tree(itfType.isFcCollectionItf() ? "true" : "false") - }); - } - - // returns the type descriptor - return new Tree(itfTrees); - } - - /** - * Returns the tree corresponding to the given controller descriptor. This - * tree is found by using the {@link #_this_weaveableL} loader. It must have - * the format specified in {@link - * org.objectweb.fractal.julia.asm.ContextClassGenerator} - * - * @param controllerDesc a string referencing a true controller descriptor. - * @return the tree corresponding to the given controller descriptor. - * @throws InstantiationException if the tree cannot be loaded. - */ - - public Tree getFcControllerDescriptor (final Object controllerDesc) - throws InstantiationException - { - Map definitions = new HashMap(); - definitions.put("attributeControllerInterface", new Tree("QUOTE")); - definitions.put("interfaceName", new Tree("QUOTE")); - try { - return _this_weaveableL.evalTree( - _this_weaveableL.loadTree((String)controllerDesc), definitions); - } catch (Exception e) { - throw new ChainedInstantiationException( - e, - null, - "Cannot load the '" + controllerDesc + "' controller descriptor"); - } - } - - /** - * Returns the tree corresponding to the given content descriptor. This tree - * has the format specified in {@link - * org.objectweb.fractal.julia.asm.ContextClassGenerator} - * - * @return the tree corresponding to the given content descriptor. - */ - - public Tree getFcContentDescriptor (final Object contentDesc) { - if (contentDesc instanceof String) { - return new Tree((String)contentDesc); - } else if (contentDesc != null && !(contentDesc instanceof Object[])) { - return new Tree(contentDesc.getClass().getName()); - } else { - return new Tree("EMPTY"); - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableL field required by this mixin. This field is - * supposed to reference the {@link Loader} interface of the component to - * which this controller object belongs. - */ - - public Loader _this_weaveableL; - - /** - * The weaveableTF field required by this mixin. This field is - * supposed to reference the {@link TypeFactory} interface of the component to - * which this controller object belongs. - */ - - public TypeFactory _this_weaveableTF; -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/BasicTemplateMixin.java b/julia/src/org/objectweb/fractal/julia/factory/BasicTemplateMixin.java deleted file mode 100644 index 812471ba60cfb56ddf82f45367d2c60f67f130ff..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/BasicTemplateMixin.java +++ /dev/null @@ -1,375 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Fractal; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; -import org.objectweb.fractal.julia.control.content.Util; -import org.objectweb.fractal.julia.type.BasicComponentType; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Provides a basic implementation of the {@link Template} interface. - *
- *
- * Requirements (here "sub template" means "any direct or indirect sub - * template") - *
    - *
  • the type of this template component must be an instance of {@link - * ComponentType}.
  • - *
  • all the sub templates of this template component must provide the {@link - * Template} interface (and the {@link Component} interface).
  • - *
  • if this template component, or one of its sub templates, has a {@link - * ContentController} interface, then the components instantiated by this - * template component must also have the {@link ContentController} interface. - * Likewise for the {@link BindingController} interface.
  • - *
  • For each binding between template components, the server interface must - * implement the {@link Interface} interface. Moreover, the owner of this - * interface must be a (sub) template of this template component.
  • - *
- */ - -public abstract class BasicTemplateMixin implements Controller, Template { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private BasicTemplateMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The functional type of the components instantiated by this template. - */ - - public Type fcInstanceType; - - /** - * The controller and content descriptors of the components instantiated by - * this template. - */ - - public Object[] fcContent; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - // initializes the fcContent field - fcContent = (Object[])ic.content; - - // initializes the fcInstanceType field - // this type is computed from the type of this component by removing the - // factory interface type, and all the control interface types - ComponentType tmplType = (ComponentType)ic.type; - InterfaceType[] itfTypes = tmplType.getFcInterfaceTypes(); - List itfList = new ArrayList(); - for (int j = 0; j < itfTypes.length; ++j) { - String n = itfTypes[j].getFcItfName(); - if (!n.equals("factory")) { - if (n.equals("attribute-controller")) { - itfList.add(itfTypes[j]); - } else if (!(n.equals("component") || n.endsWith("-controller"))) { - itfList.add(itfTypes[j]); - } - } - } - itfTypes = new InterfaceType[itfList.size()]; - itfTypes = (InterfaceType[])itfList.toArray(itfTypes); - fcInstanceType = new BasicComponentType(itfTypes); - - // calls the overriden method - _super_initFcController(ic); - } - - public Type getFcInstanceType () { - return fcInstanceType; - } - - public Object getFcControllerDesc () { - return fcContent[0]; - } - - public Object getFcContentDesc () { - return fcContent[1]; - } - - public Component newFcInstance () throws InstantiationException { - // finds all the direct and indirect sub templates of this template - // finds all the direct and indirect sub components of this component - Component thisComponent; - try { - thisComponent = (Component)_this_weaveableC.getFcInterface("component"); - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - _this_weaveableC, - "The template component must provide the Component interface"); - } - List allSubTemplates = Util.getAllSubComponents(thisComponent); - - // instantiates all the templates - Map instances = new HashMap(); - for (int i = 0; i < allSubTemplates.size(); ++i) { - Component tmpl = (Component)allSubTemplates.get(i); - Template t; - try { - t = (Template)tmpl.getFcInterface("factory"); - } catch (Exception e) { - try { - t = (Template)tmpl.getFcInterface("/template"); - } catch (NoSuchInterfaceException f) { - throw new ChainedInstantiationException( - f, - _this_weaveableC, - "All the (sub) templates must provide the Template interface"); - } - } - Component instance = t.newFcControllerInstance(); - instances.put(tmpl, instance); - } - - // adds the instances into each other - for (int i = 0; i < allSubTemplates.size(); ++i) { - Component tmpl = (Component)allSubTemplates.get(i); - Component instance = (Component)instances.get(tmpl); - - ContentController tmplCC, instanceCC; - try { - tmplCC = (ContentController)tmpl.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - continue; - } - try { - instanceCC = - (ContentController)instance.getFcInterface("content-controller"); - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "A component instantiated from a template with a ContentController " + - "interface must provide the ContentController interface"); - } - Component[] subTemplates = tmplCC.getFcSubComponents(); - Component[] subInstances = instanceCC.getFcSubComponents(); - for (int j = 0; j < subTemplates.length; ++j) { - Component subInstance = (Component)instances.get(subTemplates[j]); - boolean add = true; - for (int k = 0; k < subInstances.length; ++k) { - if (subInstances[k].equals(subInstance)) { - // if sunInstance is already a sub component of instance, - // do not add it again (this can happen with singleton templates) - add = false; - } - } - if (add) { - try { - instanceCC.addFcSubComponent(subInstance); - } catch (IllegalContentException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "Cannot set the component hierarchy from the template hierarchy"); - } catch (IllegalLifeCycleException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "Cannot set the component hierarchy from the template hierarchy"); - } - } - } - } - - // binds the instances to each other, as the templates are bound - for (int i = 0; i < allSubTemplates.size(); ++i) { - Component tmpl = (Component)allSubTemplates.get(i); - Component instance = (Component)instances.get(tmpl); - - BindingController tmplBC, instanceBC; - try { - tmplBC = (BindingController)tmpl.getFcInterface("binding-controller"); - } catch (NoSuchInterfaceException e) { - continue; - } - try { - instanceBC = - (BindingController)instance.getFcInterface("binding-controller"); - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "A component instantiated from a template with a BindingController " + - "interface must provide the BindingController interface"); - } - String[] itfNames = tmplBC.listFc(); - for (int j = 0; j < itfNames.length; ++j) { - String itfName = itfNames[j]; - Interface serverItf; - try { - serverItf = (Interface)tmplBC.lookupFc(itfName); - } catch (ClassCastException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "The server interface of each binding between templates " + - "must implement the Interface interface"); - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "The '" + itfName + - "' interface returned by the listFc method does not exist"); - } - if (serverItf == null) { - continue; - } - - Component serverTmpl = serverItf.getFcItfOwner(); - Component serverInstance = (Component)instances.get(serverTmpl); - if (serverInstance == null) { - // 'tmpl' bound to a component that does not belong to the root - // instantiated template: do not create this binding for 'instance' - continue; - } - - Object itfValue; - try { - if (serverItf.isFcInternalItf()) { - ContentController cc = (ContentController)serverInstance. - getFcInterface("content-controller"); - itfValue = cc.getFcInternalInterface(serverItf.getFcItfName()); - } else { - itfValue = serverInstance.getFcInterface(serverItf.getFcItfName()); - } - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - serverTmpl, - "The server interface '" + serverItf.getFcItfName() + - "'is missing in the component instantiated from the template"); - } - - try { - if (instanceBC.lookupFc(itfName).equals(itfValue)) { - // if the binding already exists, do not create again - // (this can happen with singleton templates) - continue; - } - } catch (Exception e) { - } - - try { - instanceBC.bindFc(itfName, itfValue); - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "Cannot set the component bindings from the template bindings"); - } catch (IllegalBindingException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "Cannot set the component bindings from the template bindings"); - } catch (IllegalLifeCycleException e) { - throw new ChainedInstantiationException( - e, - tmpl, - "Cannot set the component bindings from the template bindings"); - } - } - } - - return (Component)instances.get(allSubTemplates.get(0)); - } - - public Component newFcControllerInstance () throws InstantiationException { - if (fcContent[1] instanceof Component) { - return (Component)fcContent[1]; - } - GenericFactory factory; - try { - factory = (GenericFactory)Fractal.getBootstrapComponent(). - getFcInterface("generic-factory"); - } catch (InstantiationException e) { - throw new ChainedInstantiationException( - e, - _this_weaveableC, - "Cannot find the GenericFactory interface of the bootstrap " + - "component, which is needed to instantiate the template"); - } catch (NoSuchInterfaceException e) { - throw new ChainedInstantiationException( - e, - _this_weaveableC, - "Cannot find the GenericFactory interface of the bootstrap " + - "component, which is needed to instantiate the template"); - } - return factory.newFcInstance(fcInstanceType, fcContent[0], fcContent[1]); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/ChainedInstantiationException.java b/julia/src/org/objectweb/fractal/julia/factory/ChainedInstantiationException.java deleted file mode 100644 index 2cbabc1a13c917fbc123b39e723cf084102e9d97..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/ChainedInstantiationException.java +++ /dev/null @@ -1,174 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Util; - -import java.io.PrintStream; -import java.io.PrintWriter; -import java.io.ObjectOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; - -/** - * A sub class of the {@link InstantiationException} class. - */ - -public class ChainedInstantiationException extends InstantiationException { - - /** - * The exception that caused this exception. May be null. - */ - - private final Throwable exception; - - /** - * The factory component that cannot be instantiated. May be null. - */ - - private transient Component factory; - - /** - * Constructs a new {@link ChainedInstantiationException} exception. - * - * @param exception the cause of this exception. May be null. - * @param factory the factory component that cannot be instantiated. May be - * null. - * @param message a detailed error message. - */ - - public ChainedInstantiationException ( - final Throwable exception, - final Component factory, - final String message) - { - super(message); - this.exception = exception; - this.factory = factory; - } - - /** - * Returns the exception that caused in this exception. - * - * @return the exception that caused this exception. May be null. - */ - - public Throwable getException () { - return exception; - } - - /** - * Returns the factory component that cannot be instantiated. - * - * @return the factory component that cannot be instantiated. May be - * null. - */ - - public Component getFactory () { - if (factory != null && !(factory instanceof Interface)) { - try { - return (Component)factory.getFcInterface("component"); - } catch (NoSuchInterfaceException ignored) { - } - } - return factory; - } - - // ------------------------------------------------------------------------- - // Overriden Exception methods - // ------------------------------------------------------------------------- - - /** - * Returns a String representation of this exception. - * - * @return a String representation of this exception. - */ - - public String toString () { - StringBuffer buf = new StringBuffer(); - buf.append("InstantiationException: "); - buf.append(getMessage()); - if (getFactory() != null) { - buf.append(" (template = "); - Util.toString(getFactory(), buf); - buf.append(')'); - } - return buf.toString(); - } - - /** - * Prints the stack backtrace. - */ - - public void printStackTrace () { - if (exception != null) { - exception.printStackTrace(); - } - super.printStackTrace(); - } - - /** - * Prints this exception and its backtrace to the specified print stream. - * - * @param s PrintStream to use for output. - */ - - public void printStackTrace (final PrintStream s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - /** - * Prints this exception and its backtrace to the specified print writer. - * - * @param s PrintWriter to use for output. - */ - - public void printStackTrace (final PrintWriter s) { - if (exception != null) { - exception.printStackTrace(s); - } - super.printStackTrace(s); - } - - private void writeObject (final ObjectOutputStream out) throws IOException { - out.defaultWriteObject(); - Component c = getFactory(); - out.writeObject(c instanceof Interface ? c : null); - } - - private void readObject (final ObjectInputStream in) - throws IOException, ClassNotFoundException - { - in.defaultReadObject(); - factory = (Component)in.readObject(); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/CheckGenericFactoryMixin.java b/julia/src/org/objectweb/fractal/julia/factory/CheckGenericFactoryMixin.java deleted file mode 100644 index fab11bb57929ab4aed3aba49fd4a894c18729383..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/CheckGenericFactoryMixin.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import java.lang.reflect.Modifier; - -/** - * Provides reflective checks to a {@link GenericFactory}. - *
- *
- * Requirements - *
    - *
  • the types of the components created with this generic factory must be - * instances of the {@link ComponentType} interface.
  • - *
  • the Java platform must provide the Java Reflection API, the - * ClassLoader class, and Thread.getContextClassLoader method.
  • - *
- */ - -public abstract class CheckGenericFactoryMixin implements GenericFactory { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private CheckGenericFactoryMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks that type and contentDesc are compatible, and - * then calls the overriden method. - */ - - public Component newFcInstance ( - final Type type, - final Object controllerDesc, - final Object contentDesc) throws InstantiationException - { - Object content = contentDesc; - if (content instanceof Object[]) { - // case of a template content descriptor: - // extract the instance content descriptor - content = ((Object[])content)[1]; - } - if (content instanceof String) { - checkFcContentClass(type, (String)content); - } - return _super_newFcInstance(type, controllerDesc, contentDesc); - } - - /** - * Checks the given class against the given component type. This method checks - * that the given class exists, that it is public non abstract class with a - * default public constructor, that it implements all the server interface - * types (except control interface types) of the given type, and that it - * implements BindingController (if there is at least one client interface). - * - * @param type a component type, must be instance of {@link ComponentType}. - * @param content the fully qualified name of a Java class. - * @throws InstantiationException if the given class is not compatible with - * the given component type. - */ - - public void checkFcContentClass (final Type type, final String content) - throws InstantiationException - { - Class contentClass; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - // checks that the class exists - try { - contentClass = cl.loadClass(content); - } catch (ClassNotFoundException e) { - cl = getClass().getClassLoader(); - try { - contentClass = cl.loadClass(content); - } catch (ClassNotFoundException f) { - throw new ChainedInstantiationException( - f, - null, - "Cannot find the component implementation class '" + content + "'"); - } - } - // checks that the class is public and non abstract class - int mods = contentClass.getModifiers(); - if (!Modifier.isPublic(mods) || - Modifier.isAbstract(mods) || - Modifier.isInterface(mods)) - { - throw new ChainedInstantiationException( - null, - null, - "The component implementation class '" + content + - "' is a not public, non abstract class"); - } - // checks that the class has a default public constructor - try { - contentClass.getConstructor(new Class[0]); - } catch (final NoSuchMethodException e) { - throw new ChainedInstantiationException( - null, - null, - "The component implementation class '" + content + - "' does not have a default public constructor"); - } - // check that the class implements BindingController, if this is required - boolean hasDependencies = false; - ComponentType compType = (ComponentType)type; - InterfaceType[] itfTypes = compType.getFcInterfaceTypes(); - for (int i = 0; i < itfTypes.length; i++) { - InterfaceType itfType = itfTypes[i]; - if (itfType.isFcClientItf()) { - hasDependencies = true; - } - } - if (hasDependencies) { - Class bc; - try { - bc = cl.loadClass( - "org.objectweb.fractal.api.control.BindingController"); - } catch (ClassNotFoundException e) { - throw new ChainedInstantiationException( - e, null, "Cannot find the BindingController class"); - } - if (!bc.isAssignableFrom(contentClass)) { - throw new ChainedInstantiationException( - null, - null, - "The component implementation class '" + content + - "' must implement the BindingController interface, " + - "since the component type contains client interfaces"); - } - } - // check that the class implements all the server interface types - for (int i = 0; i < itfTypes.length; ++i) { - InterfaceType itfType = itfTypes[i]; - String itfName = itfType.getFcItfName(); - if (!itfType.isFcClientItf() && - !itfType.isFcOptionalItf() && - !(itfName.equals("component") ||itfName.endsWith("-controller"))) - { - Class itf; - try { - itf = cl.loadClass(itfType.getFcItfSignature()); - } catch (ClassNotFoundException e) { - throw new ChainedInstantiationException( - e, - null, - "Cannot find the Java interface '" + itfType.getFcItfSignature() + - "' declared in the component type"); - } - if (!itf.isAssignableFrom(contentClass)) { - throw new ChainedInstantiationException( - null, - null, - "The component implementation class '" + content + - "' does not implement the '" + itf.getName() + - "' server interface declared in the component type"); - } - } - } - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link GenericFactory#newFcInstance newFcInstance} method overriden by - * this mixin. - */ - - public abstract Component _super_newFcInstance ( - Type type, - Object controllerDesc, - Object contentDesc) throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/NameTemplateMixin.java b/julia/src/org/objectweb/fractal/julia/factory/NameTemplateMixin.java deleted file mode 100644 index a5cccb7e74c2e04653a2d404f0efc6d69b24d1fb..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/NameTemplateMixin.java +++ /dev/null @@ -1,93 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.NameController; - -/** - * Provides a name copy function to a {@link Template}. - *
- *
- * Requirements - *
    - *
  • none (the template component may provide a {@link NameController} - * interface, but this is not mandatory - in this case this mixin does - * nothing).
  • - *
- */ - -public abstract class NameTemplateMixin implements Template { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private NameTemplateMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Calls the overriden method and then sets the name of the created component. - * The name of the created component is initialized to the name of this - * template, if both components have a {@link NameController} interface - * (otherwise this mixin does nothing). - */ - - public Component newFcControllerInstance () { - Component comp = _super_newFcControllerInstance(); - if (_this_weaveableOptNC != null) { - try { - // copies the name of this template to the component, if applicable - String name = _this_weaveableOptNC.getFcName(); - ((NameController)comp.getFcInterface("name-controller")).setFcName(name); - } catch (NoSuchInterfaceException ignored) { - } - } - return comp; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableOptNC field required by this mixin. This field is - * supposed to reference the {@link NameController} interface of the component - * to which this controller object belongs. - */ - - public NameController _this_weaveableOptNC; - - /** - * The {@link Template#newFcControllerInstance newFcControllerInstance} - * overriden by this mixin. - */ - - public abstract Component _super_newFcControllerInstance (); -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/SingletonTemplateMixin.java b/julia/src/org/objectweb/fractal/julia/factory/SingletonTemplateMixin.java deleted file mode 100644 index 0f7dffe04ad304da86bf4cfd2a482ccf1b89bf73..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/SingletonTemplateMixin.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; - -/** - * Provides a singleton behavior to a {@link Template}. - * A singleton composite template must only contain other singleton - * templates, otherwise the "singleton" semantics will not be ensured. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public abstract class SingletonTemplateMixin implements Template { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private SingletonTemplateMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The singleton instance created by this template. - */ - - public Component fcInstance; - - /** - * Calls the overriden method only if the {@link #fcInstance} field is - * null. - */ - - public Component newFcControllerInstance () { - if (fcInstance == null) { - fcInstance = _super_newFcControllerInstance(); - } - return fcInstance; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Template#newFcControllerInstance newFcControllerInstance} - * overriden by this mixin. - */ - - public abstract Component _super_newFcControllerInstance (); -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/Template.java b/julia/src/org/objectweb/fractal/julia/factory/Template.java deleted file mode 100644 index 1405071a588c2d8212d4d8fd5605c5ebc87b4796..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/Template.java +++ /dev/null @@ -1,49 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.factory; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.Factory; -import org.objectweb.fractal.api.factory.InstantiationException; - -/** - * An extended {@link Factory} interface. - */ - -public interface Template extends Factory { - - /** - * Instantiates only the controller part of the component normally - * instantiated by this template. Because of component sharing, the {@link - * #newFcInstance newFcInstance} method cannot be implemented by just calling - * itself recursively on the sub templates of this template (otherwise some - * sub templates may be instantiated several times). Hence this method. - * - * @return the instantiated component. - * @throws InstantiationException if the component controller cannot be - * instantiated. - */ - - Component newFcControllerInstance () throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/factory/package.html b/julia/src/org/objectweb/fractal/julia/factory/package.html deleted file mode 100644 index 93fb02a218b675e47954d9c650f76e5abef3bdde..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/factory/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides mixins to implement the {@link -org.objectweb.fractal.api.factory.Factory [Generic]Factory} interfaces. -@since Julia 0.8.0 - - diff --git a/julia/src/org/objectweb/fractal/julia/loader/BasicLoader.java b/julia/src/org/objectweb/fractal/julia/loader/BasicLoader.java deleted file mode 100644 index c52846c247f81b9283fe8c6dec8622b75d302a26..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/BasicLoader.java +++ /dev/null @@ -1,437 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.loader; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Provides a basic implementation of the {@link Loader} interface. This - * implementation loads the required classes from the class path. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public class BasicLoader implements Loader { - - // ------------------------------------------------------------------------- - // PUBLIC constructor (needed for bootstrap) - // ------------------------------------------------------------------------- - - public BasicLoader () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The value of the 'julia.config' system property. This property is a list - * of configuration file names. - */ - - private String config; - - /** - * The value of the 'julia.loader.gen.check' system property. This property - * indicates whether or not the class parameters of the generated classes must - * be checked. - */ - - private boolean checkClassParameters; - - /** - * The value of the 'julia.loader.gen.pkg' system property. This property - * indicates the package that contains the classes generated by Julia. - */ - - private String genPkg; - - /** - * A map associating variable names to {@link Tree} values. - */ - - private Map definitions; - - /** - * A transient stream used to parse trees. - */ - - private InputStream is; - - /** - * Current line number in {@link #is is}. - */ - - private int line; - - /** - * Last character read from {@link #is is}. - */ - - private int car; - - // ------------------------------------------------------------------------- - // Implementation of the Loader interface - // ------------------------------------------------------------------------- - - public Tree loadTree (final String name) throws Exception { - if (definitions == null) { - config = System.getProperty("julia.config"); - if (config == null) { - throw new Exception( - "The julia.config system property is not defined"); - } - if ("true".equals(System.getProperty("julia.loader.check"))) { - checkClassParameters = true; - } - definitions = new HashMap(); - int b = 0; - int i; - do { - i = config.indexOf(',', b); - String file; - if (i == -1) { - file = config.substring(b); - } else { - file = config.substring(b, i); - b = i + 1; - } - InputStream is; - try { - is = getInputStream(file); - } catch (IOException ioe) { - is = getClass().getResourceAsStream("/" + file); - if (is == null) { - throw new Exception("Cannot find or open the '" + file + "' file"); - } - } - try { - line = 1; - while (true) { - Tree def; - try { - def = parseTree(is); - } catch (Throwable e) { - throw new Exception( - "File '" + file + "', line " + line + ": " + e.getMessage()); - } - if (def == null) { - break; - } else { - definitions.put(def.getSubTree(0).toString(), def.getSubTree(1)); - } - } - } finally { - try { - is.close(); - } catch (IOException ignored) { - } - } - } while (i != -1); - } - Tree t = (Tree)definitions.get(name); - if (t == null) { - throw new Exception( - "Cannot find the '" + name + - "' descriptor in the '" + config + - "' file(s) specified in the julia.loader.config system property"); - } - return t; - } - - public Tree evalTree (final Tree tree, final Map context) - throws Exception - { - if (tree.getSize() == 0) { - String var = tree.toString(); - if (var.startsWith("'")) { - var = var.substring(1); - Tree val = (Tree)context.get(var); - if (val == null) { - val = loadTree(var); - } - if (val == null) { - throw new Exception(var); - } - if (!val.toString().equals("QUOTE")) { - return evalTree(val, context); - } - } - return tree; - } else { - boolean ok = true; - Tree[] subTrees = tree.getSubTrees(); - for (int i = 0; i < subTrees.length; ++i) { - Tree oldSubTree = subTrees[i]; - Tree newSubTree = evalTree(oldSubTree, context); - if (newSubTree != oldSubTree) { - if (ok) { - Tree[] newSubTrees = new Tree[subTrees.length]; - System.arraycopy(subTrees, 0, newSubTrees, 0, subTrees.length); - subTrees = newSubTrees; - ok = false; - } - subTrees[i] = newSubTree; - } - } - return (ok ? tree : new Tree(subTrees)); - } - } - - public Object newObject (final Tree objectDescriptor) throws Exception { - if (objectDescriptor.getSize() == 0) { - return loadClass(objectDescriptor.toString()).newInstance(); - } else { - Object o; - o = loadClass(objectDescriptor.getSubTree(0)).newInstance(); - if (objectDescriptor.getSize() > 1) { - Tree[] trees = objectDescriptor.getSubTrees(); - Tree[] args = new Tree[trees.length - 1]; - System.arraycopy(trees, 1, args, 0, args.length); - ((Initializable)o).initialize(new Tree(args)); - } - return o; - } - } - - public Class loadClass (final String name) throws ClassNotFoundException { - return Class.forName(name); - } - - public Class loadClass (final Tree classDescriptor) - throws ClassNotFoundException - { - if (classDescriptor.getSize() == 0) { - return loadClass(classDescriptor.toString()); - } - if (genPkg == null) { - genPkg = System.getProperty("julia.loader.gen.pkg"); - if (genPkg == null) { - genPkg = "org.objectweb.fractal.julia.generated.C"; - } else { - genPkg = genPkg + ".C"; - } - } - int n = 0; - String s = genPkg + Integer.toHexString(classDescriptor.hashCode()) + "_"; - while (true) { - String name = s + n; - Class c; - try { - c = loadClass(name); - } catch (ClassNotFoundException e) { - return generateClass(name, classDescriptor); - } - if (!checkClassParameters) { - return c; - } - try { - Generated gen = (Generated)c.newInstance(); - if (gen != null && - classDescriptor.equals(gen.getFcGeneratorParameters())) - { - return c; - } - } catch (Exception ignored) { - } - ++n; - } - } - - // ------------------------------------------------------------------------- - // Utility methods: tree parsing - // ------------------------------------------------------------------------- - - /* - * Convenience method used for J2ME conversion - * (FileInputStream not available in CLDC API). - */ - - private InputStream getInputStream (String file) throws IOException { - return new FileInputStream(file); - } - - /** - * Creates a tree by parsing the given input stream. This method can be called - * several times on the same stream, in order to parse several consecutive - * trees, but only if the there is at least one space, tab or return - * character between these trees. - * - * @param is the input stream to be parsed. This input stream must use a LISP - * like syntax, with single line comments beginning with '#', as in the - * following example: - *
-   *      ( # foo
-   *        foo
-   *        # bar
-   *        (bar foo)
-   *      )
- * @return the tree parsed from the given input stream, or null if - * the end of the stream has been reached. - * @throws IOException if an I/O exception occurs during parsing. - * @throws Exception if a syntax error is found. - */ - - private Tree parseTree (final InputStream is) throws Exception { - try { - this.is = is; - read(); - parseSpaces(); - if (car == -1) { - return null; - } else { - return parseTree(); - } - } finally { - this.is = null; - } - } - - /** - * Recursive method to parse a tree. The first character of the tree to be - * parsed is supposed to have already been read, and available in {@link #car - * car}. After parsing, the character immediately following the parsed tree - * is also supposed to have already been parsed, and available in {@link #car - * car}. - * - * @return a tree parsed from the {@link #is is} stream. - * @throws IOException if an I/O exception occurs during parsing. - * @throws Exception if a syntax error is found. - */ - - private Tree parseTree () throws IOException, Exception { - int c = car; - if (c == -1) { - throw new Exception("Unexpected end of file"); - } else if (c == ')') { - throw new Exception("Unmatched closing parenthesis"); - } else if (c == '(') { - // parses a tree of the form "(subTree1 ... subTreeN)" - read(); - List subTrees = new ArrayList(); - while (true) { - c = parseSpaces(); - if (c == ')') { - read(); - return new Tree((Tree[])subTrees.toArray(new Tree[subTrees.size()])); - } else { - subTrees.add(parseTree()); - } - } - } else { - // parses a tree of the form "tree" - StringBuffer buf = new StringBuffer(); - while (true) { - buf.append((char)c); - c = read(); - if (c == -1 || c == ' ' || c == '\t' || c == '\n' || - c == '\r' || c == '#' || c == '(' || c == ')') - { - car = c; - return new Tree(buf.toString()); - } - } - } - } - - /** - * Parses spaces and comments until a non space character is found. - * - * @return the first non space character found, which is also stored in - * {@link #car car}. - * @throws IOException if I/O exception occurs during parsing. - */ - - private int parseSpaces () throws IOException { - int c = car; - while (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '#') { - if (c == '#') { - // parses a single line comment - do { - c = read(); - } while (c != '\n' && c != '\r'); - } - c = read(); - } - return car = c; - } - - /** - * Reads a char in {@link #is} and updates {@link #line} if needed. - * - * @return a char read from {@link #is}. - * @throws IOException if I/O exception occurs during reading. - */ - - private int read () throws IOException { - car = is.read(); - if (car == '\n' || car == '\r') { - ++line; - } - return car; - } - - // ------------------------------------------------------------------------- - // Utility methods: class generation - // ------------------------------------------------------------------------- - - /** - * Generates the class whose descriptor is given, with the given name. The - * generated class must implement the {@link Generated} interface, - * and its {@link Generated#getFcGeneratorParameters getFcGeneratorParameters} - * method must return classDescriptor.toString(). The default - * implementation of this method throws an exception. - * - * @param name the name of the class to be generated. - * @param classDescriptor the descriptor of the class to be generated. This - * descriptor must be of the form "(objectDescriptor arg1 ... - * argN)" (see {@link #loadClass(Tree) loadClass}). - * @return a class named name and whose content is described by the - * given class descriptor. - * @throws ClassNotFoundException if a problem occurs during the generation - * of the class. - */ - - protected Class generateClass ( - final String name, - final Tree classDescriptor) throws ClassNotFoundException - { - throw new ClassNotFoundException(name); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - -} diff --git a/julia/src/org/objectweb/fractal/julia/loader/DynamicLoader.java b/julia/src/org/objectweb/fractal/julia/loader/DynamicLoader.java deleted file mode 100644 index ea8a3f76ceb0f1daa160e87cb5eaaacf1258a6ba..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/DynamicLoader.java +++ /dev/null @@ -1,215 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.loader; - -import org.objectweb.fractal.julia.asm.ClassGenerationException; -import org.objectweb.fractal.julia.asm.ClassGenerator; - -import java.io.BufferedOutputStream; -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -/** - * Provides an implementation of the {@link Loader} interface that can - * generate classes on the fly. - *
- *
- * Requirements - *
    - *
  • the Java platform must provide the Java reflection API and the - * ClassLoader class.
  • - *
- */ - -public class DynamicLoader extends BasicLoader { - - // ------------------------------------------------------------------------- - // PUBLIC constructor (needed for bootstrap) - // ------------------------------------------------------------------------- - - public DynamicLoader () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - public Class loadClass (final String name) throws ClassNotFoundException { - try { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - cl = PublicClassLoader.getInstance(cl); - return cl.loadClass(name); - } catch (ClassNotFoundException e) { - ClassLoader cl = getClass().getClassLoader(); - cl = PublicClassLoader.getInstance(cl); - return cl.loadClass(name); - } - } - - protected Class generateClass ( - final String name, - final Tree classDescriptor) throws ClassNotFoundException - { - ClassGenerator classGen = null; - try { - classGen = (ClassGenerator)newObject(classDescriptor.getSubTree(0)); - } catch (ClassCastException e) { - throw new ClassGenerationException( - null, - classDescriptor.toString(), - "The class generator is not an instance of ClassGenerator"); - } catch (Exception e) { - throw new ClassGenerationException( - e, classDescriptor.toString(), "Cannot create the class generator"); - } - byte[] b = classGen.generateClass(name, classDescriptor, this); - String genLog = System.getProperty("julia.loader.gen.log"); - String genDir = System.getProperty("julia.loader.gen.dir"); - if (genLog != null) { - String line = classDescriptor.toString(); - if (genLog.equals("out")) { - System.out.println(line); - } else if (genLog.equals("err")) { - System.err.println(line); - } else { - try { - FileWriter fw = new FileWriter(genLog, true); - fw.write(line); - fw.write('\n'); - fw.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - if (genDir != null) { - try { - String pkg; - String cls; - int dot = name.lastIndexOf('.'); - if (dot > 0) { - pkg = name.substring(0, dot).replace('.', File.separatorChar); - cls = name.substring(dot + 1); - } else { - pkg = ""; - cls = name; - } - File dirFile = new File(new File(genDir), pkg); - if (!dirFile.exists()) { - dirFile.mkdirs(); - } - File classFile = new File(dirFile, cls + ".class"); - BufferedOutputStream bos = - new BufferedOutputStream(new FileOutputStream(classFile)); - bos.write(b); - bos.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - PublicClassLoader pcl = PublicClassLoader.getInstance(cl); - return pcl.defineClass(name, b); - } - - /** - * Provides a {@link ClassLoader} with a public {@link ClassLoader#defineClass - * defineClass} method. - */ - - static class PublicClassLoader extends ClassLoader { - - /** - * A map associating loaders to their parent class loader. - */ - - private final static Map INSTANCES = new HashMap(); - - /** - * Byte code of the dynamically generated classes. - */ - - private Map bytecodes = new HashMap(); - - /** - * Constructs a {@link PublicClassLoader} with the given parent class - * loader. - * - * @param parent the parent class loader. - */ - - private PublicClassLoader (final ClassLoader parent) { - super(parent); - } - - /** - * Returns the PublicClassLoader whose parent class loader is equal to the - * given loader. - * - * @param parent the parent class loader. - * @return the PublicClassLoader whose parent class loader is equal to the - * given loader. - */ - - public static PublicClassLoader getInstance (final ClassLoader parent) { - synchronized (INSTANCES) { - PublicClassLoader instance = (PublicClassLoader)INSTANCES.get(parent); - if (instance == null) { - instance = new PublicClassLoader(parent); - INSTANCES.put(parent, instance); - } - return instance; - } - } - - /** - * Converts an array of bytes into an instance of class {@link Class}. - * - * @param name the name of the class. - * @param b the class bytes. - * @return the {@link Class} object created from the data. - */ - - public Class defineClass (final String name, final byte[] b) { - bytecodes.put(name.replace('.', '/') + ".class", b); - return defineClass(name, b, 0, b.length); - } - - public InputStream getResourceAsStream (final String name) { - InputStream is = super.getResourceAsStream(name); - if (is == null) { - byte[] b = (byte[])bytecodes.get(name); - if (b != null) { - is = new ByteArrayInputStream(b); - } - } - return is; - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/loader/Generated.java b/julia/src/org/objectweb/fractal/julia/loader/Generated.java deleted file mode 100644 index 90763b5fa662266ed79667e411909b7ddd2c7ec8..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/Generated.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.loader; - -/** - * The interface that all Julia's generated classes must implement. - */ - -public interface Generated { - - /** - * Returns the string representation of the arguments that were used to - * generate the class of this object. - * - * @return the string representation of the arguments that were used to - * generate the class of this object. This string representation is of - * the form "(objectDescriptor arg1 ... argN)" (see {@link - * Loader#loadClass loadClass}). - */ - - String getFcGeneratorParameters (); -} diff --git a/julia/src/org/objectweb/fractal/julia/loader/Initializable.java b/julia/src/org/objectweb/fractal/julia/loader/Initializable.java deleted file mode 100644 index 6a03d8c9043c3de6e66478abd144fb992e8406f4..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/Initializable.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.objectweb.fractal.julia.loader; - -/** - * The interface used by the {@link Loader#newObject newObject} method to - * initialize some objects. See {@link Loader#newObject newObject}. - */ - -public interface Initializable { - - /** - * Initializes this object with the given arguments. - * - * @param args the arguments to be used to initialize this object. The format - * of these arguments depends on the class of this object. - * @throws Exception if a problem occurs during the object initialization. - */ - - void initialize (Tree args) throws Exception; -} diff --git a/julia/src/org/objectweb/fractal/julia/loader/Loader.java b/julia/src/org/objectweb/fractal/julia/loader/Loader.java deleted file mode 100644 index 2f1664cbf0058da95306ac621bf9d6cc74675cfb..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/Loader.java +++ /dev/null @@ -1,126 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.loader; - -import java.util.Map; - -/** - * An interface to load classes or to generate them on the fly. - */ - -public interface Loader { - - /** - * Loads the tree whose name is given. - * - * @param name a tree name. - * @return the tree whose name is given. - * @throws Exception if the tree is not found or cannot be loaded. - */ - - Tree loadTree (String name) throws Exception; - - /** - * Evaluates the given tree in the given context. Each leaf node of the given - * tree whose name begins with ' is replaced by the evaluation of the tree - * associated to this name in the given context (except if the result of this - * evaluation is "QUOTE"). For example the evaluation of "('x d)" in a context - * where x is associated to "(a 'y)", y is associated to "(b 'z)", and z is - * associated to "QUOTE" gives "((a (b 'z)) d)". - * - * @param tree the tree to be evaluated. - * @param context a map associating names to trees. - * @return the evaluated tree. - * @throws Exception if a name is not found in the given context. The - * exception's detail is equal to this name. - */ - - Tree evalTree (Tree tree, Map context) throws Exception; - - /** - * Creates and returns the object whose description is given. - * - * @param objectDescriptor the descriptor of the object to be created. This - * descriptor must be either of the form "className", or of the form - * "(classDescriptor arg1 ... argN)". In the first case, "className" - * must be the fully qualified name of a class. In the second case, - * "classDescriptor" must be a valid class descriptor (see {@link - * #loadClass(Tree) loadClass}). "arg1" ... "argN" can be arbitrary - * trees. - * @return an object created according to the given description. If this - * description is of the form "className", this method returns a new - * instance of the "className" class (which must have a default public - * constructor). If the description is of the form "(classDescriptor - * arg1 ... argN)", the class described by "classDescriptor" is loaded or - * generated with the {@link #loadClass loadClass} method, and a new - * instance of this class is created (this class must have a default - * public constructor). Then, if the arguments "arg1 ... argN" are not - * empty, the {@link Initializable#initialize initialize} method is used - * to initialize the previous instance (in this case, the - * "classDescriptor" class must implement the {@link Initializable} - * interface; the {@link Initializable#initialize initialize} method is - * called with (arg1 ... argN) as parameter). Finally the - * previously created object is returned. - * @throws Exception if the specified object cannot be created. - */ - - Object newObject (Tree objectDescriptor) throws Exception; - - /** - * Loads the class whose name is given. - * - * @param className the fully qualified name of the class to be returned. - * @return the class whose name is given. - * @throws ClassNotFoundException if the specified class is not found. - */ - - Class loadClass (String className) throws ClassNotFoundException; - - /** - * Loads or generates the class whose descriptor is given. - * - * @param classDescriptor the descriptor of the class to be loaded or - * dynamically generated. This descriptor must be either of the form - * "className", or of the form "(objectDescriptor arg1 ... argN)". In the - * first case, "className" must be the fully qualified name of a class. - * In the second case, "objectDescriptor" must be a valid object - * descriptor (see {@link #newObject newObject}), describing an object - * that implements the {@link - * org.objectweb.fractal.julia.asm.ClassGenerator} interface. - * "arg1" ... "argN" can be arbitrary trees. - * @return the class whose description is given. If this description is of the - * form "className", this method returns the "className" class. If the - * description is of the form "(objectDescriptor arg1 ... argN)", the - * class generator described by "objectDescriptor" is instantiated with - * the {@link #newObject newObject} method, and its {@link - * org.objectweb.fractal.julia.asm.ClassGenerator#generateClass - * generateClass} method is used to generate a class (this method is - * called with classDescriptor as second argument), which is - * finally returned. - * @throws ClassNotFoundException is the specified class cannot be loaded or - * dynamically generated. - */ - - Class loadClass (Tree classDescriptor) throws ClassNotFoundException; -} diff --git a/julia/src/org/objectweb/fractal/julia/loader/Tree.java b/julia/src/org/objectweb/fractal/julia/loader/Tree.java deleted file mode 100644 index 9179984fabdc5bf325183b818a1ae190cb36e267..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/Tree.java +++ /dev/null @@ -1,272 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.loader; - -/** - * An immutable string tree. - */ - -public class Tree { - - /** - * The value of this leaf node, or null for a "normal" node. - */ - - private final String leaf; - - /** - * The subtrees of this node, or null for a leaf node. - */ - - private final Tree[] subTrees; - - // ----------------------------------------------------------------------- - // Constructor - // ----------------------------------------------------------------------- - - /** - * Constructs a new {@link Tree} instance. - * - * @param leaf the value of the node to be created. - */ - - public Tree (final String leaf) { - this.leaf = leaf; - this.subTrees = null; - } - /** - * Constructs a new {@link Tree} instance. - * - * @param subTrees the subtrees of the node to be created, or null - * for a leaf node. - */ - - public Tree (final Tree[] subTrees) { - this.leaf = null; - this.subTrees = subTrees; - } - - // ----------------------------------------------------------------------- - // Accessors - // ----------------------------------------------------------------------- - - /** - * Returns the number of sub trees of this tree. - * - * @return the number of sub trees of this tree. - */ - - public int getSize () { - return (subTrees == null ? 0 : subTrees.length); - } - - /** - * Returns the sub tree of this tree whose index is given. - * - * @param index the index of the sub tree to be returned. - * @return the sub tree of this tree whose index is given. - * @throws java.lang.ArrayIndexOutOfBoundsException if index is - * negative or strictly greater than {@link #getSize getSize}. - */ - - public Tree getSubTree (final int index) { - if (subTrees == null) { - throw new ArrayIndexOutOfBoundsException(index); - } else { - return subTrees[index]; - } - } - - /** - * Returns the sub trees of this tree. - * - * @return the sub trees of this tree. - */ - - public Tree[] getSubTrees () { - if (subTrees == null) { - return new Tree[0]; - } else { - return subTrees; - } - } - - // ----------------------------------------------------------------------- - // Overriden Object methods - // ----------------------------------------------------------------------- - - /** - * Tests if this tree is equal to the given object. - * - * @param o the object to be compared to this tree. - * @return true if o is a tree that is equal to this tree, - * or if o is a String that is equal to the String - * representation of this tree. - */ - - public boolean equals (final Object o) { - if (o instanceof String) { - String s = (String)o; - // instead of converting this tree to a String, and then comparing the two - // Strings, it is MUCH MORE EFFICIENT to compare the tree directly to the - // given String, without doing any String manipulation: - return equals(s, 0, s.length()) == 0; - } else { - throw new RuntimeException("Not yet implemented"); - } - } - - /** - * Returns the hashcode of this tree. - * - * @return the hashcode of this tree. - */ - - public int hashCode () { - // instead of converting this tree to a String, and then computing the - // hashcode of this String, it is MUCH MORE EFFICIENT to compute the - // hashcode directly, without doing any String manipulation: - return hashCode(0); - } - - /** - * Returns a string representation of this tree. - * - * @return a string representation of this tree, with a LISP like syntax, as - * in the following example: "(foo (bar foo))". - */ - - public String toString () { - if (leaf != null) { - return leaf; - } - if (subTrees.length == 0) { - return "()"; - } - StringBuffer buf = new StringBuffer(); - toString(buf); - return buf.toString(); - } - - // ----------------------------------------------------------------------- - // Utility methods - // ----------------------------------------------------------------------- - - /** - * Computes the hashcode of this tree based on an initial hashcode value. - * - * @param hc an initial hashcode value. - * @return the hashcode of this tree based on the given initial value. - */ - - private int hashCode (int hc) { - if (leaf != null) { - hc = 17 * (hc + leaf.hashCode()); - } else { - int l = subTrees.length; - hc = 17 * (hc + '('); - for (int i = 0; i < l; ++i) { - if (i > 0) { - hc = 17 * (hc + ' '); - } - hc = subTrees[i].hashCode(hc); - } - hc = 17 * (hc + ')'); - } - return hc; - } - - /** - * Test if the String representation of this tree is equal to the given - * String. - * - * @param str a String. - * @param off the start index of the String to be compared to this tree in - * str; - * @param len the length of the String to be compared to this tree. - * @return the number of remaining characters in str, once the prefix - * corresponding to the String representation of this tree is removed, or - * -1 if the given String does not starts with the String representation - * of this tree. - */ - - public int equals (final String str, int off, int len) { - if (leaf != null) { - int l = leaf.length(); - if (len < l || !str.regionMatches(false, off, leaf, 0, l)) { - return -1; - } - return len - l; - } else { - int l = subTrees.length; - if (len == 0 || str.charAt(off) != '(') { - return -1; - } - ++off; - --len; - for (int i = 0; i < l; ++i) { - if (i > 0) { - if (len == 0 || str.charAt(off) != ' ') { - return -1; - } - ++off; - --len; - } - int newLen = subTrees[i].equals(str, off, len); - if (newLen == -1) { - return -1; - } - off += len - newLen; - len = newLen; - } - if (len == 0 || str.charAt(off) != ')') { - return -1; - } - return len - 1; - } - } - - /** - * Appends the string representation of this tree to the given string buffer. - * - * @param buf the string buffer into which the string description of this - * tree must be appened. - */ - - private void toString (final StringBuffer buf) { - if (subTrees == null) { - buf.append(leaf); - } else { - int l = subTrees.length; - buf.append('('); - for (int i = 0; i < l; ++i) { - if (i > 0) { - buf.append(' '); - } - subTrees[i].toString(buf); - } - buf.append(')'); - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/loader/UseLoaderMixin.java b/julia/src/org/objectweb/fractal/julia/loader/UseLoaderMixin.java deleted file mode 100644 index 9c051833164117e7063128530561561c5a3a9c43..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/UseLoaderMixin.java +++ /dev/null @@ -1,84 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.loader; - -import org.objectweb.fractal.api.factory.InstantiationException; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a {@link Loader} field to a {@link Controller}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller belongs must provide the {@link - * Loader} interface.
  • - *
- */ - -public abstract class UseLoaderMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseLoaderMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The {@link Loader} interface of the component to which this controller - * object belongs. - */ - - public Loader weaveableL; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableL = (Loader)ic.getInterface("loader"); - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/loader/package.html b/julia/src/org/objectweb/fractal/julia/loader/package.html deleted file mode 100644 index c591854fa4d1db7db55d1e72ccb7f4181b56dccb..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/loader/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -Provides a loader to load or to generate classes on the fly. -@since Julia 2.0 - - diff --git a/julia/src/org/objectweb/fractal/julia/logger/LoggerLifeCycleMixin.java b/julia/src/org/objectweb/fractal/julia/logger/LoggerLifeCycleMixin.java deleted file mode 100644 index 9dc19e3ff13786956e0db15b64fb706a2447a6a1..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/logger/LoggerLifeCycleMixin.java +++ /dev/null @@ -1,175 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.logger; - -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.Component; - -import org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator; -import org.objectweb.fractal.julia.control.binding.ContentBindingController; -import org.objectweb.fractal.julia.Util; -import org.objectweb.fractal.julia.loader.Initializable; -import org.objectweb.fractal.julia.loader.Tree; - -import org.objectweb.util.monolog.api.Logger; -import org.objectweb.util.monolog.api.MonologFactory; -import org.objectweb.util.monolog.api.Loggable; -import org.objectweb.util.monolog.Monolog; - -/** - * Assigns a logger to a component during its startup. The topic - * name is based on the component path in the architecture. To use this mixin - * you have to add two lines in the julia.cfg configuration file: - *
- * (lifecycle-controller-impl
- *   ((org.objectweb.fractal.julia.asm.MixinClassGenerator
- *     LifeCycleControllerImpl
- *     org.objectweb.fractal.julia.BasicControllerMixin
- *     org.objectweb.fractal.julia.UseComponentMixin
- *     org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin
- *     org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin
- *     # to check that mandatory client interfaces are bound in startFc:
- *     org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin
- *     # to automatically assign the logger and logger factory:
- *     org.objectweb.fractal.julia.BasicInitializableMixin
- *     org.objectweb.fractal.julia.logger.LoggerLifeCycleMixin
- *     # to notify the encapsulated component (if present) when its state changes:
- *     org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin
- *   )
- *     # optional initialization parameter (monolog configuration file name):
- *     (monolog-conf-file monolog.properties)
- *   )
- * )
- * The user component must also implement either {@link BindingController} or - * {@link Loggable}. In the first case, the logger and logger factory can be - * retreived like this: - *
- * public void bindFc (String s, Object o) {
- *   if ("logger".equals(s)) {
- *     myLogger = (Logger) o;
- *   } else if ("monolog-factory".equals(s)) { // optional
- *     String baseName = myLogger.getName();
- *     otherLogger1 = ((LoggerFactory) o).getLogger(baseName + ".toto");
- *     otherLogger2 = ((LoggerFactory) o).getLogger(baseName + ".titi");
- *   } else ...
- * }
- * The other {@link BindingController} methods, and in particular the {@link - * BindingController#listFc listFc} method, must not take these logger - * "bindings" into account. - * - * @author E.Bruneton, S.Chassande-Barrioz - */ - -public abstract class LoggerLifeCycleMixin - implements LifeCycleCoordinator, Initializable -{ - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private LoggerLifeCycleMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - public void initialize (final Tree args) throws Exception { - _super_initialize(args); - for (int i = 0; i < args.getSize(); ++i) { - Tree arg = args.getSubTree(i); - if (arg.getSize() == 2 && arg.getSubTree(0).equals("monolog-conf-file")) { - String monologConfFile = arg.getSubTree(1).toString(); - if (Monolog.monologFactory == Monolog.getDefaultMonologFactory()) { - Monolog.getMonologFactory(monologConfFile); - } - } - } - } - - /** - * Calls the overriden method and then sets the logger and logger factory of - * the user component encapsulated in this component (if there is one). - */ - - public boolean setFcStarted () throws IllegalLifeCycleException { - boolean result = _super_setFcStarted(); - try { - if (Monolog.monologFactory == Monolog.getDefaultMonologFactory()) { - Monolog.initialize(); - } - StringBuffer path = new StringBuffer(); - Util.toString(_this_weaveableC, path); - String s = path.toString().substring(1).replace('/', '.'); - MonologFactory mf = Monolog.monologFactory; - Logger logger = Monolog.monologFactory.getLogger(s); - Object content = _this_weaveableC.getFcInterface("/content"); - if (content instanceof Loggable) { - ((Loggable)content).setLogger(logger); - ((Loggable)content).setLoggerFactory(mf); - } - if (content instanceof ContentBindingController) { - ContentBindingController bc = (ContentBindingController)content; - // final static constants must be avoided in mixins - bc.bindFcContent("logger", logger); - bc.bindFcContent("monolog-factory", mf); - } else if (content instanceof BindingController) { - BindingController bc = (BindingController)content; - // final static constants must be avoided in mixins - bc.bindFc("logger", logger); - bc.bindFc("monolog-factory", mf); - } - } catch (Exception ignored) { - } - return result; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The weaveableC field required by this mixin. This field is - * supposed to reference the {@link Component} interface of the component to - * which this controller object belongs. - */ - - public Component _this_weaveableC; - - /** - * The {@link Initializable#initialize initialize} method overriden by this - * mixin. - */ - - public abstract void _super_initialize (final Tree args) throws Exception; - - /** - * The {@link LifeCycleCoordinator#setFcStarted setFcStarted} method overriden - * by this mixin. - */ - - public abstract boolean _super_setFcStarted() throws IllegalLifeCycleException; -} diff --git a/julia/src/org/objectweb/fractal/julia/logger/package.html b/julia/src/org/objectweb/fractal/julia/logger/package.html deleted file mode 100644 index c96a1faa4a4f182046ee555e2c924549d88606be..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/logger/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides a mixin to assign a {@link org.objectweb.util.monolog.api.Logger Logger} to -components when they are started. -@since Julia 2.0 - - diff --git a/julia/src/org/objectweb/fractal/julia/overview.html b/julia/src/org/objectweb/fractal/julia/overview.html deleted file mode 100644 index 3f2ac5c122b520bfe1935c439acf6daa1bdad807..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/overview.html +++ /dev/null @@ -1,1266 +0,0 @@ - - - - - - -DO NOT REMOVE THIS LINE (will be automatically removed). - -

Table of Contents

-
-1 Introduction
-2 Design goals
-3 Code structure
-4 Main data structures
-5 Mixin classes
-6 Interceptor classes
-7 Class generation framework
-8 Support for constrained environments
-A Mixins reference
-B Optimizations
-
- -

1 Introduction

- -Julia is France Telecom's implementation of the Fractal Specification. -This document describes the design choices made to implement Julia, the -organization of Julia's source code, and the main algorithms and data -structures used in Julia. This document is intended for framework developpers -that want to extend Julia, but it can also be useful for component developpers -that want to understand how Julia works. The reader is supposed to be familiar -with the Fractal Specification. - -

2 Design Goals

- -The main design goal is to implement a framework to program component -controllers: we want to implement an extensible set of control objects, from -which the user can freely choose and assemble the controller objects he or she -wants, in order to build the controller part of a Fractal component. - -

The second goal is to provide a complete continuum from static -configuration to dynamic reconfiguration: we want to provide a sufficiently -rich and flexible set of control objects, so that the user can make the -speed/memory tradeoffs he or she wants. In particular, this set of control -objects must allow the user to instantiate non reconfigurable but very efficent -components or, on the contrary, completely reconfigurable but less efficient -components. It must also allow the user to mix these components, in order to use -different optimization levels for the different parts of an application. The -last requirement is to be able to dynamically deoptimize an optimized component, -in order to make it reconfigurable, and to be able to dynamically reoptimize it -after it has been reconfigured. - -

The third goal is to implement these control objects so as to minimize the -time overhead due to these objects on user applications and to optimize the -performances of the methods of the Fractal API. The memory overhead of the -controller objects was not a priority (indeed, in many cases, the number of -components is less than one hundred or a thousand of components). - -

The last goal is to implement a framework that can be used on any JVM and/or -JDK, including very constrained ones such as the KVM and the J2ME profile (where -there is no ClassLoader class, no reflection API, no collection -API...). - -

In addition to the previous design goals, we also make two hypotheses in -order to simplify the implementation: -

    -
  • concurrency: we suppose there is only one (re)configuration thread at a - given time.
  • - -
  • protection: Julia's internal data structures are not protected from - malicious user components.
  • -
- -

3 Code Structure

- -The source code of Julia is organized in three parts: -
    -
  • julia-runtime.jar: this part contains the minimum classes that are - needed at runtime. These classes are exception classes, some Java interfaces, - as well as some utility classes providing useful static methods.
  • - -
  • julia-mixins.jar: this part contains implementations of the Fractal - API interfaces, as a set of mixin classes (see section 5) - that can be composed in many ways.
  • - -
  • julia-asm.jar: this part contains the classes that are used to - generate application specific classes that are needed by Julia (these - application specific classes can be compared to stub and skeleton classes in - ORBs).
  • -
- -By default, when a Fractal application is launched with Julia, the generator -classes dynamically generate the needed application specific classes, as well as -the needed controller classes (by mixing some or all of the mixins classes). -These classes are then used to construct the application's components. If these -generated classes are stored on disk and included in the classpath, then the -application can be constructed directly, without needing the generator and -mixins classes. In summary, Julia can be used in two different ways: -
    -
  • with dynamic class generation: in this case the three julia-*.jar - files are needed at runtime, as well as the asm.jar file (and, of - course, the fractal.jar file - this gives a total of approximatively - 190 KB jars). This case is not always possible: indeed, the code generator - classes heavily rely on Java's reflection API, which is not available on all - JVMs (they also need a ClassLoader class which is not always - available).
  • - -
  • with static class generation: in this case, in addition to the generated - classes, only the julia-runtime.jar and the fractal.jar - files are needed at runtime (this gives a total of approximatively 45 KB).
  • -
- -The Julia source is organized in several packages that have the same structure -as the Fractal API packages: -
    -
  • the org.objectweb.fractal.julia package provides mixins classes - to implement the Component interface. It also provides an abstract - implementation of the Interface interface, which is used as a super - class to generate the application specific Interface classes.
  • -
  • the org.objectweb.fractal.julia.control.* packages provide mixins - classes to implement the BindingController, ContentController, - LifeCycleController and NameController interfaces.
  • - -
  • the org.objectweb.fractal.julia.factory package provides mixins - classes to implement the Factory and GenericFactory - interfaces.
  • - -
  • the org.objectweb.fractal.julia.type package provides classes - that implement the interfaces of the corresponding Fractal API package.
  • - -
  • finally the org.objectweb.fractal.julia.loader package provides a - dynamic and a static loader to load the needed application specific - classes.
  • -
- -

4 Main Data Structures

- -This section presents an overview of the data structures used in Julia to -represent Fractal components. - -

4.1 Overview

- -
- -

Figure 1: an abstract component and a possible implementation in Julia -

- -

A Fractal component is generally represented by many Java objects, which can -be separated into three groups (see Figure 1): -

-
    -
  • the objects that implement the component interfaces, in red and green in - the above figure (one object per component interface; each object has an - "impl" link to an object that really implements the Java interface, and to - which all method calls are delegated; this reference is null for - client interfaces),
  • - -
  • the objects that implement the controller part of the component, in black - and brown in the figure (a controller object can implement zero of more - control interfaces),
  • - -
  • and the objects that implement the content part of the component (not - shown in the figure).
  • -
- -The fact that each component interface is represented by its own Java object -comes from the fact that component interfaces are typed (i.e., a component -interface object implements both Interface and the Java interface -corresponding to this interface). It is not possible to do better, unless -perhaps by using very complex bytecode manipulations that modify the signature -of all the methods of all classes (if i and j are interface -objects corresponding to two component interfaces named "iitf" and "jitf", then -i.getFcName() = "iitf" and j.getFcItfName() = "jitf". -i and j must therefore be distinct objects - if they were -physicaly equal, then i.getFcItfName() and j.getFcItfName() -would be logically equal too). - -

The objects that represent the controller part of a component can be -separated into two groups: the objects that implement the control interfaces (in -black in the above figure), and (optional) interceptor objects (in brown) -that intercept incoming and/or outgoing method calls on functional (or business, -or user) interfaces. These objects implement respectively the Controller -and the Interceptor interfaces. Each controller object can contain -references (in black) to other controller objects (since the control aspects are -generally not independent - or "orthogonal" - they must generally communicate -between each other, and must therefore have references to each other). - -

The objects that implement the content part of a component can be sub -components (for composite components), or user objects (for primitive -components). Note: Julia makes a distinction between the primitive -components that contain no user objects (such as primitive template components), -which are just called "primitive", and primitive components that contain a non -empty rooted graph of user objects, which are called "container" -(this name can lead to confusions with the fuzzy EJB and CCM container -definitions, but we do not have a better name to express the fact that these -components contain a non empty set of user objects). - -

4.2 Constraints

- -In order to reconfigure a component, it is sometimes necessary to replace an -object by another (for example to change an interceptor). The problem is that, -in order to do so, all the Java references to the object that must be replaced -must be changed also. And, in general, these references are not known. In order -to be able to reconfigure Fractal components, Julia makes the following -hypotheses: -
    -
  • the objects encapsulated in container components, also called user - objects, only see component interface objects (*),
  • - -
  • component interface objects cannot be replaced (but their internal state - can be changed).
  • -
- -These hypotheses eliminate the unknowable references to controller and content -objects (i.e. the references from user objects to controller and content -objects, which can not be known from Julia), which can therefore be replaced if -necessary. Indeed, although there can be references between controller objects, -between component interface and controller objects, between interceptor and -"content" objects, and so on, all these references are managed by Julia, and are -therefore known. - -

These hypotheses also explain why the component interface objects are -separated from controller and interceptors objects: this is to be able to change -the controller and interceptor objects. - -

(*) the only exception is when user objects are bound directly to each other, -in a "static" configuration (see section 2.4 in the Julia tutorial). In this -case there may be unknowable references to content objects (but not to -controller or interceptor objects). In this case the application must not -disseminate these references, or must know and update them all when requested to -do so (via BindingController), or else there may be problems when a -user component is replaced by another. - -

4.3 Hidden Interfaces

- -Since the control aspects are generally not independent - or "orthogonal" - they -must generally communicate between each other, either inside a single component, -or between components. In these cases, in order to have a modular framework, -the interface and implementation separation principle is used (*): if a -controller object needs a service provided by another one, a Java interface is -defined for this service, which is implemented by the server object, and used in -the client object. - -

In order to be able to add protection mechanisms to Julia, or to be able to -provide distributed components on top of Julia (as Fractal RMI does), it was -also decided that the previous interfaces, only used inside Julia but not -visible from the outside, would be retrieved like any other component interface, -i.e., via the getFcInterface method of the Component -interface. The only difference is that these interfaces are hidden, i.e., -they do not appear in the array returned by getFcInterfaces (hidden -interfaces are distinguished from normal interfaces by the fact that their name -starts with "/"). Therefore, one cannot get the reference to such an interface -without knowing its name. And, although not yet implemented, it is also possible -to perform access control checks in the getFcInterface method, to -ensure that only Julia's classes can access these hidden interfaces. - -

(*) a reference between an interceptor and a controller object may not follow -this principle, for performance reasons. For example, the lifecycle interceptor -object directly uses fields defined in the lifecycle controller object. In -practice this is not a problem, because the algorithms used in these two objects -are strongly coupled (i.e., the interceptor can not be changed without changing -the controller object, and vice versa). - -

4.4 Instantiation

- -Julia components can be created manually or automatically. The manual method -can be used to create any kind of components, while the automatic one is -restricted to components whose type follows the basic type system defined in the -Fractal specification, which provide a Component interface, and which -provide interface introspection functions. In both methods, a component must be -created as follows: -
    -
  • creation of the component interface objects (if the component must provide - interface introspection), of the controller objects, of the interceptor - objects, and of the component's content (for container components).
  • - -
  • initialization of the "impl" references between the component interfaces - objects and the content, controller and interceptor objects.
  • - -
  • creation of an InitializationContext, and set up of this - context, with references to the previous objects.
  • - -
  • initialization of the controller and interceptor objects by calling their - initFcController method, with the previous - InitializationContext object as parameter (this step allows the - controller and interceptor objects to initialize themselves, i.e. to set up - the references between all these objects).
  • -
- -In the automatic method, i.e. when components are created through the -GenericFactory interface, the operations that must be done at the -previous steps are deduced from the component's type, and from its controller -and content descriptor. Once these descriptors have been analyzed and checked, -and once the previous operations have been determined, a sub class of the -InitilizationContext class that implements these operations is -generated (with the InitializationContextClassGenerator). Finally the -component is created by using this generated class (in other words, the -controller are content descriptors are compiled on the fly, once and for all, -instead of being interpreted and checked each time a component must be -created). - -

5 Mixin classes

- -

5.1 Motivations

- -The main design goal of Julia is to implement a framework to program -component controllers (see section 2). In particular, since -everything in the Fractal specification is optional, Julia must provide -implementations of the Fractal API interfaces for any conformance level -(see the Fractal specification). For example, Julia must provide a -basic Component implementation, as well as an implementation for -components whose type follows the basic type system (in the first case -Component behaves like a read only hash map; in the second case, -because of collection interface types, the getFcInterface method can -lazily create new component interfaces). Likewhise, Julia must provide a basic -BindingController implementation, as well as an implementation for -cases where the basic type system is used, where a life cycle controller is -present, or where composite components are used (these implementations are -needed to check type, life cycle or content related constraints on bindings). -There must also be an implementation for cases where both the basic type system -and a life cycle controller are used, or where both the basic type system, life -cycle controllers and composite components are used. And these implementations -must be extensible, in order to take into account user defined controllers when -needed. - -

In order to provide all these implementations, a first solution would be to -use class inheritance. But this solution is not feasible, because it leads to a -combinatorial explosion, and to a lot of code duplication. Consider for example -the BindingController interface, and the "type system", "life cycle" -and "composite" concerns. These three concerns give 23=8 possible -combinations. Therefore, in order to implement these three concerns, -eight classes (and not just three) must be provided. Moreover these -eight classes can not be provided without duplicating code, if multiple -inheritance is not available. - -

Another solution to this problem would be to use an Aspect Oriented -Programming (AOP) tool or language, such as Aspect/J, since the goal of these -tools and languages is to solve the "crosscutting" problems. Aspect/J, for -example, could effectively be used to solve the above problem: three aspect -classes are sufficient to implement the three concerns, without any code -duplication. But using Aspect/J would introduce a new problem, due to the fact -that, in Aspect/J, aspects must be applied at compile time, and that this -process requires the source code of the "base" classes. It would then be -impossible to distribute Julia in compiled form, in a jar file, because then the -users would not be able to apply new aspects to the existing Julia classes (in -order to add new control aspects that crosscut existing ones). - -

What is needed to really solve our modularity and extensiblity problem is -therefore a kind of AOP tool or language that can be used at load time or at -runtime, without needing the source code of the base classes, such as JAC (Java -Aspect Components). For performance reasons the current Julia version does not -use JAC or other similar systems: it uses instead some kind of mixin -classes. A mixin class is a class whose super class is specified in an abstract -way, by specifying the minimum set of fields and methods it should have. A -mixin class can therefore be applied (i.e. override and add methods) to -any super class that defines at least these fields and methods. This property -solves the above combinatory problem. The Aspect/J problem is solved by the fact -that the mixin classes used in Julia can be applied at runtime (unlike in most -mixin based inheritance languages, where mixed classes are declared at compile -time). - -

5.2 Implementation

- -Instead of using a Java extension to program the mixin classes, which would -require an extended Java compiler or a pre processor, mixin classes in Julia are -programmed by using patterns. For example a mixin class, which, in JAM, would be written -as: - -
-mixin A {
-
-  inherited public void m ();
-
-  public int count;
-  public void m () {
-    ++count;
-    super.m();
-  }
-}
-
- -is written in Julia in pure Java, as follows: - -
-abstract class A {
-
-  abstract void _super_m ();
-
-  public int count;
-  public void m () {
-    ++count;
-    _super_m();
-  }
-}
-
- -In other words, the _super_ prefix is used to denote the -inherited members in JAM, i.e., the members that are required in a -base class, for the mixin class to be applicable to it. More precisely, the -_super_ prefix is used to denote methods that are overriden by the -mixin class. Members that are required but not overriden are denoted with -_this_ (a mixin class cannot contain a _super_m method if it -does not have a corresponding m method. Likewise, a mixin class cannot -have both a _this_m method and a corresponding m method): - -
-abstract class M implements I, Countable {
-
-  int _this_f;
-  abstract void _super_m ();
-  abstract void _this_n ();
-
-  public int count;
-  public void m () {
-    ++count;
-    _this_n();
-    _super_m();
-  }
-  public int getCount () {
-    return count;
-  }
-}
-
- -Mixin classes can be mixed, resulting in normal classes. More precisely, the -result of mixing several mixin classes M1, ... Mn, -in this order, is a normal class that is equivalent to a class -Mn extending the Mn-1 class, itself extending the -Mn-2 class, ... itself extending the M1 class. Several -mixin classes can be mixed only if each method and field required by a mixin -class Mi is provided by a mixin class Mj, with j < i -(each required method and field may be provided by a different mixin). For -example, if N and O designate the following mixins: - -
-abstract class N implements I {
-
-  abstract void _super_m ();
-  abstract void _super_n ();
-
-  public void m () {
-    System.out.println("m called");
-    _super_m();
-  }
-  public void n () {
-    System.out.println("n called");
-    _super_n();
-  }
-}
-
-abstract class O implements I {
-  public int f;
-  public void m () {
-    System.out.println("m");
-  }
-  public void n () {
-    System.out.println("n");
-  }
-}
-
- -then the mixed class O N M is equivalent to the following class -(note that this class implements all the interfaces implemented by the -mixin classes): - -
-public class ONM implements I, Countable {
-
-  // from O
-  public int f;
-  private void m$1 () {
-    System.out.println("m");
-  }
-  private void n$0 () {
-    System.out.println("n");
-  }
-
-  // from N
-  private void m$0 () {
-    System.out.println("m called");
-    m$1();
-  }
-  public void n () {
-    System.out.println("n called");
-    n$0();
-  }
-
-  // from M
-  public int count;
-  public void m () {
-    ++count;
-    n();
-    m$0();
-  }
-  public int getCount () {
-    return count;
-  }
-}
-
- -while the mixed class O M N is the following class: - -
-public class OMN implements I, Countable {
-
-  // from O
-  public int f;
-  private void m$1 () {
-    System.out.println("m");
-  }
-  private void n$0 () {
-    System.out.println("n");
-  }
-
-  // from M
-  public int count;
-  private void m$0 () {
-    ++count;
-    n();
-    m$1();
-  }
-  public int getCount () {
-    return count;
-  }
-
-  // from N
-  public void m () {
-    System.out.println("m called");
-    m$0();
-  }
-  public void n () {
-    System.out.println("n called");
-    n$0();
-  }
-}
-
- -The mixed classes are generated dynamically by the MixinClassGenerator -class. Since this class can not mix constructors (this limitation could be -removed in future versions), a mixin class must not rely on constructors to -initialize its instances (in Julia, all mixin classes have a private empty -constructor without argument, to show that mixin classes should not be -instantiated directly). A mixed class can be declared as follows in the Julia -configuration file: - -
-(onm
-  (org.objectweb.fractal.julia.asm.MixinClassGenerator
-    ONM
-    org.pkg.O
-    org.pkg.N
-    org.pkg.M
-  )
-)
-
- -The first line after MixinClassGenerator is a symbolic name for the -mixed class. The following lines are the names of the classes to be mixed. In -order to ease debugging, the class generator keeps the line numbers of the mixin -classes in the mixed class. More precisely, a line number l of the mixin -class at index i (in the list of mixin classes, and starting from 1) is -transformed into 1000*i + l. For example, if a new -Exception().printStackTrace() were added in the N.m method, -the stack trace would contain the following line: - -

at C55d992cb_0.m$0(ONM:2010) - -

meaning that the exception was created in method m$0 of the -C55d992cb_0 class, whose source is the ONM mixed class (ONM comes from -the first line after MixinClassGenerator in the above descriptor), at -line 10 of mixin 2, i.e. at line 10 of the org.pkg.N mixin class. - -

6 Interceptor classes

- -This section gives some details about the generator used to generate interceptor -classes. This generator takes as parameters the name of a super class, -the name(s) of one or more application specific interface(s), and one or -more "aspect" code generator(s). It generates a sub class of the given -super class that implements all the given application specific interfaces -and that, for each application specific method, implements all the "aspects" -corresponding to the given "aspect" code generators. - -

Each "aspect" code generator can modify the code of each application specific -method arbitralily. For example, an "aspect" code generator A can modify -the method void m () { impl.m() } into: - -

-

-void m () {
-  // pre code A
-  try {
-    impl.m();
-  } finally {
-    // post code A
-  }
-}
-
-
- -while another "aspect" code generator B will modify this method into: - -
-

-void m () {
-  // pre code B
-  impl.m();
-  // post code B
-}
-
-
- -When an interceptor class is generated by using several "aspect" code -generators, the transformations performed by these code generators are -automatically composed together. For example, if A and B are used to generate -an interceptor class, in this order, the result for the previous m -method is the following: - -
-

-void m () {
-  // pre code A
-  try {
-    // pre code B
-    impl.m();
-    // post code B
-  } finally {
-    // post code A
-  }
-}
-
-
- -The order in which the aspects are "woven" is generally important, and -must be specified by the user of the code generator. For example, if A and B -are used in the reverse order, the result for the previous m method is -the following: - -
-

-void m () {
-  // pre code B
-  // pre code A
-  try {
-    impl.m();
-  } finally {
-    // post code A
-  }
-  // post code B
-}
-
-
- -Note that, thanks to this (elementary) automatic weaving, which is very similar -to what can be found in Aspect/J or in Composition Filters, several aspects can -be managed by a single interceptor object: there is no need, and there are -no chains of interceptor objects, each object corresponding to an aspect -(if one really wants interceptor chains, this can be done by implementing a new -interceptor class generator). - -

Like the controller objects, the aspects managed by the interceptor -objects of a given component can all be specified by the user when the -component is created. The user can therefore not only choose the control -interfaces he or she wants, but also the interceptor objects he or she -wants. Julia only provides two aspect code generators: one to manage the -lifecycle of components, the other to trace incoming and/or outgoing method -calls. Julia also provides two abstract code generators, named -SimpleCodeGenerator and MetaCodeGenerator, that can be easily -specialized (i.e. without needing to know ASM), in order to implement custom -code generators. - -

Note: each aspect code generator is given a Method object -corresponding to the method for which it must generate interception code. Thanks -to this argument, a code generator can generate code that adapts to the specific -signature of each method. It can also generate code to reify the method's -parameters if desired (although this is less efficient than the first method). - -

7 Class Generation Framework

- -Julia needs a lot of automatically generated classes, such as the component -factory classes (see section 4.4), the controller classes -generated from the mixin classes defined in Julia (see section -5), the classes that implement both Interface and an -application specific interface, the interceptor classes (see section 6), the merged controller classes (see appendix B), and so on. - -

Since Julia must work even with very limited JVMs (see section 2), without application specific class loaders, and without the -Java reflection API, the generators that generate the previous classes must be -useable either dynamically or statically, before launching the application. A -convention is therefore needed to name the generated classes. Indeed, in the -static case, the "generated" classes must be loaded from the classpath and, to -this end, their name must be known. And, therefore, the static class generator -cannot give arbitrary names to the class it generates. - -

A solution to this problem is to name the generated classes with the -parameters that were used to generate them. Indeed, in this case, when a -generated class is needed at runtime, and since the parameters to generate it -are of course known at this time, the class can either be dynamically generated -with these parameters or, in the static case, loaded with Class.forName -method, by using these parameters as a class name. - -

The problem of this solution is that the parameters used to generate a class -are quite long, and this would result in very long, and may be too long, -generated class names (some JVMs do not accept classes with a name of more than -256 characters). In order to solve this problem, the name of a generated class -is the hashcode of the parameters that were used to generate this class, -instead of being a bijective encoding of these parameters. Of course, two -different sets of parameters can have the same hashcode, and so conflicts are -possible. To solve this new problem, each generated class contains a -getFcGeneratorParameters method, defined in the Generated -interface, whose role it to return the exact parameters that were used to -generate the class. The algorithm to load a generated class is then the -following: - -

-

-hashcode = hashcode(parameters needed to generate the desired class);
-int n = 0;
-while (true) {
-  Class c = Class.forName("package." + hashcode + "_" + n);
-  Generated g = (Generated)c.newInstance();
-  if (g.getFcGeneratorParameters().equals(above parameters)) {
-    return c;
-  }
-  ++n;
-}
-
-
- -Notes: -
    -
  • the equals test in the above algorithm can take a long time with - very long parameters (typically 3000 characters for factory class generator - parameters). In order to speed up class loading, this check can be skipped. In - fact it is skipped by default, and executed only when the - julia.loader.check system property is set to "true".
  • - -
  • these naming conventions have some problems. Firstly, the generated names - are completely meaningless for humans, which makes debugging more difficult - (these names appear in stack traces). Secondly, because of conflicts, classes - may have different names on different machines, if they are not generated in - the same order. This may be a problem for Java's serialization mechanism.
  • -
- -

8 Support for Constrained Environments

- -As explained in section 2, one of the goals of Julia is to be -usable even with very constrained JVMs and JDKs, such as the KVM and the J2ME -librairies (CLDC profile). This goal is achieved thanks to the following -properties: -
    -
  • the size of Julia runtime (35KB, plus 10KB for the Fractal API), which is - the only part of Julia that is needed at runtime, is compatible with the - capabilities of most constrained environments;
  • - -
  • Julia can be used in environments that do not provide the Java Reflection - API or the ClassLoader class, which are needed to dynamically - generate the Julia application specific classes, since these classes can also - be generated statically, in a less constrained environment;
  • - -
  • the Julia classes that are needed at runtime, or whose code can be copied - into application specific runtime classes, use only the J2ME, CLDC profile - APIs, with only two exceptions for collections and serialization. For - collections a subset of the JDK 1.2 collection API is used. This API is not - available in the CLDC profile, but a bytecode modification tool is provided - with Julia to convert classes that use this subset into classes that use the - CLDC APIs instead. Likewise, for serialization, which is not supported in - CLDC, a bytecode modification tool is provided to remove serialization related - code in Julia. In other words the Julia jars cannot be used directly with - CLDC, but can be transformed automatically in new jars that are compatible - with this API.
  • -
- -

A Mixins reference

- -

A.1 Mixins for the Component interface

- -
- -

Figure 2: mixins for the Component interface -

- -Julia provides two mixins for the Component interface: -
    -
  • BasicComponentMixin provides a basic implementation, that does - not depend on the component's type system;
  • - -
  • TypeComponentMixin extends an existing Component - implementation in order to support the basic type system (this mixin adds some - type related checks, and provides support for the lazy creation of interfaces - for collection interface types).
  • -
- -The first mixin requires a base class that implements the Controller -interface, such as the BasicControllerMixin (this class is an empty -implementation of the Controller interface). The second mixin requires -a base class that implements the Component interface. These -dependencies are summarized in the figure below (an arrow from a mixin A to a -mixin B means that A needs a base class that provides the same fields and -methods as B - it does not mean that A requires exactly the B mixin). - -

A.2 Mixins for the TypeFactory interface

- -
- -

Figure 3: mixins for the TypeFactory interface -

- -Julia provides two mixins for the TypeFactory interface: -
    -
  • BasicTypeFactoryMixin provides a basic implementation;
  • - -
  • CheckTypeFactoryMixin extends an existing TypeFactory - implementation in order to perform some checks before creating interface - types. This mixin requires the Java Reflection API and the - ClassLoader class, and so can not be used with the CLDC profile.
  • -
- -

A.3 Mixins for the GenericFactory interface

- -
- -

Figure 4: mixins for the GenericFactory interface -

- -Julia provides two mixins for the GenericFactory interface: -
    -
  • BasicGenericFactoryMixin provides a basic implementation. This - mixins requires a base class with a Loader field and a - TypeFactory field. These fields can be provided and initialized by - mixins such as the UseLoaderMixin and UseTypeFactoryMixin - mixins, which themselves require a base class that implements the - Controller interface;
  • - -
  • CheckGenericFactoryMixin extends an existing - GenericFactory implementation in order to perform some checks before - creating components. This mixin requires the Java Reflection API and the - ClassLoader class, and so can not be used with the CLDC profile.
  • -
- -

A.4 Mixins for the Factory interface

- -
- -

Figure 5: mixins for the Factory interface -

- -Julia provides four mixins for the Factory interface, or more precisely -for the Julia Template interface, i.e. for Factory -interfaces for Fractal template components: -
    -
  • BasicTemplateMixin provides a basic implementation of the - Factory interface for template components;
  • - -
  • NameTemplateMixin extends an existing Factory - implementation in order to copy the name of the template to the components - instantiated from it;
  • - -
  • AttributeTemplateMixin extends an existing Factory - implementation in order to copy the attributes the template to the components - instantiated from it;
  • - -
  • SingletonTemplateMixin extends an existing Factory - implementation in order to give it a "singleton" semantics.
  • -
- -

A.5 Mixins for the BindingController interface

- -
- -

Figure 6: mixins for the BindingController interface -

- -Julia provides a lot of mixins for the BindingController interface. -First of all, it provides two mutually exclusive, basic implementations of the -BindingController interface: -
    -
  • BasicBindingControllerMixin is based on a hash table;
  • - -
  • ContainerBindingControllerMixin delegates to the - BindingController interface of the content part of the component, for - "container" components;
  • -
- -Then four other mixins are provided, which extend any existing -BindingController implementation (such as the two previous mixins), in -order to perform various checks: -
    -
  • CheckBindingMixin performs some basic checks before binding or - unbinding an interface (such as "interface already bound", or "interface not - bound"). These checks do not depend on any other concerns than the "binding" - concern;
  • - -
  • TypeBindingMixin performs type related checks, for the basic type - system. For example, this mixin checks the existence of the interface to be - bound or unbound, checks that a client interface is always bound to a server - interface (whose type is compatible with the client interface type), and so - on;
  • - -
  • LifeCycleBindingMixin performs life cycle related checks before - unbinding an interface (the component must be stopped for doing that);
  • - -
  • ContentBindingMixin performs structural constraints related - checks before binding an interface (all bindings must be local bindings).
  • -
- -Two other mixins are designed to extend the -ContainerBindingControllerMixin: -
    -
  • OptimizedContainerBindingMixin extends an existing - BindingController implementation in order to skip Interface - objects, which removes one indirection for each binding of the component (the - bindFc method of this mixin stores the server interface argument in - an internal hash table, and calls the overriden method with the "impl" link of - this server interface as argument, instead of the server interface itself; the - other methods are modified accordingly).
  • - -
  • InterceporBindingMixin extends an existing - BindingController implementation in order to properly manage output - interceptors.
  • -
- -And, finally, two other, mutually exclusive mixins are designed to extend the -BasicBindingControllerMixin, and target composite components: -
    -
  • CompositeBindingMixin extends an existing - BindingController implementation in order to update the "impl" links - (see section 4.1) of the Interface objects of the - component when bindings are changed.
  • - -
  • OptimizedCompositeBindingMixin does the same thing, but with an - optimized algorithm that can create and update shortcut links between - components (see appendix B).
  • -
- -

A.6 Mixins for the ContentController interface

- -
- -

Figure 7: mixins for the ContentController interface -

- -Julia provides six mixins for the ContentController interface: -
    -
  • BasicContentControllerMixin provides a basic implementation, that - does not depend on the component's type system, or any other concern;
  • - -
  • CheckContentMixin extends an existing ContentController - implementation in order to perform some basic checks before adding or removing - a sub component (in particular to avoid cycles in the component's hierarchy). - These checks do not depend on any other concern than the "content" - concern;
  • - -
  • TypeContentMixin extends an existing ContentController - implementation in order to support the basic type system (this mixin adds some - type related checks, and provides support for the lazy creation of internal - interfaces, for collection interface types);
  • - -
  • BindingContentMixin extends an existing ContentController - implementation in order to check binding related constraints before removing a - component (removing a component must not create non local bindings);
  • - -
  • LifeCycleContentMixin extends an existing - ContentController implementation in order to check life cycle related - constraints before removing a component (a sub component can not be removed if - the super component is not stopped);
  • - -
  • SuperContentMixin extends an existing ContentController - implementation in order to notify the sub components when they are added or - removed from a super component, through the Julia - SuperControllerNotifier interface. This mixin should be put at the - end of the mixin list, in order to notify the sub components only after all - the checks have been passed.
  • -
- -

A.7 Mixins for the SuperController interface

- -
- -

Figure 8: mixins for the SuperController interface -

- -Julia provides only one mixin for the SuperController interface, -which provides a basic implementation of this interface. - -

A.8 Mixins for the LifeCycleController interface

- -
- -

Figure 9: mixins for the LifeCycleController interface -

- -Julia provides two, mutually exclusive mixins that implement that implement the -LifeCycleController interface: -
    -
  • BasicLifeCycleController provides an implementation that can work - with primitive or composite components, and which is based on a counter that - is updated by associated interceptor objects.
  • - -
  • OptimizedLifeCycleController provides an implementation that - works ony with composite components, and that does not requires associated - interceptors. This implementation works by stopping simultaneously all the - direct and indirect primitive sub components of the composite components.
  • -
- -These two mixins require methods that are provided by the -BasicLifeCycleCoordinator mixin. The TypeLifeCycleMixin -extends an existing LifeCycleController implementation in order to -check type related constraints before starting a component (more precisely, this -mixin checks that all the mandatory client interface of the component and of its -direct and indirect sub components ar bound). Finally the -ContainerLifeCycleMixin extends existing LifeCycleController -implementation in order to notify the component's content when it is started or -stopped, through its LifeCycleController interface, if it is present -(this mixin is intendend for "container" components). - -

A.9 Mixins for the NameController interface

- -
- -

Figure 10: mixins for the NameController interface -

- -Julia provides only one mixin for the NameController interface, which -provides a basic implementation of this interface. - -

B Optimizations

- -

B.1 Intra component optimizations

- -In order to (re)configure the controller objects that constitute the controller -part of a Fractal component, a natural solution would be to use Fractal itself: -each controller object would then be a Fractal component with, for example, a -BindingController interface to bind it to other controller objects. It -would also be possible, with this approach, to use composite components inside -the controller part of a component! - -

This solution will perhaps be implemented in future versions of Julia. The -current version uses a more efficient solution, in which it is always possible -to merge the controller objects into a single one (which is obviously not -possible with the above solution). This solution is the following: -

    -
  • each controller object can provide and require zero or more Java - interfaces. The provided interfaces must be implemented by the object, and - there must be one field per required interface, whose name must begin with - weaveable for a mandatory interface, or weaveableOpt for an - optional interface (see below). Each controller class that require at least - one interface must also implement the Controller interface (see - below).
  • - -
  • in a given configuration, a given interface cannot be provided by more - than one object (except for the Controller interface). Otherwise it - would be impossible to merge these objects (an object cannot implement a given - interface in several ways).
  • - -
  • the bindings between objects in a given configuration are established - automatically in a two steps process:
  • -
      -
    • each controller object of the configuration is registered into - a "naming service". In practice, this naming service is the - InitializationContext interface;
    • - -
    • then, each controller object initializes itself by using the previous - "naming service" to retrieve the interface it requires.
    • -
    -
- -To be more precise, lets suppose we have four control interfaces I, J, K and L, -and three controller classes IImpl, JImpl and KImpl. -These classes should look like this: - -
-

-public class IImpl implements Controller, I {
-
-  // indicates a required interface of type J
-  public J weaveableJ;
-
-  // indicates an optional required interface of type L
-  public L weaveableOptL;
-
-  // other fields:
-  public int foo;
-
-  // implementation of the Controller interface
-  public void initFcController (InitializationContext ic) {
-    weaveableJ = (J)ic.getInterface("j");
-    weaveableOptL = (L)ic.getOptionalInterface("l");
-  }
-
-  // other methods:
-  public void foo (String name) {
-    weaveableJ.bar(weaveableOptL, foo, weaveableC.getFcInterface(name));
-  }
-}
-
-public class JImpl implements Controller, J {
-
-  public K weaveableK;
-
-  // implementation of the Controller interface ...
-  public void initFcController (InitializationContext ic) {
-    weaveableK = (K)ic.getInterface("k");
-  }
-  // other methods (not shown) ...
-}
-
-public class KImpl implements Controller, K {
-  // other methods ...
-}
-
-
- -In the non optimized case, a component with these three controller objects is -instantiated in the following steps: -
    -
  • an instance of IImpl, JImpl and KImpl is - created,
  • - -
  • the resulting objects are put in an InitializationContext - object,
  • - -
  • the initFcController method is called on each controller object - with this context as argument.
  • -
- -In the optimized case, the instantiation process is the following: -
    -
  • the class obtained by "merging" the IImpl, JImpl and - KImpl is dynamically generated, or loaded from the classpath if it - has been statically generated before launching the application, or just - returned if it has already been generated or loaded.
  • - -
  • this class is instantiated.
  • -
- -The "merging" process is the following. Basically, all the methods and fields -of each class are copied into a new class (the resulting class does not depend -on the order into which the classes are copied). However the fields whose name -begins with weaveable are replaced by this, and those whose -name begins with weaveableOpt are replaced either by this, if -a class that implements the corresponding type is present in the list of the -classes to be merged, or null otherwise. Finally, the -initFcController methods from the Controller interface are -merged into a single initFcController method. The result is the -following class: - -
-

-public class Cb234f2 implements Controller, I, J, K, ... {
-
-  // fields copied from the IImpl class:
-  public int foo;
-  // fields copied from the JImpl class: none
-  // fields copied from the KImpl class: none
-
-  // methods copied from IImpl:
-  public void foo (String name) {
-    bar(null, foo, getFcInterface(name);
-  }
-  // methods copied from JImpl (not shown) ...
-  // methods copied from KImpl (not shown) ...
-
-  // merged initFcController method
-  public void initFcController (InitializationContext ic) {
-    (J)ic.getInterface("j");
-    (L)ic.getOptionalInterface("l");
-    (K)ic.getInterface("k");
-  }
-}
-
-
- -Notes: -
    -
  • As explained in section 4.1, the controller part of a - component is made of controller objects and of interceptor objects. The above - optimization only applies to controller objects. Therefore, even with this - optimization, the controller part of a component is still made, in general, of - several Java objects. However, if the interceptor objects all delegate to the - same "content" object, and if they do not have conflicting interfaces, it is - possible to really have only one Java object for the whole controller part - of the component. In this case, which happens for most primitive components, - the instantiation process is the following: -
      -
    • a class that merges the controller classes is generated or loaded as - before,
    • - -
    • a sub class of this class that implements the interception code for each - method of each functional interface is generated or loaded,
    • - -
    • this sub class is instantiated.
    • -
  • - -
  • Even if the controllers and interceptors are merged into a single object, - the content part of the component is still made of a separate object. It is - however possible to instantiate a whole component (i.e. the controllers, the - interceptors and the content part) as a single Java object. In order to do - this, the user component class is used as a super class to generate the merged - controller class, which is itself used a super class to generate the - interceptor class (as described above). -
  • - -
  • In order to be able to dynamically deoptimize an optimized component, the - code generator that generates "merged" classes should also generate a - deoptimization method, i.e., instructions to create individual objects for - each original class, and to copy the fields of the merged class into the - appropriate objects. This is not yet implemented.
  • -
- -

B.2 Inter component optimizations

- -In addition to the previous intra component optimizations, which are mainly -used to save memory, Julia also provides an inter component optimization, namely -an algorithm to create and update shortcut links between components, and -whose role is to improve time performances. - -

As explained in section 4.1, each interface of a component -contains an "impl" link to an object that really implements the component -interface. In the case of a server interface s, this link generally -points to an interceptor object, which itself points to the server interface to -which the complementary client interface of s is bound: - -

- -

Figure 11: implementation of bindings with -CompositeBindingMixin -

- -More precisely, this is the case with the CompositeBindingMixin (see -appendix A.5). With the -OptimizedCompositeBindingMixin, the "impl" links are optimized when -possible. For example, in the above figure, since I1 does not have an associated -interceptor object, and since component interface objects such as I2 just -forward any incoming method calls to the object referenced by their "impl" link, -the "impl" link of I1 can directly reference the interceptor associated to I2: - -
- -

Figure 12: implementation of bindings with -OptimizedCompositeBindingMixin -

- - diff --git a/julia/src/org/objectweb/fractal/julia/package.html b/julia/src/org/objectweb/fractal/julia/package.html deleted file mode 100644 index 845c943b2168d4508218b5528b5e2f8b31e5e294..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/package.html +++ /dev/null @@ -1,6 +0,0 @@ - - -Provides mixins to implement the {@link org.objectweb.fractal.api} interfaces. -@since Julia 0.8.0 - - diff --git a/julia/src/org/objectweb/fractal/julia/type/BasicComponentType.java b/julia/src/org/objectweb/fractal/julia/type/BasicComponentType.java deleted file mode 100644 index e4127e9bdf2acba6f0b44a0f3680562f5f60f0e6..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/type/BasicComponentType.java +++ /dev/null @@ -1,142 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.type; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.ChainedNoSuchInterfaceException; -import org.objectweb.fractal.julia.factory.ChainedInstantiationException; - -import java.io.Serializable; - -/** - * Provides a basic implementation of the {@link ComponentType} interface. - */ - -public class BasicComponentType implements ComponentType, Serializable { - - /** - * The types of the interfaces of components of this type. - */ - - private final InterfaceType[] interfaceTypes; - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Constructs a {@link BasicComponentType} object. - * - * @param itfTypes the types of the interfaces of components of this type. - * @throws InstantiationException if two interface types have the same name, - * or if the name of an interface type is a prefix of the name of a - * collection interface type. - */ - - public BasicComponentType (final InterfaceType[] itfTypes) - throws InstantiationException - { - interfaceTypes = clone(itfTypes); - // verifications - for (int i = 0; i < interfaceTypes.length; ++i) { - String p = interfaceTypes[i].getFcItfName(); - boolean collection = interfaceTypes[i].isFcCollectionItf(); - for (int j = i + 1; j < interfaceTypes.length; ++j) { - String q = interfaceTypes[j].getFcItfName(); - if (p.equals(q)) { - throw new ChainedInstantiationException( - null, null, "Two interfaces have the same name '" + q + "'"); - } - if (collection && q.startsWith(p)) { - throw new ChainedInstantiationException( - null, - null, - "The name of the interface '" + q + "' starts with '" + - p + "', which is the name of a collection interface"); - } - if (interfaceTypes[j].isFcCollectionItf() && p.startsWith(q)) { - throw new ChainedInstantiationException( - null, - null, - "The name of the interface '" + p + "' starts with '" + - q + "', which is the name of a collection interface"); - } - } - } - } - - // ------------------------------------------------------------------------- - // Implementation of the ComponentType interface - // ------------------------------------------------------------------------- - - public InterfaceType[] getFcInterfaceTypes () { - return clone(interfaceTypes); - } - - public InterfaceType getFcInterfaceType (final String name) - throws NoSuchInterfaceException - { - for (int i = 0; i < interfaceTypes.length; ++i) { - InterfaceType itfType = interfaceTypes[i]; - String itfName = itfType.getFcItfName(); - if (itfType.isFcCollectionItf()) { - if (name.startsWith(itfName)) { - return itfType; - } - } else if (name.equals(itfName)) { - return itfType; - } - } - throw new ChainedNoSuchInterfaceException(null, null, name); - } - - public boolean isFcSubTypeOf (final Type type) { // TODO - throw new RuntimeException("Not yet implemented."); - } - - /** - * Returns a copy of the given interface type array. This method is used to - * return a copy of the field of this class, instead of the field itself, so - * that its content can not be modified from outside. - * - * @param types the array to be cloned. - * @return a clone of the given array, or an empty array if type is - * null. - */ - - private static InterfaceType[] clone (final InterfaceType[] types) { - if (types == null) { - return new InterfaceType[0]; - } else { - InterfaceType[] clone = new InterfaceType[types.length]; - System.arraycopy(types, 0, clone, 0, types.length); - return clone; - } - } -} diff --git a/julia/src/org/objectweb/fractal/julia/type/BasicInterfaceType.java b/julia/src/org/objectweb/fractal/julia/type/BasicInterfaceType.java deleted file mode 100644 index 7ab1fa02808cff1457cf0b96ad615524f4605ed8..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/type/BasicInterfaceType.java +++ /dev/null @@ -1,178 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.type; - -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.type.InterfaceType; - -import java.io.Serializable; - -/** - * Provides a basic implementation of the {@link InterfaceType} interface. - */ - -public class BasicInterfaceType implements InterfaceType, Serializable { - - /** - * The {@link #flags flags} bit that indicates a client interface. - */ - - private final static int CLIENT_FLAG = 1; - - /** - * The {@link #flags flags} bit that indicates an optional interface. - */ - - private final static int OPTIONAL_FLAG = 2; - - /** - * The {@link #flags flags} bit that indicates a collection interface. - */ - - private final static int COLLECTION_FLAG = 4; - - /** - * The name of the interface described by this type. - */ - - private String name; - - /** - * The Java type of the interface described by this type. - */ - - private String signature; - - /** - * The Java class corresponding to "signature". This reference ensures that - * the Java class corresponding to this interface type will be serialized - * along with this object. - */ - - private Class signatureClass; - - /** - * Indicates if the interface described by this type is a client interface, - * if it is optional... - */ - - private int flags; - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Constructs a new {@link BasicInterfaceType} object. - * - * @param name the name of the described interface. - * @param signature the fully qualified name of the Java type of the described - * interface, or a Class object. - * @param isClient true if the described interface is a client - * interface. - * @param isOptional true if the described interface is an - * optional interface. - * @param isCollection true if the described interface is a - * collection interface. - */ - - public BasicInterfaceType ( - final String name, - final Object signature, - final boolean isClient, - final boolean isOptional, - final boolean isCollection) - { - int flags = 0; - flags = (isClient ? flags | CLIENT_FLAG : flags); - flags = (isOptional ? flags | OPTIONAL_FLAG : flags); - flags = (isCollection ? flags | COLLECTION_FLAG : flags); - this.name = name; - if (signature instanceof String) { - this.signature = (String)signature; - this.signatureClass = null; - } else { - this.signature = ((Class)signature).getName(); - this.signatureClass = (Class)signature; - } - this.flags = flags; - } - - // ------------------------------------------------------------------------- - // Implementation of the InterfaceType interface - // ------------------------------------------------------------------------- - - public String getFcItfName () { - return name; - } - - public String getFcItfSignature () { - return signature; - } - - public boolean isFcClientItf () { - return (flags & CLIENT_FLAG) != 0; - } - - public boolean isFcOptionalItf () { - return (flags & OPTIONAL_FLAG) != 0; - } - - public boolean isFcCollectionItf () { - return (flags & COLLECTION_FLAG) != 0; - } - - public boolean isFcSubTypeOf (final Type type) { // TODO - throw new RuntimeException("Not yet implemented."); - } - - // ------------------------------------------------------------------------- - // Overriden Object methods - // ------------------------------------------------------------------------- - - /** - * Tests if this interface type is equal to the given object. - * - * @param o the object to be compared to this interface type. - * @return true if this interface type is equal to the given object. - */ - - public boolean equals (final Object o) { - if (o instanceof InterfaceType) { - InterfaceType type = (InterfaceType)o; - if (getFcItfName().equals(type.getFcItfName()) && - isFcClientItf() == type.isFcClientItf() && - isFcOptionalItf() == type.isFcOptionalItf() && - isFcCollectionItf() == type.isFcCollectionItf()) - { - if (getFcItfName().equals("attribute-controller") || - getFcItfSignature().equals(type.getFcItfSignature())) - { - return true; - } - } - } - return false; - } -} diff --git a/julia/src/org/objectweb/fractal/julia/type/BasicTypeFactoryMixin.java b/julia/src/org/objectweb/fractal/julia/type/BasicTypeFactoryMixin.java deleted file mode 100644 index f45dd518d002604980f87634b3402e0cf96920b7..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/type/BasicTypeFactoryMixin.java +++ /dev/null @@ -1,70 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.type; - -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -/** - * Provides a basic implementation of the {@link TypeFactory} interface. - *
- *
- * Requirements - *
    - *
  • none.
  • - *
- */ - -public class BasicTypeFactoryMixin implements TypeFactory { - - // ------------------------------------------------------------------------- - // PUBLIC constructor (unlike standard mixin classes ; needed for bootstrap) - // ------------------------------------------------------------------------- - - public BasicTypeFactoryMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - public InterfaceType createFcItfType ( - final String name, - final String signature, - final boolean isClient, - final boolean isOptional, - final boolean isCollection) throws InstantiationException - { - return new BasicInterfaceType( - name, signature, isClient, isOptional, isCollection); - } - - public ComponentType createFcType (final InterfaceType[] interfaceTypes) - throws InstantiationException - { - return new BasicComponentType(interfaceTypes); - } -} diff --git a/julia/src/org/objectweb/fractal/julia/type/CheckTypeFactoryMixin.java b/julia/src/org/objectweb/fractal/julia/type/CheckTypeFactoryMixin.java deleted file mode 100644 index 3110817a6549282d6916e547475286f619d4407e..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/type/CheckTypeFactoryMixin.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.objectweb.fractal.julia.type; - -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.julia.factory.ChainedInstantiationException; - -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; - -/** - * Provides reflective checks to a {@link TypeFactory}. - *
- *
- * Requirements - *
    - *
  • the Java platform must provide the Java Reflection API, the - * ClassLoader class, and Thread.getContextClassLoader method.
  • - *
- */ - -public abstract class CheckTypeFactoryMixin implements TypeFactory { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - public CheckTypeFactoryMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * Checks the signature Java interface and then calls the overriden - * method. This method check that the Java interface exists, that it is not - * a class, that it is public, and that it is a valid attribute controller - * interface (only if name is equal to "attribute-controller", of - * course). - */ - - public InterfaceType createFcItfType ( - final String name, - final String signature, - final boolean isClient, - final boolean isOptional, - final boolean isCollection) throws InstantiationException - { - Class itf; - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - // checks that the interface exists - try { - itf = cl.loadClass(signature); - } catch (ClassNotFoundException e) { - cl = getClass().getClassLoader(); - try { - itf = cl.loadClass(signature); - } catch (ClassNotFoundException f) { - throw new ChainedInstantiationException( - f, null, "No such interface: " + signature); - } - } - // checks that it is a public interface - if (!(itf.isInterface() && Modifier.isPublic(itf.getModifiers()))) { - throw new ChainedInstantiationException( - null, null, signature + " is not a public interface"); - } - if (name.equals("attribute-controller")) { - // checks that itf is a valid atrribute controller interface - Class ac; - try { - ac = cl.loadClass( - "org.objectweb.fractal.api.control.AttributeController"); - } catch (ClassNotFoundException e) { - throw new ChainedInstantiationException( - e, null, "Cannot check this operation"); - } - if (ac.isAssignableFrom(itf)) { - if (!checkFcAttributeControllerInterface(itf)) { - throw new ChainedInstantiationException( - null, - null, - signature + " is not a valid attribute controller interface"); - } - } - } - return new BasicInterfaceType( - name, itf, isClient, isOptional, isCollection); - } - - /** - * Checks that the given class is valid attribute controller interface. - * - * @param itf a Java interface - * @return true if the given interface is valid, or false - * otherwise. - */ - - public boolean checkFcAttributeControllerInterface (final Class itf) { - Map types = new HashMap(); - Method[] meths = itf.getMethods(); - // checks each method - for (int i = 0; i < meths.length; ++i) { - Method m = meths[i]; - String name = m.getName(); - Class[] formals = m.getParameterTypes(); - Class result = m.getReturnType(); - if (name.startsWith("get")) { - if (formals.length == 0 && !result.equals(Void.TYPE)) { - types.put(name, result); - continue; - } - } else if (name.startsWith("set")) { - if (formals.length == 1 && result.equals(Void.TYPE)) { - types.put(name, formals[0]); - continue; - } - } - return false; - } - // checks that if a get/set method has a complementary set/get method, - // then the two methods are compatible - for (int i = 0; i < meths.length; ++i) { - Method m = meths[i]; - String name = m.getName(); - if (name.startsWith("get")) { - Class type = (Class)types.get("set" + name.substring(3)); - if (type == null || m.getReturnType().equals(type)) { - continue; - } - } else { - Class type = (Class)types.get("get" + name.substring(3)); - if (type == null || m.getParameterTypes()[0].equals(type)) { - continue; - } - } - return false; - } - return true; - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link TypeFactory#createFcItfType createFcItfType} method overriden by - * this mixin. - */ - - public abstract InterfaceType _super_createFcItfType ( - String name, - String signature, - boolean isClient, - boolean isOptional, - boolean isCollection) throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/type/UseTypeFactoryMixin.java b/julia/src/org/objectweb/fractal/julia/type/UseTypeFactoryMixin.java deleted file mode 100644 index 6056cfdf2da7b157492b008b83662ccb63122c37..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/type/UseTypeFactoryMixin.java +++ /dev/null @@ -1,85 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.type; - -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.julia.Controller; -import org.objectweb.fractal.julia.InitializationContext; - -/** - * Provides a {@link TypeFactory} field to a {@link Controller}. - *
- *
- * Requirements - *
    - *
  • the component to which this controller belongs must provide the {@link - * TypeFactory} interface.
  • - *
- */ - -public abstract class UseTypeFactoryMixin implements Controller { - - // ------------------------------------------------------------------------- - // Private constructor - // ------------------------------------------------------------------------- - - private UseTypeFactoryMixin () { - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * The {@link TypeFactory} interface of the component to which this controller - * object belongs. - */ - - public TypeFactory weaveableTF; - - /** - * Initializes the fields of this mixin and then calls the overriden method. - */ - - public void initFcController (final InitializationContext ic) - throws InstantiationException - { - weaveableTF = (TypeFactory)ic.getInterface("type-factory"); - _super_initFcController(ic); - } - - // ------------------------------------------------------------------------- - // Fields and methods required by the mixin class in the base class - // ------------------------------------------------------------------------- - - /** - * The {@link Controller#initFcController initFcController} method overriden - * by this mixin. - */ - - public abstract void _super_initFcController (InitializationContext i) - throws InstantiationException; -} diff --git a/julia/src/org/objectweb/fractal/julia/type/package.html b/julia/src/org/objectweb/fractal/julia/type/package.html deleted file mode 100644 index d4729765dea97490f49fc82c2db670360616933e..0000000000000000000000000000000000000000 --- a/julia/src/org/objectweb/fractal/julia/type/package.html +++ /dev/null @@ -1,7 +0,0 @@ - - -Provides mixins to implement the {@link -org.objectweb.fractal.api.type.TypeFactory} interface. -@since Julia 0.8.0 - - diff --git a/julia/test/build.xml b/julia/test/build.xml deleted file mode 100644 index 3727c3024b120109d4089430f054808b73f7eafb..0000000000000000000000000000000000000000 --- a/julia/test/build.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/conform/conf.xml b/julia/test/conform/conf.xml deleted file mode 100644 index fe732efe774bb3c631190e12bdd9810c849cb221..0000000000000000000000000000000000000000 --- a/julia/test/conform/conf.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/conform/julia-merge1.cfg b/julia/test/conform/julia-merge1.cfg deleted file mode 100644 index ed2b86b3e7f7fd4c2957e6f576cb020ede7ba3d7..0000000000000000000000000000000000000000 --- a/julia/test/conform/julia-merge1.cfg +++ /dev/null @@ -1,3 +0,0 @@ -(optimizationLevel - mergeControllers -) diff --git a/julia/test/conform/julia-merge2.cfg b/julia/test/conform/julia-merge2.cfg deleted file mode 100644 index 9fccfd57e47ea5dc074791ba07a102470edd3a66..0000000000000000000000000000000000000000 --- a/julia/test/conform/julia-merge2.cfg +++ /dev/null @@ -1,3 +0,0 @@ -(optimizationLevel - mergeControllersAndInterceptors -) diff --git a/julia/test/conform/julia-merge3.cfg b/julia/test/conform/julia-merge3.cfg deleted file mode 100644 index 168264e29327ad346156eef9152ef5211b826313..0000000000000000000000000000000000000000 --- a/julia/test/conform/julia-merge3.cfg +++ /dev/null @@ -1,3 +0,0 @@ -(optimizationLevel - mergeControllersAndContent -) diff --git a/julia/test/conform/julia-merge4.cfg b/julia/test/conform/julia-merge4.cfg deleted file mode 100644 index 8c4ff0b1fc3409fa517abb46b47f0e6ff54991fc..0000000000000000000000000000000000000000 --- a/julia/test/conform/julia-merge4.cfg +++ /dev/null @@ -1,3 +0,0 @@ -(optimizationLevel - mergeControllersInterceptorsAndContent -) diff --git a/julia/test/conform/julia.cfg b/julia/test/conform/julia.cfg deleted file mode 100644 index 33dcb6414a6f30741020fc65bd22aa06e9699603..0000000000000000000000000000000000000000 --- a/julia/test/conform/julia.cfg +++ /dev/null @@ -1,863 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -# ----------------------------------------------------------------------------- -# Definitions for a "flat" component model, without composite components -# ContentController, SuperController and all Content related mixins are not used -# ----------------------------------------------------------------------------- - -(flat-primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FlatPrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - # org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - # org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -(flat-container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FlatContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - # org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - # org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -(flatPrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'flat-container-binding-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(flatParametricPrimitive - 'flatPrimitive -) - -(flatPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'flat-primitive-binding-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(flatParametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'flat-primitive-binding-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -# ----------------------------------------------------------------------------- -# Definitions for the interceptor tests -# ----------------------------------------------------------------------------- - -(stat-controller-itf - (stat-controller org.objectweb.fractal.julia.conform.controllers.StatController) -) - -(statPrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - 'stat-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - org.objectweb.fractal.julia.conform.controllers.BasicStatController - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - org.objectweb.fractal.julia.conform.controllers.StatCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(statComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - 'stat-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - org.objectweb.fractal.julia.conform.controllers.BasicStatController - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.conform.controllers.StatCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -# ----------------------------------------------------------------------------- -# Bad definitions to test errors detection -# ----------------------------------------------------------------------------- - -(badPrimitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - # implementation missing for the LifeCycleController interface - # 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(badParametricPrimitive - 'badPrimitive -) diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/Test.java b/julia/test/conform/org/objectweb/fractal/julia/conform/Test.java deleted file mode 100644 index 428890f1cfebaacd44de03f54cca43ac7b976143..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/Test.java +++ /dev/null @@ -1,174 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.control.ContentController; - -import org.objectweb.fractal.julia.conform.components.I; - -import org.objectweb.fractal.util.Fractal; - -import junit.framework.TestCase; - -import java.util.Set; -import java.util.Iterator; -import java.util.HashSet; - -public class Test extends TestCase { - - protected final static String COMP = "component/org.objectweb.fractal.api.Component/false,false,false"; - protected final static String BC = "binding-controller/org.objectweb.fractal.api.control.BindingController/false,false,false"; - protected final static String LC = "lifecycle-controller/org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator/false,false,false"; - protected final static String CC = "content-controller/org.objectweb.fractal.api.control.ContentController/false,false,false"; - protected final static String SC = "super-controller/org.objectweb.fractal.julia.control.content.SuperControllerNotifier/false,false,false"; - protected final static String NC = "name-controller/org.objectweb.fractal.api.control.NameController/false,false,false"; - protected final static String F = "factory/org.objectweb.fractal.julia.factory.Template/false,false,false"; - - protected final static String PKG = "org.objectweb.fractal.julia.conform.components"; - - public Test (final String name) { - super(name); - } - - protected void checkInterface (I i) { - i.m(true); - i.m((byte)1); - i.m((char)1); - i.m((short)1); - i.m((int)1); - i.m((long)1); - i.m((float)1); - i.m((double)1); - i.m("1"); - i.m(new String[] { "1" }); - - assertEquals(true, i.n(true, null)); - assertEquals((byte)1, i.n((byte)1, null)); - assertEquals((char)1, i.n((char)1, (double)0)); - assertEquals((short)1, i.n((short)1, (float)0)); - assertEquals((int)1, i.n((int)1, (long)0)); - assertEquals((long)1, i.n((long)1, (int)0)); - assertEquals((float)1, i.n((float)1, (short)0), 0); - assertEquals((double)1, i.n((double)1, (char)0), 0); - assertEquals("1", i.n("1", (byte)0)); - } - - protected void checkComponent (Component c, Set itfs) throws Exception { - Set extItfs = getExternalItfs(c); - assertEquals("Wrong external interface list", itfs, extItfs); - Iterator i = itfs.iterator(); - while (i.hasNext()) { - String itf = (String)i.next(); - String compItf = null; - try { - compItf = getItf((Interface)c.getFcInterface(getItfName(itf)), false); - } catch (NoSuchInterfaceException e) { - fail("Missing external interface: " + itf); - } - assertEquals("Wrong external interface", itf, compItf); - } - - ContentController cc; - try { - cc = Fractal.getContentController(c); - } catch (NoSuchInterfaceException e) { - return; - } - - itfs = new HashSet(itfs); - i = itfs.iterator(); - while (i.hasNext()) { - String itf = (String)i.next(); - if (itf.startsWith("component/") || itf.indexOf("-controller/") != -1) { - i.remove(); - } - } - - Set intItfs = getInternalItfs(cc); - assertEquals("Wrong internal interface list", itfs, intItfs); - i = itfs.iterator(); - while (i.hasNext()) { - String itf = (String)i.next(); - String compItf = null; - try { - compItf = getItf((Interface)cc.getFcInternalInterface(getItfName(itf)), true); - } catch (NoSuchInterfaceException e) { - fail("Missing internal interface: " + itf); - } - assertEquals("Wrong internal interface", itf, compItf); - } - } - - private Set getExternalItfs (Component c) { - HashSet result = new HashSet(); - Object[] extItfs = c.getFcInterfaces(); - for (int i = 0; i < extItfs.length; ++i) { - String itf = getItf((Interface)extItfs[i], false); - if (!result.add(itf)) { - fail("Duplicated interface: " + itf); - } - } - return result; - } - - private Set getInternalItfs (ContentController cc) { - HashSet result = new HashSet(); - Object[] extItfs = cc.getFcInternalInterfaces(); - for (int i = 0; i < extItfs.length; ++i) { - String itf = getItf((Interface)extItfs[i], true); - if (!result.add(itf)) { - fail("Duplicated interface: " + itf); - } - } - return result; - } - - protected static String getItf (Interface itf, boolean internal) { - InterfaceType itfType = (InterfaceType)itf.getFcItfType(); - return getItf( - itf.getFcItfName(), - itfType.getFcItfSignature(), - itfType.isFcClientItf() ^ internal, - itfType.isFcOptionalItf(), - itfType.isFcCollectionItf()); - } - - private static String getItf ( - String name, - String signature, - boolean isClient, - boolean isOptional, - boolean isCollection) - { - return name+'/'+signature+'/'+isClient+','+isOptional+','+isCollection; - } - - private static String getItfName (String itf) { - return itf.substring(0, itf.indexOf('/')); - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestBindingController.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestBindingController.java deleted file mode 100644 index 9cc013a6471bc7067e4b56c76ead0d96b4836f61..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestBindingController.java +++ /dev/null @@ -1,498 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.conform.components.I; -import org.objectweb.fractal.julia.conform.components.C; -import org.objectweb.fractal.julia.conform.components.J; - -import org.objectweb.fractal.util.Fractal; - -import java.util.Arrays; -import java.util.HashSet; - -public class TestBindingController extends Test { - - protected Component boot; - protected TypeFactory tf; - protected GenericFactory gf; - - protected ComponentType t, u; - protected Component c, d, e; - - protected boolean isTemplate; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestBindingController (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - gf = Fractal.getGenericFactory(boot); - t = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("servers", I.class.getName(), false, false, true), - tf.createFcItfType("client", I.class.getName(), true, false, false), - tf.createFcItfType("clients", I.class.getName(), true, false, true) - }); - u = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("serverI", I.class.getName(), false, true, false), - tf.createFcItfType("serverJ", J.class.getName(), false, false, false), - }); - setUpComponents(); - } - - protected void setUpComponents () throws Exception { - c = gf.newFcInstance(t, "flatPrimitive", C.class.getName()); - d = gf.newFcInstance(t, "flatPrimitive", C.class.getName()); - e = gf.newFcInstance(u, "flatPrimitive", C.class.getName()); - } - - // ------------------------------------------------------------------------- - // Test list, lookup, bind, unbind - // ------------------------------------------------------------------------- - - public void testList () throws Exception { - BindingController bc = Fractal.getBindingController(c); - checkList(bc, new String[] { "client" }); - } - - public void testBindLookupUnbind () throws Exception { - BindingController bc = Fractal.getBindingController(c); - bc.bindFc("client", d.getFcInterface("server")); - checkList(bc, new String[] { "client" }); - assertEquals(d.getFcInterface("server"), bc.lookupFc("client")); - bc.unbindFc("client"); - assertEquals(null, bc.lookupFc("client")); - } - - public void testCollectionBindLookupUnbind () throws Exception { - BindingController bc = Fractal.getBindingController(c); - bc.bindFc("clients0", d.getFcInterface("server")); - checkList(bc, new String[] { "client", "clients0" }); - assertEquals(d.getFcInterface("server"), bc.lookupFc("clients0")); - bc.unbindFc("clients0"); - try { - assertEquals(null, bc.lookupFc("clients0")); - } catch (NoSuchInterfaceException e) { - checkList(bc, new String[] { "client" }); - } - } - - protected void checkList (BindingController bc, String[] expected) { - String[] names = bc.listFc(); - HashSet nameSet = new HashSet(); - for (int i = 0; i < names.length; ++i) { - String name = names[i]; - if (!nameSet.add(name)) { - fail("Duplicated interface name: " + name); - } - } - assertEquals(new HashSet(Arrays.asList(expected)), nameSet); - } - - // ------------------------------------------------------------------------- - // Test errors in lookup, bind, unbind - // ------------------------------------------------------------------------- - - public void testNoSuchInterfaceLookup () throws Exception { - try { - Fractal.getBindingController(c).lookupFc("c"); - fail(); - } catch (NoSuchInterfaceException e) { - } - } - - public void testNoSuchInterfaceBind () throws Exception { - try { - Fractal.getBindingController(c).bindFc("c", d.getFcInterface("server")); - fail(); - } catch (NoSuchInterfaceException e) { - } - } - - public void testNotAServerInterface () throws Exception { - try { - Fractal.getBindingController(c).bindFc("client", c.getFcInterface("client")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testWrongType () throws Exception { - try { - Fractal.getBindingController(c).bindFc("client", e.getFcInterface("serverJ")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testMandatoryToOptional () throws Exception { - try { - Fractal.getBindingController(c).bindFc("client", e.getFcInterface("serverI")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testAlreadyBound () throws Exception { - BindingController bc = Fractal.getBindingController(c); - bc.bindFc("client", d.getFcInterface("server")); - try { - bc.bindFc("client", d.getFcInterface("server")); - fail(); - } catch (IllegalBindingException e) { - } - bc.bindFc("clients0", d.getFcInterface("server")); - try { - bc.bindFc("clients0", d.getFcInterface("server")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testNoSuchInterfaceUnind () throws Exception { - try { - Fractal.getBindingController(c).unbindFc("c"); - fail(); - } catch (NoSuchInterfaceException e) { - } - } - - public void testNotBound () throws Exception { - try { - Fractal.getBindingController(c).unbindFc("client"); - fail(); - } catch (IllegalBindingException e) { - } - } - - // --- - - public static class Composite extends TestBindingController { - - protected Component r; - - public Composite (String name) { - super(name); - } - - protected void setUpComponents () throws Exception { - r = gf.newFcInstance(t, "composite", null); - c = gf.newFcInstance(t, "primitive", C.class.getName()); - d = gf.newFcInstance(t, "composite", null); - e = gf.newFcInstance(u, "composite", null); - Fractal.getContentController(r).addFcSubComponent(c); - Fractal.getContentController(r).addFcSubComponent(d); - Fractal.getContentController(r).addFcSubComponent(e); - } - - public void testCompositeList () throws Exception { - BindingController bc = Fractal.getBindingController(r); - if (isTemplate) { - checkList(bc, new String[] { "client", "server", "factory" }); - } else { - checkList(bc, new String[] { "client", "server" }); - } - } - - public void testCompositeExportBindLookupUnbind () throws Exception { - BindingController bc = Fractal.getBindingController(r); - bc.bindFc("server", c.getFcInterface("server")); - if (isTemplate) { - checkList(bc, new String[] { "client", "server", "factory" }); - } else { - checkList(bc, new String[] { "client", "server" }); - } - assertEquals(c.getFcInterface("server"), bc.lookupFc("server")); - bc.unbindFc("server"); - assertEquals(null, bc.lookupFc("server")); - } - - public void testCompositeCollectionExportBindLookupUnbind () throws Exception { - BindingController bc = Fractal.getBindingController(r); - bc.bindFc("servers0", c.getFcInterface("server")); - if (isTemplate) { - checkList(bc, new String[] { "client", "server", "servers0", "factory" }); - } else { - checkList(bc, new String[] { "client", "server", "servers0" }); - } - assertEquals(c.getFcInterface("server"), bc.lookupFc("servers0")); - bc.unbindFc("servers0"); - try { - assertEquals(null, bc.lookupFc("servers0")); - } catch (NoSuchInterfaceException e) { - checkList(bc, new String[] { "client", "server" }); - } - } - - public void testCompositeImportBindLookupUnbind () throws Exception { - ContentController cc = Fractal.getContentController(r); - BindingController bc = Fractal.getBindingController(d); - bc.bindFc("client", cc.getFcInternalInterface("client")); - if (isTemplate) { - checkList(bc, new String[] { "client", "server", "factory" }); - } else { - checkList(bc, new String[] { "client", "server" }); - } - assertEquals(cc.getFcInternalInterface("client"), bc.lookupFc("client")); - bc.unbindFc("client"); - assertEquals(null, bc.lookupFc("client")); - } - - public void testCompositeCollectionImportBindLookupUnbind () throws Exception { - ContentController cc = Fractal.getContentController(r); - BindingController bc = Fractal.getBindingController(d); - bc.bindFc("clients0", cc.getFcInternalInterface("client")); - if (isTemplate) { - checkList(bc, new String[] { "client", "clients0", "server", "factory" }); - } else { - checkList(bc, new String[] { "client", "clients0", "server" }); - } - assertEquals(cc.getFcInternalInterface("client"), bc.lookupFc("clients0")); - bc.unbindFc("clients0"); - try { - assertEquals(null, bc.lookupFc("clients0")); - } catch (NoSuchInterfaceException e) { - checkList(bc, new String[] { "client", "server" }); - } - } - - public void testCompositeSelfBindLookupUnbind () throws Exception { - Object itf = - Fractal.getContentController(r).getFcInternalInterface("client"); - BindingController bc = Fractal.getBindingController(r); - bc.bindFc("server", itf); - if (isTemplate) { - checkList(bc, new String[] { "client", "server", "factory" }); - } else { - checkList(bc, new String[] { "client", "server" }); - } - assertEquals(itf, bc.lookupFc("server")); - bc.unbindFc("server"); - assertEquals(null, bc.lookupFc("server")); - } - - public void testCompositeCollectionSelfBindLookupUnbind () throws Exception { - Object itf = - Fractal.getContentController(r).getFcInternalInterface("clients0"); - BindingController bc = Fractal.getBindingController(r); - bc.bindFc("servers0", itf); - if (isTemplate) { - checkList(bc, new String[] { "client", "server", "servers0", "factory" }); - } else { - checkList(bc, new String[] { "client", "server", "servers0" }); - } - assertEquals(itf, bc.lookupFc("servers0")); - bc.unbindFc("servers0"); - try { - assertEquals(null, bc.lookupFc("servers0")); - } catch (NoSuchInterfaceException e) { - checkList(bc, new String[] { "client", "server" }); - } - } - - public void testCompositeNoSuchInterface () throws Exception { - try { - Fractal.getBindingController(r).lookupFc("c"); - fail(); - } catch (NoSuchInterfaceException e) { - } - } - - public void testAlreadyBound () throws Exception { - super.testAlreadyBound(); - BindingController bc = Fractal.getBindingController(d); - bc.bindFc("client", c.getFcInterface("server")); - try { - bc.bindFc("client", c.getFcInterface("server")); - fail(); - } catch (IllegalBindingException e) { - } - bc.bindFc("clients0", c.getFcInterface("server")); - try { - bc.bindFc("clients0", c.getFcInterface("server")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testNotBound () throws Exception { - super.testNotBound(); - try { - Fractal.getBindingController(d).unbindFc("client"); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testInvalidExportBinding () throws Exception { - Fractal.getContentController(r).removeFcSubComponent(c); - BindingController bc = Fractal.getBindingController(r); - try { - bc.bindFc("server", c.getFcInterface("server")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testInvalidNormalBinding () throws Exception { - Fractal.getContentController(r).removeFcSubComponent(d); - BindingController bc = Fractal.getBindingController(c); - try { - bc.bindFc("client", d.getFcInterface("server")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testInvalidImportBinding () throws Exception { - ContentController cc = Fractal.getContentController(r); - BindingController bc = Fractal.getBindingController(d); - cc.removeFcSubComponent(d); - try { - bc.bindFc("client", cc.getFcInternalInterface("client")); - fail(); - } catch (IllegalBindingException e) { - } - } - - public void testWouldCreateInvalidExportBinding () throws Exception { - Fractal.getBindingController(r).bindFc("server", c.getFcInterface("server")); - try { - Fractal.getContentController(r).removeFcSubComponent(c); - fail(); - } catch (IllegalContentException e) { - } - } - - public void testWouldCreateInvalidLocalBinding () throws Exception { - Fractal.getBindingController(c).bindFc("client", d.getFcInterface("server")); - try { - Fractal.getContentController(r).removeFcSubComponent(c); - fail(); - } catch (IllegalContentException e) { - } - } - - public void testWouldCreateInvalidImportBinding () throws Exception { - ContentController cc = Fractal.getContentController(r); - Fractal.getBindingController(d).bindFc("client", cc.getFcInternalInterface("client")); - try { - cc.removeFcSubComponent(d); - fail(); - } catch (IllegalContentException e) { - } - } - } - - public static class Template extends TestBindingController { - - public Template (String name) { - super(name); - isTemplate = true; - } - - protected void setUpComponents () throws Exception { - c = gf.newFcInstance(t, "flatPrimitiveTemplate", new Object[] { "flatPrimitive", C.class.getName() }); - d = gf.newFcInstance(t, "flatPrimitiveTemplate", new Object[] { "flatPrimitive", C.class.getName() }); - e = gf.newFcInstance(u, "flatPrimitiveTemplate", new Object[] { "flatPrimitive", C.class.getName() }); - } - } - - public static class CompositeTemplate extends Composite { - - public CompositeTemplate (String name) { - super(name); - isTemplate = true; - } - - protected void setUpComponents () throws Exception { - r = gf.newFcInstance(t, "compositeTemplate", new Object[] { "composite", null }); - c = gf.newFcInstance(t, "primitiveTemplate", new Object[] { "primitive", C.class.getName() }); - d = gf.newFcInstance(t, "compositeTemplate", new Object[] { "composite", null }); - e = gf.newFcInstance(u, "compositeTemplate", new Object[] { "composite", null }); - Fractal.getContentController(r).addFcSubComponent(c); - Fractal.getContentController(r).addFcSubComponent(d); - Fractal.getContentController(r).addFcSubComponent(e); - } - - public void testInstanceBinding () throws Exception { - ContentController cc = Fractal.getContentController(r); - Fractal.getContentController(e).addFcSubComponent(c); - - Fractal.getBindingController(r).bindFc("server", c.getFcInterface("server")); - Fractal.getBindingController(c).bindFc("client", d.getFcInterface("server")); - Fractal.getBindingController(d).bindFc("client", cc.getFcInternalInterface("client")); - - Fractal.getBindingController(r).bindFc("servers0", c.getFcInterface("servers0")); - Fractal.getBindingController(c).bindFc("clients0", d.getFcInterface("servers0")); - Fractal.getBindingController(d).bindFc("clients0", cc.getFcInternalInterface("clients0")); - - Component rComp = Fractal.getFactory(r).newFcInstance(); - - cc = Fractal.getContentController(rComp); - Component[] comps = cc.getFcSubComponents(); - - Component cComp = comps[0]; - Component dComp = comps[1]; - - assertEquals( - Fractal.getBindingController(rComp).lookupFc("server"), - cComp.getFcInterface("server")); - assertEquals( - Fractal.getBindingController(cComp).lookupFc("client"), - dComp.getFcInterface("server")); - assertEquals( - Fractal.getBindingController(dComp).lookupFc("client"), - cc.getFcInternalInterface("client")); - - assertEquals( - Fractal.getBindingController(rComp).lookupFc("servers0"), - cComp.getFcInterface("servers0")); - assertEquals( - Fractal.getBindingController(cComp).lookupFc("clients0"), - dComp.getFcInterface("servers0")); - assertEquals( - Fractal.getBindingController(dComp).lookupFc("clients0"), - cc.getFcInternalInterface("clients0")); - } - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestCollection.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestCollection.java deleted file mode 100644 index 9cf3b80e8f963d910c0ad4ffefd69854ca98ea28..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestCollection.java +++ /dev/null @@ -1,276 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.conform.components.C; -import org.objectweb.fractal.julia.conform.components.I; - -import org.objectweb.fractal.util.Fractal; - -import java.util.HashSet; -import java.util.Arrays; - -public class TestCollection extends Test { - - protected Component boot; - protected TypeFactory tf; - protected GenericFactory gf; - - protected ComponentType t; - - protected final static String serverI = "server/"+PKG+".I/false,false,false"; - protected final static String servers0I = "servers0/"+PKG+".I/false,false,true"; - protected final static String servers1I = "servers1/"+PKG+".I/false,false,true"; - protected final static String servers2I = "servers2/"+PKG+".I/true,false,true"; - protected final static String servers3I = "servers3/"+PKG+".I/true,false,true"; - protected final static String clientI = "client/"+PKG+".I/true,true,false"; - protected final static String clients0I = "clients0/"+PKG+".I/true,true,true"; - protected final static String clients1I = "clients1/"+PKG+".I/true,true,true"; - protected final static String clients2I = "clients2/"+PKG+".I/false,true,true"; - protected final static String clients3I = "clients3/"+PKG+".I/false,true,true"; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestCollection (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - gf = Fractal.getGenericFactory(boot); - t = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("servers", I.class.getName(), false, false, true), - tf.createFcItfType("client", I.class.getName(), true, true, false), - tf.createFcItfType("clients", I.class.getName(), true, true, true) - }); - } - - // ------------------------------------------------------------------------- - // Test component instantiation - // ------------------------------------------------------------------------- - - public void testPrimitiveWithCollection () throws Exception { - Component c = gf.newFcInstance(t, "primitive", C.class.getName()); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, SC, NC, serverI, clientI - }))); - } - - public void testCompositeWithCollection () throws Exception { - Component c = gf.newFcInstance(t, "composite", null); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, LC, SC, NC, serverI, clientI - }))); - } - - public void testPrimitiveTemplateWithCollection () throws Exception { - Component c = gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", C.class.getName() }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, F, SC, NC, serverI, clientI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, SC, NC, serverI, clientI - }))); - } - - public void testCompositeTemplateWithCollection () throws Exception { - Component c = gf.newFcInstance( - t, "compositeTemplate", new Object[] { "composite", null }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, F, SC, NC, serverI, clientI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, LC, SC, NC, serverI, clientI - }))); - } - - // ------------------------------------------------------------------------- - // Test lazy interface creation through getFc(Internal)Interface - // ------------------------------------------------------------------------- - - public void testPrimitiveGetFcInterface () throws Exception { - Component c = gf.newFcInstance(t, "primitive", C.class.getName()); - Fractal.getLifeCycleController(c).startFc(); - Interface i; - i = (Interface)c.getFcInterface("servers0"); - assertEquals("Bad interface", servers0I, getItf(i, false)); - checkInterface((I)i); - i = (Interface)c.getFcInterface("servers1"); - assertEquals("Bad interface", servers1I, getItf(i, false)); - checkInterface((I)i); - i = (Interface)c.getFcInterface("clients0"); - assertEquals("Bad interface", clients0I, getItf(i, false)); - i = (Interface)c.getFcInterface("clients1"); - assertEquals("Bad interface", clients1I, getItf(i, false)); - } - - public void testCompositeGetFcInterface () throws Exception { - Component c = gf.newFcInstance(t, "composite", null); - Interface i; - i = (Interface)c.getFcInterface("servers0"); - assertEquals("Bad interface", servers0I, getItf(i, false)); - i = (Interface)c.getFcInterface("servers1"); - assertEquals("Bad interface", servers1I, getItf(i, false)); - i = (Interface)c.getFcInterface("clients0"); - assertEquals("Bad interface", clients0I, getItf(i, false)); - i = (Interface)c.getFcInterface("clients1"); - assertEquals("Bad interface", clients1I, getItf(i, false)); - - ContentController cc = Fractal.getContentController(c); - i = (Interface)cc.getFcInternalInterface("servers2"); - assertEquals("Bad interface", servers2I, getItf(i, false)); - i = (Interface)cc.getFcInternalInterface("servers3"); - assertEquals("Bad interface", servers3I, getItf(i, false)); - i = (Interface)cc.getFcInternalInterface("clients2"); - assertEquals("Bad interface", clients2I, getItf(i, false)); - i = (Interface)cc.getFcInternalInterface("clients3"); - assertEquals("Bad interface", clients3I, getItf(i, false)); - } - - public void testPrimitiveTemplateGetFcInterface () throws Exception { - Component c = gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", C.class.getName() }); - Interface i; - i = (Interface)c.getFcInterface("servers0"); - assertEquals("Bad interface", servers0I, getItf(i, false)); - i = (Interface)c.getFcInterface("servers1"); - assertEquals("Bad interface", servers1I, getItf(i, false)); - i = (Interface)c.getFcInterface("clients0"); - assertEquals("Bad interface", clients0I, getItf(i, false)); - i = (Interface)c.getFcInterface("clients1"); - assertEquals("Bad interface", clients1I, getItf(i, false)); - - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, SC, NC, serverI, clientI - }))); - } - - public void testCompositeTemplateGetFcInterface () throws Exception { - Component c = gf.newFcInstance( - t, "compositeTemplate", new Object[] { "composite", null }); - Interface i; - i = (Interface)c.getFcInterface("servers0"); - assertEquals("Bad interface", servers0I, getItf(i, false)); - i = (Interface)c.getFcInterface("servers1"); - assertEquals("Bad interface", servers1I, getItf(i, false)); - i = (Interface)c.getFcInterface("clients0"); - assertEquals("Bad interface", clients0I, getItf(i, false)); - i = (Interface)c.getFcInterface("clients1"); - assertEquals("Bad interface", clients1I, getItf(i, false)); - - ContentController cc = Fractal.getContentController(c); - i = (Interface)cc.getFcInternalInterface("servers2"); - assertEquals("Bad interface", servers2I, getItf(i, false)); - i = (Interface)cc.getFcInternalInterface("servers3"); - assertEquals("Bad interface", servers3I, getItf(i, false)); - i = (Interface)cc.getFcInternalInterface("clients2"); - assertEquals("Bad interface", clients2I, getItf(i, false)); - i = (Interface)cc.getFcInternalInterface("clients3"); - assertEquals("Bad interface", clients3I, getItf(i, false)); - - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, LC, SC, NC, serverI, clientI - }))); - } - - // ------------------------------------------------------------------------- - // Test errors of lazy interface creation through getFc(Internal)Interface - // ------------------------------------------------------------------------- - - public void testPrimitiveNoSuchCollectionItf () throws Exception { - Component c = gf.newFcInstance(t, "primitive", C.class.getName()); - try { - c.getFcInterface("server0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - try { - c.getFcInterface("client0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - } - - public void testCompositeNoSuchCollectionItf () throws Exception { - Component c = gf.newFcInstance(t, "composite", null); - try { - c.getFcInterface("server0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - try { - c.getFcInterface("client0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - } - - public void testPrimitiveTemplateNoSuchCollectionItf () throws Exception { - Component c = gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", C.class.getName() }); - try { - c.getFcInterface("server0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - try { - c.getFcInterface("client0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - } - - public void testCompositeTemplateNoSuchCollectionItf () throws Exception { - Component c = gf.newFcInstance( - t, "compositeTemplate", new Object[] { "composite", null }); - try { - c.getFcInterface("server0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - try { - c.getFcInterface("client0"); - fail(); - } catch (NoSuchInterfaceException e) { - } - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestComponent.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestComponent.java deleted file mode 100644 index 8c0653d618aba5fad4cf1073fd2eeac0c49c85a4..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestComponent.java +++ /dev/null @@ -1,133 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.conform.components.I; -import org.objectweb.fractal.julia.conform.components.C; -import org.objectweb.fractal.julia.conform.components.CAttributes; - -import org.objectweb.fractal.util.Fractal; - -public class TestComponent extends Test { - - protected Component boot; - protected TypeFactory tf; - protected GenericFactory gf; - - protected ComponentType t; - - protected final static String AC = "attribute-controller/"+PKG+".CAttributes/false,false,false"; - protected final static String sI = "server/"+PKG+".I/false,false,false"; - protected final static String cI = "client/"+PKG+".I/true,false,false"; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestComponent (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - gf = Fractal.getGenericFactory(boot); - t = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("attribute-controller", CAttributes.class.getName(), false, false, false), - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("client", I.class.getName(), true, true, false) - }); - } - - // ------------------------------------------------------------------------- - // Test functional and attribute controller interfaces - // ------------------------------------------------------------------------- - - public void testParametricPrimitive () throws Exception { - Component c = gf.newFcInstance(t, "parametricPrimitive", C.class.getName()); - Fractal.getLifeCycleController(c).startFc(); - I i = (I)c.getFcInterface("server"); - checkInterface(i); - - CAttributes ca = (CAttributes)c.getFcInterface("attribute-controller"); - ca.setX1(true); - assertEquals(true, ca.getX1()); - ca.setX2((byte)1); - assertEquals((byte)1, ca.getX2()); - ca.setX3((char)1); - assertEquals((char)1, ca.getX3()); - ca.setX4((short)1); - assertEquals((short)1, ca.getX4()); - ca.setX5((int)1); - assertEquals((int)1, ca.getX5()); - ca.setX6(1); - assertEquals((long)1, ca.getX6()); - ca.setX7(1); - assertEquals((float)1, ca.getX7(), 0); - ca.setX8(1); - assertEquals((double)1, ca.getX8(), 0); - ca.setX9("1"); - assertEquals("1", ca.getX9()); - ca.setWriteOnlyX11(true); - assertEquals(true, i.n(false, null)); - } - - public void testParametricPrimitiveTemplate () throws Exception { - Component c = gf.newFcInstance( - t, "parametricPrimitiveTemplate", new Object[] { "parametricPrimitive", C.class.getName() }); - - CAttributes ca = (CAttributes)c.getFcInterface("attribute-controller"); - ca.setX1(true); - ca.setX2((byte)1); - ca.setX3((char)1); - ca.setX4((short)1); - ca.setX5((int)1); - ca.setX6(1); - ca.setX7(1); - ca.setX8(1); - ca.setX9("1"); - ca.setWriteOnlyX11(true); - - c = Fractal.getFactory(c).newFcInstance(); - Fractal.getLifeCycleController(c).startFc(); - ca = (CAttributes)c.getFcInterface("attribute-controller"); - - assertEquals(true, ca.getX1()); - assertEquals((byte)1, ca.getX2()); - assertEquals((char)1, ca.getX3()); - assertEquals((short)1, ca.getX4()); - assertEquals((int)1, ca.getX5()); - assertEquals((long)1, ca.getX6()); - assertEquals((float)1, ca.getX7(), 0); - assertEquals((double)1, ca.getX8(), 0); - assertEquals("1", ca.getX9()); - assertEquals(true, ((I)c.getFcInterface("server")).n(false, null)); - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestContentController.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestContentController.java deleted file mode 100644 index 41c10d7796f149d061a12ab412e05c2328a4f02f..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestContentController.java +++ /dev/null @@ -1,199 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.IllegalContentException; -import org.objectweb.fractal.api.factory.GenericFactory; - -import org.objectweb.fractal.julia.conform.components.I; -import org.objectweb.fractal.julia.conform.components.C; - -import org.objectweb.fractal.util.Fractal; - -import java.util.Arrays; - -public class TestContentController extends Test { - - protected Component boot; - protected TypeFactory tf; - protected GenericFactory gf; - - protected ComponentType t; - protected Component c, d, e; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestContentController (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - gf = Fractal.getGenericFactory(boot); - t = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("client", I.class.getName(), true, true, false) - }); - setUpComponents(); - } - - protected void setUpComponents () throws Exception { - c = gf.newFcInstance(t, "composite", null); - d = gf.newFcInstance(t, "composite", null); - e = gf.newFcInstance(t, "primitive", C.class.getName()); - } - - // ------------------------------------------------------------------------- - // Test add and remove - // ------------------------------------------------------------------------- - - public void testAddAndRemove () throws Exception { - ContentController cc = Fractal.getContentController(c); - cc.addFcSubComponent(e); - assertTrue(Arrays.asList(cc.getFcSubComponents()).contains(e)); - cc.removeFcSubComponent(e); - assertTrue(!Arrays.asList(cc.getFcSubComponents()).contains(e)); - } - - // ------------------------------------------------------------------------- - // Test add errors - // ------------------------------------------------------------------------- - - public void testAlreadySubComponent () throws Exception { - ContentController cc = Fractal.getContentController(c); - cc.addFcSubComponent(e); - try { - cc.addFcSubComponent(e); - fail(); - } catch (IllegalContentException e) { - } - } - - public void testWouldCreateCycle1 () throws Exception { - ContentController cc = Fractal.getContentController(c); - try { - cc.addFcSubComponent(c); - fail(); - } catch (IllegalContentException e) { - } - } - - public void testWouldCreateCycle2 () throws Exception { - ContentController cc = Fractal.getContentController(c); - ContentController cd = Fractal.getContentController(d); - cc.addFcSubComponent(d); - try { - cd.addFcSubComponent(c); - fail(); - } catch (IllegalContentException e) { - } - } - - // ------------------------------------------------------------------------- - // Test remove errors - // ------------------------------------------------------------------------- - - public void testNotASubComponent () throws Exception { - ContentController cc = Fractal.getContentController(c); - try { - cc.removeFcSubComponent(d); - fail(); - } catch (IllegalContentException e) { - } - } - - public void testWouldCreateNonLocalExportBinding () throws Exception { - ContentController cc = Fractal.getContentController(c); - cc.addFcSubComponent(e); - Fractal.getBindingController(c).bindFc("server", e.getFcInterface("server")); - try { - cc.removeFcSubComponent(e); - fail(); - } catch (IllegalContentException e) { - } - } - - public void testWouldCreateNonLocalImportBinding () throws Exception { - ContentController cc = Fractal.getContentController(c); - cc.addFcSubComponent(e); - Fractal.getBindingController(e).bindFc("client", cc.getFcInternalInterface("client")); - try { - cc.removeFcSubComponent(e); - fail(); - } catch (IllegalContentException e) { - } - } - - public void testWouldCreateNonLocalNormalBinding () throws Exception { - ContentController cc = Fractal.getContentController(c); - cc.addFcSubComponent(d); - cc.addFcSubComponent(e); - Fractal.getBindingController(d).bindFc("client", e.getFcInterface("server")); - try { - cc.removeFcSubComponent(e); - fail(); - } catch (IllegalContentException e) { - } - } - - // --- - - public static class Template extends TestContentController { - - public Template (String name) { - super(name); - } - - protected void setUpComponents () throws Exception { - c = gf.newFcInstance(t, "compositeTemplate", new Object[] { "composite", null }); - d = gf.newFcInstance(t, "compositeTemplate", new Object[] { "composite", null }); - e = gf.newFcInstance(t, "primitiveTemplate", new Object[] { "primitive", C.class.getName() }); - } - - public void testInstanceContent () throws Exception { - Component r = gf.newFcInstance(t, "compositeTemplate", new Object[] { "composite", null }); - Fractal.getContentController(r).addFcSubComponent(c); - Fractal.getContentController(r).addFcSubComponent(d); - Fractal.getContentController(c).addFcSubComponent(e); - Fractal.getContentController(d).addFcSubComponent(e); - - Component root = Fractal.getFactory(r).newFcInstance(); - Component[] comps = Fractal.getContentController(root).getFcSubComponents(); - assertEquals(2, comps.length); - Component[] cComps = Fractal.getContentController(comps[0]).getFcSubComponents(); - Component[] dComps = Fractal.getContentController(comps[1]).getFcSubComponents(); - assertEquals(1, cComps.length); - assertEquals(1, dComps.length); - assertEquals(cComps[0], dComps[0]); - } - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestGenericFactory.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestGenericFactory.java deleted file mode 100644 index e40ade605a8385dc0bb6865f002a1364105038ea..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestGenericFactory.java +++ /dev/null @@ -1,328 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.ComponentType; - -import org.objectweb.fractal.julia.conform.components.C; -import org.objectweb.fractal.julia.conform.components.I; -import org.objectweb.fractal.julia.conform.components.W; -import org.objectweb.fractal.julia.conform.components.X; -import org.objectweb.fractal.julia.conform.components.Y; -import org.objectweb.fractal.julia.conform.components.Z; -import org.objectweb.fractal.julia.conform.components.CAttributes; - -import org.objectweb.fractal.util.Fractal; - -import java.util.HashSet; -import java.util.Arrays; - -public class TestGenericFactory extends Test { - - protected Component boot; - protected TypeFactory tf; - protected GenericFactory gf; - - protected ComponentType t, u; - - protected final static String AC = "attribute-controller/"+PKG+".CAttributes/false,false,false"; - protected final static String sI = "server/"+PKG+".I/false,false,false"; - protected final static String cI = "client/"+PKG+".I/true,false,false"; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestGenericFactory (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - gf = Fractal.getGenericFactory(boot); - t = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("client", I.class.getName(), true, false, false) - }); - u = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("attribute-controller", CAttributes.class.getName(), false, false, false), - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("client", I.class.getName(), true, false, false) - }); - } - - // ------------------------------------------------------------------------- - // Test direct component creation - // ------------------------------------------------------------------------- - - public void testFPrimitive () throws Exception { - Component c = gf.newFcInstance(t, "flatPrimitive", C.class.getName()); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, NC, sI, cI - }))); - } - - public void testFParametricPrimitive () throws Exception { - Component c = gf.newFcInstance(u, "flatParametricPrimitive", C.class.getName()); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, AC, NC, sI, cI - }))); - } - - public void testPrimitive () throws Exception { - Component c = gf.newFcInstance(t, "primitive", C.class.getName()); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, SC, NC, sI, cI - }))); - } - - public void testParametricPrimitive () throws Exception { - Component c = gf.newFcInstance(u, "parametricPrimitive", C.class.getName()); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, SC, AC, NC, sI, cI - }))); - } - - public void testComposite () throws Exception { - Component c = gf.newFcInstance(t, "composite", null); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, LC, SC, NC, sI, cI - }))); - } - - public void testParametricComposite () throws Exception { - Component c = gf.newFcInstance(u, "parametricComposite", C.class.getName()); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, LC, SC, AC, NC, sI, cI - }))); - } - - // ------------------------------------------------------------------------- - // Test component creation via templates - // ------------------------------------------------------------------------- - - public void testFPrimitiveTemplate () throws Exception { - Component c = gf.newFcInstance( - t, "flatPrimitiveTemplate", new Object[] { "flatPrimitive", C.class.getName() }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, F, NC, sI, cI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, NC, sI, cI - }))); - } - - public void testFParametricPrimitiveTemplate () throws Exception { - Component c = gf.newFcInstance( - u, "flatParametricPrimitiveTemplate", new Object[] { "flatParametricPrimitive", C.class.getName() }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, F, AC, NC, sI, cI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, AC, NC, sI, cI - }))); - } - - public void testPrimitiveTemplate () throws Exception { - Component c = gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", C.class.getName() }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, F, SC, NC, sI, cI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, SC, NC, sI, cI - }))); - } - - public void testParametricPrimitiveTemplate () throws Exception { - Component c = gf.newFcInstance( - u, "parametricPrimitiveTemplate", new Object[] { "parametricPrimitive", C.class.getName() }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, F, SC, AC, NC, sI, cI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, LC, SC, AC, NC, sI, cI - }))); - } - - public void testCompositeTemplate () throws Exception { - Component c = gf.newFcInstance( - t, "compositeTemplate", new Object[] { "composite", null }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, F, SC, NC, sI, cI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, LC, SC, NC, sI, cI - }))); - } - - public void testParametricCompositeTemplate () throws Exception { - Component c = gf.newFcInstance( - u, "parametricCompositeTemplate", new Object[] { "parametricComposite", C.class.getName() }); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, F, SC, AC, NC, sI, cI - }))); - c = Fractal.getFactory(c).newFcInstance(); - checkComponent(c, new HashSet(Arrays.asList(new Object[] { - COMP, BC, CC, LC, SC, AC, NC, sI, cI - }))); - } - - // ------------------------------------------------------------------------- - // Test component creation errors - // ------------------------------------------------------------------------- - - public void testUnknownControllerDescriptor () throws Exception { - try { - // no such controller descriptor - gf.newFcInstance(t, "unknownDescriptor", C.class.getName()); - fail(); - } catch (InstantiationException e) { - } - } - - public void testBadControllerDescriptor1 () throws Exception { - try { - // error in controller descriptor - gf.newFcInstance(t, "badPrimitive", C.class.getName()); - fail(); - } catch (InstantiationException e) { - } - } - - public void testBadControllerDescriptor2 () throws Exception { - try { - // error in controller descriptor - gf.newFcInstance(u, "badParametricPrimitive", C.class.getName()); - fail(); - } catch (InstantiationException e) { - } - } - - public void testContentClassNotFound () throws Exception { - try { - // no such class - gf.newFcInstance(t, "primitive", "UnknownClass"); - fail(); - } catch (InstantiationException e) { - } - } - - public void testContentClassAbstract () throws Exception { - try { - // X is an abstract class - gf.newFcInstance(t, "primitive", W.class.getName()); - fail(); - } catch (InstantiationException e) { - } - } - - public void testContentClassNoDefaultConstructor () throws Exception { - try { - // X has no public constructor - gf.newFcInstance(t, "primitive", X.class.getName()); - fail(); - } catch (InstantiationException e) { - } - } - - public void testContentClassControlInterfaceMissing () throws Exception { - try { - // Y does not implement BindingController - gf.newFcInstance(t, "primitive", Y.class.getName()); - fail(); - } catch (InstantiationException e) { - } - } - - public void testContentClassInterfaceMissing () throws Exception { - try { - // Z does not implement I - gf.newFcInstance(t, "primitive", Z.class.getName()); - fail(); - } catch (InstantiationException e) { - } - } - - public void testTemplateContentClassNotFound () throws Exception { - try { - // no such class - gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", "UnknownClass" }); - fail(); - } catch (InstantiationException e) { - } - } - - public void testTemplateContentClassAbstract () throws Exception { - try { - // X is an abstract class - gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", W.class.getName() }); - fail(); - } catch (InstantiationException e) { - } - } - - public void testTemplateContentClassNoDefaultConstructor () throws Exception { - try { - // X has no public constructor - gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", X.class.getName() }); - fail(); - } catch (InstantiationException e) { - } - } - - public void testTemplateContentClassControlInterfaceMissing () throws Exception { - try { - // Y does not implement BindingController - gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", Y.class.getName() }); - fail(); - } catch (InstantiationException e) { - } - } - - public void testTemplateContentClassInterfaceMissing () throws Exception { - try { - // Z does not implement I - gf.newFcInstance( - t, "primitiveTemplate", new Object[] { "primitive", Z.class.getName() }); - fail(); - } catch (InstantiationException e) { - } - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestInterceptor.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestInterceptor.java deleted file mode 100644 index a8daa1e9effdb3a5c405f70bb6d46edda625afe9..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestInterceptor.java +++ /dev/null @@ -1,149 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.conform.components.I; -import org.objectweb.fractal.julia.conform.components.C; -import org.objectweb.fractal.julia.conform.controllers.StatController; - -import org.objectweb.fractal.util.Fractal; - -public class TestInterceptor extends Test { - - protected Component boot; - protected TypeFactory tf; - protected GenericFactory gf; - - protected ComponentType t; - protected Component r, c, d; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestInterceptor (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - gf = Fractal.getGenericFactory(boot); - t = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("servers", I.class.getName(), false, false, true), - tf.createFcItfType("client", I.class.getName(), true, true, false), - tf.createFcItfType("clients", I.class.getName(), true, true, true) - }); - r = gf.newFcInstance(t, "composite", null); - c = gf.newFcInstance(t, "statComposite", null); - d = gf.newFcInstance(t, "statPrimitive", C.class.getName()); - Fractal.getContentController(r).addFcSubComponent(c); - Fractal.getContentController(c).addFcSubComponent(d); - } - - // ------------------------------------------------------------------------- - // Test interceptors - // ------------------------------------------------------------------------- - - public void testInterceptors () throws Exception { - Fractal.getBindingController(d).bindFc( - "client", - d.getFcInterface("server")); - Fractal.getLifeCycleController(d).startFc(); - - StatController sd = (StatController)d.getFcInterface("stat-controller"); - assertEquals(0, sd.getNumberOfMethodCalled()); - - I i = (I)d.getFcInterface("server"); - assertEquals(3, i.n(0, (long)3)); - assertEquals(7, sd.getNumberOfMethodCalled()); - } - - public void testCompositeInterceptors () throws Exception { - Fractal.getBindingController(c).bindFc( - "server", - d.getFcInterface("server")); - Fractal.getBindingController(d).bindFc( - "client", - Fractal.getContentController(c).getFcInternalInterface("client")); - Fractal.getBindingController(c).bindFc( - "client", - c.getFcInterface("server")); - Fractal.getLifeCycleController(c).startFc(); - - StatController sc = (StatController)c.getFcInterface("stat-controller"); - StatController sd = (StatController)d.getFcInterface("stat-controller"); - assertEquals(0, sc.getNumberOfMethodCalled()); - assertEquals(0, sd.getNumberOfMethodCalled()); - - I i = (I)c.getFcInterface("server"); - assertEquals(3, i.n(0, (long)3)); - assertEquals(7, sc.getNumberOfMethodCalled()); - assertEquals(7, sd.getNumberOfMethodCalled()); - } - - public void testCollectionInterceptors () throws Exception { - Fractal.getBindingController(d).bindFc( - "clients0", - d.getFcInterface("servers0")); - Fractal.getLifeCycleController(d).startFc(); - - StatController sd = (StatController)d.getFcInterface("stat-controller"); - assertEquals(0, sd.getNumberOfMethodCalled()); - - I i = (I)d.getFcInterface("servers0"); - assertEquals(3, i.n(0, (long)3)); - assertEquals(7, sd.getNumberOfMethodCalled()); - } - - public void testCollectionCompositeInterceptors () throws Exception { - Fractal.getBindingController(c).bindFc( - "servers0", - d.getFcInterface("servers0")); - Fractal.getBindingController(d).bindFc( - "clients0", - Fractal.getContentController(c).getFcInternalInterface("clients0")); - Fractal.getBindingController(c).bindFc( - "clients0", - c.getFcInterface("servers0")); - Fractal.getLifeCycleController(c).startFc(); - - StatController sc = (StatController)c.getFcInterface("stat-controller"); - StatController sd = (StatController)d.getFcInterface("stat-controller"); - assertEquals(0, sc.getNumberOfMethodCalled()); - assertEquals(0, sd.getNumberOfMethodCalled()); - - I i = (I)c.getFcInterface("servers0"); - assertEquals(3, i.n(0, (long)3)); - assertEquals(7, sc.getNumberOfMethodCalled()); - assertEquals(7, sd.getNumberOfMethodCalled()); - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestLifeCycleController.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestLifeCycleController.java deleted file mode 100644 index 88abeccb567691282526e0bcd10a641178a3a057..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestLifeCycleController.java +++ /dev/null @@ -1,214 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.TypeFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - -import org.objectweb.fractal.julia.conform.components.I; -import org.objectweb.fractal.julia.conform.components.C; - -import org.objectweb.fractal.util.Fractal; - -public class TestLifeCycleController extends Test { - - protected Component boot; - protected TypeFactory tf; - protected GenericFactory gf; - - protected ComponentType t; - protected Component c, d; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestLifeCycleController (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - gf = Fractal.getGenericFactory(boot); - t = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", I.class.getName(), false, false, false), - tf.createFcItfType("servers", I.class.getName(), false, false, true), - tf.createFcItfType("client", I.class.getName(), true, false, false), - tf.createFcItfType("clients", I.class.getName(), true, false, true) - }); - setUpComponents(); - } - - protected void setUpComponents () throws Exception { - c = gf.newFcInstance(t, "flatPrimitive", C.class.getName()); - d = gf.newFcInstance(t, "flatPrimitive", C.class.getName()); - } - - // ------------------------------------------------------------------------- - // Test started and stopped states - // ------------------------------------------------------------------------- - - public void testStarted () throws Exception { - Fractal.getBindingController(c).bindFc("client", d.getFcInterface("server")); - assertEquals("STOPPED", Fractal.getLifeCycleController(c).getFcState()); - Fractal.getLifeCycleController(c).startFc(); - assertEquals("STARTED", Fractal.getLifeCycleController(c).getFcState()); - final I i = (I)c.getFcInterface("server"); - Thread t = new Thread(new Runnable() { - public void run () { i.m(true); } - }); - t.start(); - t.join(50); - assertTrue(!t.isAlive()); - } - - public void testStopped () throws Exception { - final I i = (I)c.getFcInterface("server"); - Thread t = new Thread(new Runnable() { - public void run () { i.m(true); } - }); - t.start(); - t.join(50); - assertTrue(t.isAlive()); - } - - // ------------------------------------------------------------------------- - // Test errors in start - // ------------------------------------------------------------------------- - - public void testMandatoryInterfaceNotBound () throws Exception { - try { - Fractal.getLifeCycleController(c).startFc(); - fail(); - } catch (IllegalLifeCycleException e) { - assertEquals("STOPPED", Fractal.getLifeCycleController(c).getFcState()); - } - } - - // ------------------------------------------------------------------------- - // Test invalid operations in started state - // ------------------------------------------------------------------------- - - public void testUnbindNotStopped () throws Exception { - Fractal.getBindingController(c).bindFc("client", d.getFcInterface("server")); - Fractal.getBindingController(c).bindFc("clients0", d.getFcInterface("server")); - Fractal.getLifeCycleController(c).startFc(); - try { - Fractal.getBindingController(c).unbindFc("client"); - fail(); - } catch (IllegalLifeCycleException e) { - } - try { - Fractal.getBindingController(c).unbindFc("clients0"); - fail(); - } catch (IllegalLifeCycleException e) { - } - } - - // --- - - public static class Composite extends TestLifeCycleController { - - protected Component r; - - public Composite (String name) { - super(name); - } - - protected void setUpComponents () throws Exception { - Component o = gf.newFcInstance(t, "composite", null); - r = gf.newFcInstance(t, "composite", null); - c = gf.newFcInstance(t, "primitive", C.class.getName()); - d = gf.newFcInstance(t, "primitive", C.class.getName()); - Fractal.getContentController(o).addFcSubComponent(r); - Fractal.getContentController(r).addFcSubComponent(c); - Fractal.getContentController(r).addFcSubComponent(d); - } - - public void testRecursiveStartStop () throws Exception { - ContentController cc = Fractal.getContentController(r); - Fractal.getBindingController(r).bindFc("server", c.getFcInterface("server")); - Fractal.getBindingController(c).bindFc("client", d.getFcInterface("server")); - Fractal.getBindingController(d).bindFc("client", cc.getFcInternalInterface("client")); - Fractal.getBindingController(r).bindFc("client", r.getFcInterface("server")); - - Fractal.getLifeCycleController(r).startFc(); - assertEquals("STARTED", Fractal.getLifeCycleController(r).getFcState()); - assertEquals("STARTED", Fractal.getLifeCycleController(c).getFcState()); - assertEquals("STARTED", Fractal.getLifeCycleController(d).getFcState()); - final I i = (I)r.getFcInterface("server"); - Thread t = new Thread(new Runnable() { - public void run () { i.m(true); } - }); - t.start(); - t.join(50); - assertTrue(!t.isAlive()); - - Fractal.getLifeCycleController(r).stopFc(); - assertEquals("STOPPED", Fractal.getLifeCycleController(r).getFcState()); - assertEquals("STOPPED", Fractal.getLifeCycleController(c).getFcState()); - assertEquals("STOPPED", Fractal.getLifeCycleController(d).getFcState()); - t = new Thread(new Runnable() { - public void run () { i.m(true); } - }); - t.start(); - t.join(50); - assertTrue(t.isAlive()); - } - - public void testMandatoryInterfaceNotBound () throws Exception { - super.testMandatoryInterfaceNotBound(); - ContentController cc = Fractal.getContentController(r); - cc.removeFcSubComponent(c); - cc.removeFcSubComponent(d); - Fractal.getBindingController(r).bindFc("client", r.getFcInterface("server")); - try { - Fractal.getLifeCycleController(c).startFc(); - fail(); - } catch (IllegalLifeCycleException e) { - } - } - - public void testRemoveNotStopped () throws Exception { - ContentController cc = Fractal.getContentController(r); - Fractal.getBindingController(r).bindFc("server", c.getFcInterface("server")); - Fractal.getBindingController(c).bindFc("client", cc.getFcInternalInterface("client")); - Fractal.getBindingController(r).bindFc("client", r.getFcInterface("server")); - cc.removeFcSubComponent(d); - Fractal.getLifeCycleController(r).startFc(); - cc.addFcSubComponent(d); - try { - cc.removeFcSubComponent(d); - fail(); - } catch (IllegalLifeCycleException e) { - } - } - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/TestTypeFactory.java b/julia/test/conform/org/objectweb/fractal/julia/conform/TestTypeFactory.java deleted file mode 100644 index b43d44b2b37267b032fb6f63dd79380718cbb575..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/TestTypeFactory.java +++ /dev/null @@ -1,121 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.julia.conform.components.I; - -import org.objectweb.fractal.util.Fractal; - -import junit.framework.TestCase; - -public class TestTypeFactory extends TestCase { - - protected Component boot; - protected TypeFactory tf; - - // ------------------------------------------------------------------------- - // Constructor ans setup - // ------------------------------------------------------------------------- - - public TestTypeFactory (final String name) { - super(name); - } - - protected void setUp () throws Exception { - boot = Fractal.getBootstrapComponent(); - tf = Fractal.getTypeFactory(boot); - } - - // ------------------------------------------------------------------------- - // Test interface types - // ------------------------------------------------------------------------- - - public void testInterfaceType () throws Exception { - tf.createFcItfType("i", I.class.getName(), false, false, false); - tf.createFcItfType("i", I.class.getName(), true, false, false); - } - - public void testNoSuchClass () { - try { - // no such class - tf.createFcItfType("i", "xyz", false, false, false); - fail(); - } catch (InstantiationException e) { - } - } - - public void testNotAnInterface () { - try { - // not an interface - tf.createFcItfType("i", TestTypeFactory.class.getName(), false, false, false); - fail(); - } catch (InstantiationException e) { - } - } - - // ------------------------------------------------------------------------- - // Test component types - // ------------------------------------------------------------------------- - - public void testComponentType () throws Exception { - InterfaceType sType = - tf.createFcItfType("s", I.class.getName(), false, false, false); - InterfaceType i1Type = - tf.createFcItfType("i1", I.class.getName(), true, false, false); - InterfaceType i2Type = - tf.createFcItfType("i2", I.class.getName(), true, false, false); - tf.createFcType(null); - tf.createFcType(new InterfaceType[] { sType }); - tf.createFcType(new InterfaceType[] { i1Type, i2Type }); - tf.createFcType(new InterfaceType[] { sType, i1Type, i2Type }); - } - - public void testBadPrefixes () { - try { - // bad prefixes - tf.createFcType( - new InterfaceType[] { - tf.createFcItfType("i", I.class.getName(), false, false, false), - tf.createFcItfType("i", I.class.getName(), true, false, false) - }); - fail(); - } catch (InstantiationException e) { - } - try { - // bad prefixes - tf.createFcType( - new InterfaceType[] { - tf.createFcItfType("i", I.class.getName(), true, true, true), - tf.createFcItfType("ij", I.class.getName(), true, true, true) - }); - fail(); - } catch (InstantiationException e) { - } - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/C.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/C.java deleted file mode 100644 index c864a2621a862f7bb14a77d45150cb0eed9a6644..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/C.java +++ /dev/null @@ -1,243 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -import org.objectweb.fractal.api.control.BindingController; - -import java.util.Map; -import java.util.HashMap; - -public class C implements CAttributes, BindingController, I, J { - - private boolean x1; - private byte x2; - private char x3; - private short x4; - private int x5; - private long x6; - private float x7; - private double x8; - private String x9; - private boolean x11; - - private I i; - - private Map j = new HashMap(); - - // ATTRIBUTE CONTROLLER - - public boolean getX1 () { - return x1; - } - - public void setX1 (boolean x1) { - this.x1 = x1; - } - - public byte getX2 () { - return x2; - } - - public void setX2 (byte x2) { - this.x2 = x2; - } - - public char getX3 () { - return x3; - } - - public void setX3 (char x3) { - this.x3 = x3; - } - - public short getX4 () { - return x4; - } - - public void setX4 (short x4) { - this.x4 = x4; - } - - public int getX5 () { - return x5; - } - - public void setX5 (int x5) { - this.x5 = x5; - } - - public long getX6 () { - return x6; - } - - public void setX6 (long x6) { - this.x6 = x6; - } - - public float getX7 () { - return x7; - } - - public void setX7 (float x7) { - this.x7 = x7; - } - - public double getX8 () { - return x8; - } - - public void setX8 (double x8) { - this.x8 = x8; - } - - public String getX9 () { - return x9; - } - - public void setX9 (String x9) { - this.x9 = x9; - } - - public boolean getReadOnlyX10 () { - return true; - } - - public void setWriteOnlyX11 (boolean x11) { - this.x11 = x11; - } - - // BINDING CONTROLLER - - public String[] listFc () { - String[] result = new String[j.size() + 1]; - j.keySet().toArray(result); - result[j.size()] = "client"; - return result; - } - - public Object lookupFc (String s) { - if (s.equals("client")) { - return i; - } else if (s.startsWith("clients")) { - return j.get(s); - } - return null; - } - - public void bindFc (String s, Object o) { - if (s.equals("client")) { - i = (I)o; - } else if (s.startsWith("clients")) { - j.put(s, o); - } - } - - public void unbindFc (String s) { - if (s.equals("client")) { - i = null; - } else if (s.startsWith("clients")) { - j.remove(s); - } - } - - // FUNCTIONAL INTERFACE - - public void m (boolean v) { - } - - public void m (byte v) { - } - - public void m (char v) { - } - - public void m (short v) { - } - - public void m (int v) { - } - - public void m (long v) { - } - - public void m (float v) { - } - - public void m (double v) { - } - - public void m (String v) { - } - - public void m (String[] v) { - } - - public boolean n (boolean v, String[] w) { - return v | x11; // for write only attribute tests - } - - public byte n (byte v, String w) { - return v; - } - - public char n (char v, double w) { - return v; - } - - public short n (short v, float w) { - return v; - } - - public int n (int v, long w) { - if (i != null) { - // for interceptors tests - return w == 0 ? v : i.n(v + 1, w - 1); - } else if (j.size() > 0) { - // for interceptors tests - return w == 0 ? v : ((I)j.values().iterator().next()).n(v + 1, w - 1); - } else { - return v; - } - } - - public long n (long v, int w) { - return v; - } - - public float n (float v, short w) { - return v; - } - - public double n (double v, char w) { - return v; - } - - public String n (String v, byte w) { - return v; - } - - public String[] n (String[] v, boolean w) { - return v; - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/CAttributes.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/CAttributes.java deleted file mode 100644 index e785282050dd9bb2e05331b35fd69e194bf56159..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/CAttributes.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -import org.objectweb.fractal.api.control.AttributeController; - -public interface CAttributes extends AttributeController { - - boolean getX1 (); - void setX1 (boolean v); - - byte getX2 (); - void setX2 (byte v); - - char getX3 (); - void setX3 (char v); - - short getX4 (); - void setX4 (short v); - - int getX5 (); - void setX5 (int v); - - long getX6 (); - void setX6 (long v); - - float getX7 (); - void setX7 (float v); - - double getX8 (); - void setX8 (double v); - - String getX9 (); - void setX9 (String v); - - boolean getReadOnlyX10 (); - - void setWriteOnlyX11 (boolean v); -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/I.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/I.java deleted file mode 100644 index 8dd3f73f84b355e7c22eba4999c8f0b8b2237e45..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/I.java +++ /dev/null @@ -1,49 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -public interface I { - - void m (boolean v); - void m (byte v); - void m (char v); - void m (short v); - void m (int v); - void m (long v); - void m (float v); - void m (double v); - void m (String v); - void m (String[] v); - - boolean n (boolean v, String[] w); - byte n (byte v, String w); - char n (char v, double w); - short n (short v, float w); - int n (int v, long w); - long n (long v, int w); - float n (float v, short w); - double n (double v, char w); - String n (String v, byte w); - String[] n (String[] v, boolean w); -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/J.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/J.java deleted file mode 100644 index eec33af137e9b65ba7e4fc6a9045f9e4031c9881..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/J.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -public interface J { - -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/W.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/W.java deleted file mode 100644 index 7884aec58ea9a62439a6f5d813ee6db9bb8ccf21..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/W.java +++ /dev/null @@ -1,32 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -import org.objectweb.fractal.julia.conform.components.C; - -public abstract class W extends C { - - // invalid component class (abstract class) - -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/X.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/X.java deleted file mode 100644 index c3dfa5eed795f71d9347f388ae3cd1de30c6c6bf..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/X.java +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -import org.objectweb.fractal.julia.conform.components.C; - -public class X extends C { - - // invalid component class (no public constructor) - - public X (int i) { - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/Y.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/Y.java deleted file mode 100644 index 0610afacddecb5e0714cb4a8db374e96d7cf36c2..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/Y.java +++ /dev/null @@ -1,102 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -import org.objectweb.fractal.julia.conform.components.I; - -public class Y implements I { - - // invalid component class for components with dependencies: - // does not implement BindingController - - public void m (boolean v) { - } - - public void m (byte v) { - } - - public void m (char v) { - } - - public void m (short v) { - } - - public void m (int v) { - } - - public void m (long v) { - } - - public void m (float v) { - } - - public void m (double v) { - } - - public void m (String v) { - } - - public void m (String[] v) { - } - - public boolean n (boolean v, String[] w) { - return v; - } - - public byte n (byte v, String w) { - return v; - } - - public char n (char v, double w) { - return v; - } - - public short n (short v, float w) { - return v; - } - - public int n (int v, long w) { - return v; - } - - public long n (long v, int w) { - return v; - } - - public float n (float v, short w) { - return v; - } - - public double n (double v, char w) { - return v; - } - - public String n (String v, byte w) { - return v; - } - - public String[] n (String[] v, boolean w) { - return v; - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/components/Z.java b/julia/test/conform/org/objectweb/fractal/julia/conform/components/Z.java deleted file mode 100644 index d6ffc3088659796b7139e3f70917df5267042360..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/components/Z.java +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.components; - -import org.objectweb.fractal.api.control.BindingController; - -import org.objectweb.fractal.julia.conform.components.I; - -public class Z implements BindingController { - - // invalid component class for components providing an I interface: - // does not implement I - - private I i; - - public String[] listFc () { - return new String[] { "c" }; - } - - public Object lookupFc (String s) { - if (s.equals("c")) { - return i; - } - return null; - } - - public void bindFc (String s, Object o) { - if (s.equals("c")) { - i = (I)o; - } - } - - public void unbindFc (String s) { - if (s.equals("c")) { - i = null; - } - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/BasicStatController.java b/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/BasicStatController.java deleted file mode 100644 index 9be45e6971da6f05bc55d8d0bf4df4f455c3e308..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/BasicStatController.java +++ /dev/null @@ -1,37 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.controllers; - -public class BasicStatController implements StatController { - - public int fcCounter; - - public void incrementFcCounter (String method) { - ++fcCounter; - } - - public int getNumberOfMethodCalled () { - return fcCounter; - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/StatCodeGenerator.java b/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/StatCodeGenerator.java deleted file mode 100644 index d5a38c671955f2bed167698a4bf883ec00bb683a..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/StatCodeGenerator.java +++ /dev/null @@ -1,62 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.controllers; - -import org.objectweb.fractal.julia.asm.SimpleCodeGenerator; -import org.objectweb.fractal.julia.asm.InterceptorCodeAdapter; -import org.objectweb.fractal.julia.asm.InterceptorClassGenerator; - -import java.lang.reflect.Method; - -public class StatCodeGenerator extends SimpleCodeGenerator { - - public int init (final InterceptorClassGenerator icg) { - super.init(icg); - return IN_OUT; - } - - protected String getControllerInterfaceName () { - return "stat-controller"; - } - - protected int getInterceptionType (Method m) { - return InterceptorCodeAdapter.EMPTY; - } - - protected String getPreMethodName () { - return "incrementFcCounter"; - } - - protected String getPostMethodName () { - return null; - } - - protected Class getContextType () { - return Void.TYPE; - } - - protected String getMethodName (final Method m) { - return m.getName(); - } -} diff --git a/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/StatController.java b/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/StatController.java deleted file mode 100644 index 1ede45c404269a70f2c8b9ac15ff28d9cc834533..0000000000000000000000000000000000000000 --- a/julia/test/conform/org/objectweb/fractal/julia/conform/controllers/StatController.java +++ /dev/null @@ -1,29 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.conform.controllers; - -public interface StatController { - - int getNumberOfMethodCalled (); -} diff --git a/julia/test/lib/junit.jar b/julia/test/lib/junit.jar deleted file mode 100644 index 914a5cfa9b467c86d2841b32c367295653ed754c..0000000000000000000000000000000000000000 Binary files a/julia/test/lib/junit.jar and /dev/null differ diff --git a/julia/test/perf/julia.cfg b/julia/test/perf/julia.cfg deleted file mode 100644 index 8c35125c35c6ea2c2e8f3f007fbdf08dc8850a92..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia.cfg +++ /dev/null @@ -1,614 +0,0 @@ -############################################################################### -# STANDARD JULIA CONFIGURATION FILE - DO NOT EDIT -# -# PUT NEW OR OVERRIDEN DEFINITIONS AT THE END OF THE FILE, OR IN OTHER FILES -############################################################################### - -# ----------------------------------------------------------------------------- -# INTERFACE CLASS GENERATORS -# ----------------------------------------------------------------------------- - -# default class generator, generates sub classes of BasicComponentInterface - -(interface-class-generator - (org.objectweb.fractal.julia.asm.InterfaceClassGenerator - org.objectweb.fractal.julia.BasicComponentInterface - ) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER INTERFACES -# -# each definition must be of the form (interface-name interface-signature) -# ----------------------------------------------------------------------------- - -# Component interface - -(component-itf - (component org.objectweb.fractal.api.Component) -) - -# TypeFactory interface - -(type-factory-itf - (type-factory org.objectweb.fractal.api.type.TypeFactory) -) - -# GenericFactory interface - -(generic-factory-itf - (generic-factory org.objectweb.fractal.api.factory.GenericFactory) -) - -# Factory interface - -(factory-itf - # choose one of the following definitions: - # the first one provides only the Fractal Factory interface - # the second one provides a Julia extension of the Factory interface - # (factory org.objectweb.fractal.api.factory.Factory) - (factory org.objectweb.fractal.julia.factory.Template) -) - -(julia-factory-itf - (/template org.objectweb.fractal.julia.factory.Template) -) - -# AttributeController interface - -(attribute-controller-itf - (attribute org.objectweb.fractal.api.control.AttributeController) -) - -(julia-attribute-controller-itf - (/cloneable-attribute-controller org.objectweb.fractal.julia.control.attribute.CloneableAttributeController) -) - -# BindingController interface - -(binding-controller-itf - (binding-controller org.objectweb.fractal.api.control.BindingController) -) - -# ContentController interface - -(content-controller-itf - (content-controller org.objectweb.fractal.api.control.ContentController) -) - -# SuperController interface - -(super-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal SuperController interface - # the second one provides a Julia extension of the SuperController interface - # (super-controller org.objectweb.fractal.api.control.SuperController) - (super-controller org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -(julia-super-controller-itf - (/super-controller-notifier org.objectweb.fractal.julia.control.content.SuperControllerNotifier) -) - -# LifeCycleController interface - -(lifecycle-controller-itf - # choose one of the following definitions: - # the first one provides only the Fractal LifeCycleController interface - # the second one provides a Julia extension of the LifeCycleController interface - # (lifecycle-controller org.objectweb.fractal.api.control.LifeCycleController) - (lifecycle-controller org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -(julia-lifecycle-controller-itf - (/lifecycle-coordinator org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator) -) - -# NameController interface - -(name-controller-itf - (name-controller org.objectweb.fractal.api.control.NameController) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER OBJECTS -# -# each definition must be an object descriptor -# ----------------------------------------------------------------------------- - -# Component implementation - -(component-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ComponentImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.BasicComponentMixin - # to check type related constraints, and for collection interfaces support: - org.objectweb.fractal.julia.TypeComponentMixin - )) -) - -# TypeFactory implementation - -(type-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - TypeFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.type.BasicTypeFactoryMixin - # to check the component interface signatures with the Java Reflection API: - org.objectweb.fractal.julia.type.CheckTypeFactoryMixin - )) -) - -# GenericFactory implementation - -(generic-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - GenericFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.loader.UseLoaderMixin - org.objectweb.fractal.julia.type.UseTypeFactoryMixin - org.objectweb.fractal.julia.factory.BasicGenericFactoryMixin - # to check the component content descriptor with the Java Reflection API: - org.objectweb.fractal.julia.factory.CheckGenericFactoryMixin - )) -) - -# Factory implementation (for template components) - -(factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - FactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - )) -) - -# Factory implementation (for singleton template components) - -(singleton-factory-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SingletonFactoryImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.factory.BasicTemplateMixin - # to copy the template's attributes to the components it creates: - org.objectweb.fractal.julia.control.attribute.UseCloneableAttributeControllerMixin - org.objectweb.fractal.julia.factory.AttributeTemplateMixin - # to copy the template's name to the components it creates: - org.objectweb.fractal.julia.control.name.UseNameControllerMixin - org.objectweb.fractal.julia.factory.NameTemplateMixin - # to provide the singleton semantics to the template: - org.objectweb.fractal.julia.factory.SingletonTemplateMixin - )) -) - -# BindingController implementation (for primitive components without content) - -(primitive-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - PrimitiveBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for primitive components with content) - -(container-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContainerBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.ContainerBindingControllerMixin - # to skip Interface objects before delegating to the encapsulated component: - # org.objectweb.fractal.julia.control.binding.OptimizedContainerBindingMixin - # to manage output interceptors: - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.InterceptorBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - )) -) - -# BindingController implementation (for composite components) - -(composite-binding-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeBindingControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.binding.BasicBindingControllerMixin - # to initialize the BasicBindingControllerMixin from the component's type: - org.objectweb.fractal.julia.control.binding.TypeBasicBindingMixin - # to check some basic pre conditions (interface not already bound, ...) - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.binding.CheckBindingMixin - # to check type related constraints for bindings: - org.objectweb.fractal.julia.control.binding.TypeBindingMixin - # to check content related constraints for bindings: - org.objectweb.fractal.julia.control.content.UseSuperControllerMixin - org.objectweb.fractal.julia.control.binding.ContentBindingMixin - # to check lifecycle related constraints for bindings: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.binding.LifeCycleBindingMixin - # to manage the getFcItfImpl links of the Interface objects: - # choose one of ComponentBindingMixin and OptimizedCompositeBindingMixin - # (the last one creates and updates shortcuts links when possible) - org.objectweb.fractal.julia.control.content.UseContentControllerMixin - # org.objectweb.fractal.julia.control.binding.CompositeBindingMixin - org.objectweb.fractal.julia.control.binding.OptimizedCompositeBindingMixin - )) -) - -# ContentController implementation - -(content-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - ContentControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.content.BasicContentControllerMixin - # to check some basic pre conditions, and to prevent hierarchy cycles: - org.objectweb.fractal.julia.control.content.CheckContentMixin - # to check type related constraints in getFcInternalInterface: - org.objectweb.fractal.julia.control.content.TypeContentMixin - # to check binding locality related constraints in removeFcSubComponent: - org.objectweb.fractal.julia.control.content.BindingContentMixin - # to check lifecycle related constraints: - org.objectweb.fractal.julia.control.lifecycle.UseLifeCycleControllerMixin - org.objectweb.fractal.julia.control.content.LifeCycleContentMixin - # to notify sub components when they are added or removed from this component: - org.objectweb.fractal.julia.control.content.SuperContentMixin - )) -) - -# SuperController implementation - -(super-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - SuperControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.content.BasicSuperControllerMixin - )) -) - -# LifeCycleController implementation (for primitive or composite components) - -(lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - LifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - # to notify the encapsulated component (if present) when its state changes: - org.objectweb.fractal.julia.control.lifecycle.ContainerLifeCycleMixin - )) -) - -# LifeCycleController implementation (for composite components only) - -(composite-lifecycle-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - CompositeLifeCycleControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.UseComponentMixin - org.objectweb.fractal.julia.control.lifecycle.BasicLifeCycleCoordinatorMixin - org.objectweb.fractal.julia.control.lifecycle.OptimizedLifeCycleControllerMixin - # to check that mandatory client interfaces are bound in startFc: - org.objectweb.fractal.julia.control.lifecycle.TypeLifeCycleMixin - )) -) - -# NameController implementation - -(name-controller-impl - ((org.objectweb.fractal.julia.asm.MixinClassGenerator - NameControllerImpl - org.objectweb.fractal.julia.BasicControllerMixin - org.objectweb.fractal.julia.control.name.BasicNameControllerMixin - )) -) - -# ----------------------------------------------------------------------------- -# CONTROLLER DESCRIPTORS -# ----------------------------------------------------------------------------- - -(optimizationLevel - # choose one of the following optimization options: - none - # mergeControllers - # mergeControllersAndInterceptors - # mergeControllersAndContent - # mergeControllersInterceptorsAndContent -) - -(bootstrap - ( - 'interface-class-generator - ( - 'component-itf - 'type-factory-itf - 'generic-factory-itf - (loader org.objectweb.fractal.julia.loader.Loader) - ) - ( - 'component-impl - 'type-factory-impl - 'generic-factory-impl - # choose one of the following classes: - # the first one loads all classes from the classpath - # the second one can generate missing classes on the fly, dynamically - # org.objectweb.fractal.julia.loader.BasicLoader - org.objectweb.fractal.julia.loader.DynamicLoader - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) - -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitive - 'primitive -) - -(composite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricComposite - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'composite-lifecycle-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(primitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricPrimitiveTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'primitive-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(compositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -(parametricCompositeTemplate - ( - 'interface-class-generator - ( - 'component-itf - 'julia-attribute-controller-itf - 'binding-controller-itf - 'content-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - 'factory-itf - # only if factory-itf does not designate the Julia interface: - # 'julia-factory-itf - ) - ( - 'component-impl - ((org.objectweb.fractal.julia.asm.AttributeControllerClassGenerator - ('attributeControllerInterface) - )) - 'composite-binding-controller-impl - 'content-controller-impl - 'super-controller-impl - 'name-controller-impl - 'factory-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - 'optimizationLevel - ) -) - -############################################################################### -# CUSTOM CONFIGURATION INFORMATION -############################################################################### - -# no custom definitions diff --git a/julia/test/perf/julia1.cfg b/julia/test/perf/julia1.cfg deleted file mode 100644 index cac96d6b43695650c544c2d6e229836414065c07..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia1.cfg +++ /dev/null @@ -1,30 +0,0 @@ -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) diff --git a/julia/test/perf/julia2.cfg b/julia/test/perf/julia2.cfg deleted file mode 100644 index 540749c98afdf404823a0b77f2c9dd2d74b12627..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia2.cfg +++ /dev/null @@ -1,30 +0,0 @@ -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - mergeControllers - ) -) diff --git a/julia/test/perf/julia3.cfg b/julia/test/perf/julia3.cfg deleted file mode 100644 index 2d3aa930bd5426e73d7e1f88975089342063cca8..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia3.cfg +++ /dev/null @@ -1,30 +0,0 @@ -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'lifecycle-controller-itf - # only if lifecycle-controller-itf does not designate the Julia interface: - # 'julia-lifecycle-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'lifecycle-controller-impl - 'name-controller-impl - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - mergeControllersInterceptorsAndContent - ) -) diff --git a/julia/test/perf/julia4.cfg b/julia/test/perf/julia4.cfg deleted file mode 100644 index 8de4ce4a561a75b232c694ca41caef91be60fbbf..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia4.cfg +++ /dev/null @@ -1,24 +0,0 @@ -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) diff --git a/julia/test/perf/julia5.cfg b/julia/test/perf/julia5.cfg deleted file mode 100644 index 6f3ccf5e5e686e8eb4fde747ff817b2db14f2f6a..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia5.cfg +++ /dev/null @@ -1,24 +0,0 @@ -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - mergeControllers - ) -) diff --git a/julia/test/perf/julia6.cfg b/julia/test/perf/julia6.cfg deleted file mode 100644 index 52a16748af60c4880d00fbb5b9fbe3272b7377b2..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia6.cfg +++ /dev/null @@ -1,24 +0,0 @@ -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - ) - ( - # no interceptors - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - mergeControllersInterceptorsAndContent - ) -) diff --git a/julia/test/perf/julia7.cfg b/julia/test/perf/julia7.cfg deleted file mode 100644 index 07604e2c9642cd7deb4becf567035671886784f3..0000000000000000000000000000000000000000 --- a/julia/test/perf/julia7.cfg +++ /dev/null @@ -1,28 +0,0 @@ -(primitive - ( - 'interface-class-generator - ( - 'component-itf - 'binding-controller-itf - 'super-controller-itf - # only if super-controller-itf does not designate the Julia interface: - # 'julia-super-controller-itf - 'name-controller-itf - (mop-controller org.objectweb.fractal.julia.perf.controllers.MOP) - ) - ( - 'component-impl - 'container-binding-controller-impl - 'super-controller-impl - 'name-controller-impl - org.objectweb.fractal.julia.perf.controllers.MOPController - ) - ( - (org.objectweb.fractal.julia.asm.InterceptorClassGenerator - org.objectweb.fractal.julia.perf.controllers.MOPCodeGenerator - ) - ) - org.objectweb.fractal.julia.asm.MergeClassGenerator - none - ) -) diff --git a/julia/test/perf/org/objectweb/fractal/julia/perf/TestPerf.java b/julia/test/perf/org/objectweb/fractal/julia/perf/TestPerf.java deleted file mode 100644 index 042c5c9f2ec58a37107b35cbed4df4f98756564f..0000000000000000000000000000000000000000 --- a/julia/test/perf/org/objectweb/fractal/julia/perf/TestPerf.java +++ /dev/null @@ -1,572 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.perf; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.factory.Factory; -import org.objectweb.fractal.api.factory.GenericFactory; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.api.type.TypeFactory; - -import org.objectweb.fractal.julia.perf.components.I; -import org.objectweb.fractal.julia.perf.components.C; - -import org.objectweb.fractal.util.Fractal; - -/** - * An application to test the performances of the framework. This application - * computes the size of empty components and compares it to the size of an empty - * Java object. It also computes the duration of an empty method call on a - * component, and compares it to the duration of an empty method call on a Java - * object (via a Java interface, i.e., through an opc_invokeinterface bytecode - * instruction). These measurements are done both with compiled and generated - * containers. - */ - -public class TestPerf { - - /** - * Launches the performance measurement tests. - */ - - public static void main (final String[] args) throws Exception { - - Component boot = Fractal.getBootstrapComponent(); - - TypeFactory tf = Fractal.getTypeFactory(boot); - ComponentType type = tf.createFcType(new InterfaceType[] { - tf.createFcItfType( - "s", - I.class.getName(), - false, - false, - false) - }); - GenericFactory cf = Fractal.getGenericFactory(boot); - Component tmpl = cf.newFcInstance( - type, "primitiveTemplate", new Object[] { - "primitive", C.class.getName() - }); - - Component comp = Fractal.getFactory(tmpl).newFcInstance(); - try { - Fractal.getLifeCycleController(comp).startFc(); - } catch (NoSuchInterfaceException _) { - } - I i = (I)comp.getFcInterface("s"); - - System.out.println("Julia performances, " + args[0]); - computeObjectCallDuration(); - computeComponentCallDuration(i); - computeEmptyObjectSize(); - computeEmptyComponentSize(Fractal.getFactory(tmpl)); - computeComponentTypeSize((ComponentType)comp.getFcType()); - computeComponentCreationDuration(); - computeTemplateCreationDuration(); - computeTemplateInstantiationDuration(Fractal.getFactory(tmpl)); - System.out.println(); - } - - // ------------------------------------------------------------------------- - // Time measurements - // ------------------------------------------------------------------------- - - /** - * Number of method calls to execute to estimate method call durations. - */ - - private final static int NB_CALLS = 10000000; - - /** - * Number of estimations needed to compute min, max and mean values. - */ - - private final static int LOOPS = 7; - - /** - * Mean duration of an empty method call on an object. - */ - - private static double objectCallMean; - - /** - * Estimates the duration of an empty method call on an object. - */ - - private static void computeObjectCallDuration () { - // initializes the min, max and mean value - double min = Long.MAX_VALUE; - double max = Long.MIN_VALUE; - double mean = 0; - I itf = new C(); - - // makes several estimations in order to compute min, max and mean - for (int j = 0; j < LOOPS; ++j) { - int i = NB_CALLS; - double dt = System.currentTimeMillis(); - while (i > 0) { - i = itf.m(i); - } - dt = 1000 * (System.currentTimeMillis() - dt) / NB_CALLS; - // the first iterations are not taken into account (warm up) - if (j > 1) { - // updates the min, max and mean values - min = Math.min(dt, min); - max = Math.max(dt, max); - mean += dt; - } - } - // computes the mean value in micro-seconds - mean = mean / (LOOPS - 2); - // computes the variation in nano-seconds - double delta = 1000 * Math.max(max - mean, mean - min); - // prints the results - System.out.print("method call = "); - System.out.println(format(mean) + " µs (+/- " + format(delta) + " ns)"); - // stores the min, max and mean value to compute overhead of components - // (see computeComponentCallDuration) - objectCallMean = mean; - } - - /** - * Estimates the duration of an empty method call on a component. - */ - - private static void computeComponentCallDuration (I itf) { - // initializes the min, max and mean value - double min = Long.MAX_VALUE; - double max = Long.MIN_VALUE; - double mean = 0; - - // makes several estimations in order to compute min, max and mean - for (int j = 0; j < LOOPS; ++j) { - int i = NB_CALLS; - double dt = System.currentTimeMillis(); - while (i > 0) { - i = itf.m(i); - } - dt = 1000 * (System.currentTimeMillis() - dt) / NB_CALLS; - // the first iterations are not taken into account (warm up) - if (j > 1) { - // updates the min, max and mean values - min = Math.min(dt, min); - max = Math.max(dt, max); - mean += dt; - } - } - // computes the mean value in micro-seconds - mean = mean / (LOOPS - 2); - // computes the variation in nano-seconds - double delta = 1000 * Math.max(max - mean, mean - min); - // compute the mean overhead, due to the interception code - double overhead = mean - objectCallMean; - // prints the results - System.out.print("component call = "); - System.out.print(format(mean) + " µs (+/- " + format(delta) + " ns)"); - System.out.print(" => +" + format(overhead) + " µs"); - System.out.println(" (" + format(overhead / objectCallMean) + " calls)"); - } - - /** - * Estimates the time needed to create a component. - */ - - private static void computeComponentCreationDuration () throws Exception { - Component boot = Fractal.getBootstrapComponent(); - // initializes the min, max and mean value - double min = Long.MAX_VALUE; - double max = Long.MIN_VALUE; - double mean = 0; - // makes several estimations in order to compute min, max and mean - for (int j = 0; j < LOOPS; ++j) { - int i = 0; - double dt = System.currentTimeMillis(); - while (i < NB_INSTANCES_2) { - TypeFactory tf = Fractal.getTypeFactory(boot); - GenericFactory cf = Fractal.getGenericFactory(boot); - ComponentType type = tf.createFcType(new InterfaceType[] { - tf.createFcItfType( - "s", - I.class.getName(), - false, - false, - false) - }); - cf.newFcInstance(type, "primitive", C.class.getName()); - ++i; - } - dt = (System.currentTimeMillis() - dt) / NB_INSTANCES_2; - // the first iterations are not taken into account (warm up) - if (j > 1) { - // updates the min, max and mean values - min = Math.min(dt, min); - max = Math.max(dt, max); - mean += dt; - } - } - // computes the mean value in milli-seconds - mean = mean / (LOOPS - 2); - // computes the variation in micro-seconds - double delta = 1000 * Math.max(max - mean, mean - min); - // prints the results - System.out.print("component creation = "); - System.out.println(format(mean) + " ms (+/- " + format(delta) + " µs)"); - } - - /** - * Estimates the time needed to create a component template. - */ - - private static void computeTemplateCreationDuration () throws Exception { - Component boot = Fractal.getBootstrapComponent(); - // initializes the min, max and mean value - double min = Long.MAX_VALUE; - double max = Long.MIN_VALUE; - double mean = 0; - // makes several estimations in order to compute min, max and mean - for (int j = 0; j < LOOPS; ++j) { - int i = 0; - double dt = System.currentTimeMillis(); - while (i < NB_INSTANCES_2) { - TypeFactory tf = Fractal.getTypeFactory(boot); - ComponentType type = tf.createFcType(new InterfaceType[] { - tf.createFcItfType( - "s", - I.class.getName(), - false, - false, - false) - }); - GenericFactory cf = Fractal.getGenericFactory(boot); - cf.newFcInstance( - type, "primitiveTemplate", new Object[] { - "primitive", C.class.getName() - }); - ++i; - } - dt = (System.currentTimeMillis() - dt) / NB_INSTANCES_2; - // the first iterations are not taken into account (warm up) - if (j > 1) { - // updates the min, max and mean values - min = Math.min(dt, min); - max = Math.max(dt, max); - mean += dt; - } - } - // computes the mean value in milli-seconds - mean = mean / (LOOPS - 2); - // computes the variation in micro-seconds - double delta = 1000 * Math.max(max - mean, mean - min); - // prints the results - System.out.print("template creation = "); - System.out.println(format(mean) + " ms (+/- " + format(delta) + " µs)"); - } - - /** - * Estimates the time needed to instantiate a component template. - */ - - private static void computeTemplateInstantiationDuration (Factory tmpl) - throws Exception - { - // initializes the min, max and mean value - double min = Long.MAX_VALUE; - double max = Long.MIN_VALUE; - double mean = 0; - // makes several estimations in order to compute min, max and mean - for (int j = 0; j < LOOPS; ++j) { - int i = 0; - double dt = System.currentTimeMillis(); - while (i < NB_INSTANCES_2) { - tmpl.newFcInstance(); - ++i; - } - dt = (System.currentTimeMillis() - dt) / NB_INSTANCES_2; - // the first iterations are not taken into account (warm up) - if (j > 1) { - // updates the min, max and mean values - min = Math.min(dt, min); - max = Math.max(dt, max); - mean += dt; - } - } - // computes the mean value in milli-seconds - mean = mean / (LOOPS - 2); - // computes the variation in micro-seconds - double delta = 1000 * Math.max(max - mean, mean - min); - // prints the results - System.out.print("template instantiation = "); - System.out.println(format(mean) + " ms (+/- " + format(delta) + " µs)"); - } - - // ------------------------------------------------------------------------- - // Memory measurements - // ------------------------------------------------------------------------- - - /** - * Number of instances to instantiate to estimate object and component sizes. - */ - - private final static int NB_INSTANCES_1 = 100; - - /** - * Number of instances to estimate object and component creation durations. - */ - - private final static int NB_INSTANCES_2 = 1000; - - /** - * Estimated size of an empty object. - */ - - private static long objectSize; - - /** - * Computes the size of an empty object. - */ - - private static void computeEmptyObjectSize () { - // makes a first estimate - long oldSize; - long newSize = estimateEmptyObjectSize(); - //System.err.println("SIZE ESTIMATE " + newSize); - do { - // makes a new estimate - oldSize = newSize; - newSize = estimateEmptyObjectSize(); - //System.err.println("SIZE ESTIMATE " + newSize); - // loop until two consecutive estimates are equal - } while (newSize != oldSize); - // prints the results - System.out.print("empty object = "); - System.out.println(newSize + " bytes (" + (newSize / 4) + " words)"); - // stores the result to compute the overhead of components - // (see computeEmptyComponentSize) - objectSize = newSize; - } - - /** - * Estimates the size of an empty object. - */ - - private static long estimateEmptyObjectSize () { - long min = 0; - while (true) { - min = freeMem(min); - Object[] instances = new Object[NB_INSTANCES_1]; - long start = freeMem(0); - for (int i = 0; i < instances.length; ++i) { - instances[i] = new C(); - } - long freeMem = freeMem(0); - for (int i = 0; i < instances.length; ++i) { - instances[i] = null; - } - long end = freeMem(freeMem); - /* - System.err.println("FREE MEM BEFORE INSTANTIATE " + start); - System.err.println("FREE MEM AFTER INSTANTIATE " + freeMem); - System.err.println("FREE MEM AFTER GC " + end); - */ - if (Math.abs(end - start) < NB_INSTANCES_1) { - return (end - freeMem) / NB_INSTANCES_1; - } - } - } - - /** - * Computes the size of an empty component. - */ - - private static void computeEmptyComponentSize (Factory tmpl) - throws Exception - { - // makes a first estimate - long oldSize; - long newSize = estimateEmptyComponentSize(tmpl); - //System.err.println("SIZE ESTIMATE " + newSize); - do { - // makes a new estimate - oldSize = newSize; - newSize = estimateEmptyComponentSize(tmpl); - //System.err.println("SIZE ESTIMATE " + newSize); - // loop until two consecutive estimates are equal - } while (newSize != oldSize); - // prints the results - System.out.print("empty component = "); - System.out.print(newSize + " bytes (" + (newSize / 4) + " words)"); - System.out.println(" => + " + (newSize - objectSize) / 4 + " words"); - } - - /** - * Estimates the size of an empty component. - */ - - private static long estimateEmptyComponentSize (Factory tmpl) - throws Exception - { - long min = 0; - while (true) { - min = freeMem(min); - Object[] instances = new Object[NB_INSTANCES_1]; - long start = freeMem(0); - for (int i = 0; i < instances.length; ++i) { - instances[i] = tmpl.newFcInstance(); - } - long freeMem = freeMem(0); - for (int i = 0; i < instances.length; ++i) { - instances[i] = null; - } - long end = freeMem(freeMem); - /* - System.err.println("FREE MEM BEFORE INSTANTIATE " + start); - System.err.println("FREE MEM AFTER INSTANTIATE " + freeMem); - System.err.println("FREE MEM AFTER GC " + end); - */ - if (Math.abs(end - start) < NB_INSTANCES_1) { - return (end - freeMem) / NB_INSTANCES_1; - } - } - } - - /** - * Computes the size of a component type. - */ - - private static void computeComponentTypeSize (ComponentType type) - throws Exception - { - // makes a first estimate - long oldSize; - long newSize = estimateComponentTypeSize(type); - //System.err.println("SIZE ESTIMATE " + newSize); - do { - // makes a new estimate - oldSize = newSize; - newSize = estimateComponentTypeSize(type); - //System.err.println("SIZE ESTIMATE " + newSize); - // loop until two consecutive estimates are equal - } while (newSize != oldSize); - // prints the results - int n = type.getFcInterfaceTypes().length; - System.out.print("component type (" + n + " interfaces) = "); - System.out.println(newSize + " bytes (" + (newSize / 4) + " words)"); - } - - /** - * Estimates the size of a component type. - */ - - private static long estimateComponentTypeSize (ComponentType type) - throws Exception - { - TypeFactory tf = Fractal.getTypeFactory(Fractal.getBootstrapComponent()); - long min = 0; - while (true) { - min = freeMem(min); - Object[] instances = new Object[NB_INSTANCES_1]; - long start = freeMem(0); - for (int i = 0; i < instances.length; ++i) { - instances[i] = clone(tf, type); - } - long freeMem = freeMem(0); - for (int i = 0; i < instances.length; ++i) { - instances[i] = null; - } - long end = freeMem(freeMem); - /* - System.err.println("FREE MEM BEFORE INSTANTIATE " + start); - System.err.println("FREE MEM AFTER INSTANTIATE " + freeMem); - System.err.println("FREE MEM AFTER GC " + end); - */ - if (Math.abs(end - start) < NB_INSTANCES_1) { - return (end - freeMem) / NB_INSTANCES_1; - } - } - } - - /** - * Estimates the amount of free memory. - * - * @param min the expected minimal amount of free memory - */ - - private static long freeMem (long min) { - Runtime rt = Runtime.getRuntime(); - // gets the amount of free memory, after a garbage collection - rt.gc(); - long oldFreeMem; - long newFreeMem = rt.freeMemory(); - while (true) { - // gets the amount of free memory again, after another garbage collection - rt.gc(); - oldFreeMem = newFreeMem; - newFreeMem = rt.freeMemory(); - // loop until two consecutive results are equal above 'min' - if (newFreeMem == oldFreeMem && newFreeMem >= min) { - return newFreeMem; - } - } - } - - // ------------------------------------------------------------------------- - // Utility methods - // ------------------------------------------------------------------------- - - /** - * Converts the given double to a String. - */ - - private static String format (final double d) { - return Float.toString((float)d); - } - - /** - * Clones a component type. - * - * @param tf the type factory to be used to create the clone. - * @param type the component type to be cloned. - * @return a clone of the given component type. - */ - - private static ComponentType clone ( - final TypeFactory tf, - final ComponentType type) throws Exception - { - InterfaceType[] itfTypes = type.getFcInterfaceTypes(); - InterfaceType[] cloneItfTypes = new InterfaceType[itfTypes.length]; - for (int i = 0; i < itfTypes.length; ++i) { - InterfaceType itfType = itfTypes[i]; - cloneItfTypes[i] = tf.createFcItfType( - new String(itfType.getFcItfName().toCharArray()), - new String(itfType.getFcItfSignature().toCharArray()), - itfType.isFcClientItf(), - itfType.isFcOptionalItf(), - itfType.isFcCollectionItf()); - } - return tf.createFcType(cloneItfTypes); - } -} diff --git a/julia/test/perf/org/objectweb/fractal/julia/perf/components/C.java b/julia/test/perf/org/objectweb/fractal/julia/perf/components/C.java deleted file mode 100644 index e2d522f846c25ab37ddde8d501235d302e118bd5..0000000000000000000000000000000000000000 --- a/julia/test/perf/org/objectweb/fractal/julia/perf/components/C.java +++ /dev/null @@ -1,33 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.perf.components; - -import org.objectweb.fractal.julia.perf.components.I; - -public class C implements I { - - public int m (int i) { - return i - 1; - } -} diff --git a/julia/test/perf/org/objectweb/fractal/julia/perf/components/I.java b/julia/test/perf/org/objectweb/fractal/julia/perf/components/I.java deleted file mode 100644 index f44f0e63f8a2bb4520965f4189f7dcb22d3bcaab..0000000000000000000000000000000000000000 --- a/julia/test/perf/org/objectweb/fractal/julia/perf/components/I.java +++ /dev/null @@ -1,28 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.perf.components; - -public interface I { - int m (int i); -} diff --git a/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOP.java b/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOP.java deleted file mode 100644 index 671c3dc4ff4fe1301c28d188935831bf6d9e3aa3..0000000000000000000000000000000000000000 --- a/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOP.java +++ /dev/null @@ -1,27 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.perf.controllers; - -public interface MOP { -} diff --git a/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOPCodeGenerator.java b/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOPCodeGenerator.java deleted file mode 100644 index 694f14481b0fc512030f82c8320c5d5cf6351003..0000000000000000000000000000000000000000 --- a/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOPCodeGenerator.java +++ /dev/null @@ -1,49 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.perf.controllers; - -import org.objectweb.fractal.julia.asm.MetaCodeGenerator; - -public class MOPCodeGenerator extends MetaCodeGenerator { - - protected String getControllerInterfaceName () { - return "mop-controller"; - } - - protected String getControllerClass () { - return MOPController.class.getName(); - } - - protected String getHandleMethodCallMethodName () { - return "handleMethodCall"; - } - - protected String getIsReflectedCallMethodName () { - return null; - } - - protected boolean reifyTargetObject () { - return true; - } -} diff --git a/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOPController.java b/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOPController.java deleted file mode 100644 index f62286345d669a80c4a9d115949b36f003a853d1..0000000000000000000000000000000000000000 --- a/julia/test/perf/org/objectweb/fractal/julia/perf/controllers/MOPController.java +++ /dev/null @@ -1,39 +0,0 @@ -/*** - * Julia: France Telecom's implementation of the Fractal API - * Copyright (C) 2001-2002 France Telecom R&D - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Eric.Bruneton@rd.francetelecom.com - * - * Author: Eric Bruneton - */ - -package org.objectweb.fractal.julia.perf.controllers; - -import org.objectweb.fractal.julia.perf.controllers.MOP; - -import java.lang.reflect.Method; - -public class MOPController implements MOP { - - public Object handleMethodCall (Object target, Method m, Object[] args) { - try { - return m.invoke(target, args); - } catch (Exception e) { - return null; - } - } -} diff --git a/julia/test/perf/perf1.xml b/julia/test/perf/perf1.xml deleted file mode 100644 index 6fa8e7ff116a4d6baa85ae77fbb6aa31d558f1df..0000000000000000000000000000000000000000 --- a/julia/test/perf/perf1.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/perf/perf2.xml b/julia/test/perf/perf2.xml deleted file mode 100644 index 5b7e7966e67bf16db8ff95de44d6b72702ba586e..0000000000000000000000000000000000000000 --- a/julia/test/perf/perf2.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/perf/perf3.xml b/julia/test/perf/perf3.xml deleted file mode 100644 index 0db32dd3d95c155e80b16f057a7fc2cfac67a9c8..0000000000000000000000000000000000000000 --- a/julia/test/perf/perf3.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/perf/perf4.xml b/julia/test/perf/perf4.xml deleted file mode 100644 index e7f6e5b988981d345bd05c050b1940b2635cb50b..0000000000000000000000000000000000000000 --- a/julia/test/perf/perf4.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/perf/perf5.xml b/julia/test/perf/perf5.xml deleted file mode 100644 index 7ac03daa8b0c0f4f28021dc787d1b6ec52fde3b1..0000000000000000000000000000000000000000 --- a/julia/test/perf/perf5.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/perf/perf6.xml b/julia/test/perf/perf6.xml deleted file mode 100644 index 85dccbf73f92f3f1b5d03091fb66883e20336e2d..0000000000000000000000000000000000000000 --- a/julia/test/perf/perf6.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/julia/test/perf/perf7.xml b/julia/test/perf/perf7.xml deleted file mode 100644 index a88cee6eb4cc10402f338aa9f2d9f3dbc78a551d..0000000000000000000000000000000000000000 --- a/julia/test/perf/perf7.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/build.properties b/web/build.properties deleted file mode 100644 index 7f4476500db04ffb95ffe14e9b3ea79b9fe8ebba..0000000000000000000000000000000000000000 --- a/web/build.properties +++ /dev/null @@ -1,2 +0,0 @@ - -html.dest=${basedir}/../../public_html diff --git a/web/build.xml b/web/build.xml deleted file mode 100644 index 5d33e75a2515f727d0708b48fa341ee5ab270f24..0000000000000000000000000000000000000000 --- a/web/build.xml +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/common_web.zip b/web/common_web.zip deleted file mode 100644 index 426d75f1e4e686415773db877f9c4b46944386d2..0000000000000000000000000000000000000000 Binary files a/web/common_web.zip and /dev/null differ diff --git a/web/html/images/fractal-big.jpg b/web/html/images/fractal-big.jpg deleted file mode 100644 index dd1e4dfb9686afe4bfaff9c5f318235e8794a238..0000000000000000000000000000000000000000 Binary files a/web/html/images/fractal-big.jpg and /dev/null differ diff --git a/web/html/images/fractal.jpg b/web/html/images/fractal.jpg deleted file mode 100644 index 1fe324258946afbb438d5fcc52644d465aacec59..0000000000000000000000000000000000000000 Binary files a/web/html/images/fractal.jpg and /dev/null differ diff --git a/web/html/images/partners/francetelecomrd.jpg b/web/html/images/partners/francetelecomrd.jpg deleted file mode 100644 index 2611a31ed2d52082c08a02ce3a858dd70a6f6f8d..0000000000000000000000000000000000000000 Binary files a/web/html/images/partners/francetelecomrd.jpg and /dev/null differ diff --git a/web/html/images/partners/inria.gif b/web/html/images/partners/inria.gif deleted file mode 100644 index 3ebcf903b0a8f19b84a6c80e122256b734c64076..0000000000000000000000000000000000000000 Binary files a/web/html/images/partners/inria.gif and /dev/null differ diff --git a/web/html/images/partners/loria.gif b/web/html/images/partners/loria.gif deleted file mode 100644 index a39ea6b48fdf0f32d316dd5b913310b79db05e1d..0000000000000000000000000000000000000000 Binary files a/web/html/images/partners/loria.gif and /dev/null differ diff --git a/web/html/specification/example.png b/web/html/specification/example.png deleted file mode 100644 index b7ce131bd349dbc981c61c0928ec88fed1b9daf3..0000000000000000000000000000000000000000 Binary files a/web/html/specification/example.png and /dev/null differ diff --git a/web/html/specification/example2.png b/web/html/specification/example2.png deleted file mode 100644 index 0d52ca2bb28476a8fff49d8ce5dae7b710efed0a..0000000000000000000000000000000000000000 Binary files a/web/html/specification/example2.png and /dev/null differ diff --git a/web/html/specification/external-view.png b/web/html/specification/external-view.png deleted file mode 100644 index cb8d831d4058dbfead844e32f99b50117e87c82c..0000000000000000000000000000000000000000 Binary files a/web/html/specification/external-view.png and /dev/null differ diff --git a/web/html/specification/fractal-specification.html b/web/html/specification/fractal-specification.html deleted file mode 100644 index 5ae24be720d8915c825c8087db7020da91f8593e..0000000000000000000000000000000000000000 --- a/web/html/specification/fractal-specification.html +++ /dev/null @@ -1,4069 +0,0 @@ - - - - - - - - - - - - - - - - - - -
- - -
- - -
- -
- -[PDF version] -[PS version] - -
- -
- -
- -
- - - -
- - -


- -
- -
The Fractal Component Model
-
-
-
fractal.png
- -
-


- -
- -
- - - - - - - - -
Authors:       
E. Bruneton          (France Telecom R&D)
T. Coupaye          (France Telecom R&D)
J.B. Stefani          (INRIA)
-
- -
-
- -
- - - - - - -
Released    February 5, 2004
Status   Draft
Version   2.0-3
-
- -
-
-General Information - -
- -
    -
  • Authors are given in alphabetical order. -
    -
  • - -
  • Background of front-page image appears courtesy of Giuseppe Zito. -
    -
  • - -
  • Please send technical comments on this specification to fractal@objectweb.org. -Authors would be glad to hear from people using, implementing or extending -Fractal. -
    -
  • -
-Copyright 2002-2003 France Télécom S.A.
-28, chemin du vieux chêne, 38243, Meylan Cedex, France.
-Copyright 2002-2003 INRIA.
-655 avenue de l'Europe, ZIRST, Montbonnot St Martin, 38334 Saint-Ismier -Cedex, France.
-All rights reserved. - -
-Trademarks - -
-All product names mentioned herein are trademarks of their respective -owners. - -
-Disclaimer of warranties - -
-The specification is provided "as is". The specification -could include technical inaccuracies or typographical errors. Changes -are periodically added to the information therein; these changes will -be incorporated into new versions of the specification, if any. -France Telecom and INRIA make no representations or warranties, -either express or implied, including but not limited to, warranties -of merchantability, fitness for a particular purpose, or non-infringement -that the contents of the specification are suitable for any purpose -or that any practice or implementation of such contents will not infringe -any third party patents, copyrights, trade secrets or other rights. - -
-
- -

Contents

-1  Introduction
-    1.1  Rationale
-    1.2  Overview
-2  Foundations
-    2.1  Interface Definition Language
-    2.2  Naming and binding
-3  Introspection
-    3.1  External component structure
-    3.2  Component introspection
-    3.3  Interface introspection
-4  Configuration (introspection & intercession)
-    4.1  Internal component structure
-    4.2  Attribute control
-    4.3  Binding control
-    4.4  Content control
-    4.5  Life cycle control
-5  Instantiation
-    5.1  Factories
-    5.2  Templates
-    5.3  Bootstrap
-6  Typing
-    6.1  Contingency and cardinality
-    6.2  Type system
-    6.3  Sub typing relation
-7  Options
-    7.1  Conformance levels
-    7.2  Extensions
-8  Example
-    8.1  Instantiation
-    8.2  Reconfiguration
-A  Fractal APIs
-B  Glossary
-C  Change History
- - -
-
-

-1  Introduction

- -
-

-1.1  Rationale

- -
-By enforcing a strict separation between interface and implementation -and by making software architecture explicit, component-based programming -can facilitate the implementation and maintenance of complex software -systems. Coupled with the use of meta-programming techniques, component-based -programming can hide to application programmers some of the complexities -inherent in the handling of non-functional aspects in a software system, -such as distribution and fault-tolerance, as exemplified e.g. by the -container concept in Enterprise Java Beans (EJB), CORBA Component -Model (CCM), or Microsoft .Net. - -
-Existing component-based frameworks and architecture description languages, -however, provide only limited support for extension and adaptation. -This limitation has several important drawbacks: it prevents the easy -and possibly dynamic introduction of different control facilities -for components such as non-functional aspects; it prevents application -designers and programmers from making important trade-offs such as -degree of configurability vs performance and space consumption; and -it can make difficult the use of these frameworks and languages in -different environments, including embedded systems. - -
-The Fractal component model alleviates the above problems by introducing -a notion of component endowed with an open set of control capabilities. -In other terms, components in Fractal are reflective, and their reflective -capabilities are not fixed in the model but can be extended and adapted -to fit the programmer's constraints and objectives. - -
-

-1.2  Overview

- -
-Main goals of the Fractal component model are to implement, deploy -and manage (i.e. monitor and dynamically reconfigure) complex software -systems. These goals motivate the main features of the Fractal model: -composite components (to have a uniform view of applications at various -abstraction levels), shared components (to model resources), introspection -capabilities (to monitor a running system), and configuration and -reconfiguration capabilities (to deploy and dynamically reconfigure -an application). But another goal of the Fractal model is to be applicable -to many software, from embedded software to application servers and -information systems. Unfortunately, the advanced features of the Fractal -model have a cost that is not always compatible with the limited resources -of constrained environments. - -
-In order to achieve these contradictory goals, the Fractal component -model is not defined as a big, fixed specification that all Fractal -components must follow, but rather as an extensible system of relations -between well defined concepts and corresponding APIs that Fractal -components may or may not implement, depending on what -they can or want to offer to other components. This set of specifications -can be organized, and is presented in this document as increasing -"levels of control", i.e. in increasing order of reflective -capabilities (introspection and intercession). - -
-At the lowest level of control, a Fractal component is a runtime entity -that does not provide any control capability to other components, -and is therefore like an object (such a component can be used in only -one way, namely by calling methods on it). In fact, an object is -a Fractal component without any control capability (see section 2). -This feature is useful to handle cases where components have to be -connected to legacy software. - -
-At the next level of control capability, which can be called the external -"introspection" level (see section 3), -a Fractal component can provide a standard interface, similar to the -IUnknown interface in COM, that allows one to discover all -its external interfaces or, in other words, its boundary (like an -object, a Fractal component can provide several interfaces). - -
-At the next level of control capability, which can be called the "configuration" -level (see section 4), a Fractal component -can provide control interfaces to introspect and modify its content, -i.e. what is inside its boundary. In the Fractal model, this content -is made of other Fractal components, called its sub components, -bound together through bindings. A Fractal component can therefore -choose to provide or not an interface to control the set of its sub -components, the set of bindings between these sub components, and -so on. - -
-In addition to these control capabilities, the Fractal model also -specifies a framework for the instantiation of components (see section 5), -and a simple type system for Fractal components (see section 6). -Like the above control capabilities, the instantiation framework and -the simple type system are optional. In fact, in the Fractal model, -everything is optional. This has advantages and drawbacks, -which are discussed in section 7. - -
-As a result of this modular and extensible organization (anyone is -free to define its own control interfaces, in order to provide new -introspection and intercession capabilities), and given the fact that -the Fractal component model is not tied to a specific language, Fractal -components can be used in very different situations, from operating -systems to middleware platforms, from graphical user interfaces to -information systems, and from highly optimized but unreconfigurable -configurations, to less optimized but highly dynamic and reconfigurable -systems or applications. - -
-

-2  Foundations

- -
-At the lowest control capability level, a Fractal component does not -provide any introspection or intercession function to other components. -Such a component, called a base component, can be used in only -one way, namely by invoking operations on its component interfaces. -A component interface is an access point to a component -that implements a language interface. Component interfaces -and language interfaces should not be mixed up: a component interface -is an access point that implements a language interface; a -language interface is a type. Despite of this risk, sentences -such as "a component has an interface that implements the language -interface X" will often be abbreviated, in the rest of this document, -into "a component has an interface X", in order to improve -readability. - -
-This section defines the pseudo Interface Definition Language used -in the rest of this document to define the language interfaces implemented -by Fractal component interfaces. It also defines a framework to get -access to component interfaces. - -
-

-2.1  Interface Definition Language

- -
-In order to allow Fractal components implemented in potentially distinct -programming languages to interoperate, some standard protocols for -local and remote operation invocations are necessary. One way to ensure -this is to use an Interface Definition Language (IDL), and mappings -from the IDL to existing programming languages. The IDL compiler can -then generate stubs and skeletons to make the conversion from language -specific protocols to standard protocols, and vice versa. - -
-Despite of this, in the Fractal component model, IDLs and mappings -are optional, as everything else. This means that Fractal component -interfaces can be defined either directly in any programming -language, or indirectly via any IDL. As a consequence, the -constraints and costs associated to the use of an IDL do not have -to be paid for, if interoperability is not needed. - -
-In this document the component interfaces are specified in a pseudo -IDL language (see below), in order to show that the Fractal component -model does not enforce the use of any existing programming or interface -definition language. A possible definition of these interfaces is -also given in Java, C and OMG IDL (see Appendix A). -These definitions can be used as "standard" definitions to provide -interoperability between Java components only, between C components -only, and between any components (respectively). - -
-The non normative, pseudo IDL language used in this document for illustration -purposes is a modified subset of Java, so as to be immediately understandable -by Java programmers. In this language, an interface definition is -a Java interface definition with the following restrictions: - -
- -
    -
  • modifiers (public, final, ...) -are not allowed; -
    -
  • - -
  • field (i.e. constant) declarations are allowed only with literal expressions; -
    -
  • - -
  • inner interface and class definitions are not allowed; -
    -
  • - -
  • class types are not allowed in array types, formal parameter types -and return types. -
    -
  • -
-and with the following extensions: - -
- -
    -
  • a new any type, meaning any interface type, is available -to replace java.lang.Object; -
    -
  • - -
  • a new string primitive type is available to replace -java.lang.String. -
    -
  • -
-Exceptions are allowed in operation declarations, but are not -considered as classes, as in Java: they are instead considered as -abstract names, denoting categories of errors. - -
-

-2.2  Naming and binding

- -
-In order to invoke operations on a component interface, one must first -identify the interface to be called, and then get an access to this -interface. This section defines a framework for doing so, based on -names, naming contexts and binders (see Figure 1). -This framework is mainly designed to access remote interfaces, but -can also be used in a single address space. - -
- -
-
package org.objectweb.naming; - -
-interface Name { - -
-   NamingContext getNamingContext (); - -
-   byte[] encode () throws -NamingException; - -
-} - -
-interface NamingContext { - -
-   Name export (any o, any -hints) throws NamingException; - -
-   Name decode (byte[] b) -throws NamingException; - -
-} - -
-interface Binder extends -NamingContext { - -
-   any bind (Name n, any -hints) throws NamingException; - -
-}
- -
-
Figure 1: Naming API
- -
-A name designates a component interface. Names can take many -forms, such as Java references or Interoperable Object References -(IORs). A name does not necessarily give direct access to the interface -it designates (a CORBA IOR does not give direct access to the designated -remote interface; on the contrary, a Java reference can be used directly -to call methods on the designated interface). A name is represented -by the Name interface. - -
-A name is always associated to a naming context, and is generally -invalid outside this context. For example the naming context of a -Java reference is the Java Virtual Machine (JVM) in which the designated -object resides. This name is meaningless outside this context and, -in particular, in another JVM. The naming context of an IOR is the -CORBA IOR "name space". An IOR is meaningless outside this context -and, in particular, in the Java RMI over JRMP context. The Name -interface specifies a getNamingContext operation, which returns -the naming context of the name on which this operation is invoked. - -
-A name can be serialized in many forms, such as a string or a byte -array. For example a Java reference can be serialized as a string -representing the memory address of the object, in decimal or hexadecimal -form. An IOR can be serialized as a string containing a host name -or IP address, a TCP port number, and an object key. In serialized -form, a name can be sent over a network, or stored in a file or a -database. The Name interface specifies an encode -operation, which returns an encoded form of the name on which this -operation is invoked, as a byte array. - -
-A naming context is represented by the NamingContext interface. -A naming context creates and manages names in its context. In particular, -a naming context can create a name for a given component interface. -The NamingContext interface specifies an export -operation for doing that: this operation takes as argument a component -interface and optional hints, and returns a name for this interface. -A naming context can also deserialize names in serialized form. The -NamingContext interface specifies a decode operation -for doing that: this operation takes as argument a serialized name, -as a byte array, and returns the corresponding name. - -
-In order to access the interface designated by a name, a binding -must be established to this interface. For example, in order to access -a remote interface designated by an IOR, a socket must be opened to -send an invocation message to the remote interface. These bindings -are created by binders. A binder is represented by the Binder -interface, which extends the NamingContext interface. This -interface specifies a bind operation that takes a name as -parameter, creates a binding to the interface designated by this name, -and returns a delegate (or proxy) of this interface, or the interface -itself, to invoke operations on it. - -
-The org.objectweb.naming.NamingException exception must be -thrown when an error occurs in the operations of the Name, -NamingContext and Binder interfaces. - -
-

-3  Introspection

- -
-At the next control capability level, beyond the base level where -components do not provide any control function, a Fractal component -can provide introspection functions to introspect its external -features, i.e. its boundary. This section defines more precisely the -external features of Fractal components, and specifies the interfaces -related to the introspection of these features. The interfaces -related to the introspection (and reconfiguration) of the internal -features of Fractal components are specified in the next section. - -
-

-3.1  External component structure

- -
-Depending on the level of observation, or scale, a Fractal -component can be seen as a black box or as a white box. When seen -as black box, i.e. when its internal organization is not visible, -the only visible details of a Fractal component are some access -points to this black box, called its external interfaces (see -Figure 2). Each interface has a name, in order -to distinguish it from the other interfaces of the component (a component -can have several interfaces implementing the same language interface). -All the external interfaces of a component must have distinct names, -but two interfaces in two distinct components may have the same name. -One may distinguish two kinds of interfaces: a client (or required) -interface emits operation invocations, while a server (or provided) -interface receives them. - -
- -
- -
external-view.png
- -
-
Figure 2: External view of a Fractal component
- -
-The interfaces of a component can be introspected with two language -interfaces, specified in the next two sections: one to get the list -of interfaces of a component, and one to introspect the interfaces -themselves. These two interfaces are of course optional, as everything -in the Fractal model: a component can provide both interfaces, only -the first one, or none of them. - -
-

-3.2  Component introspection

- -
-In order to discover the external interfaces of a component, a component -can provide an interface that implements the Component interface -(see Figure 3). This language -interface provides two operations named getFcInterfaces and -getFcInterface, that can be used to retrieve the interfaces -of the component. The first operation takes no arguments, and returns -an array containing all the external interfaces, either client or -server, of the component, including the Component interface. -The second operation takes the name of an interface as parameter, -and returns this interface, if it exists. - -
- -
-
package org.objectweb.fractal.api; - -
-interface Component { - -
-   any[] getFcInterfaces (); - -
-   any getFcInterface (string -itfName) throws NoSuchInterfaceException; - -
-   Type getFcType (); - -
-} - -
-interface Type { - -
-   boolean isFcSubTypeOf (Type t); - -
-}
- -
-
Figure 3: Component introspection API
- -
-The getFcInterfaces and getFcInterface operations -return references that give access to requested interfaces. In other -words, the references returned by these operations can be used directly, -after an appropriate cast, to invoke operations on the component's -server interfaces (no explicit binding is needed). For example, if -a component has a server interface named account implementing -the language interface Account, then the getBalance -operation of this interface can be invoked with a code like ((Account)c.getFcInterface("account")).getBalance(), -where c is a reference to the Component interface -of the component. - -
-The Component interface also provides a getFcType -operation, which returns the type of the component, as a Type -reference. This interface defines a minimal notion of type, which -actually defines only one operation named isFcSubTypeOf, -whose role is to test if a given type is a sub type or not of another -type. This interface can be extended to define more useful type systems -for components and component interfaces, such as the one defined in -section 6. - -
-The org.objectweb.fractal.api.NoSuchInterfaceException exception -must be thrown in the getFcInterface operation when a requested -component interface is not found. - -
-A component interface implementing Component must be named -component. - -
-

-3.3  Interface introspection

- -
-By default the references returned by the getFcInterface -and getFcInterfaces operations provide access to the requested -interfaces, and nothing more. In particular, it is impossible to find -the names of these interfaces. In order to provide such interface -introspection functions, a component can ensure that the references -returned by the above operations are castable into the Interface -type (see Figure 4). This interface -specifies four operations to get the name of a component interface, -to get its type (as a Type reference), to get the Component -interface of the component to which it belongs, and to test if the -interface is internal or not (see section 4.1). - -
- -
-
package org.objectweb.fractal.api; - -
-interface Interface { - -
-   string getFcItfName (); - -
-   Type getFcItfType (); - -
-   Component getFcItfOwner (); - -
-   boolean isFcInternalItf (); - -
-}
- -
-
Figure 4: Interface introspection API
- -
-Note that the getFcItfOwner operation allows one to discover -all the interfaces of a component from any interface of this component, -and not only from its Component interface. For example, if -a is a reference to the Account interface of a such -component, the Component interface of this component can -be retrieved with a code like ((Interface)a).getFcItfOwner(), -if the component provides interface introspection functions. The result -can then be used to get the reference of any other interface of the -component. - -
-The Interface interface inherits from the Name interface, -in order to show that component interfaces can be sent over a network, -as names. Furthermore, this name can be seen as a compound name, made -of a name that identifies a component (returned by getFcItfOwner), -and of a local name (returned by getFcItfName) that identifies -an interface inside this component. Note that simple string names -are used for local interface names, although it would have been possible -to use instead the general naming and binding framework defined in -section 2.2. - - -
- -

Notes

- -
- -
    -
  • Component and Interface have very distinct roles -and should not be mixed up. On the one hand, Component is -a language interface that is provided by a component just like any -other language interface. On the other hand, in the case of a component -providing interface introspection, Interface is a language -interface that is implemented by all the component interfaces: -any component interface of a such component implements both a specific -language interface, such as Account or Component, -and Interface. -
    -
  • - -
  • A functional interface such as Account is likely to provide -a getName or getOwner operation, as the Interface -interface. And since, in the case of components that provide interface -introspection, a reference of one type should be castable to the other, -there is a risk of name conflicts (at least in some languages, such -as Java). In order to reduce these risks, the Interface operations -follow the pattern verbFcnoun, where Fc -stands for Fractal component. This pattern has then been generalized -to all the Fractal APIs. -
    -
  • - -
  • Providing the Component interface is quite easy, but supporting -the Interface interface can imply some runtime time overheads. -This is why this interface is optional. -
    -
  • -
- - -
-

-4  Configuration (introspection & intercession)

- -
-At the next level of control capability, beyond the "introspection" -level where components provide interfaces to introspect their external -features, a Fractal component can provide control interfaces to introspect -and reconfigure its internal features. This section defines -these internal features, and specifies some possible interfaces to -introspect and reconfigure them. - -
-

-4.1  Internal component structure

- -
-Internally, a Fractal component is formed out of two parts: a controller -(also called membrane), and a content (see Figure 5). -The content of a component is composed of (a finite number of) other -components, called sub components, which are under the control -of the controller of the enclosing component. The Fractal model is -thus recursive and allows components to be nested (i.e. to appear -in the content of enclosing components) at an arbitrary level. A component -that exposes its content is called a composite component. A -component that does not expose its content, but has at least one control -interface (see below), is called a primitive component. A component -without any control interface is called a base component (see section 2). - -
- -
- -
internal-view.png
- -
-
Figure 5: Internal view of a Fractal component
- -
-The controller of a component can have external and internal -interfaces. External interfaces are accessible from outside the component, -while internal interfaces are accessible only from the component's -sub components. All the external interfaces of a component must have -distinct names, all its internal interfaces must have distinct names, -but a component can have an external and an internal interface of -the same name. A functional interface is an interface that -corresponds to a provided or required functionality of a component, -while a control interface is a server interface that -corresponds to a "non functional aspect", such as introspection, -configuration or reconfiguration, and so on. By convention, an interface -is considered to be a control interface if its name is equal to component, -or ends with -controller. All other interfaces are considered -to be functional interfaces. - -
-The controller of a component embodies the control behavior associated -with a particular component. In particular, a component controller -can: - -
- -
    -
  • Provide an explicit and causally connected representation of the component's -sub components; -
    -
  • - -
  • Intercept oncoming and outgoing operation invocations targeting or -originating from the component's sub components; -
    -
  • - -
  • Superpose a control behavior to the behavior of the component's sub -components, including suspending, check pointing and resuming activities -of these sub components. -
    -
  • -
-Each component controller can thus be seen as implementing a particular -semantic of composition for the component's sub components. The control -capability of a controller is not limited by the model. For instance, -it can be mainly interception-based as in industrial component frameworks -containers for instance; or it can be void (i.e. no control is exercised -- in this case, the controller can still be useful for it can provide -a representation of its content and manifest a containment relationship). - -
-A component may appear in the content of (be shared by) several -distinct enclosing components (see section 4.4 -and Figure 9). A component that is shared among -two or more distinct components is subject to the control of their -respective controllers. The exact semantics of the resulting configuration -(e.g. which control behavior is enacted) is in general determined -by an encompassing component that encloses all the relevant components -in the configuration. - -
-A binding is a communication path between component interfaces. -The Fractal model distinguishes between primitive bindings -and composite bindings. A primitive binding is a binding between -one client interface and one server interface, in the same address -space, which means that the operation invocations emitted by the client -interface should be accepted by the specified server interface. A -primitive binding between a client interface c and a server interface -s of two components C and S must verify one of the following constraints -(see Figure 5): - -
- -
    -
  • c and s are external interfaces, and C and S have a direct common -enclosing component. Such bindings are called normal bindings. -
    -
  • - -
  • c is an internal interface, s is an external interface, and S is a -sub component of C. Such bindings are called export bindings. -
    -
  • - -
  • c is an external interface, s is an internal interface, and C is a -sub component of S. Such bindings are called import bindings. -
    -
  • -
-In addition to these structural constraints, which ensure that primitive -bindings cannot "cross" component boundaries except through -interfaces, a primitive binding can be established between a client -and a server interface only if the server interface can accept at -least all the operation invocations that the client interface can -emit. In other words, the (language) type of the server interface -must be a sub type of the type of the client interface (the two interfaces -can of course be of the same type since a sub typing relation must -be reflexive). The last constraint is that a client interface can -be bound to at most one server interface, while several client interfaces -can be bound to the same server interface. - -
-A composite binding is a communication path between an arbitrary number -of component interfaces, of arbitrary language types. These bindings -are represented as a set of primitive bindings and binding components -(stubs, skeletons, adapters, ...). A binding component is a normal -Fractal component, whose role is dedicated to communication. Binding -components are also called connectors: hence Fractal does -have connectors, although this concept is not a core concept here, -as component or interface - this is why there is no special API for -them. It should be noted that the binding concept defined here is -exactly is the same as the binding concept defined in section 2.2: -in particular, primitive bindings correspond to local bindings, i.e. -to bindings inside a single address space. - -
-

-4.2  Attribute control

- -
-An attribute is a configurable property of a component, such -as the text or color of a button, or the maximum size of a pool or -cache component. Attributes are generally of primitive type, and are -used to configure the state of components without needing to use bindings -(it is possible to configure the text of a button, for example, by -binding this button component to a text component; but this is overly -complex for what is needed). A component can provide an AttributeController -interface to read and write its attributes from outside the component -(see Figure 6). - -
- -
-
package org.objectweb.fractal.api.control; - -
-interface AttributeController { }
- -
-
Figure 6: Attribute control API
- -
-In this case, the component must actually provide a sub interface -of this interface, since the AttributeController interface -is in fact empty. This sub interface must contain one getter and/or -setter operation per configurable attribute. For example: - -
- -
    -
  • a component that wants to provide an AttributeController -interface for a read only string attribute foo must provide -a sub interface of this interface containing the following operation: -string getFoo(); -
    -
  • - -
  • a component that wants to provide an AttributeController -interface for a write only string attribute foo must provide -a sub interface of this interface containing the following operation: -void setFoo(string foo); -
    -
  • - -
  • a component that wants to provide an AttributeController -interface to configure two string attributes foo and bar -must provide a sub interface of this interface containing the following -operations: string getFoo(), void setFoo(string foo), -string getBar() and void setBar(string bar); -
    -
  • -
-It is a requirement of this specification that setters and getters -must follow the lexicographic and typing conventions introduced informally -in the example above with respect to names and signatures of setters -and getters (these conventions are those of the Java Beans component -model). - -
-A component interface implementing AttributeController must -be named attribute-controller. - -
-

-4.3  Binding control

- -
-A component can provide the BindingController interface to -bind and unbind its client interfaces to other components through -primitive bindings (see Figure 7). - -
- -
-
package org.objectweb.fractal.api.control; - -
-interface BindingController { - -
-   string[] listFc (); - -
-   any lookupFc (string -clientItfName) - -
-      throws NoSuchInterfaceException; - -
-   void bindFc (string -clientItfName, any serverItf) - -
-      throws NoSuchInterfaceException, -IllegalBindingException, IllegalLifeCycleException; - -
-   void unbindFc (string -clientItfName) - -
-      throws NoSuchInterfaceException, -IllegalBindingException, IllegalLifeCycleException; - -
-}
- -
-
Figure 7: Binding control API
- -
-This interface defines the following operations: - -
- -
    -
  • The listFc operation returns the names of the client interfaces -of the component. These names are the names that can be passed as -first argument to the lookupFc operation. -
    -
  • - -
  • The lookupFc operation takes as parameter the name of a client -interface of the component, either external or internal, and returns -the server interface that is bound to this client interface, or null -if there is no such interface. If the component to which the server -interface belongs supports the interface introspection (see section 3.3), -the reference returned by this operation can be cast to Interface. -
    -
  • - -
  • The bindFc operation takes as parameters the name of a client -interface of the component, either external or internal, and a server -interface of another component, and binds these two interfaces together. -As above, the server interface can be cast or not to Interface, -depending on the introspection capabilities provided by the server -component. -
    -
  • - -
  • The unbindFc operation takes as parameter the name of a client -interface of the component, either external or internal, and unbinds -this interface. -
    -
  • -
-These operations may throw a NoSuchInterfaceException -exception if a specified client interface does not exist, an IllegalLifeCycleException -exception when a component is not in an appropriate state to perform -an operation, and an org.objectweb.fractal.api.control.IllegalBindingException -exception in case of other errors related to bindings. - -
-A component interface implementing BindingController must -be named binding-controller. - -
-Composite bindings are created with the general naming and binding -framework (see section 2.2). For example, -in order to bind two component interfaces that are not in the same -address space, a binding component must first be created between the -two interfaces, by using the naming and binding framework (typically, -the server interface will be exported in some distributed NamingContext, -the returned Name will be encoded, sent over the network, -decoded, and finally a Binder will be used to create the -binding component from this name; all this can be done explicitly -or implicitly, as the effect of passing an interface reference in -a remote operation invocation). The BindingController interface -will then be used to create the primitive bindings between the client -interface and the binding component, and between the binding component -and the server interface. - -
-

-4.4  Content control

- -
-A component can provide the ContentController interface to -add and remove sub components in this component (see Figure 8). - -
- -
-
package org.objectweb.fractal.api.control; - -
-interface ContentController { - -
-   any[] getFcInternalInterfaces -(); - -
-   any getFcInternalInterface (string -itfName) throws NoSuchInterfaceException; - -
-   Component[] getFcSubComponents (); - -
-   void addFcSubComponent (Component -c) - -
-      throws IllegalContentException, -IllegalLifeCycleException; - -
-   void removeFcSubComponent (Component -c) - -
-      throws IllegalContentException, -IllegalLifeCycleException; - -
-} - -
-interface SuperController { - -
-   Component[] getFcSuperComponents (); - -
-}
- -
-
Figure 8: Content control API
- -
-This interface defines three operations to get the list of sub components -of a component, and to add and remove sub components in a component: - -
- -
    -
  • the getFcSubComponents operation returns the list of sub -components of the component, as an array of Component references. -The getFcSuperComponents operation, in the SuperController -interface (see Figure 8), provides the -opposite function: it returns the components that contain this component, -and which are called its super components. -
    -
  • - -
  • the addFcSubComponent operation takes a component c as -parameter, as a Component reference, and adds this component -to the component's content. If C and C¢ are the set of sub components -of the component before and after c is added, then c Î C¢ but -C¢ is not necessarily equal to CÈ{ c}. -
    -
  • - -
  • the removeFcSubComponent operation takes a component as parameter, -as a Component reference, and removes this component from -the component's content. If C and C¢ are the set of sub components -of the component before and after c is removed, then c Ï C¢ -but C¢ is not necessarily equal to C-{ c}. -
    -
  • -
-A given component can be added to several other components. Such a -component is said to be shared between these components. Shared -components are useful, paradoxically, to preserve component encapsulation. -Consider, for example, a menu and a toolbar components (see Figure 9), -with an "undo" toolbar button corresponding to an "undo" -menu item. It is natural to represent the menu items and toolbar buttons -as sub components, encapsulated in the menu and toolbar components, -respectively. But, without sharing, this solution does not work for -the "undo" button and menu item, which must have the same state -(enabled or disabled): these components, or an associated state component, -must be put outside the menu and toolbar components. With component -sharing, the state component can be shared between the menu and toolbar -components, in order to preserve component encapsulation. Shared components -are also useful to help separate "aspects" in component based -applications. For example, a shared logger component allows one to -avoid adding a Logger client interface to many components. - -
- -
- -
sharing.png
- -
-
Figure 9: Advantages of shared components
- -
-Because of shared components, the structure of a Fractal component, -in terms of direct and indirect sub components, is not necessarily -a tree, but can be a directed acyclic graph (it cannot be an arbitrary -graph, because a component cannot be added inside itself or inside -one of its direct or indirect sub components). In terms of bindings, -this structure can be arbitrary, provided it follows the constraints -of section 4.1. In particular, -bindings can form cycles. - -
-The ContentController interface also specifies two operations -to get the internal interfaces of the component, which are similar -to the getFcInterface and getFcInterfaces operations. -These operations are useful to bind the internal interfaces to sub -components. - -
-The content controller operations may throw a NoSuchInterfaceException -exception if a specified client interface does not exist, an IllegalLifeCycleException -exception when a component is not in an appropriate state to perform -an operation and, in case of other errors related to content control, -an org.objectweb.fractal.api.control.IllegalContentException -exception. - -
-A component interface implementing ContentController (resp. -SuperController) must be named content-controller -(resp. super-controller). - -
- -

Note

- -
-In order to associate local names to the sub components of a component, -similar to the local names of the interfaces of a component, a possibility -is to ensure that all these sub components provide the NameController -interface defined in Figure 10. - -
- -
-
interface NameController { - -
-   string getFcName (); - -
-   void setFcName (string -name); - -
-}
- -
-
Figure 10: Name control API
- -
-A component interface implementing NameController must be -named name-controller. - -
-

-4.5  Life cycle control

- -
-Changing an attribute or a binding, or removing a sub component, with -the above control interfaces, and while components are executing, -can be dangerous: messages can be lost, the application's state may -become inconsistent, or the application may simply crash. In order -to provide a minimal support to help implement such dynamic reconfigurations, -a component can provide the LifeCycleController interface -(see Figure 11). - -
- -
-
package org.objectweb.fractal.api.control; - -
-interface LifeCycleController { - -
-   string getFcState (); - -
-   void startFc () throws -IllegalLifeCycleException; - -
-   void stopFc () throws -IllegalLifeCycleException; - -
-}
- -
-
Figure 11: Life cycle control API
- -
-This interface provides two operations named startFc and -stopFc, to start and stop a component properly. As for the -addFcSubComponent and removeFcSubComponent operations, -the semantics of these operations is voluntarily as weak as possible, -so that many implementations are possible: these operations may or -may not be recursive, i.e. starting or stopping a component may or -may not automatically start or stop all its direct and indirect sub -components. Likewise, the effect of these operations on the component's -state is voluntarily not specified (in fact it cannot be specified -here, because the APIs defined in this document do not provide access -to this state). In particular, the stopFc operation can be -seen as a clean up operation invoked before the component is destroyed, -or as a suspend operation. In the first case the component's state -will be erased, while in the second case it will be left unchanged. - -
-In addition to these operations, the LifeCycleController -interface also provides a getFcState operation. This operation -returns the current state of the component (in a strict sense, i.e. -without taking into account its sub components, which can have a different -execution state), as a string. The STARTED and STOPPED -strings mean that the component is started or stopped, respectively. - -
-In the STARTED state, i.e. just after successful completion -of a call to startFc, a component can emit or accept operation -invocations, which are guaranteed to execute "normally". Note -that this does not prevent the unbindFc and removeFcSubComponent -operations to throw the IllegalLifeCycleException if they -are invoked while the component is in this state (in order to prevent -a component from being reconfigured while it is in an unstable state). - -
-In the STOPPED state, i.e. just after successful completion -of a call to stopFc, a component cannot emit operation invocations, -and can accept operation invocations only through control interfaces. -The result of operation invocations to the functional interfaces -of a stopped component is undefined. It may be a normal result, an -exception, a suspension of the invocation until the component is restarted, -or anything else. - -
-The LifeCycleController interface corresponds to a minimal -life cycle automaton, whose transitions are represented in the following -table: - -
- -
- - - - - - -
 STOPPEDSTARTED
startFcSTARTEDSTARTED
stopFcSTOPPEDSTOPPED
-
- -
-However, some components may require very different life cycles. Of -course, completely arbitrary life cycles can be specified by providing -completely new interfaces, distinct from the LifeCycleController -interface. More commonly, life cycles can be adapted from the basic -one by extending the LifeCycleController interface to introduce -new states and transitions or even to change the transitions of the -basic life cycle. In this case, it is a requirement of this specification -that the semantics associated to the STARTED and STOPPED -states should be preserved. - -
-The org.objectweb.fractal.api.control.IllegalLifeCycleException -exception may be thrown when a requested transition, in a life cycle -automaton, is not valid. - -
-A component interface implementing LifeCycleController must -be named lifecycle-controller. - -
-

-5  Instantiation

- -
-The frameworks presented in the previous sections allows one to use, -introspect, configure and reconfigure existing components. -In order to be useful, they must be completed with a framework to -create new components. This section defines such a framework, -based on factories. - -
-

-5.1  Factories

- -
-In the instantiation framework specified in this section, components -are created by other components called component factories. -The Fractal model distinguishes between generic component factories, -which can create several kinds of components, and standard component -factories, which can create only one kind of components, all with -the same component type. Generic and standard component factories -can provide the GenericFactory interface and the Factory -interfaces, respectively (see Figure 12 -- note that, in accordance with the rule defined in section 4.1, -both interfaces are functional interfaces, and not control interfaces). - -
- -
-
package org.objectweb.fractal.api.factory; - -
-interface GenericFactory { - -
-   Component newFcInstance (Type t, any -controllerDesc, any contentDesc) - -
-      throws InstantiationException; - -
-} - -
-interface Factory { - -
-   Type getFcInstanceType (); - -
-   any getFcControllerDesc (); - -
-   any getFcContentDesc (); - -
-   Component newFcInstance () throws -InstantiationException; - -
-}
- -
-
Figure 12: Instantiation API
- -
-The GenericFactory interface provides only one operation -named newFcInstance. This operation takes as parameter the -type of the component to be created, a descriptor of its controller -part, and a descriptor of its content part. This operation creates -a component corresponding to the given description, and returns its -Component interface. - -
-The Factory interface also provides a newFcInstance -operation, but this operation does not take any parameter, which reflects -the fact that all the components created by this operation have the -same type, and the same controller and content descriptors. These -information can be retrieved with the three other operations of this -interface, named getFcInstanceType, getFcControllerDesc -and getFcContentDesc. - -
-In both interfaces, the component type must describe only the functional -interfaces of the components to be created. The control interfaces -of the components to be created must indeed be specified in the controller -descriptors. The exact semantics of the controller and content descriptors, -in both interfaces, is however left unspecified in this version of -the Fractal component model specification. - -
-Note that, in both interfaces, the newFcInstance operation -does not necessarily create a new component instance each time it -is invoked. It can also, for example, always return the same instance -(this is the singleton pattern). The components created by a factory -must be created in the same address space as the factory component. -But the exact location of the created components, in this address -space, is voluntarily not specified. In particular, it is not -ensured that the components created by a factory are automatically -added to the parent component(s) of the factory component. - -
-The org.objectweb.fractal.api.factory.InstantiationException -exception must be thrown when a component cannot be created, in the -newFcInstance operations of the Factory and GenericFactory -interfaces. - -
-A component interface implementing GenericFactory must be -named generic-factory. A component interface implementing -Factory must be named factory. - -
-

-5.2  Templates

- -
-A template is a special kind of standard factory component -that creates components that are quasi "isomorphic" to itself. -More precisely, the components created by a template component must -have the same functional client and server interfaces as the template -component (except for the Factory interface, which is provided -by the template, but not necessarily by its instances), but can have -arbitrary control interfaces. The components created by a template -component also have the same attributes as the template. A template -component may contain several sub template components, bound together -through bindings. The components created by such a template component -are components that contain as many sub components as sub templates -in the template, bound together as the sub templates are bound in -the template (see Figure 13). If some sub -templates are shared, the corresponding sub components in the components -created by the template will also be shared. - -
- -
- -
templates.png
- -
-
Figure 13: A sample template component and a component created from it
- -
-If a generic factory component is able to create template components, -then it must be possible to create a template component with a operation -invocation, on this generic factory, of the form newFcInstance(type, -templateControllerDesc, {controllerDesc, contentDesc}), where type -describes the functional client and server interfaces of the components -that the template will create, templateControllerDesc is -the descriptor of the controller part of the template component to -be created, and controllerDesc and contentDesc are -the descriptors of the controller and content parts of the components -that the template will create (the brackets denote an array). - -
-Template components are useful in only one case, namely when several -identical components must be created from a textual representation, -such as an Architecture Description Language definition. In this case, -instead of parsing the textual representation each time an instance -must be created, it can be more efficient to parse the text file(s) -and to create a corresponding template only once, and then to instantiate -the template each time an instance is needed. In all other cases, -using templates is equivalent, but generally less efficient, than -not using them. - -
-

-5.3  Bootstrap

- -
-According to the above framework, components are created from component -factories. But how are created component factories? They can be created -from other component factories, but this leads to an infinite recursion. -In order to stop it, a bootstrap component factory, which does not -need to be created explicitly, and which is accessible from a "well-known" -name, is necessary. This bootstrap component factory must be able -to create several kinds of components, including component factories. -In other words, it must provide the GenericFactory interface. - -
- -

Note

- -
-In Java, this bootstrap component must be accessible from the getBootstrapComponent -static method, defined in the org.objectweb.fractal.api.Fractal -class. This method must not take any parameter, and must return the -Component interface of the bootstrap component. - -
-

-6  Typing

- -
-This section defines a simple type system for components and component -interfaces. This type system reflects the main characteristics of -component interfaces, introduced in section 3, -i.e. their name, their language type, and their role (client -or server). It also introduces two new characteristics named contingency -and cardinality. - -
-

-6.1  Contingency and cardinality

- -
-The contingency of an interface indicates if the functionality -corresponding to this interface is guaranteed to be available or not, -while the component is running: - -
- -
    -
  • the operations of a mandatory interface are guaranteed to be -available when the component is running. This semantic is obvious -for a server interface. For a client interface, which does not have -a functionality of its own, it means that the interface must -be bound, and that it must be bound to a mandatory interface. As a -consequence, a component with mandatory client interfaces cannot be -started until all these interfaces are bound to other mandatory interfaces. -
    -
  • - -
  • the operations of an optional interface are not guaranteed -to be available. This can happen, for a server interface, when the -complementary internal interface is not bound to a sub component. -This can also happen, for a client interface, when this interface -is not bound. -
    -
  • -
-The cardinality of an interface type T indicates -how many interfaces of type T a given component may have: - -
- -
    -
  • the singleton cardinality means that a given component must -have exactly one interface of type T. -
    -
  • - -
  • the collection cardinality means that a given component may -have an arbitrary number of interfaces of type T. All these interfaces -must have a name that begins with the name specified in T -(see next section). Since there is a priori an infinite number of -such interfaces, these interfaces cannot all be created at the same -time: they must be created lazily, during invocations of the getFcInterface -and bindFc operations. For example, if the name specified -in T is listener, then an invocation to getFcInterface("listener11") -or to bindFc("listener11", s) will create -an interface named listener11, if it does not already exist. -This interface may be removed automatically when it is no longer used -by any binding. -
    -
  • -
-Mandatory and optional interfaces are useful for components that absolutely -require other components to work, and which may also use other components, -if they are present. For example, a parser component absolutely needs -a lexer component, but can work with or without a logger component. -Collection interfaces are useful for components with a variable number -of required components of the same type, such as a menu component -and its associated menu item components, a model component and its -listener components (in the MVC model), and so on. - -
-

-6.2  Type system

- -
-In the type system specified here, a component type is just a set -of component interface types. A component type is represented by the -ComponentType interface (see Figure 14). -This interface defines a getFcInterfaceTypes operation, which -returns the set of component interface types in this component type, -as an array. It also defines a getFcInterfaceType operation, -which returns the component interface type whose name is given as -parameter (this operation must throw the NoSuchInterfaceException -if the requested interface type does not exist). - -
-A component interface type is represented by the InterfaceType -interface. Such a type is made of a name, a signature, a role, a contingency -and a cardinality. The name is the name of component interfaces of -this type. The signature is the name of the language interface type -that is implemented by component interfaces of this type (for a client -interface, an empty signature means that this client interface can -be connected to any server interface). The role indicates if component -interfaces of this type are client or server interfaces. The contingency -indicates if the functionality of interfaces of this type is guaranteed -to be available or not. Finally, the cardinality indicates how many -interfaces of this type a component may have. - -
-Component and component interface types can be created by using a -type factory, represented by the TypeFactory interface. Indeed -this interface provides two operations to create component interface -types and component types. A component interface implementing TypeFactory -must be named type-factory. - -
- -
-
package org.objectweb.fractal.api.type; - -
-interface ComponentType extends -Type { - -
-   InterfaceType[] getFcInterfaceTypes (); - -
-   InterfaceType getFcInterfaceType (string -itfName) throws NoSuchInterfaceException; - -
-} - -
-interface InterfaceType extends -Type { - -
-   string getFcItfName (); - -
-   string getFcItfSignature (); - -
-   boolean isFcClientItf (); - -
-   boolean isFcOptionalItf (); - -
-   boolean isFcCollectionItf (); - -
-} - -
-interface TypeFactory { - -
-   InterfaceType createFcItfType (string -name, string signature, boolean -isClient, - -
-      boolean isOptional, boolean -isCollection) throws InstantiationException; - -
-   ComponentType createFcType (InterfaceType[] itfTypes) -throws InstantiationException; - -
-}
- -
-
Figure 14: Typing API
- -
-A component of type T must have as many external interfaces as -described in T (and, in particular, in the interface cardinalities), -and all these interfaces must have the name, language type and role -described in the corresponding component interface type. Likewise, -if this component also exposes its content, and in particular its -internal interfaces, then it must also have, at most, as many -internal functional interfaces as described in T, and each -of these interfaces must have the name, language type and role described -in the corresponding component interface type. This implies that each -internal functional interface has a complementary external -interface of the same name, signature, contingency and cardinality, -and of opposite role (but the converse is not necessarily true). Note -that this property is ensured by the type system specified in this -section: in the general case, nothing more than what is explicitely -stated in section 4.1 is ensured -(and so an internal interface may not have a complementary external -interface). - -
-Note that if, in general, the number of interfaces of a Fractal component -may change during its life time, the number of interfaces of a Fractal -component that uses the type system presented here cannot change -during its lifetime (except for interface collections). Indeed the -ComponentType and InterfaceType interfaces do not -offer any operations to modify an existing type, and the other interfaces -specified in this document do not offer a operation to change the -type of a component or of an interface. But a Fractal component may -perfectly provide a setFcType operation, if needed, since -the Fractal model is extensible. - -
-

-6.3  Sub typing relation

- -
-This section defines a sub typing relation for component and component -interface types, based on substitutability. This relation provides -a sufficient (but not necessary) condition such that if a component -type T1 is a sub type of T2, then a component of type -T1 can replace a component of type T2 in any environment, -this environment (other components and bindings) being left unchanged, -and both components being seen as black boxes. - -
-An interface type I1 is a sub type of a server interface -type I2 if the following conditions are satisfied: I1 -has the same name and the same role as I2; the language interface -corresponding to I1 is a sub interface of the language interface -corresponding to I2; if the contingency of I2 is mandatory, -then the contingency of I1 is mandatory too; if the cardinality -of I2 is collection, then the cardinality of I1 is collection -too. - -
-An interface type I1 is a sub type of a client interface -type I2 if the following conditions are satisfied: I1 -has the same name and the same role as I2; the language interface -corresponding to I1 is a super interface of the language interface -corresponding to I2; if the contingency of I2 is optional, -then the contingency of I1 is optional too; if the cardinality -of I2 is collection, then the cardinality of I1 is collection -too. - -
-A component type T1 is a sub type of a component type T2 -if and only if each client interface type defined in T1 is a -sub type of an interface type defined in T2, and each server -interface type defined in T2 is a super type of an interface -type defined in T1. - -
-

-7  Options

- -
-As said in section 1.2, in the Fractal component -model, everything is optional. For example, a Fractal component may -provide or not the Component interface, it may support or -not the Interface interface, it may provide or not the control -interfaces defined in section 4, it may use -or not the type system defined in section 6, and -so on. - -
-In addition, a Fractal component may provide or use new or alternative -control interfaces, type systems, or even component semantics. For -example, a Fractal component may provide a new ConcurrencyController -interface to control concurrent accesses to the component. It may -also provide an alternative BindingController interface, -named for example InternalBindingController, to control the -bindings between sub components directly from the enclosing component. -It can also use an empty type system, with a unique type, sub type -of itself, used for all components and component interfaces. A Fractal -component may even define a new semantic for the communication between -its sub components: instead of specifying that operation invocations -follow bindings, as defined in section 4.1, -it can for example specify that operation invocations are broadcasted -to all the sub components, in order to model an asynchronous, reactive -"space". Bindings are then useless (another possiblity is to -define parallel components, where all the sub components have the -same type as the enclosing component, and where each operation invocation -received on this component is executed in parallel by all its sub -components). A Fractal component may also refine the internal component -structure defined in section 4.1, -by specifying that the component's controller can, like the component's -content, contain sub components. Such a Fractal component can then -provide new control interfaces to introspect and reconfigure the sub -components of its controller part. - -
-The advantage of this extreme modularity and extensibility is that -the Fractal component model can be applied to many situations. The -drawback is that two arbitrary Fractal components will generally not -be able to work together, because they will generally use very different, -and potentially incompatible, options or extensions of the Fractal -model. In order to reduce this problem, this section defines some -set of options, and gives them a symbolic name called a conformance -level. The goal is to be able to say, or even certify, that -a given Fractal application or tool is conform to the Fractal model -of level X. It will then be easy to know which Fractal applications -and tools can work together, by comparing their conformance level -to the Fractal model. - -
-

-7.1  Conformance levels

- -
-This specification defines the following conformance levels (new conformance -levels can of course be defined as needed): - -
- -
    -
  • level 0: at this level nothing is mandatory. Fractal components -are like simple objects. A Java object, a Java Bean, or an Enterprise -Java Bean, for example, are conform to the Fractal component model -of level 0. - -
    - -
      -
    • level 0.1: same as level 0, with the additional requirements -that all components with configurable attributes must provide the -AttributeController interface, that all components with client -interfaces must provide the BindingController interface, -that all components that expose their content must provide the ContentController -interface, and that all components that expose their life cycle must -provide the LifeCycleController interface. Of course, these -requirements do not prevent components from providing additional control -interfaces, including extensions and alternatives of the previous -interfaces. -
      -
    • -
    -
    -
  • - -
  • level 1: same as level 0, with the additional requirement that -all components must provide, at least, the Component interface. - -
    - -
      -
    • level 1.1: same as level 1, with the same additional requirements -as for level 0.1, concerning the control interfaces. -
      -
    • -
    -
    -
  • - -
  • level 2: same as level 1, with the additional requirement that -all component interface references must be castable to Interface. - -
    - -
      -
    • level 2.1: same as level 2, with the same additional requirements -as for levels 0.1 and 1.1, concerning the control interfaces. -
      -
    • -
    -
    -
  • - -
  • level 3: same as level 2, with the additional requirement that -all the components must use (an extension of) the type system defined -in section 6. - -
    - -
      -
    • level 3.1: same as level 3, with the same additional requirements -as for levels 0.1, 1.1 and 2.1, concerning the control interfaces. -
      -
    • - -
    • level 3.2: same as level 3.1, with the additional requirement -that a bootstrap component must be accessible from a "well-known" -name. This bootstrap component must provide a GenericFactory -and a TypeFactory interface. Moreover, the GenericFactory -interface must be able to create components with any control interfaces -in the set of control interfaces defined in section 4 -(and, in particular, primitive and composite components). Finally, -this interface must also be able to create (3.2 level) primitive -components encapsulating 0.1 level components (see below for more -details). -
      -
    • - -
    • level 3.3: same as level 3.2, with the additional requirement -that the GenericFactory interface of the bootstrap component -must be able to create primitive and composite template components. -
      -
    • -
    -
    -
  • -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - -
CICT, ITAC, BC, CC, LCFT
0      
0.1   x  
1x     
1.1x  x  
2xx    
2.1xx x  
3xxx   
3.1xxxx  
3.2xxxxx 
3.3xxxxxx
-
- -
-
Figure 15: Conformance levels to the Fractal component model
- -
-These conformance levels can summarized as shown in Figure 15, -where C, I, CT, IT, AC, BC, CC, LC, F and T represent the component, -interface, component type, interface type, attribute controller, binding -controller, life cycle controller, factory and "template" interfaces, -respectively, and where an x denotes a mandatory feature. - -
-Note that a level 3 component is also a level 2, 1 or 0 -component, a level 2 component is also a level 1 or 0 component, -a level 3.3 component is also a level 3.2, 3.1 or 3 component, -but a level 3, 2 or 1 component is not a level 0.1, -1.1 or 2.1 component. More generally, if l1 is greater -than l2 in alphabetical order, a level l2 component is -not necessarily also a level l1 component (this desirable -rule cannot always be respected, because the alphabetical order is -a total order, while the set inclusion order is only a partial order). - -
- -

Encapsulated components

- -
-As specified above, at the 3.2 level, the bootstrap generic factory -must be able to create 3.2 primitive components that encapsulate -0.1 level components. These encapsulating components (which do -not have a ContentController interface, and therefore are -not composite components) must "delegate" all the operation -invocations they receive on their functional and control interfaces -to their encapsulated component, if the encapsulated component has -a corresponding interface. For example, if the bindFc or -startFc operation is invoked on an encapsulating component, -this component must in turn invoke this operation on its encapsulated -component, if it provides the BindingController or LifeCycleController -interface. The encapsulating component can of course do some pre and -post computations before and after calling its encapsulated component. - -
-If the encapsulated component provides a BindingController -interface, then the encapsulating component must invoke, during its -initialization, the bindFc operation of this interface with, -as arguments, the component name and the reference of its -Component interface, so that the encapsulated component can -get a reference to the Component interface of its encapsulating -component. - -
-

-7.2  Extensions

- -
-The above conformance levels may not be sufficient to fully compare -two Fractal systems. In particular, for Fractal systems dedicated -to a specific language, such as C or Java, the language is as important -as the conformance level. And, even for Fractal systems based on the -same language, other "details" (such as, in Java, the class -loading policy - one class loader per component vs a single class -loader for all the components), unspecified here, may cause incompatibilities. -However, if needed, these other features can be captured in new conformance -levels, such as C.x.y or J.x.y, for C and Java respectively. - -
-

-8  Example

- -
-This section shows how a 3.3 level, Java Fractal platform can be used, -in order to illustrate how the APIs defined in this specification -can be used to create, assemble and reconfigure component configurations. - -
-The example used throughout this section is a very simple application -made of two primitive components inside a composite component (see -Figure 16). The first primitive component is a "server" -component that provides an interface s of type S. -The other primitive component is a "client" component, bound -to the previous server interface. - -
- -
- -
example.png
- -
-
Figure 16: A sample component based application
- -
-

-8.1  Instantiation

- -
-The above components can be instantiated as follows. The first step -is to create the component and component interface types. In order -to do this, we get a reference to the bootstrap component, and then -to its TypeFactory interface: - -
-
Component boot = Fractal.getBootstrapComponent(); - -
-TypeFactory tf = (TypeFactory)boot.getFcInterface("type-factory");
- -
-We can now create the types of the root, client and server components -as follows: - -
-
ComponentType rType = tf.createFcType(new -InterfaceType[] { - -
-   tf.createFcItfType("m", "M", -false, false, -false) - -
-});
- -
-
ComponentType cType = tf.createFcType(new -InterfaceType[] { - -
-   tf.createFcItfType("m", "M", -false, false, -false), - -
-   tf.createFcItfType("s", "S", -true, false, -false) - -
-});
- -
-
ComponentType sType = tf.createFcType(new -InterfaceType[] { - -
-   tf.createFcItfType("s", "S", -false, false, -false) - -
-});
- -
-We could now create the components directly, but we will use intermediate -template components here, in order to show how they can be used. These -component templates can be created as follows: - -
-
GenericFactory gf = (GenericFactory)boot.getFcInterface("generic-factory");
- -
-
Component rTmpl = gf.newFcInstance( - -
-   rType, "compositeTemplate", new -Object[] {"composite", null});
- -
-
Component cTmpl = gf.newFcInstance( - -
-   cType, "template", new -Object[] {"primitive", "CImpl"});
- -
-
Component sTmpl = gf.newFcInstance( - -
-   sType, "template", new -Object[] {"primitive", "SImpl"});
- -
-Here the template (resp. compositeTemplate) descriptor -is supposed to describe components with a BindingController -interface (resp. with a BindingController and a ContentController -interfaces). The primitive and composite descriptors -are supposed to describe similar components, but with an additional -LifeCycleController interface. Finally, CImpl and -SImpl are the names of the Java classes of the 0.1 level -Fractal components that will be encapsulated in the client -and server components (see end of section 7.1). -The CImpl class, for example, has the following form: - -
-
public class -CImpl implements M, BindingController -{ - -
-   private S s; - -
-   public String[] listFc -() { return new String[] -{ "s" }; } - -
-   public Object lookupFc (String -name) { - -
-      if (name.equals("s")) -return s; - -
-      return null; - -
-   } - -
-   public Object bindFc (String -name, Object itf) { - -
-      if (name.equals("s")) -s = (S)itf; - -
-   } - -
-   public Object unbindFc (String -name) { - -
-      if (name.equals("s")) -s = null; - -
-   } - -
-   // ... - -
-}
- -
-We can then either instantiate each template one by one, put the resulting -primitive components inside the composite component, connect all these -components, and finally start them. But we can also put the primitive -templates inside the composite template, connect these templates together, -and then instantiate the whole application by just instantiating the -composite template component. This is what we do here. - -
-We begin by putting the primitive template components inside the composite -one (here we assume a strong semantic for the addFcSubComponent -method, i.e. we assume that C¢=CÈ{ c} - see section 4.4): - -
-
ContentController cc = (ContentController)rTmpl.getFcInterface("content-controller"); - -
-cc.addFcSubComponent(cTmpl); - -
-cc.addFcSubComponent(sTmpl);
- -
-We then bind the internal client interface m of the composite -template to the server interface m of the client template: - -
-
((BindingController)rTmpl.getFcInterface("binding-controller")) - -
-   .bindFc("m", cTmpl.getFcInterface("m"));
- -
-Finally, we bind the client interface s of the client template -to the server interface s of the server template: - -
-
((BindingController)cTmpl.getFcInterface("binding-controller")) - -
-   .bindFc("s", sTmpl.getFcInterface("s"));
- -
-At this stage the template components are like the components depicted -in Figure 16, with just an additional Factory -interface. Now that the template components have been created and -bound to each other, the application components can be instantiated -and bound to each other automatically, by just calling the newFcInstance -method on the root template component: - -
-
Component r = ((Factory)rTmpl.getFcInterface("factory")).newFcInstance();
- -
-The result is depicted in Figure 17. As can be seen, -the 0.1 level components CImpl and SImpl have -been encapsulated in 3.2 level components, which provide them component -and interface introspection functions. - -
- -
- -
example2.png
- -
-
Figure 17: Result of the instantiation of the application depicted in Figure 16 -
- -
-All the application components can now be started automatically by -just calling the startFc method on the root application component -(here we assume a stronger semantic than the default one for the startFc -method, i.e. we assume it to be recursive - see section 4.5): - -
-
((LifeCycleController)r.getFcInterface("lifecycle-controller")).startFc();
- -
-

-8.2  Reconfiguration

- -
-Let us suppose we want to dynamically change the server component. -In order to do this, we need to unbind the client component, remove -the server component, create a new server component, add the server -component in the composite component, and finally bind the client -component to the new server. But the binding and component removals -cannot be done while the client and the composite component, respectively, -are not stopped. So we must first stop these components (here again -we assume this method to be recursive; we also assume that it does -not change the states of the components, and that method calls to -functional interfaces while the components are stopped are only suspended -until the components are restarted): - -
-
((LifeCycleController)r.getFcInterface("lifecycle-controller")).stopFc();
- -
-We then retrieve the references of the client and server components -(more precisely of the 3.2 level components that encapsulate the -0.1 level components CImpl and SImpl): - -
-
Component c = ((Interface)((BindingController)r. - -
-   getFcInterface("binding-controller")).lookupFc("m")).getFcItfOwner(); - -
-Component s = ((Interface)((BindingController)c. - -
-   getFcInterface("binding-controller")).lookupFc("s")).getFcItfOwner();
- -
-We can now unbind the client and server components, and remove the -server component from the composite component (we assume a strong -semantic for removeFcSubComponent): - -
-
((BindingController)c.getFcInterface("binding-controller")).unbindFc("s"); - -
-((ContentController)r.getFcInterface("content-controller")).removeFcSubComponent(s);
- -
-We can now create the new server component, i.e. a new 3.2 level -component encapsulating a new 0.1 level component. Instead of using -a template component for doing that, as in the previous section, we -use here the bootstrap generic factory directly: - -
-
Component newS = gf.newFcInstance(sType, "primitive", -"NewSImpl");
- -
-We can now add this new component in the composite component, bind -it to the client component, and finally resume the application's execution -(we make the same semantic hypotheses as in the previous section for -the addFcSubComponent and startFc methods): - -
-
((ContentController)r.getFcInterface("content-controller")).addFcSubComponent(newS); - -
-((BindingController)c.getFcInterface("binding-controller")).bindFc("s", -newS); - -
-((LifeCycleController)r.getFcInterface("lifecycle-controller")).startFc();
- -
-

-A  Fractal APIs

- -
-This section defines the Fractal API in Java, C and OMG IDL. These -definitions can be used as "standard" definitions to provide -interoperability between Java components only, between C components -only, and between any components (respectively). They are the result -of straightforward transformations of the pseudo IDL interface definitions -from section 2 to 6. - -
- -

Java API

- -
- - -
-package org.objectweb.naming; - -
-public interface Name { - -
-  NamingContext getNamingContext (); - -
-  byte[] encode () throws NamingException; - -
-} - -
-public interface NamingContext { - -
-  Name export (Object o, Object hints) throws NamingException; - -
-  Name decode (byte[] b) throws NamingException; - -
-} - -
-public interface Binder extends NamingContext -{ - -
-  Object bind (Name n, Object hints) throws NamingException; - -
-} - -
-public class NamingException extends Exception -{ - -
-  public NamingException (String msg) { super(msg); -} - -
-} - -
-package org.objectweb.fractal.api; - -
-import org.objectweb.fractal.api.factory.InstantiationException; - -
-public interface Component { - -
-  Type getFcType (); - -
-  Object[] getFcInterfaces (); - -
-  Object getFcInterface (String interfaceName) throws NoSuchInterfaceException; - -
-} - -
-public interface Interface { - -
-  Component getFcItfOwner (); - -
-  String getFcItfName (); - -
-  Type getFcItfType (); - -
-  boolean isFcInternalItf (); - -
-} - -
-public interface Type { - -
-  boolean isFcSubTypeOf (Type type); - -
-} - -
-public class Fractal { - -
-  public static Component getBootstrapComponent -() throws InstantiationException; - -
-} - -
-public class NoSuchInterfaceException extends -Exception { - -
-  public NoSuchInterfaceException (String itfName) { super(itfName); -} - -
-} - -
-package org.objectweb.fractal.api.control; - -
-import org.objectweb.fractal.api.Component; - -
-import org.objectweb.fractal.api.NoSuchInterfaceException; - -
-public interface AttributeController { } - -
-public interface BindingController { - -
-  String[] listFc (); - -
-  Object lookupFc (String clientItfName) throws NoSuchInterfaceException; - -
-  void bindFc (String clientItfName, Object serverItf) -throws - -
-    NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException; - -
-  void unbindFc (String clientItfName) throws - -
-    NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException; - -
-} - -
-public interface ContentController { - -
-  Object[] getFcInternalInterfaces (); - -
-  Object getFcInternalInterface (String interfaceName) throws -NoSuchInterfaceException; - -
-  Component[] getFcSubComponents (); - -
-  void addFcSubComponent (Component subComponent) - -
-    throws IllegalContentException, IllegalLifeCycleException; - -
-  void removeFcSubComponent (Component subComponent) - -
-    throws IllegalContentException, IllegalLifeCycleException; - -
-} - -
-public interface SuperController { - -
-  Component[] getFcSuperComponents (); - -
-} - -
-public interface LifeCycleController { - -
-  String getFcState (); - -
-  void startFc () throws IllegalLifeCycleException; - -
-  void stopFc () throws IllegalLifeCycleException; - -
-} - -
-public interface NameController { - -
-  String getFcName (); - -
-  void setFcName (String name); - -
-} - -
-public class IllegalBindingException extends -Exception { - -
-  public IllegalBindingException (String msg) { super(msg); -} - -
-} - -
-public class IllegalContentException extends -Exception { - -
-  public IllegalContentException (String msg) { super(msg); -} - -
-} - -
-public class IllegalLifeCycleException extends -Exception { - -
-  public IllegalLifeCycleException (String msg) { super(msg); -} - -
-} - -
-package org.objectweb.fractal.api.factory; - -
-import org.objectweb.fractal.api.Component; - -
-import org.objectweb.fractal.api.Type; - -
-public interface Factory { - -
-  Type getFcInstanceType (); - -
-  Object getFcControllerDesc (); - -
-  Object getFcContentDesc (); - -
-  Component newFcInstance () throws InstantiationException; - -
-} - -
-public interface GenericFactory { - -
-  Component newFcInstance (Type type, Object controllerDesc, Object -contentDesc) - -
-    throws InstantiationException; - -
-} - -
-public class InstantiationException extends -Exception { - -
-  public InstantiationException (String msg) { super(msg); -} - -
-} - -
-package org.objectweb.fractal.api.type; - -
-import org.objectweb.fractal.api.NoSuchInterfaceException; - -
-public interface ComponentType extends -org.objectweb.fractal.api.Type { - -
-  InterfaceType[] getFcInterfaceTypes (); - -
-  InterfaceType getFcInterfaceType (String name) throws -NoSuchInterfaceException; - -
-} - -
-public interface InterfaceType extends -org.objectweb.fractal.api.Type { - -
-  String getFcItfName (); - -
-  String getFcItfSignature (); - -
-  boolean isFcClientItf (); - -
-  boolean isFcOptionalItf (); - -
-  boolean isFcCollectionItf (); - -
-} - -
-public interface TypeFactory { - -
-  InterfaceType createFcItfType ( - -
-    String name, String signature, boolean isClient, -boolean isOptional, boolean isCollection) - -
-      throws org.objectweb.fractal.api.factory.InstantiationException; - -
-  ComponentType createFcType (InterfaceType[] interfaceTypes) - -
-    throws org.objectweb.fractal.api.factory.InstantiationException; - -
-} - -
-
- -
- -

C API

- -
- - -
-typedef unsigned char jboolean; - -
-typedef unsigned short jchar; - -
-typedef signed char jbyte; - -
-typedef signed short jshort; - -
-typedef signed int jint; - -
-typedef signed long long jlong; - -
-typedef float jfloat; - -
-typedef double jdouble; - -
-struct Morg_objectweb_naming_Name { - -
-  Rorg_objectweb_naming_NamingContext* (*getNamingContext)(void -*_this); - -
-  jbyte* (*encode)(void *_this); - -
-}; - -
-struct Morg_objectweb_naming_NamingContext { - -
-  Rorg_objectweb_naming_Name* (*export)(void *_this, -void* o, void* hints); - -
-  Rorg_objectweb_naming_Name* (*decode)(void *_this, -jbyte* b); - -
-}; - -
-struct Morg_objectweb_naming_Binder { - -
-  Rorg_objectweb_naming_Name* (*export)(void *_this, -void* o, void* hints); - -
-  Rorg_objectweb_naming_Name* (*decode)(void *_this, -jbyte* b); - -
-  void* (*bind)(void *_this, Rorg_objectweb_naming_Name* -n, void* hints); - -
-}; - -
-struct Morg_objectweb_fractal_api_Component { - -
-  Rorg_objectweb_fractal_api_Type* (*getFcType)(void -*_this); - -
-  void** (*getFcInterfaces)(void *_this); - -
-  void* (*getFcInterface)(void *_this, -char* interfaceName); - -
-}; - -
-struct Morg_objectweb_fractal_api_Interface { - -
-  Rorg_objectweb_fractal_api_Component* (*getFcItfOwner)(void -*_this); - -
-  char* (*getFcItfName)(void *_this); - -
-  Rorg_objectweb_fractal_api_Type* (*getFcItfType)(void -*_this); - -
-  jboolean (*isFcInternalItf)(void *_this); - -
-}; - -
-struct Morg_objectweb_fractal_api_Type { - -
-  jboolean (*isFcSubTypeOf)(void *_this, Rorg_objectweb_fractal_api_Type* -type); - -
-}; - -
-struct Morg_objectweb_fractal_api_control_AttributeController -{ }; - -
-struct Morg_objectweb_fractal_api_control_BindingController -{ - -
-  char** (*listFc)(void *_this); - -
-  void* (*lookupFc)(void *_this, char* -clientItfName); - -
-  void (*bindFc)(void *_this, char* -clientItfName, void* serverItf); - -
-  void (*unbindFc)(void *_this, char* -clientItfName); - -
-}; - -
-struct Morg_objectweb_fractal_api_control_ContentController -{ - -
-  void** (*getFcInternalInterfaces)(void -*_this); - -
-  void* (*getFcInternalInterface)(void *_this, -char* interfaceName); - -
-  Rorg_objectweb_fractal_api_Component** (*getFcSubComponents)(void -*_this); - -
-  void (*addFcSubComponent)( - -
-    void *_this, Rorg_objectweb_fractal_api_Component* -subComponent); - -
-  void (*removeFcSubComponent)( - -
-    void *_this, Rorg_objectweb_fractal_api_Component* -subComponent); - -
-}; - -
-struct Morg_objectweb_fractal_api_control_SuperController -{ - -
-  Rorg_objectweb_fractal_api_Component** (*getFcSuperComponents)(void -*_this); - -
-}; - -
-struct Morg_objectweb_fractal_api_control_LifeCycleController -{ - -
-  char* (*getFcState)(void *_this); - -
-  void (*startFc)(void *_this); - -
-  void (*stopFc)(void *_this); - -
-}; - -
-struct Morg_objectweb_fractal_api_control_NameController -{ - -
-  char* (*getFcName)(void *_this); - -
-  void (*setFcName)(void *_this, -char* name); - -
-}; - -
-struct Morg_objectweb_fractal_api_factory_Factory { - -
-  Rorg_objectweb_fractal_api_Type* (*getFcInstanceType)(void -*_this); - -
-  void* (*getFcControllerDesc)(void *_this); - -
-  void* (*getFcContentDesc)(void *_this); - -
-  Rorg_objectweb_fractal_api_Component* (*newFcInstance)(void -*_this); - -
-}; - -
-struct Morg_objectweb_fractal_api_factory_GenericFactory -{ - -
-  Rorg_objectweb_fractal_api_Component* (*newFcInstance)( - -
-    void *_this,   Rorg_objectweb_fractal_api_Type* -type, void* ctrlDesc, void* cntntDesc); - -
-}; - -
-struct Morg_objectweb_fractal_api_type_ComponentType -{ - -
-  jboolean (*isFcSubTypeOf)(void *_this, Rorg_objectweb_fractal_api_Type* -type); - -
-  Rorg_objectweb_fractal_api_type_InterfaceType** (*getFcInterfaceTypes)(void -*_this); - -
-  Rorg_objectweb_fractal_api_type_InterfaceType* (*getFcInterfaceType)(void -*_this, char* name); - -
-}; - -
-struct Morg_objectweb_fractal_api_type_InterfaceType -{ - -
-  jboolean (*isFcSubTypeOf)(void *_this, Rorg_objectweb_fractal_api_Type* -type); - -
-  char* (*getFcItfName)(void *_this); - -
-  char* (*getFcItfSignature)(void *_this); - -
-  jboolean (*isFcClientItf)(void *_this); - -
-  jboolean (*isFcOptionalItf)(void *_this); - -
-  jboolean (*isFcCollectionItf)(void *_this); - -
-}; - -
-struct Morg_objectweb_fractal_api_type_TypeFactory { - -
-  Rorg_objectweb_fractal_api_type_InterfaceType* (*createFcItfType)( - -
-    void *_this, char* name, char* -signature, - -
-    jboolean isClient, jboolean isOptional, jboolean isCollection); - -
-  Rorg_objectweb_fractal_api_type_ComponentType* (*createFcType)( - -
-    void *_this, Rorg_objectweb_fractal_api_type_InterfaceType** -interfaceTypes); - -
-}; - -
-// where Rxyz types are defined by: - -
-// typedef struct { - -
-//   struct Mxyz *meth; - -
-//   void *selfdata; - -
-// } Rxyz; - -
-
- -
- -

OMG IDL API

- -
- - -
-typedef sequence<Object> ObjectArray; - -
-typedef sequence<string> stringArray; - -
-typedef sequence<octet> octetArray; - -
-module org_objectweb_naming { - -
-  exception NamingException { }; - -
-  interface NamingContext; - -
-  interface Name { - -
-    NamingContext getNamingContext (); - -
-    octetArray encode () raises(NamingException); - -
-  }; - -
-  interface NamingContext { - -
-    Name export (in Object o, in Object hints) -raises(NamingException); - -
-    Name decode (in octetArray b) raises(NamingException); - -
-  }; - -
-  interface Binder : NamingContext { - -
-    Object bind (in Name n, in Object hints) -raises(NamingException); - -
-  }; - -
-}; - -
-module org_objectweb_fractal_api { - -
-  exception NoSuchInterfaceException { }; - -
-  interface Type { - -
-    boolean isFcSubTypeOf (in Type type); - -
-  }; - -
-  interface Component { - -
-    Type getFcType (); - -
-    ObjectArray getFcInterfaces (); - -
-    Object getFcInterface (in string interfaceName) -raises(NoSuchInterfaceException); - -
-  }; - -
-  typedef sequence<Component> ComponentArray; - -
-  interface Interface { - -
-    Component getFcItfOwner (); - -
-    string getFcItfName (); - -
-    Type getFcItfType (); - -
-    boolean isFcInternalItf (); - -
-  }; - -
-}; - -
-module org_objectweb_fractal_api_control { - -
-  exception IllegalBindingException { }; - -
-  exception IllegalContentException { }; - -
-  exception IllegalLifeCycleException { }; - -
-  interface AttributeController { }; - -
-  interface BindingController { - -
-    stringArray listFc (); - -
-    Object lookupFc (in string clientItfName) - -
-      raises(org_objectweb_fractal_api::NoSuchInterfaceException); - -
-    void bindFc (in string clientItfName, -in Object serverItf) raises(IllegalBindingException, - -
-      IllegalLifeCycleException, org_objectweb_fractal_api::NoSuchInterfaceException); - -
-    void unbindFc (in string clientItfName) -raises(IllegalBindingException, - -
-      IllegalLifeCycleException, org_objectweb_fractal_api::NoSuchInterfaceException); - -
-  }; - -
-  interface ContentController { - -
-    ObjectArray getFcInternalInterfaces (); - -
-    Object getFcInternalInterface (in string -interfaceName) - -
-      raises(org_objectweb_fractal_api::NoSuchInterfaceException); - -
-    org_objectweb_fractal_api::ComponentArray getFcSubComponents -(); - -
-    void addFcSubComponent (in org_objectweb_fractal_api::Component -subComponent) - -
-      raises(IllegalContentException, IllegalLifeCycleException); - -
-    void removeFcSubComponent (in org_objectweb_fractal_api::Component -subComponent) - -
-      raises(IllegalContentException, IllegalLifeCycleException); - -
-  }; - -
-  interface SuperController { - -
-    org_objectweb_fractal_api::ComponentArray getFcSuperComponents -(); - -
-  }; - -
-  interface LifeCycleController { - -
-    string getFcState (); - -
-    void startFc () raises(IllegalLifeCycleException); - -
-    void stopFc () raises(IllegalLifeCycleException); - -
-  }; - -
-  interface NameController { - -
-    string getFcName (); - -
-    void setFcName (in string name); - -
-  }; - -
-}; - -
-module org_objectweb_fractal_api_factory { - -
-  exception InstantiationException { }; - -
-  interface GenericFactory { - -
-    org_objectweb_fractal_api::Component newFcInstance ( - -
-      in org_objectweb_fractal_api::Type type, in -Object controllerDesc, in Object contentDesc) - -
-        raises(InstantiationException); - -
-  }; - -
-  interface Factory { - -
-    org_objectweb_fractal_api::Type getFcInstanceType (); - -
-    Object getFcControllerDesc (); - -
-    Object getFcContentDesc (); - -
-    org_objectweb_fractal_api::Component newFcInstance () raises(InstantiationException); - -
-  }; - -
-}; - -
-module org_objectweb_fractal_api_type { - -
-  interface InterfaceType : org_objectweb_fractal_api::Type -{ - -
-    string getFcItfName (); - -
-    string getFcItfSignature (); - -
-    boolean isFcClientItf (); - -
-    boolean isFcOptionalItf (); - -
-    boolean isFcCollectionItf (); - -
-  }; - -
-  typedef sequence<InterfaceType> InterfaceTypeArray; - -
-  interface ComponentType : org_objectweb_fractal_api::Type -{ - -
-    InterfaceTypeArray getFcInterfaceTypes (); - -
-    InterfaceType getFcInterfaceType (in string -name) - -
-      raises(org_objectweb_fractal_api::NoSuchInterfaceException); - -
-  }; - -
-  interface TypeFactory { - -
-    InterfaceType createFcItfType ( - -
-      in string name, in string -signature, - -
-      in boolean isClient, in boolean -isOptional, in boolean isCollection) - -
-        raises(org_objectweb_fractal_api_factory::InstantiationException); - -
-    ComponentType createFcType (in InterfaceTypeArray -interfaceTypes) - -
-      raises(org_objectweb_fractal_api_factory::InstantiationException); - -
-  }; - -
-}; - -
-
- -
-

-B  Glossary

- -
-This section defines the core concepts of the Fractal model. - -
-binder: a naming context that can also give access (reference) -to the interfaces designated by the names it manages. - -
-binding: a primitive, local communication path between a -client and a server interface. More complex "bindings" are made -of bindings and of binding components. - -
-concept: an abstract representation composed of the properties -common to a set of concrete representations of directly observable -entities. - -
-cardinality: a property of an interface type that indicates -how many interfaces of this type a given component may have. The cardinality -is either singleton or collection. - -
-component: a runtime entity exhibiting a recursive structure -and reflexive capabilities. A component is composed of a controller -and a content. A component has well defined access points called interfaces, -and provides more or less introspection and control capabilities (intercession) -to other components. - -
- -
    -
  • base component: a component that does not have any control -interface. -
    -
  • - -
  • primitive component: a component with some control interfaces, -but that does not expose its content. -
    -
  • - -
  • composite component: a component that exposes its content. -
    -
  • - -
  • sub component: a component that is contained in another component. -
    -
  • - -
  • super component: relatively to a (sub) component: a component -that contains this (sub) component. Due to component sharing, a component -may have several super components. -
    -
  • - -
  • shared component: a component that is contained in several -super components. -
    -
  • - -
  • binding component: a component dedicated to the communication -between other components. Similar to a connector in other component -models. -
    -
  • -
-conformance level : a symbolic name that designates a set -of options or extensions of the Fractal component model. A Fractal -system is conform to a given conformance level if it supports all -the options designated by this level. - -
-content: one of the two parts of a component, the other one -being its controller. A content is an abstract entity controlled by -a controller. The content of a component is (recursively) made of -sub components and bindings. - -
-contingency: a property of an interface indicates if the -functionality of this interface is guaranteed to be available or not, -while its component is running. The contingency is either optional -or mandatory. - -
-controller: one of the two parts of a component, the other -one being its content. A controller is an abstract entity that embodies -the control behavior associated with a particular component. A controller -can exercise an arbitrary control over the content of the component -it is part of (intercept incoming and outgoing operation invocations -for instance). - -
-entity: anything having existence. - -
-factory: a component that can create other components. Generic -factories can create several kinds of components, while standard component -factories create only one kind of components. - -
-fractal: a property that characterizes entities (objects -in nature; sets, functions in mathematics; software components in -the case of Fractal) which exhibit a structure at all scales or at -least at numerous scales, i.e. whose structure depends explicitly -on the resolution at which they are being observed. Some fractal systems -are scale invariants - which means they exhibit in fact the same structure -at all scales. Fractal software systems are scale invariant. They -are modelled as interacting Fractal components which are self similar: -they are not identical (of course!) but exhibit the same structure -expressed in terms of interfaces, bindings, attributes and controllers -at any resolution they are being observed. - -
-intercession: the ability of a component (seen as a program) -to modify its own execution state; or to alter its own interpretation -or semantics. - -
-interface: an access point to a component, also called a -component interface; or a language interface, i.e. a type made of -several operation declarations. - -
- -
    -
  • component interface: an access point to a component, i.e., -a place where operation invocations can be emitted or received. -
    -
  • - -
  • language interface: a type made of several operation declarations. -
    -
  • - -
  • client interface: a component interface that emits operation -invocations. -
    -
  • - -
  • server interface: a component interface that receives operation -invocations. -
    -
  • - -
  • optional interface: a component interface whose functionality -is not guaranteed to be available, while the component is running. -
    -
  • - -
  • mandatory interface: a component interface whose functionality -is guaranteed to be available, while the component is running. -
    -
  • - -
  • external interface: a component interface that is only accessible -from outside the component. -
    -
  • - -
  • internal interface: a component interface that is only accessible -from inside the component, i.e. from its sub components. -
    -
  • - -
  • complementary interface: of an interface I, a component interface -with the same name, signature, contingency, and cardinality as I, -but with opposite role and visibility (external or internal). -
    -
  • - -
  • functional interface: a component interface that corresponds -to a provided or required functionality of a component, as opposed -to a control interface. -
    -
  • - -
  • control interface: a component interface that manages a "non -functional aspect" of a component, such as introspection, configuration -or reconfiguration, and so on. By convention, control interfaces are -server interfaces whose name ends with -controller, or is -equal to component. -
    -
  • -
-introspection: the ability of a component (seen as a program) -to observe and reason about its own execution state. - -
-model: a system of relations between selected concepts - -built explicitly at ends of description, explanation or forecast. - -
-name: a value that designates a component interface, but -that does not necessarily give access to (reference) it. - -
-naming context: a entity that creates and manages names. -Naming contexts can be nested and overlapping, allowing names to be -valid in different naming contexts. A component controller constitutes -a primitive naming context. - -
-reflection (reflective capabilities): the ability of a component -(seen as a program) to manipulate as data the entities that represent -its execution state during its own execution. This manipulation can -take two forms: introspection and intercession. - -
-role: a property of a component interface, indicates if this -interface is a client or server interface. - -
-signature: of a component interface, is the name of the language -interface type corresponding to this component interface. - -
-template: a special kind of factory that creates components -that are "isomorphic" to itself. - -
-type: a set of structural properties common to a set of entities -(components and interfaces for instance). - -
-

-C  Change History

- -
- -

Changes from version 2.0

- -
-Changes in the document: - -
- -
    -
  • The Rationale (section 1.1) has been rewritten. -
    -
  • - -
  • Section 2.1 and Appendix A have been rewritten (the IDL is now clearly -presented as a pseudo, non normative IDL, used only for documentation -purposes). -
    -
  • -
- -
- -

Changes from version 1.0

- -
-The document has been completely rewritten. It is now focused exclusively -on the Fractal component model, i.e. the considerations about the -Fractal framework and the associated roles have been removed. All -features of the Fractal model have been made optional, so that the -model can be used in many situations, from embedded software to application -servers. Finally the Fractal model itself has been revised, in order -to clarify and/or simplify some points (binding control, interface -collections...). - -
-Changes in the document: - -
- -
    -
  • Some sections have been completely removed: Requirements (2.2), General -Model (3.1), Framework Increments (4.2), Roles and Responsibilities -(6), Framework Packaging (7), and Bibliography (Appendix B). The material -of the remaining sections has been completely reorganized to improve -clarity. -
    -
  • - -
  • Some completely new sections have been added: Interface Definition -Language (2.1), Options (7), Glossary -(Appendix B). -
    -
  • -
-Major changes in the API: - -
- -
    -
  • The API is now presented with an abstract IDL, not strictly dedicated -to Java. -
    -
  • - -
  • The naming and binding framework which was defined in version 0.7.3, -and removed in version 0.8, has been added back. -
    -
  • - -
  • ComponentIdentity and InterfaceReference have been -renamed and decoupled, and both interfaces are now optional. As a -consequence, InterfaceReference has been replaced with any -in the signature of the getFc[Internal]Interface[s], -lookupFc, and bindFc operations. -
    -
  • - -
  • The BindingController interface has been modified so that -UserBindingController is no longer necessary. This latter -interface has then been removed. -
    -
  • - -
  • Attributes can now be readable, writable or both: attribute controllers -are not forced anymore to define a pair of accessors (getters and -setters). -
    -
  • - -
  • Addition of the SuperController and NameController -interfaces. -
    -
  • - -
  • Templates are now optional. The Template interface has been -slightly modified and renamed into Factory. TemplateFactory -has been simplified and renamed into GenericFactory. -
    -
  • - -
  • The type system semantic has been slightly modified, but not its API. -
    -
  • - -
  • All exceptions are now checked exceptions. -
    -
  • -
- -
- -

Changes from version 0.9

- -
-Changes in the document: - -
- -
    -
  • Minor typographic changes. -
    -
  • - -
  • Sections 4.14 and 5 have been updated to take into account the API -changes (see below). -
    -
  • - -
  • Addition of a "Rationale" paragraph in Section 4.2.1. -
    -
  • - -
  • Addition of an appendix "Features Deferred to Future Releases". -
    -
  • -
-Major changes in the API: - -
- -
    -
  • Removal of setFCControllerDesc and setFCContentDesc -operations in Template. These operations have been replaced -with two new parameters in TemplateFactory.createTemplate. -
    -
  • -
-Minor changes in the API: - -
- -
    -
  • The ...FC... pattern has been replaced with ...Fc... -
    -
  • -
- -
- -

Changes from version 0.8-0

- -
-Changes in the document: - -
- -
    -
  • Section "Roles and Contracts" has moved from Section 3 to Section -6. The role Framework Provider has been refined (and the section has -been renamed "Roles and Responsibilities"). -
    -
  • - -
  • Section "Framework Increments" has been developed - especially -the section "Programming Support Increments". -
    -
  • - -
  • Section "Programming Support Increments" has been removed for -it was mostly Julia-specific. As such it should be available in the -fore coming Julia documentation. This point is linked to the two points -above. -
    -
  • -
-Major changes in the API: - -
- -
    -
  • Removal of the naming system introduced in the previous version of -Fractal. This point is linked to discussions about a potential ObjectWeb -naming system. -
    -
  • - -
  • Introduction of the interface UserBindingController. It is -very close from the interface LocalBindingController of version -0.7.2. Its purpose is to ease call-backs implementation by programmers -in "user components", i.e. Java objects. -
    -
  • - -
  • Refinement of the exceptions management: introduction of Fractal specific -exceptions: - -
    - -
      -
    • NoSuchInterfaceException, IllegalBindingException, -IllegalContentException, IllegalLifeCycleException, -InstantiationException. -
      -
    • -
    -
    -
  • - -
  • Refinement of the instantiation phase of components: introduction -of an additional parameter in the template creation operation createFCTemplate -in TemplateFactory and of two operations setFCControllerDesc -and setFCContentDesc in Template. -
    -
  • -
-Minor changes in the API: - -
- -
    -
  • The Fractal API previously defined in the org.objectweb.fractal -package is now defined in the org.objectweb.fractal.api package. -Fractal implementations will be defined in org.objectweb.fractal.xxx -packages: the Fractal Reference Implementation for instance is defined -in org.objectweb.fractal.julia. -
    -
  • - -
  • Systematization on the usage of a naming convention to prevent name -clashes. All method names are built using the naming convention: verb+"FC"+noun -as in getFCInterfaces. -
    -
  • -
- -
- -

Changes from version 0.7.3-0

- -
-Changes in the document: - -
- -
    -
  • A separate section is now devoted to the running example. -
    -
  • - -
  • Removal of the appendix "Features Deferred To Future Releases" -(which was empty anyway). -
    -
  • - -
  • Addition of the appendix "Bibliography" and bibliographic references -in text. -
    -
  • -
-Major changes in the API: - -
- -
    -
  • Introduction of a naming framework that defines interfaces Name -and NamingContext. Interface InterfaceReference -(defined in package org.objectweb.fractal) now inherits from -Name (defined in org.objectweb.naming). -
    -
  • - -
  • Typed interfaces references: an interface reference (InterfaceReference) -now has the Java type of the interface it references. This is a major -change with respect to the Fractal programming model. The major consequences -are: 1) explicit binding operations (bind) can be avoided (but cast -operations are needed instead) and 2) the bootstrap process is simpler -(a bootstrap component does not have to be a container anymore). -
    -
  • - -
  • Binding controllers now only deal with local bindings (same address -space, same enclosing component). The interface LocalBindingController -has been suppressed. A method check has been introduced (see -below). -
    -
  • -
-Minor changes in the API: - -
- -
    -
  • Name of the java package are changed from org.objectweb.compfw -to org.objectweb.fractal. -
    -
  • - -
  • Replacement of methods createXXXInterfaceType -with one single method createFCItfType with Boolean parameters -(isClient, isOptional, isCollection) in -interface TypeFactory. -
    -
  • - -
  • Addition of a method check (which checks that bindings between -components are really local) in interface ContentController. -
    -
  • -
- -
- diff --git a/web/html/specification/fractal-specification.pdf b/web/html/specification/fractal-specification.pdf deleted file mode 100644 index 24d536853c32af49b45af26e843a6364a4a636cb..0000000000000000000000000000000000000000 Binary files a/web/html/specification/fractal-specification.pdf and /dev/null differ diff --git a/web/html/specification/fractal-specification.ps.gz b/web/html/specification/fractal-specification.ps.gz deleted file mode 100644 index f1e53ff3a533dbbccbed0870c212924d8f3222fd..0000000000000000000000000000000000000000 Binary files a/web/html/specification/fractal-specification.ps.gz and /dev/null differ diff --git a/web/html/specification/fractal.png b/web/html/specification/fractal.png deleted file mode 100644 index 437e560161d8d91fb4111396d5936684b8624cc5..0000000000000000000000000000000000000000 Binary files a/web/html/specification/fractal.png and /dev/null differ diff --git a/web/html/specification/internal-view.png b/web/html/specification/internal-view.png deleted file mode 100644 index 723aa34ba6e609705a0737794923555781b82f21..0000000000000000000000000000000000000000 Binary files a/web/html/specification/internal-view.png and /dev/null differ diff --git a/web/html/specification/objectweb.png b/web/html/specification/objectweb.png deleted file mode 100644 index 38dc11d6fc9e6ad37364a78c56f376a3f33cadef..0000000000000000000000000000000000000000 Binary files a/web/html/specification/objectweb.png and /dev/null differ diff --git a/web/html/specification/sharing.png b/web/html/specification/sharing.png deleted file mode 100644 index 8045cf4af196123b5ddba0cf92bbbf5418ed68a9..0000000000000000000000000000000000000000 Binary files a/web/html/specification/sharing.png and /dev/null differ diff --git a/web/html/specification/templates.png b/web/html/specification/templates.png deleted file mode 100644 index eedf06ca282d4f3803f453dc9e588ffd5999b1a5..0000000000000000000000000000000000000000 Binary files a/web/html/specification/templates.png and /dev/null differ diff --git a/web/html/tutorial/archi.png b/web/html/tutorial/archi.png deleted file mode 100644 index cb73fb00324fb82b3f61f861011fb3103cb7aece..0000000000000000000000000000000000000000 Binary files a/web/html/tutorial/archi.png and /dev/null differ diff --git a/web/html/tutorial/archi2.png b/web/html/tutorial/archi2.png deleted file mode 100644 index 3c55ee906986849072a362e37c866313dd684d02..0000000000000000000000000000000000000000 Binary files a/web/html/tutorial/archi2.png and /dev/null differ diff --git a/web/html/tutorial/fractal-programming.html b/web/html/tutorial/fractal-programming.html deleted file mode 100644 index 2f3ae9d9ad3a0f145445d4e6e0700fd5a643e707..0000000000000000000000000000000000000000 --- a/web/html/tutorial/fractal-programming.html +++ /dev/null @@ -1,2618 +0,0 @@ - - - - - - - - - - - - - - - - - - -
- - -
- -
- -
- -[PDF version] -[PS version] - -
- -
- -
- -
- - - -
- - -


- -
- -
Developing with Fractal
-
-
-
fractal.png
- -
-


- -
- -
- - - - -
AUTHOR :       
E. Bruneton          (France Telecom R&D)
-
- -
-
- -
- - - - - - -
Released    March 10, 2004
Status   Final
Version   1.0.3
-
- -
-
- GENERAL INFORMATION - -
- -
    -
  • Background of front-page image appears courtesy of Giuseppe Zito. -
    -
  • - -
  • Please send technical comments on this document to fractal@objectweb.org -
    -
  • -
-Copyright 2003 France Télécom S.A.
-28, chemin du vieux chêne, 38243, Meylan Cedex, France.
-All rights reserved. - -
- TRADEMARKS - -
-All product names mentioned herein are trademarks of their respective -owners. - -
- DISCLAIMER OF WARRANTIES - -
-This document is provided "as is". France Télécom makes -no representations or warranties, either express or implied, including -but not limited to, warranties of merchantability, fitness for a particular -purpose, or non-infringement that the contents of this document are -suitable for any purpose or that any practice or implementation of -such contents will not infringe any third party patents, copyrights, -trade secrets or other rights. - -
-
- -

Contents

-1  Introduction
-    1.1  What is Fractal?
-    1.2  Content of this document
-    1.3  Target audience
-2  Design
-    2.1  Finding the components
-    2.2  Defining the component architecture
-    2.3  Defining the component contracts
-3  Implementation
-    3.1  Choosing the components' granularity
-    3.2  Implementing the component interfaces
-    3.3  Implementing the components
-4  Configuration
-    4.1  Programmatic configuration
-    4.2  ADL based configuration
-    4.3  GUI based configuration
-5  Reconfiguration
-    5.1  Life cycle management
-    5.2  Introspection
-6  Conclusion
-A  Comanche source code
-B  Comanche architecture definition
- - -
- -
 
- -
-
-

-1  Introduction

- -
-

-1.1  What is Fractal?

- -
-Fractal is a modular and extensible component model that can be used -with various programming languages to design, implement, deploy and -reconfigure various systems and applications, from operating systems -to middleware platforms and to graphical user interfaces. Fractal -is also a project with several sub projects, dealing with the definition -of the model, its implementations, and the implementation of reusable -components and tools on top of it. - -
-The Fractal component model heavily uses the separation -of concerns design principle. The idea of this principle is to separate -into distinct pieces of code or runtime entities the various concerns -or aspects of an application: implementing the service provided -by the application, but also making the application configurable, -secure, available, ... In particular, the Fractal component model -uses three specific cases of the separation of concerns principle: -namely separation of interface and implementation, component -oriented programming, and inversion of control. The first -pattern, also called the bridge pattern, corresponds to the separation -of the design and implementation concerns. The second pattern corresponds -to the separation of the implementation concern into several composable, -smaller concerns, implemented in well separated entities called components. -The last pattern corresponds to the separation of the functional and -configuration concerns: instead of finding and configuring themselves -the components and resources they need, Fractal components are configured -and deployed by an external, separated entity. - -
-The separation of concerns principle is also applied to the structure -of the Fractal components. A Fractal component is indeed composed -of two parts: a content that manages the functional concerns, -and a controller that manages zero or more non functional concerns -(introspection, configuration, security, transactions, ....). The -content is made of other Fractal components, i.e. Fractal components -can be nested at arbitrary levels (Fractal components can also -be shared, i.e. be nested in several components at the same -time). The introspection and configuration interfaces that can be -provided by the controllers allow components to be deployed and reconfigured -dynamically. These control interfaces can be used either programmatically, -or through tools based on them, such as deployment or supervision -tools. - -
-More information about Fractal, including the complete specification -of the component model, and several tutorials, can be found at http://fractal.objectweb.org. - -
-

-1.2  Content of this document

- -
-This tutorial is an introduction to the Fractal component model. It -explains informally how to design (section 2), implement -(section 3), deploy (section 4), -and dynamically reconfigure (section 5) -component based applications with Fractal (and with some associated -tools), in Java, by using a concrete example, namely an extremely -minimal web server. - -
-

-1.3  Target audience

- -
-This document is intended for those that do not know Fractal, and -want to get an overview of this component model, of its motivations -and benefits. If you are in this case, you should read this document -first, before reading any other document about Fractal and, in particular, -before reading the Fractal component model specification. - -
- -

Summary

- -
-
The main characteristics of the Fractal model are -recursion, reflexion and sharing. The Fractal project is made of four -sub projects: model, implementations, components and tools. - -
-
- -
-

-2  Design

- -
-Before programming a component based software system with Fractal, -one must first design it with components and, in particular, -identify the components to be implemented. Note that this component -oriented design task is quite independent from the subsequent component -oriented programming task: at programming time, it is possible to -merge several or even all the design time components into a single, -monolithic piece of code, if desired (but then, of course, one looses -the advantages of component oriented programming: modularity, -adaptability, ...). - -
-This section explains how to design component based applications, -by using a concrete example. The next sections reuse this example -to illustrate how to implement and deploy Fractal component based -applications. This example application is Comanche, an extremely minimal -HTTP server. A classical, non component oriented implementation of -this application, in Java, is shown below: - -
-
public class -Server implements Runnable { - -
-  private Socket s; - -
-  public Server (Socket s) { -this.s = s; } - -
-  public static -void main (String[] args) -throws IOException { - -
-    ServerSocket s = new ServerSocket(8080); - -
-    while (true) -{ new Thread(new Server(s.accept())).start(); -} - -
-  } - -
-  public void -run () { - -
-    try { - -
-      InputStreamReader in = new -InputStreamReader(s.getInputStream()); - -
-      PrintStream out = new PrintStream(s.getOutputStream()); - -
-      String rq = new LineNumberReader(in).readLine(); - -
-      System.out.println(rq); - -
-      if (rq.startsWith("GET -")) { - -
-        File f = new File(rq.substring(5, -rq.indexOf(' ', 4))); - -
-        if (f.exists() -&& !f.isDirectory()) { - -
-          InputStream is = new -FileInputStream(f); - -
-          byte[] data = new -byte[is.available()]; - -
-          is.read(data); - -
-          is.close(); - -
-          out.print("HTTP/1.0 200 OK\n\n"); - -
-          out.write(data); - -
-        } else { - -
-          out.print("HTTP/1.0 404 Not Found\n\n"); - -
-          out.print("<html>Document not -found.</html>"); - -
-        } - -
-      } - -
-      out.close(); - -
-      s.close(); - -
-    } catch (IOException _) -{ } - -
-  } - -
-} - -
-
- -
-As can be seen from the source code, this server accepts connections -on a server socket and, for each connection, starts a new thread to -handle it (in the main method). Each connection is handled -in two steps, in the run method: the request is analyzed -and logged to the standard output, and then the requested file is -sent back to the client (or an error is returned if the file is not -found). - -
-

-2.1  Finding the components

- -
-In a component based application, some components are dynamic, -i.e they can be created and destroyed dynamically, possibly quite -frequently, while other components are static, i.e. their life -time is equal to the life time of the application itself. The dynamic -components generally correspond to datas, while the static -ones generally correspond to services. - -
-In order to identify components in an application, it is easier to -begin by identifying its static components. In other words, one should -begin by identifying the services that are used in the application. -In the case of Comanche, we can immediately identify two main services, -namely a request receiver service and a request processor service -(corresponding to the content of the two methods of the Server -class). But it is also possible to identify other, lower level services. -For example, we can see that the request receiver service uses a thread -factory service, to create a new thread for each request. This thread -factory service can be generalized into a scheduler service that can -be implemented in several ways: sequential, multi thread, multi thread -with a thread pool, and so on. Likewise, we can see that the request -processor uses a request analyzer service, and a logger service, before -effectively responding to a request. This response is itself constructed -by using a file server service, or an error manager service. This -can be generalized into a request dispatcher service that dispatches -requests to several request handlers sequentially, until one handler -can handle the request (we can then imagine file handlers, servlet -handlers, and so on). - -
-After the services have been specified, one can look for the main -data structures, in order to identify the dynamic components. But -the identification of the dynamic components is not mandatory, and -is generally not done, because dynamic components themselves are rarely -used (this means that, at programming time, data structures are generally -not implemented as components, but as ordinary objects - if the programming -language is object oriented). Indeed components do not have many benefits -in the case of highly dynamic, short lived structures (introspection -and dynamic reconfiguration, for instance, are not very useful in -this case). In the case of Comanche we can consider sockets, HTTP -requests, files, streams, and even threads as such data structures. -But we will not map them to dynamic components. - -
-After the services have been specified, one must assign them to components. -Each component can provide one or more services but, unless two services -are very strongly coupled, it is better to use one component per service. -In the case of Comanche, we will use one component per service. We -therefore have the seven following components: request receiver, request -analyzer, request dispatcher, file request handler, error request -handler, scheduler and logger. - -
-

-2.2  Defining the component architecture

- -
-After the components have been identified, it is easy to find the -dependencies between them, and to organize them into composite components. -Indeed the service dependencies are generally identified at the same -time as the services themselves. If it is not the case, dependencies -can also be found by looking at some use cases or scenarios. Likewise, -services are generally identified from high level to lower level services -(or vice versa). It is then easy to find the dependencies and the -abstraction level of each component, since the components correspond -to the previous services. - -
-This is particularly clear in the case of Comanche: indeed, by re -reading the previous section, one can see that the service dependencies -have already been identified. For example, the request receiver service -uses the scheduler service and the request analyzer, the request analyzer -uses the request dispatcher, which itself uses the file and error -request handlers. One can also see that the abstraction levels have -already been found: the request receiver is "made of" the request -receiver itself, plus the scheduler; the request processor is made -of the request analyzer, the logger, and the request handler; the -request handler is itself made of the request dispatcher, and of the -file and error request handlers. All this can be summarized in the -following component architecture: - -
- -
archi.png
- -
-

-2.3  Defining the component contracts

- -
-After the services have been found and organized into components, -and after the component hierarchy and the component dependencies have -been found, only one thing remains to be done to finish the design -phase, namely to define precisely the contracts between the components, -at the syntaxic and semantic level (if possible with a formal language -- such as pre and post conditions, temporal logic formulas, and so -on). Classical object oriented design tools, such as scenarios and -use cases, can be used here. - -
-The component contracts must be designed with care, so as to be the -most stable as possible (changing a contract requires to change several -components, and is therefore more difficult than changing a component). -In particular, these contracts must deal only with the services provided -by the components: nothing related to the implementation or configuration -of the components themselves should appear in these contracts. For -example, a setLogger operation has nothing to do in a component -contract definition: this operation is only needed to set a reference -between a component and a logger component. In other words, contracts -must be defined with separation of concerns in mind -(see section 1): contracts must deal only with -functional concerns; configuration concerns will be dealt with separately, -as well as other concerns such as security, life cycle, transactions... - -
-In the case of Comanche, we will use minimalistic contracts, defined -directly in Java: - -
- -
    -
  • The logger service will provide a single log method, with -a single String parameter; -
    -
  • - -
  • The scheduler component will provide a single schedule method, -with a single Runnable parameter (the role of this method -is to execute the given Runnable at some time after the method -has been called, possibly in a different thread than the caller thread); -
    -
  • - -
  • The request analyzer, the request dispatcher and the file and error -request handlers will all provide a single handleRequest -method, with a single Request parameter that will contain -information about a request: its socket, the input and output streams -of this socket, and the requested URL. This single handleRequest -method will be implemented in several ways, in the different components: - -
    - -
      -
    • the request analyzer will construct the input and output streams, -and will read the input stream to get the requested URL; -
      -
    • - -
    • the request dispatcher will forward each request to its associated -request handlers, sequentially, until one request handler successfully -handles the request; -
      -
    • - -
    • the file request handler will try to find and to send back to the -client the file whose name corresponds to the requested URL, if it -exists; -
      -
    • - -
    • the error request handler will send back to the client an error message, -and will always succeed. -
      -
    • -
    -
    -
  • -
- -
- -

Summary

- -
-
The first step to design a component based application -is to define its components. This is done by finding the services -used in this application. The second step is to find the dependencies -and hierarchical levels of these components. The last step is to define -precisely the contracts between the components. - -
-
- -
-

-3  Implementation

- -
-This section explains how to program Fractal component based applications, -by using the Comanche example. It also introduces and motivates the -concepts and APIs of Fractal that are used. - -
-

-3.1  Choosing the components' granularity

- -
-As explained in section 2, component oriented design -is quite independent from component oriented implementation. In particular, -at programming time, it is possible to merge several or even all the -design time components into a single, monolithic piece of code, if -desired. For example, in the case of Comanche, one may choose to implement -all the design time components into a single class, as shown in section 2. -One may also choose to implement each component in its own class, -or to implement some components in their own class, and to merge some -other components (such as the request dispatcher and its associated -request handlers) into a single class. - -
-Using one runtime component per design time component gives maximum -flexibility and extensibility, but can be less efficient that merging -several design time components into a single runtime component. When -in doubt, the first solution should be preferred: optimizations -can be done later on, if needed. In the case of Comanche, we will -therefore use one runtime component per design time component. - -
-

-3.2  Implementing the component interfaces

- -
-Before implementing the component themselves, the first step is to -implement their interfaces. Indeed the Fractal component model -requires a strict separation between interfaces and -implementation for all components (see section 1). -This design pattern is indeed useful to easily replace one component -implementation with another, without worrying about class inheritance -problems. It also offers the possibility to add interposition objects -between a client and a component implementation, in order to transparently -manage some non functional concerns of the component (as in the Enterprise -Java Beans model - see section 5). The only -drawback of this design pattern is that it is a little less efficient -than a solution without interfaces. This is why it may sometimes be -needed to merge several design time components into a single Fractal -component. - -
-The component interfaces can be implemented easily, since most, if -not all, of the work has been done during the definition of the component -contracts (see section 2.3). In the case of Comanche, -three interfaces must be implemented. They are given below (see Appendix A -for the full source code of Comanche): - -
-
public interface -Logger { void log (String msg); -} - -
-public interface Scheduler -{ void schedule (Runnable task); } - -
-public interface RequestHandler -{ void handleRequest (Request r) throws -IOException; } - -
-
- -
-Note that requests are represented as instances of the Request -class. This choice was made here only to show that classes -can be used in interface method parameters, although this is -not recommended. It is indeed better to use interfaces, even for -data structures that are not represented as components: these data -structures can then be implemented in various ways (including as components), -without needing to change the interfaces that refer to them. Note -also that it would have been better to introduce a request factory -component (this was not done for simplification purposes). - -
-

-3.3  Implementing the components

- -
-Now that the component interfaces have been implemented, we can implement -the components themselves. The components that do not have any dependencies -to other components can be programmed like ordinary Java classes. -For example, the logger and scheduler components can be implemented -as follows: - -
-
public class -BasicLogger implements Logger { - -
-  public void log (String msg) -{ System.out.println(msg); } - -
-} - -
-public class SequentialScheduler -implements Scheduler { - -
-  public synchronized -void schedule (Runnable task) { -task.run(); } - -
-} - -
-public class MultiThreadScheduler -implements Scheduler { - -
-  public void -schedule (Runnable task) { new Thread(task).start(); -} - -
-} - -
-
- -
-In component oriented programming, and in Fractal in particular, the -components that have dependencies to other components must be programmed -in a specific way. Consider for example the request receiver component. -A possible way to implement it, in classical object oriented programming, -is as follows: - -
-
public class -RequestReceiver { - -
-  private Scheduler s = new -MultiThreadScheduler(); - -
-  private RequestHandler rh = -new RequestAnalyzer(); - -
-  // rest of the code not shown - -
-} - -
-
- -
-This approach is clearly not usable in component oriented programming, -since modularity is lost: with this implementation, it is impossible -to change the implementation of the scheduler or of the request analyzer -component used by the request receiver component, without modifying -and recompiling the source code of this component. A better approach -is to use inversion of control (see section 1): - -
-
public class -RequestReceiver { - -
-  private Scheduler s; - -
-  private RequestHandler rh; - -
-  public RequestReceiver (Scheduler -s, RequestHandler rh) { this.s = s; this.rh -= rh; } - -
-  // rest of the code not shown - -
-} - -
-
- -
-This approach solves the modularity problem, but only at deployment -time: it is still impossible to change the scheduler or the request -analyzer used by the request receiver at runtime. Since one -of the goals of Fractal is to support dynamic reconfigurations, the -inversion of control principle must be used in a better way. In fact, -in Fractal, a component with dependencies (or bindings) to -other components must implement the BindingController interface, -defined in the Fractal specification. This interface defines four -generic methods listFc, lookupFc, bindFc -and unbindFc to manage component bindings. In Fractal, the -request receiver component must therefore be implemented as follows: - -
-
public class -RequestReceiver implements Runnable, -BindingController { - -
-  private Scheduler s; - -
-  private RequestHandler rh; - -
-  // configuration concern - -
-  public String[] listFc -() { return new String[] -{ "s", "rh" }; } - -
-  public Object lookupFc (String -itfName) { - -
-    if (itfName.equals("s")) -{ return s; } - -
-    else if -(itfName.equals("rh")) { return -rh; } - -
-    else return -null; - -
-  } - -
-  public void -bindFc (String itfName, Object itfValue) { - -
-    if (itfName.equals("s")) -{ s = (Scheduler)itfValue; } - -
-    else if -(itfName.equals("rh")) { rh = (RequestHandler)itfValue; -} - -
-  } - -
-  public void -unbindFc (String itfName) { - -
-    if (itfName.equals("s")) -{ s = null; } - -
-    else if -(itfName.equals("rh")) { rh = null; -} - -
-  } - -
-  // functional concern - -
-  public void -run () { /* see Appendix A -*/ } - -
-} - -
-
- -
-As can be seen, the listFc method returns the names of the -dependencies of the component, and the lookupFc, bindFc -and unbindFc methods are used to read, set and unset the -corresponding bindings (the s and rh strings do -not have to be equal to the names of the corresponding fields). The -distinction between the controller and content part -of Fractal components (see section 1) can also -be clearly seen here: the controller part corresponds to the BindingController -interface, and the content part to the Runnable interface -(in the logger and scheduler components, the controller part was empty). - -
-For components that can use a collection of similar bindings -to other components, such as the request dispatcher component, each -binding must have a name of the form prefixpostfix -where prefix is common to all the bindings of the collection, -and where postfix is arbitrary, but distinct for each -binding. The request dispatcher component must therefore be implemented -as follows (here the prefix is h; the map used is sorted, -in order to be able to specify a dispatch order through the binding -names, but this is not mandatory): - -
-
public class -RequestDispatcher implements RequestHandler, -BindingController { - -
-  private Map handlers = new -TreeMap(); - -
-  // configuration concern - -
-  public String[] listFc -() { - -
-    return (String[])handlers.keySet().toArray(new -String[handlers.size()]); - -
-  } - -
-  public Object lookupFc (String -itfName) { - -
-    if (itfName.startsWith("h")) -{ return handlers.get(itfName); } - -
-    else return -null; - -
-  } - -
-  public void -bindFc (String itfName, Object itfValue) { - -
-    if (itfName.startsWith("h")) -{ handlers.put(itfName, itfValue); } - -
-  } - -
-  public void -unbindFc (String itfName) { - -
-    if (itfName.startsWith("h")) -{ handlers.remove(itfName); } - -
-  } - -
-  // functional concern - -
-  public void -handleRequest (Request r) throws IOException -{ /* see Appendix A */ } - -
-} - -
-
- -
- -

Summary

- -
-
Components must be implemented with an appropriate -granularity, resulting from a compromise between adaptability and -performance. Their interfaces must be separated from their implementation -(this rule must also be applied for data structures). The implementation -must not contain explicit dependencies to other components to allow -static and dynamic reconfigurations. - -
-
- -
-

-4  Configuration

- -
-This section presents several methods to assemble and deploy Fractal -components, always by using the Comanche example. It also introduces -and motivates the Fractal tools that are used. - -
-

-4.1  Programmatic configuration

- -
-The most direct, but also the lowest level method to assemble and -deploy Fractal components is to write a specific program to do that. -The role of this program is to create the components, to bind them -to each other, and finally to start the application. In the case of -Comanche, this deployment program is the following: - -
-
public class -Server { - -
-  public static -void main (String[] args) { - -
-    RequestReceiver rr = new RequestReceiver(); - -
-    RequestAnalyzer ra = new RequestAnalyzer(); - -
-    RequestDispatcher rd = new RequestDispatcher(); - -
-    FileRequestHandler frh = new FileRequestHandler(); - -
-    ErrorRequestHandler erh = new ErrorRequestHandler(); - -
-    Scheduler s = new MultiThreadScheduler(); - -
-    Logger l = new BasicLogger(); - -
-    rr.bindFc("rh", ra); - -
-    rr.bindFc("s", s); - -
-    ra.bindFc("rh", rd); - -
-    ra.bindFc("l", l); - -
-    rd.bindFc("h0", frh); - -
-    rd.bindFc("h1", erh); - -
-    rr.run(); - -
-  } - -
-} - -
-
- -
-

-4.2  ADL based configuration

- -
-The previous configuration and deployment method has several drawbacks: -it is error prone (it is easy to forget a binding or to create a wrong -binding), the component architecture is not directly visible (the -component's hierarchy description, in particular, is completely lost) -and, most importantly, this method mixes two separate concerns, -namely architecture description and deployment (it is impossible -to deploy a given component architecture in several ways, without -rewriting the configuration/deployment program). - -
-In order to solve these problems, a solution is to use an Architecture -Description Language (ADL). As its name implies, an ADL definition -describes a component architecture, and only that, i.e. its does not -describe the instantiation method. This solves the most important -drawback of the previous configuration method. An ADL is also generally -strongly typed, which allows the ADL parser to perform verifications -about the declared component architecture. Using an ADL is therefore -less error prone than using the programmatic approach. - -
-Fractal ADL is a possible, XML based ADL that can be used to describe -Fractal component configurations. A simplified ADL, not based on XML, -can also be used, and other ADLs can be created if needed (indeed -these ADLs are not part of the Fractal component model itself: they -are just tools based on this model). Fractal ADL is strongly typed. -The first step to define a component architecture is therefore to -define the types of the components. Each component type must specify -what components of this type provide to, and require from other components. -For example, the type of the file and error handler components (but -also of the request handler and backend components - see section 2.2), -in Comanche, can be defined as follows (these components provide a -RequestHandler interface, and do not have dependencies): - -
-
<definition name="comanche.HandlerType"> - -
-  <interface name="rh" -signature="comanche.RequestHandler" -role="server"/> - -
-</definition> - -
-
- -
-Components with dependencies are declared in a similar way. For example, -the type of the request dispatcher component, in Comanche, can be -defined as follows: - -
-
<definition name="comanche.DispatcherType" -extends="comanche.HandlerType"> - -
-  <interface name="h" - -
-      signature="comanche.RequestHandler" -role="client" cardinality="collection"/> - -
-</definition> - -
-
- -
-Note that this type is declared to extend the previous handler -type: this means that the provided and required interface types declared -in the handler type are inherited by the dispatcher type. Note also -the optional cardinality attribute in the interface type definition: -it means that components of this type can have a variable number of -bindings (see end of section 3.3). - -
-After the component types have been defined, the components themselves -can be defined. Here Fractal ADL distinguishes between components -that do not expose their content, called primitive components, and -components that do expose it, called composite components. A primitive -component is defined by specifying its component type and the Java -class that implements it. For example, the file handler component -can be defined as follows: - -
-
<definition name="comanche.FileHandler" -extends="comanche.HandlerType"> - -
-  <content class="comanche.FileRequestHandler"/> - -
-</definition> - -
-
- -
-Composite components are defined by specifying their sub components, -and the bindings between these sub components. For example, the Comanche -composite component, which represents the whole application, and which -contains the frontend and backend components, can be defined as follows -(see Appendix B for the -definitions of the sub components): - -
-
<definition name="comanche.Comanche" -implements="comanche.RunnableType"> - -
-  <component name="fe" -definition="comanche.Frontend"/> - -
-  <component name="be" -definition="comanche.Backend"/> - -
-  <binding client="this.r" -server="fe.r"/> - -
-  <binding client="fe.rh" -server="be.rh"/> - -
-</definition> - -
-
- -
-This definition says that the Comanche component provides a Runnable -interface (to start the application), that it contains two sub components -named fe and be, that the Runnable interface -provided by Comanche (this.r) is provided by the Runnable -interface of its frontend sub component (fe.r), and that -the request handler required by the frontend sub component (fe.rh) -is provided by the backend component (be.rh). - -
-Once the application's architecture has been defined, it can either -be compiled, which gives a Java class, in source code, similar to -the Server class shown in section 4.1, -or it can be directly interpreted. In both case, the Fractal ADL parser -performs preliminary verifications to check the architecture and, -in particular, to check that there is no missing or invalid binding. - -
-

-4.3  GUI based configuration

- -
-Using an ADL is better than using a programmatic approach, but does -not help a lot to visualize the architecture of an application. To -solve this problem, the best solution is to use a graphical tool such -as Fractal GUI, which is shown below: - -
- -
fractalgui.png
- -
-This tool can be used to graphically and interactively visualize, -define or modify component architectures. The edited architectures -can then be saved in various ADLs (currently only the Fractal ADL -is supported). - -
- -

Summary

- -
-
Components can be configured and deployed in three -different ways. The programmatic approach is the most direct but mixes -different concerns. The ADL based approach correctly separates these -concerns. The graphical and interactive approach also solves this -problem and, in addition, provides a better architectural representation. - -
-
- -
-

-5  Reconfiguration

- -
-This section explains how Fractal component based applications can -be dynamically reconfigured. It also introduces and motivates the -concepts and APIs of Fractal that are used. - -
-

-5.1  Life cycle management

- -
-In order to reconfigure an application, the easiest solution is to -stop it, to modify its architecture description, and then to restart -it. But this solution is not always possible, in particular if the -service provided by the application must not be interrupted. In these -cases, the application must be reconfigured at runtime, i.e. while -it is in execution. But this solution has its own drawbacks: in general, -if the reconfiguration process is not carefully synchronized with -the normal application activities, the application's state may become -inconsistent, or the application may simply crash. A basic practice -to realize this synchronization is to temporarily suspend the -normal application activities in the (hopefully small) part of the -application that needs to be reconfigured. This is what is called -life cycle management in Fractal. - -
-As an example, let us suppose we want to replace, in a Comanche server, -the file request handler component with a new implementation that -can manage both files and directories. We will consider here that -the HTTP server must be always available, so that the previous change -must be done dynamically, while the server is running. If rd -is a reference to the request dispatcher component, this reconfiguration -can be done with the following instructions: - -
-
RequestHandler rh = new FileAndDirectoryRequestHandler(); - -
-rd.unbindFc("h0"); - -
-rd.bindFc("h0", rh); - -
-
- -
-But this reconfiguration method may produce undefined results, or -even errors. Indeed the RequestDispatcher component uses -a TreeMap to manage its bindings (see end of section 3.3), -but this class does not support concurrent accesses. Modifying this -map in a reconfiguration thread, while it is also accessed, via an -iterator, in the applicative threads that execute the handleRequest -method, may therefore cause errors or inconsistencies. - -
-In order to solve this problem, a generic solution is to 1) temporarily -suspend the application activities in the request dispatcher component, -2) execute the above reconfiguration instructions, and 3) resume the -application activities. In order to do that the request dispatcher -component must implement the LifeCycleController interface, -defined in the Fractal specification. This interface defines two methods -startFc and stopFc, to suspend and resume the application -activities in a component, and an additional getFcState method. -A possible way to implement this interface is to use a counter of -the number of threads that are currently executing a functional method, -and to wait for this counter to become null to stop the component: - -
-
public class -RequestDispatcher implements RequestHandler, -BindingController, LifeCycleController { - -
-  private boolean started; - -
-  private int counter; - -
-  public String getFcState () { - -
-    return started ? STARTED : STOPPED; - -
-  } - -
-  public synchronized -void startFc () { - -
-    started = true; - -
-    notifyAll(); - -
-  } - -
-  public synchronized -void stopFc () { - -
-    while (counter > 0) { try -{ wait(); } catch (InterruptedException -_) {} } - -
-    started = false; - -
-  } - -
-  public void handleRequest -(Request r) throws IOException { - -
-    synchronized (this) -{ - -
-      while (counter == 0 && !started) -{ try { wait(); } catch -(InterruptedException _) {} } - -
-      ++counter; - -
-    } - -
-    try { - -
-      // original code - -
-    } finally { - -
-      synchronized (this) -{ - -
-        -counter; - -
-        if (counter == 0) { notifyAll(); -} - -
-      } - -
-    } - -
-  } - -
-  // rest of the class unchanged - -
-} - -
-
- -
-A better solution is to completely separate this life cycle management -concern from the functional concern, in order to be able to instantiate -the request dispatcher component with or without life cycle management -(this management adds an overhead to the functional methods, which -we do not want to pay if dynamic reconfigurations are not needed). -This can be done easily, thanks to the separation between interface -and implementation, by using, between the request analyzer and the -(unmodified) request dispatcher component, an interceptor of the following -form: - -
-
public class -Interceptor implements RequestHandler, -LifeCycleController { - -
-  public RequestHandler delegate; - -
-  private boolean started; - -
-  private int counter; - -
-  public String getFcState () { /* -as above */ } - -
-  public synchronized -void startFc () { /* as above -*/ } - -
-  public synchronized -void stopFc () { /* as above -*/ } - -
-  public void handleRequest -(Request r) throws IOException { - -
-    synchronized (this) -{ /* as above */ } - -
-    try { - -
-      delegate.handleRequest(r); - -
-    } finally { - -
-      synchronized (this) -{ /* as above */ } - -
-    } - -
-  } - -
-} - -
-
- -
-This interceptor can also implement the BindingController -interface by delegation. It can therefore becomes equivalent to the -modified request dispatcher component described above, and can in -fact be seen as a request dispatcher component with life cycle management, -encapsulating a request dispatcher component without this control -interface. This can be represented as follows: - -
- -
lifecycle.png
- -
-We can see here the advantages of separating the architecture description -from the instantiation method. Indeed the Comanche architecture, described -only once, can now be instantiated either as described in section 4, -or with automatically generated encapsulating components, i.e. -"interceptors" like the above one, around some or all the primitive -components. - -
-We can also see here that the distinction between the controller and -content parts is mainly a design distinction (controllers and contents -are defined as abstract entities in the Fractal specification): -in practice, these two parts are not necessarily implemented by distinct -objects (the controller and content parts of the nested component -are in a single object, but the controller and content part of the -encapsulating component are distinct objects - but this is not mandatory: -the encapsulating component can also be automatically generated as -a sub class of the nested component's class!). - -
-

-5.2  Introspection

- -
-In order to dynamically reconfigure a component based application, -one must first get the reference of the components to be reconfigured. -For example, in the example of the previous section, the reference -rd of the request dispatcher component was needed. One way -of doing this is to start from the reference of a "well known" -component, and to navigate in the application with the BindingController.lookupFc -method. For example, the rd reference can be obtained from -the reference rr of the request receiver component with the -following expression: ((BindingController)rr.lookupFc("rh")).lookupFc("rh"). -But this method only works for small applications. For more complicated -applications, with hundreds of components and many hierarchical levels -of composite components, and for applications whose architecture evolves -at runtime, it is not very realistic. In such cases, a more realistic -solution is to create and to maintain consistent, at runtime, a full -description of the component architecture, including the composite -components, so that the component architecture can be fully introspected -dynamically. - -
-This full introspection can be done, in the Fractal component model, -by instantiating, in addition to the primitive components (and optional -encapsulating components to manage some non functional concerns), -the composite components described in the component architecture. -In addition, it must also be ensured that all these components provide -the necessary interfaces to provide information about themselves. -BindingController is one of these interfaces (with its listFc -and lookupFc methods), but it is not sufficient. One must -also be able to find the sub components of a composite component and, -before that, one must also be able to find the interfaces provided -by a component. The ContentController and Component -interfaces, specified in the Fractal component model, are defined -precisely for this goal. In Java, these interfaces are defined as -follows (see the Fractal specification for more details): - -
-
public interface -Component { - -
-  Object[] getFcInterfaces (); - -
-  Object getFcInterface (String itfName); - -
-  Type getFcType (); - -
-} - -
-public interface ContentController -{ - -
-  Object[] getFcInternalInterfaces (); - -
-  Object getFcInterfaceInterface(String itfName); - -
-  Component[] getFcSubComponents (); - -
-  void addFcSubComponent (Component -c); - -
-  void removeFcSubComponent(Component -c); - -
-} - -
-
- -
-When the Comanche application is instantiated with full introspection -capabilities, the result is the following architecture (C, -BC, CC and LC stands for Component, -BindingController, ContentController and LifeCycleController -respectively; note also that the components without life cycle management -encapsulated in the primitive components are not shown): - -
- -
archi2.png
- -
- -

Summary

- -
-
Fractal provides some basic tools to allow dynamic -reconfiguration, namely reflexion and life cycle management. But dynamic -reconfiguration is difficult and not yet completely solved in Fractal -(in particular, state management is not yet specified). - -
-
- -
-

-6  Conclusion

- -
-The Fractal component model uses well known design patterns, and organizes -them into a uniform, language independent model, that can be applied -to operating systems, middleware platforms or graphical user interfaces. - -
-The Fractal component model brings several benefits: it enforces the -definition of a good, modular design; it enforces the separation of -interface and implementation, which ensures a minimum level of flexibility; -it enforces the separation between the functional, configuration and -deployment concerns, which allows the application's architecture to -be described separately from the code, for example by using an Architecture -Description Language, and allows applications to be instantiated in -various ways (from fully optimized but unreconfigurable configurations -to less efficient but fully dynamically reconfigurable configurations). -All these features should reduce the development time, and should -also increase the reusability of components and component architectures, -i.e. they should increase productivity. - -
-The Fractal component model and its associated tools, although not -yet as stable as other component models such the Enterprise Java Beans -model, are ready to be used, and have already been used successfully -in several applications such as THINK, a library of Fractal components -to build operating system kernels, Speedo, an implementation of the -Java Data Object (JDO) specification, or Fractal GUI, the graphical -tool to edit Fractal component configurations. - -
-More information about Fractal, including the complete specification -of the component model, and several tutorials, can be found at http://fractal.objectweb.org. - -
-

-A  Comanche source code

- -
-Here is the full source code of Comanche: - -
-
/* =============== Component interfaces =============== -*/ - -
-  - -
-public interface RequestHandler -{ - -
-  void handleRequest (Request -r) throws IOException; - -
-} - -
-  - -
-public interface Scheduler -{ - -
-  void schedule (Runnable task); - -
-} - -
-  - -
-public interface Logger -{ - -
-  void log (String msg); - -
-} - -
-  - -
-public class Request -{ - -
-  public Socket s; - -
-  public Reader in; - -
-  public PrintStream out; - -
-  public String url; - -
-  public Request (Socket s) { -this.s = s; } - -
-} - -
-  - -
-/* =============== Component implementations =============== -*/ - -
-  - -
-public class BasicLogger -implements Logger { - -
-  public void log (String msg) -{ System.out.println(msg); } - -
-} - -
-  - -
-public class SequentialScheduler -implements Scheduler { - -
-  public synchronized -void schedule (Runnable task) { -task.run(); } - -
-} - -
-  - -
-public class MultiThreadScheduler -implements Scheduler { - -
-  public void -schedule (Runnable task) { new Thread(task).start(); -} - -
-} - -
-  - -
-public class FileRequestHandler -implements RequestHandler { - -
-  public void -handleRequest (Request r) throws IOException -{ - -
-    File f = new File(r.url); - -
-    if (f.exists() && !f.isDirectory()) { - -
-      InputStream is = new FileInputStream(f); - -
-      byte[] data = new byte[is.available()]; - -
-      is.read(data); - -
-      is.close(); - -
-      r.out.print("HTTP/1.0 200 OK\n\n"); - -
-      r.out.write(data); - -
-    } else { throw -new IOException("File -not found"); } - -
-  } - -
-} - -
-  - -
-public class ErrorRequestHandler -implements RequestHandler { - -
-  public void -handleRequest (Request r) throws IOException -{ - -
-    r.out.print("HTTP/1.0 404 Not Found\n\n"); - -
-    r.out.print("<html>Document not found.</html>"); - -
-  } - -
-} - -
-  - -
-public class RequestDispatcher -implements RequestHandler, BindingController -{ - -
-  private Map handlers = new -TreeMap(); - -
-  // configuration concern - -
-  public String[] listFc -() { - -
-    return (String[])handlers.keySet().toArray(new -String[handlers.size()]); - -
-  } - -
-  public Object lookupFc (String -itfName) { - -
-    if (itfName.startsWith("h")) -{ return handlers.get(itfName); } - -
-    else return -null; - -
-  } - -
-  public void -bindFc (String itfName, Object itfValue) { - -
-    if (itfName.startsWith("h")) -{ handlers.put(itfName, itfValue); } - -
-  } - -
-  public void -unbindFc (String itfName) { - -
-    if (itfName.startsWith("h")) -{ handlers.remove(itfName); } - -
-  } - -
-  // functional concern - -
-  public void -handleRequest (Request r) throws IOException -{ - -
-    Iterator i = handlers.values().iterator(); - -
-    while (i.hasNext()) { - -
-      try { - -
-        ((RequestHandler)i.next()).handleRequest(r); - -
-        return; - -
-      } catch (IOException -_) { } - -
-    } - -
-  } - -
-} - -
-  - -
-public class RequestAnalyzer -implements RequestHandler, BindingController -{ - -
-  private Logger l; - -
-  private RequestHandler rh; - -
-  // configuration concern - -
-  public String[] listFc -() { return new String[] -{ "l", "rh" }; } - -
-  public Object lookupFc (String -itfName) { - -
-    if (itfName.equals("l")) -{ return l; } - -
-    else if -(itfName.equals("rh")) { return -rh; } - -
-    else return -null; - -
-  } - -
-  public void -bindFc (String itfName, Object itfValue) { - -
-    if (itfName.equals("l")) -{ l = (Logger)itfValue; } - -
-    else if -(itfName.equals("rh")) { rh = (RequestHandler)itfValue; -} - -
-  } - -
-  public void -unbindFc (String itfName) { - -
-    if (itfName.equals("l")) -{ l = null; } - -
-    else if -(itfName.equals("rh")) { rh = null; -} - -
-  } - -
-  // functional concern - -
-  public void -handleRequest (Request r) throws IOException -{ - -
-    r.in = new InputStreamReader(r.s.getInputStream()); - -
-    r.out = new PrintStream(r.s.getOutputStream()); - -
-    String rq = new LineNumberReader(r.in).readLine(); - -
-    l.log(rq); - -
-    if (rq.startsWith("GET -")) { - -
-      r.url = rq.substring(5, rq.indexOf(' ', 4)); - -
-      rh.handleRequest(r); - -
-    } - -
-    r.out.close(); - -
-    r.s.close(); - -
-  } - -
-} - -
-  - -
-public class RequestReceiver -implements Runnable, BindingController { - -
-  private Scheduler s; - -
-  private RequestHandler rh; - -
-  // configuration concern - -
-  public String[] listFc -() { return new String[] -{ "s", "rh" }; } - -
-  public Object lookupFc (String -itfName) { - -
-    if (itfName.equals("s")) -{ return s; } - -
-    else if -(itfName.equals("rh")) { return -rh; } - -
-    else return -null; - -
-  } - -
-  public void -bindFc (String itfName, Object itfValue) { - -
-    if (itfName.equals("s")) -{ s = (Scheduler)itfValue; } - -
-    else if -(itfName.equals("rh")) { rh = (RequestHandler)itfValue; -} - -
-  } - -
-  public void -unbindFc (String itfName) { - -
-    if (itfName.equals("s")) -{ s = null; } - -
-    else if -(itfName.equals("rh")) { rh = null; -} - -
-  } - -
-  // functional concern - -
-  public void -run () { - -
-    try { - -
-      ServerSocket ss = new ServerSocket(8080); - -
-      while (true) { - -
-        final Socket socket -= ss.accept(); - -
-        s.schedule(new Runnable -() { - -
-          public void -run () { - -
-            try { -rh.handleRequest(new Request(socket)); -} catch (IOException _) { } - -
-          } - -
-        }); - -
-      } - -
-    } catch (IOException e) -{ e.printStackTrace(); } - -
-  } - -
-} - -
-
- -
-

-B  Comanche architecture definition

- -
-Here are the Fractal ADL definitions describing the Comanche architecture: - -
-
<!- ============== Component types ============== --> - -
-  - -
-<definition name="comanche.RunnableType"> - -
-  <interface name="r" -signature="java.lang.Runnable" -role="server"/></provides> - -
-</definition> - -
-  - -
-<definition name="comanche.FrontendType" -extends="comanche.RunnableType"> - -
-  <interface name="rh" -signature="comanche.RequestHandler" -role="client"/> - -
-</definition> - -
-  - -
-<definition name="comanche.ReceiverType" -extends="comanche.FrontendType"> - -
-  <interface name="s" -signature="comanche.Scheduler" -role="client"/> - -
-</definition> - -
-  - -
-<definition name="comanche.SchedulerType"> - -
-  <interface name="s" -signature="comanche.Scheduler" -role="server"/> - -
-</definition> - -
-  - -
-<definition name="comanche.HandlerType"> - -
-  <interface name="rh" -signature="comanche.RequestHandler" -role="server"/> - -
-</definition> - -
-  - -
-<definition name="comanche.AnalyzerType"> - -
-  <interface name="a" -signature="comanche.RequestHandler" -role="server"/> - -
-  <interface name="rh" -signature="comanche.RequestHandler" -role="client"/> - -
-  <interface name="l" -signature="comanche.Logger" -role="client"/> - -
-</definition> - -
-  - -
-<definition name="comanche.LoggerType"> - -
-  <interface name="l" -signature="comanche.Logger" -role="server"/> - -
-</definition> - -
-  - -
-<definition name="comanche.DispatcherType" -extends="comanche.HandlerType"> - -
-  <interface name="h" - -
-      signature="comanche.RequestHandler" -role="client" cardinality="collection"/> - -
-</definition> - -
-  - -
-<!- ============== Primitive components ============== -> - -
-  - -
-<definition name="comanche.Receiver" -extends="comanche.ReceiverType"> - -
-  <content class="comanche.RequestReceiver"/> - -
-</definition> - -
-  - -
-<definition name="comanche.SequentialScheduler" -extends="comanche.SchedulerType"> - -
-  <content class="comanche.SequentialScheduler"/> - -
-</definition> - -
-  - -
-<definition name="comanche.MultiThreadScheduler" -extends="comanche.SchedulerType"> - -
-  <content class="comanche.MultiThreadScheduler"/> - -
-</definition> - -
-  - -
-<definition name="comanche.Analyzer" -extends="comanche.AnalyzerType"> - -
-  <content class="comanche.RequestAnalyzer"/> - -
-</definition> - -
-  - -
-<definition name="comanche.Logger" -extends="comanche.LoggerType"> - -
-  <content class="comanche.BasicLogger"/> - -
-</definition> - -
-  - -
-<definition name="comanche.Dispatcher" -extends="comanche.DispatcherType"> - -
-  <content class="comanche.RequestDispatcher"/> - -
-</definition> - -
-  - -
-<definition name="comanche.FileHandler" -extends="comanche.HandlerType"> - -
-  <content class="comanche.FileRequestHandler"/> - -
-</definition> - -
-  - -
-<definition name="comanche.ErrorHandler" -extends="comanche.HandlerType"> - -
-  <content class="comanche.ErrorRequestHandler"/> - -
-</definition> - -
-  - -
-<!- ============== Composite components ============== -> - -
-  - -
-<definition name="comanche.Handler" -extends="comanche.HandlerType"> - -
-  <component name="rd" -definition="comanche.Dispatcher"/> - -
-  <component name="frh" -definition="comanche.FileHandler"/> - -
-  <component name="erh" -definition="comanche.ErrorHandler"/> - -
-  <binding client="this.rh" -server="rd.rh"/> - -
-  <binding client="rd.h0" -server="frh.rh"/> - -
-  <binding client="rd.h1" -server="erh.rh"/> - -
-</definition> - -
-  - -
-<definition name="comanche.Backend" -extends="comanche.HandlerType"> - -
-  <component name="ra" -definition="comanche.Analyzer"/> - -
-  <component name="rh" -definition="comanche.Handler"/> - -
-  <component name="l" -definition="comanche.Logger"/> - -
-  <binding client="this.rh" -server="ra.a"/> - -
-  <binding client="ra.rh" -server="rh.rh"/> - -
-  <binding client="ra.l" -server="l.l"/> - -
-</definition> - -
-  - -
-<definition name="comanche.Frontend" -extends="comanche.FrontendType"> - -
-  <component name="rr" -definition="comanche.Receiver"/> - -
-  <component name="s" -definition="comanche.MultiThreadScheduler"/> - -
-  <binding client="this.r" -server="rr.r"/> - -
-  <binding client="rr.s" -server="s.s"/> - -
-  <binding client="rr.rh" -server="this.rh"/> - -
-</definition> - -
-  - -
-<definition name="comanche.Comanche" -extends="comanche.RunnableType"> - -
-  <component name="fe" -definition="comanche.Frontend"/> - -
-  <component name="be" -definition="comanche.Backend"/> - -
-  <binding client="this.r" -server="fe.r"/> - -
-  <binding client="fe.rh" -server="be.rh"/> - -
-</definition> - -
-
- diff --git a/web/html/tutorial/fractal-programming.pdf b/web/html/tutorial/fractal-programming.pdf deleted file mode 100644 index 899f30e8a30ef18604155a973a406a59660d80f6..0000000000000000000000000000000000000000 Binary files a/web/html/tutorial/fractal-programming.pdf and /dev/null differ diff --git a/web/html/tutorial/fractal-programming.ps.gz b/web/html/tutorial/fractal-programming.ps.gz deleted file mode 100644 index be4404dd64fe937524c71b6874c0bc25a8f72ecd..0000000000000000000000000000000000000000 Binary files a/web/html/tutorial/fractal-programming.ps.gz and /dev/null differ diff --git a/web/html/tutorial/fractal.png b/web/html/tutorial/fractal.png deleted file mode 100644 index 437e560161d8d91fb4111396d5936684b8624cc5..0000000000000000000000000000000000000000 Binary files a/web/html/tutorial/fractal.png and /dev/null differ diff --git a/web/html/tutorial/fractalgui.png b/web/html/tutorial/fractalgui.png deleted file mode 100644 index ad9a4e53c5660fe26b501f67fd6838f03ea9b6f0..0000000000000000000000000000000000000000 Binary files a/web/html/tutorial/fractalgui.png and /dev/null differ diff --git a/web/html/tutorial/lifecycle.png b/web/html/tutorial/lifecycle.png deleted file mode 100644 index b5ca01addc3db550ed86580c8ec0ecb1bee157f1..0000000000000000000000000000000000000000 Binary files a/web/html/tutorial/lifecycle.png and /dev/null differ diff --git a/web/html/tutorials/adl/body.html b/web/html/tutorials/adl/body.html deleted file mode 100644 index 7e14c5c836e7e7602f7c37b97da0b7c138a0282d..0000000000000000000000000000000000000000 --- a/web/html/tutorials/adl/body.html +++ /dev/null @@ -1,709 +0,0 @@ -


-
Fractal ADL Tutorial
-


- -
- - - -
AUTHOR :       
E. Bruneton          (France Telecom R&D)
-
- -
- -
- - - -
Version   1.2
Released    March 10, 2004
-
- -
- -


- -

1 Introduction

-The Fractal Architecture Description Language (ADL) is an open and -extensible language to define component architectures for the Fractal -component model, which is itself open and extensible. More precisely, -the Fractal ADL is made of an open and extensible set of ADL modules, were each module defines -an abstract syntax for a -given architectural "aspect" (such as interfaces, bindings, attributes, -or containment relationships). Users are then free to define their own -modules for their own aspects. They can also define their own concrete -syntax for the language.
-
-This tutorial presents the modules that are included in the Fractal ADL -distribution, and uses the default XML based syntax for code samples -(these code samples are available in the Fractal ADL distribution, in -the "HelloWorld" example).
-

2 Primitive components

-A primitive component can be defined by specifying the interfaces it -provides, the interfaces it requires, and the class that implements -this component:
-
-<?xml version="1.0" -encoding="ISO-8859-1" ?>
-<!DOCTYPE definition PUBLIC
-    "-//objectweb.org//DTD Fractal ADL 2.0//EN"
-    -"classpath://org/objectweb/fractal/adl/xml/basic.dtd">

-
-<definition -name="ClientImpl">
-  <interface name="r" role="server" -signature="java.lang.Runnable"/>
-  <interface name="s" -role="client" -signature="Service"/>
-  <content -class="ClientImpl"/>
-</definition>
-
-The above definition defines the "ClientImpl" component. The header -specifies the XML version, the encoding used, and the location of the -basic Fractal ADL DTD. The first line inside "ClientImpl" defines a -provided (or "server") interface, whose name is "r" and whose signature -is "java.lang.Runnable". The second line defines a required (or -"client") interface named "s", and the third line specifies that the -component is implemented by the "ClientImpl" class (the name of the -definition does not need to be the same as the class name, although -this convention is frequently used).
-
-Note: by default the cardinality and contingency of an interface is -"singleton" and "mandatory", respectively. Other values can be -specified like this:
-
-<interface name="..." -role="...." signature="..." cardinality="collection" -contingency="optional"/>
-

3 Composite components

-A composite component can be defined by specifying the interface it -provides, the interfaces it requires, the sub components it contains, -and the bindings between these sub components, and the composite -component itself (XML headers are omitted in the rest of this document):
-
-<definition -name="HelloWorld">
-  <interface name="r" -role="server" signature="java.lang.Runnable"/>
-  <component -name="client">
-    <interface -name="r" role="server" signature="java.lang.Runnable"/>
-    <interface -name="s" role="client" signature="Service"/>
-    <content -class="ClientImpl"/>
-  </component>
-  <component -name="server">
-    <interface -name="s" role="server" signature="Service"/>
-    <content -class="ServerImpl"/>
-  </component>
-  <binding -client="this.r" server="client.r"/>
-  <binding -client="client.s" server="server.s"/>
-</definition>
-
-The above definition defines the "HelloWorld" component. The first line -defines a provided interface named "r". The following five lines define -a primitive sub component named "client", which is equal to the -primitive component introduced in the previous section. The following -four lines define another primitive sub component named "server", with -a single provided interface named "s". The last two lines define a -binding from the internal client interface "r" of the composite -component (designated by "this") to the server interface "r" of the -client component, and a binding from the "s" client interface of the -"client" component to the "s" server interface of the "server" -component.
-

4 Component controllers

-The controller of a primitive or composite component can be specified -by defining a controller descriptor, as well as an attribute controller -interface, and attribute values:
-
-<definition -name="ServerImpl">
-  <interface name="s" -role="server" signature="Service"/>
-  <content -class="ServerImpl"/>
-  -<attributes signature="ServiceAttributes">
-    -<attribute name="header" value="->"/>
-    -<attribute name="count" value="1"/>
-  -</attributes>
-  -<controller desc="primitive"/>
-</definition>
-
-The above definition specifies that the "ServerImpl" component has a -"primitive" controller, and an attribute controller interface whose -signature is "ServiceAttribute". It also defines values for the -"header" and "count" attributes.
-

5 Component references

-

5.1 Simple references

-A sub component of a composite component can be defined in two ways: -either directly inside the definition of the composite component -itself, or in another definition. In the last case, the composite -component definition just contains a reference to the external -definition:
-
-<definition -name="HelloWorld">
-  <interface name="r" -role="server" signature="java.lang.Runnable"/>
-  <component -name="client" definition="ClientImpl"/>
-  <component name="server">
-    <interface -name="s" role="server" signature="Service"/>
-    <content -class="ServerImpl"/>
-  </component>
-  <binding -client="this.r" server="client.r"/>
-  <binding -client="client.s" server="server.s"/>
-</definition>
-
-Embedded definitions are more concise than external definitions, but -they are less reusable. Using embedded definitions is therefore not -recommanded, except for definitions that are anyhow not reusable. Note -that embedded and external definitions can be mixed arbitrarily.
-

5.2 Inheritance references

-Component definitions can be defined by extending existing definitions. The -extension mechanism is similar to class inheritance, i.e. a sub definition can add and override elements in its super definition. This mechanism -can be used to define concrete components as sub definitions of -abstract component definitions:
-
-<definition -name="ClientType">
-  <interface name="r" role="server" -signature="java.lang.Runnable"/>
-  <interface name="s" -role="client" -signature="Service"/>
-</definition>
-

-<definition name="ClientImpl" extends="ClientType">

-  <content -class="ClientImpl"/>
-
</definition>
-
-The "ClientImpl" definition defined here is equivalent to the -"ClientImpl" definition of section 2, because the above "ClientImpl" -definition inherits the -interfaces defined in "ClientType". This pattern can also be used for -composite components:
-
-<definition -name="AbstractClientServer">
-  <interface name="r" -role="server" signature="java.lang.Runnable"/>
-  <component -name="client" definition="ClientType"/>
-  <component name="server" -definition="ServerType"/>
-  <binding client="this.r" -server="client.r"/>
-  <binding -client="client.s" server="server.s"/>
-</definition>
-
-
<definition name="ClientServerImpl" -extends="AbstractClientServer">
-  <component name="client" -definition="ClientImpl"/>
-  <component name="server" -definition="ServerImpl"/>
-</definition>
-
-
The "ClientServerImpl" definition is equivalent to the -"HelloWorld" definition of section 3 because the "ClientServerImpl" -definition overrides the -"client" and "server" sub component definitions of -"AbstractClientServer", and because it inherits the bindings defined in -"AbstractClientServer".
-
-A definition can be locally extended when defining a sub component by -reference:
-
-<definition -name="ClientServerImpl">
-  <interface name="r" -role="server" signature="java.lang.Runnable"/>
-  <component -name="client" definition="ClientType">
-    <content class="ClientImpl"/>
-  </component>
-
  <component name="server" definition="ServerType">
-    <content class="ServerImpl"/>
-  </component>
-
  <binding client="this.r" -server="client.r"/>
-  <binding -client="client.s" server="server.s"/>
-</definition>
-
-The above definition is equivalent to the previous one, because the -external definitions "ClientType" and "ServerType" are locally -extended, in the "client" and "server" sub component definitions, which -add class definitions to the component type definitions (these -anonymous sub definitions are similar to anonymous inner classes in -Java).
-
-The "extends" and "definition" attributes can contain a comma separated -list of definition names. In other words, multiple inheritance is -allowed for component definitions. Conflicts are solved by -systematically linearizing the inheritance graph. For example, if -A1Type, A2Type, AType and BType are defined by:
-
-<definition name="A1Type">
-  <interface name="a" -role="server" signature="A1"/>
-</definition>
-<definition name="A2Type">
-  <interface name="a" -role="server" signature="A2"/>
-</definition>
-<definition name="AType" extends="A1Type,A2Type"/>
-<definition name="BType" extends="A2Type,A1Type"/>
-
-then AType is equivalent to A2Type (because AType is equivalent to an -AType extending an A2Type, itself extending the A1Type). Similarly, -BType is equivalent to A1Type.
-

5.3 Shared components

-Shared components are defined by using paths: in order for the -components "a/server" and "b/server" to be physically equal (where -"a/server" refers to the "server" sub component of the "a" sub -component), one component must be defined as usual, and the other must -be defined by giving the path from the currently defined component to -the first one:
-
-<definition -name="SharedHelloWorld">
-  <interface name="r" -role="server" -signature="java.lang.Runnable"/>
-  <component name="a" -definition="HelloWorld"/>
-  <component name="b" -definition="HelloWorld">
-    <component -name="server" definition="a/server"/>
-  </component>
-  <binding -client="this.r" server="a.r"/>
-</definition>
-
-The above definition defines a composite component named -"SharedHelloWorld" that contains two sub components "a" and "b", which -themselves contain a "client" and a "server" component (as defined in -"HelloWorld"). However the definition of the "server" sub component of -the "b" component has been overriden, and now refers to the "server" -sub component of the "a" sub component of the currently defined -component (i.e. SharedHelloWorld"). The effect of this definition is -that "a/server" and "b/server" will be a single component shared by "a" -and "b".
-

5.4 Mixed definitions

-A component definition can refer to or extend a definition that is not -defined with the same ADL modules, or with the same concrete syntax, so -that independently developped components can still be composed together -to build larger systems or applications (indeed, since the Fractal ADL -is extensible, independently developped component definitions will -likely use different modules and syntax). For example, a component -defined by using the basic DTD can refer to a component type defined by -using the core DTD, although the two DTDs do not include the same set -of ADL modules):
-
-ClientType.fractal:
-
-<?xml version="1.0" -encoding="ISO-8859-1" ?>
-<!DOCTYPE definition PUBLIC
-    "-//objectweb.org//DTD Fractal ADL 2.0//EN"
-    "classpath://org/objectweb/fractal/adl/xml/core.dtd">

-
-<definition -name="ClientType">
-  <interface name="r" role="server" -signature="java.lang.Runnable"/>
-  <interface name="s" -role="client" -signature="Service"/>
-</definition>
-

-ClientImpl.fractal:
-
-<?xml version="1.0" -encoding="ISO-8859-1" ?>
-<!DOCTYPE definition PUBLIC
-    "-//objectweb.org//DTD Fractal ADL 2.0//EN"
-    "classpath://org/objectweb/fractal/adl/xml/basic.dtd">

-
-<definition name="ClientImpl" extends="ClientType">
-  <content -class="ClientImpl"/>
-</definition>

-

6 Arguments

-The "arguments" module (only available with the -"standard.dtd" DTD) provides the ability to define components with -formal arguments, whose value can be fixed at load time, i.e. when the -component definition is loaded in order to instantiate a corresponding -component. Formal arguments must be defined in the "arguments" -attribute of the "definition" element, and must be referenced with the -"${...}" notation:
-
-<definition -name="GenericServerImpl" arguments="impl,header,count">
-  <interface name="s" -role="server" signature="Service"/>
-  <content class="${impl}"/>
-  <attributes -signature="ServiceAttributes">
-    <attribute -name="header" value="${header}"/>
-    <attribute -name="count" value="${count}"/>
-  </attributes>
-  <controller -desc="primitive"/>
-</definition>
-
-The scope of a formal argument is the lexical scope of the entire -definition, i.e. it includes embedded component definitions, but does not extend to the externally -referenced definitions. Arguments can be used anywhere inside this -scope (such as in class names, attribute values, controller -descriptors, or component references).
-
-Definitions with formal parameters must be referenced by giving actual -values to these arguments:
-
-<definition name="ClientServerImpl" -arguments="h" extends="AbstractClientServer">
-  <component name="client" -definition="ClientImpl"/>
-  <component name="server" -definition="GenericServerImpl(ServerImpl,${h},1)"/>
-</definition>

-

7 Other modules

-The comments module (only avalaible with the "standard.dtd" DTD) -provides the ability to add human readeable comments to any element of -a definition. Several comments can be defined for the same element, and -a language can be specified for each comment:
-
-<definition -name="HelloWorld">
-  <comment -text="definition for the HelloWorld composite component"/>
-  <comment language="fr" -text="definition pour le composant composite HelloWorld"/>
-
  <interface -name="r" -role="server" signature="java.lang.Runnable">
-    <comment -text="the main interface of the composite component"/>
-  </interface>
-
  <component -name="client">
-    <interface -name="r" role="server" signature="java.lang.Runnable"/>
-    <interface -name="s" role="client" signature="Service"/>
-    <content -class="ClientImpl">
-      -<comment text="the client component is implemented by the ClientImpl -Java class"/>
-    </content>
-
  </component>
-  <component -name="server">
-    <interface -name="s" role="server" signature="Service"/>
-    <content -class="ServerImpl"/>
-  </component>
-  <binding -client="this.r" server="client.r">
-    <comment -text="defines an export binding"/>
-  </binding>
-
  <binding -client="client.s" server="server.s"/>
-</definition>
-
-TODO logger module (not yet implemented)
-TODO distribution module (not yet implemented)
-TODO coordinates module (not yet implemented)
-

8 Instantiation

-In order to instantiate a component from an ADL definition, one -first needs to get a factory that can create components from ADL -definitions. This can be done in the following way:
-
-Factory f = -FactoryFactory.getFactory();
-
-were Factory and FactoryFactory are defined in -the org.objectweb.fractal.adl -package. The factory can then be used to create the component:
-
-Object c = -f.newComponent("ClientImpl", null);
-

8.1 Definition sources

-The default factory looks for definitions in the classpath: a -definition "org.pkg.Foo" is loaded by looking for the -"org/pkg/Foo.fractal" ressource with the getResourceAsStream method of -the ClassLoader of the Factory component.
-
-As a consequence, a definition "org.pkg.Foo" must be defined in a file -"Foo.fractal" in the "org/pkg" directory, which must be accessible -(either directly or inside a jar file) from the class loader of the Factory component.
-

8.2 Definition arguments

-The newComponent method -of the Factory interface -takes as parameter the name of a definition, and an optional Map that can be used to give -additional information to the factory. For example, this map is used by -the "arguments" module to look for actual argument values:
-
-Map -context = new HashMap();
-context.put("impl", -"ServerImpl");
-context.put("header", -"->");
-context.put("count", -"1");
-f.newComponent("GenericServerImpl", -context);
-

8.3 Backends

-The default Fractal ADL factory is a Fractal composite component -(defined with Fractal ADL definitions) made of many components, -including a backend component that comes in four versions: a Java -backend, a Fractal backend, a static Java backend, and a static Fractal -backend.
-
-The Java backend (which is the default backend) creates components by -using the java.lang.reflect -API. For example, this backend creates the "ClientImpl" component with -a code similar to Class.forName("ClientImpl").newInstance().
-
-The Fractal backend creates components by using the Fractal API. This -backend uses the Fractal.getBootstrapComponent() -bootstrap component, unless another bootsrap component is associated to -the "bootstrap" key in the factory context. For example:
-
-Map context = new HashMap();
-context.put("bootstrap", /* a [remote] bootstrap component */); // -optional
-
-
Factory f = -FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND);
-
Component c = -(Component)f.newComponent("ClientImpl", context);
-
-creates c by executing the following code:
-
-Component boot = -(Component)context.get("bootstrap");
-TypeFactory tf = -Fractal.getTypeFactory(boot);
-GenericFactory gf = -Fractal.getGenericFactory(boot);
-ComponentType t = -tf.createFcType(new InterfaceType[] {
-  tf.createFcItfType("r", -"java.lang.Runnable", false, false, false),
-  tf.createFcItfType("s", -"Service", true, false, false)
-});
-Component c = gf.newFcInstance(t, -"primitive", "ClientImpl");
-
-The static Java and Fractal backends are similar to the Java and -Fractal backends, except that they produce source code instead of -directly interpreting it. These two backends require a PrintWriter associated to the -"printwriter" key in the factory context. This PrintWriter is the output -stream that will be used to generate the source code. For example:
-
-Map context = new HashMap();
-context.put("printwriter", new -PrintWriter(...));
-Factory f = -FactoryFactory.getFactory(FactoryFactory.STATIC_JAVA_BACKEND);
-String s = -(String)f.newComponent("HelloWorld", -context);
-
-generates source code similar to:
-
-ServerImpl P0 = new ServerImpl();
-P0.setHeader("->");
-P0.setCount(1);
-ClientImpl P1 = new ClientImpl();
-P1.bindFc("s", P0);
-Map C0 = new HashMap();
-C0.put("r", P1);
-
-and returns the identifier of the top level component, i.e. the "C0" -string here (composite components are represented by maps that -associate a value to each interface name of the component). In order to -be really usable, the generated code must be enclosed in a complete -Java class. This must be done by the Fractal ADL user.
diff --git a/web/html/tutorials/fractal/body.html b/web/html/tutorials/fractal/body.html deleted file mode 100644 index eee348cf73e9cfdd735f184d45221f67ce6d4768..0000000000000000000000000000000000000000 --- a/web/html/tutorials/fractal/body.html +++ /dev/null @@ -1,421 +0,0 @@ -


-
Fractal Tutorial
-


- -
- - - -
AUTHOR :       
E. Bruneton          (France Telecom R&D)
-
- -
- -
- - - -
Version   1.1
Released    September 12, 2003
-
- -
- -


- -

This tutorial explains how to program a Fractal component based application -in Java, and how to deploy it. This tutorial is independent of any -specific Java implementation of the Fractal component model, provided it is -compliant with the 3.3 conformance level (cf. the Fractal specification). - -

The example used throughout this tutorial is a very simple application -made of two primitive components inside a composite component (see the -figure below). The first primitive component is a "server" component that -provides an interface to print messages on the console. It can be parameterized -thanks to two attributes: a "header" attribute to configure the header -printed in front of each message, and a "count" attribute to configure -the number of times each message should be printed. The other primitive -component is a "client" component that uses the previous component to print -some messages. - -

- -

The server component provides a server interface named "s" of type Service, -which provides a print method. It also has an AttributeController -interface of type ServiceAttributes, which provides four methods -to get and set the two attributes of the server component. - -

The client component provides a server interface named "m" of type Main, -which provides a main method, called when the application is launched. -It also has a client interface named "s" of type Service. - -

The code of the classes and interfaces described here can be found in -the examples/helloworld directory of the Fractal distribution. - -

1 Implementation

- -The application can be programmed in two steps, by creating the component -interfaces first, and then implementing these interfaces in the component classes. - -

1.1 Creating the component interfaces

- -Three interfaces must be implemented: the two "functional" interfaces Service -and Main, and the attribute controller interface ServiceAttributes. - -

The functional interfaces are programmed "normally", i.e., the Fractal -model does not impose any constraints on the Fractal functional component -interfaces, except the fact that they must be public. The Service -and Main interfaces are therefore very simple to implement: - -

-public interface Service {
-  void print (String msg);
-}
-
-public interface Main {
-  void main (String[] args);
-}
-
- -

On the other hand, the attribute controller interfaces must extend the -AttributeController -interface, and must only have getter and setter method pairs (and they -must be public too). The ServiceAttributes interface -is therefore the following: - -

-public interface ServiceAttributes extends AttributeController {
-  String getHeader ();
-  void setHeader (String header);
-  int getCount ();
-  void setCount (int count);
-}
-
- -

1.2 Implementing the component classes

- -The component classes must implement the previous interfaces, as well as -some Fractal control interfaces. - -

The server component class, called ServerImpl, must implement -the Service and ServiceAttributes interfaces. It may -also implement the LifeCycleController -interface, in order to be notified when it is started and stopped, but -this is not mandatory. Since the server component does not have client -interfaces, the ServerImpl class does not need to implement the -BindingController -interface. The ServerImpl class is therefore the following: - -

-public class ServerImpl implements Service, ServiceAttributes {
-
-  private String header = "";
-
-  private int count = 0;
-
-  public void print (final String msg) {
-    for (int i = 0; i < count; ++i) {
-      System.err.println(header + msg);
-    }
-  }
-
-  public String getHeader () {
-    return header;
-  }
-
-  public void setHeader (final String header) {
-    this.header = header;
-  }
-
-  public int getCount () {
-    return count;
-  }
-
-  public void setCount (final int count) {
-    this.count = count;
-  }
-}
-
- -

The client component class, called ClientImpl, must implement -the Main interface. Since the client component has client interfaces, -ClientImpl must -also implement the BindingController -interface. It may also implement the LifeCycleController -interface, in order to be notified when the component is started and stopped, -but this is not mandatory. The ClientImpl class is therefore the -following: - -

-public class ClientImpl implements Main, BindingController {
-
-  private Service service;
-
-  public void main (final String[] args) {
-    service.print("hello world");
-  }
-
-  public String[] listFc () {
-    return new String[] { "s" };
-  }
-
-  public Object lookupFc (final String cItf) {
-    if (cItf.equals("s")) {
-      return service;
-    }
-    return null;
-  }
-
-  public void bindFc (final String cItf, final Object sItf) {
-    if (cItf.equals("s")) {
-      service = (Service)sItf;
-    }
-  }
-
-  public void unbindFc (final String cItf) {
-    if (cItf.equals("s")) {
-      service = null;
-    }
-  }
-}
-
- -

If "s" were a collection of client interfaces, i.e., if the -client component could be bound to several server components, the ClientImpl -class would be the following: - -

-public class ClientImpl implements Main, BindingController {
-
-  private Map services = new HashMap();
-
-  public void main (final String[] args) {
-    Iterator i = services.values().iterator();
-    while (i.hasNext()) {
-      ((Service)i.next()).print("hello world");
-    }
-  }
-
-  public String[] listFc () {
-    return (String[])services.keySet().toArray(new String[services.size()]);
-  }
-
-  public Object lookupFc (final String cItf) {
-    if (cItf.startsWith("s")) {
-      return services.get(cItf);
-    }
-    return null;
-  }
-
-  public void bindFc (final String cItf, final Object sItf) {
-    if (cItf.startsWith("s")) {
-      services.put(cItf, (Service)sItf);
-    }
-  }
-
-  public void unbindFc (final String cItf) {
-    if (cItf.startsWith("s")) {
-      services.remove(sItf);
-    }
-  }
-}
-
- -

Note: in the current Julia version, the component classes must -be public and must have a public constructor without arguments. - -

2 Deployment

- -The simplest method to deploy an application is to describe the architecture -of the application in a (possibly XML based) Architecture Description Language -(ADL), and to use a Fractal deployment tool to automatically instantiate -the application (see the Fractal ADL tutorial). -However, in order to explain how the Core Fractal Framework can be used, we show -here how the example application can be deployed by directly using the Fractal -API. - -

2.1 Creating the component types

- -We begin by creating objects that represent the types of the components -of the application. In order to do this, we must first get a bootstrap -component. The standard way to do this is the following one (this method -creates an instance of the class specified in the fractal.provider -system property, and uses this instance to get the bootstrap component): - -
-Component boot = Fractal.getBootstrapComponent();
-
- -

We then get the TypeFactory -interface provided by this bootstrap component: - -

-TypeFactory tf = (TypeFactory)boot.getFcInterface("type-factory");
-
- -

We can then create the type of the composite component, which only provides -a Main server interface named "m": - -

-// type of the root component
-ComponentType rType = tf.createFcType(new InterfaceType[] {
-  tf.createFcItfType("m", "Main", false, false, false)
-});
-
- -

The type of the client and server components are created in a similar -way: - -

-// type of the client component
-ComponentType cType = tf.createFcType(new InterfaceType[] {
-  tf.createFcItfType("m", "Main", false, false, false),
-  tf.createFcItfType("s", "Service", true, false, false)
-});
-// type of the server component
-ComponentType sType = tf.createFcType(new InterfaceType[] {
-  tf.createFcItfType("s", "Service", false, false, false),
-  tf.createFcItfType("attribute-controller", "ServiceAttributes", false, false, false)
-});
-
- -

2.2 Creating the component templates

- -We could now create the components directly, but we will use intermediate -template components here, in order to illustrate how they can be used. -We must therefore create template components corresponding to the components -of the application. In order to do this, we first get the GenericFactory -interface provided by the bootstrap component: - -
-GenericFatory cf = (GenericFatory)boot.getFcInterface("generic-factory");
-
- -

We then create a composite template component to instantiate the composite -component. Here the "compositeTemplate" argument is supposed to describe, -in the Fractal implementation that is actually used, a component with the -Factory, -BindingController -and ContentController -interfaces. Likewise, the "composite" argument is supposed to describe -a component with the LifeCycleController, -BindingController -and ContentController -interfaces. - -

-// template to create the root component
-Component rTmpl = cf.newFcInstance(
-  rType, "compositeTemplate", new Object[] {"composite", null});
-
- -

We then create a template to instantiate client component instances. -Here the "primitiveTemplate" argument is supposed to describe, in the Fractal implementation -that is actually used, a component with the Factory -and BindingController -interfaces. Likewise, the "primitive" argument is supposed to describe -a component with the LifeCycleController -and -BindingController -interfaces. The "ClientImpl" argument is of course the name of the client -component class. - -

-// template to create the client component
-Component cTmpl = cf.newFcInstance(
-  cType, "primitiveTemplate", new Object[] {"primitive", "ClientImpl"});
-
- -

We then create a template to instantiate server component instances. -Here the "parametricPrimitiveTemplate" argument is supposed to describe, in the -Fractal implementation that is actually used, a component with the Template, -BindingController -and AttributeController -interfaces. The "ServerImpl" argument is of course the name of the server -component class. - -

-// template to create the server component
-Component sTmpl = cf.newFcInstance(
-  sType, "parametricPrimitiveTemplate", new Object[] {"parametricPrimitive", "ServerImpl"});
-
- -

We can then configure the attributes of the server component template, -which has the same attribute controller interface as the server component. -The template attributes will be automatically copied into all the components -created by the template. - -

-ServiceAttribute sa = (ServiceAttribute)sTmpl.getFcInterface("attribute-controller");
-sa.setHeader("-> ");
-sa.setCount(1);
-
- -

At this stage we have the following architecture: - -

- -

We can then either instantiate each template one by one, put the resulting -primitive components inside the composite component, connect all these -components, and finally start them. But we can also put the primitive templates -inside the composite template, connect these templates together, and then -instantiate the whole application by just instantiating the composite template -component. This is what we do here. - -

We begin by putting the primitive template components inside the composite -one: - -

-ContentController cc = (ContentController)rTmpl.getFcInterface("content-controller");
-cc.addFcSubComponent(cTmpl);
-cc.addFcSubComponent(sTmpl);
-
- -

We then bind the internal client interface "m" of the composite template -to the server interface "m" of the client template: - -

-((BindingController)rTmpl.getFcInterface(
-  "binding-controller")).bindFc("m", cTmpl.getFcInterface("m"));
-
- -

Finally, we bind the client interface "s" of the client template to -the server interface "s" of the server template: - -

-((BindingController)cTmpl.getFcInterface(
-  "binding-controller")).bindFc("s", sTmpl.getFcInterface("s"));
-
- -

The final architecture is the following: - -

- -

2.3 Instantiating and launching the application

- -Now that the template components have been created and bound to each other, the -application components can be instantiated and bound to each other -automatically, by just calling the newFcInstance method on the -root composite template component: - -
-Component rComp = ((Factory)rTmpl.getFcInterface(
-  "factory")).newFcInstance();
-
- -

The result is shown in the figure below: - -

- -

Likewise, all the application components can be started automatically -by just calling the startFc method on the root application component: - -

-((LifeCycleController)rComp.getFcInterface(
-  "lifecycle-controller")).startFc();
-
- -

We can finally (!) launch the application: - -

-((Main)rComp.getFcInterface("m")).main(null);
-
diff --git a/web/html/tutorials/fractal/model.fig b/web/html/tutorials/fractal/model.fig deleted file mode 100644 index 22709ab44d81eb07343e4a8586e7b04a9836a7b7..0000000000000000000000000000000000000000 --- a/web/html/tutorials/fractal/model.fig +++ /dev/null @@ -1,173 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 3510 2790 3645 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2835 3555 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2925 3600 2925 --6 -6 3870 2835 3915 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 2835 3915 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 2925 3870 2925 --6 -6 2790 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2925 2790 2925 --6 -6 2430 2790 2565 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2475 2835 2475 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2475 2925 2520 2925 --6 -6 810 2790 945 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2835 855 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2925 900 2925 --6 -6 1170 2835 1215 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 2835 1215 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 2925 1170 2925 --6 -6 -90 2835 -45 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -45 2835 -45 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -45 2925 -90 2925 --6 -6 -495 2790 -360 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 2835 -450 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 2925 -405 2925 --6 -6 975 1815 1185 2085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 2025 990 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1080 2025 1080 2070 -4 1 0 50 0 0 12 0.0000 4 120 120 1080 1935 C\001 --6 -6 -330 1050 -120 1320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -135 1260 -315 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -225 1260 -225 1305 -4 1 0 50 0 0 12 0.0000 4 120 120 -225 1170 C\001 --6 -6 0 1035 270 1350 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 225 1260 45 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 135 1260 135 1305 -4 1 0 50 0 0 12 0.0000 4 120 240 135 1170 BC\001 --6 -6 360 1035 630 1350 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 495 1260 495 1305 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 585 1260 405 1260 -4 1 0 50 0 0 12 0.0000 4 120 240 495 1170 CC\001 --6 -6 720 1035 990 1350 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 855 1260 855 1305 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1260 765 1260 -4 1 0 50 0 0 12 0.0000 4 120 225 855 1170 LC\001 --6 -6 1305 1800 1575 2115 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 2025 1350 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1440 2025 1440 2070 -4 1 0 50 0 0 12 0.0000 4 120 240 1440 1935 BC\001 --6 -6 1665 1800 1935 2115 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1800 2025 1800 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1890 2025 1710 2025 -4 1 0 50 0 0 12 0.0000 4 120 225 1800 1935 LC\001 --6 -6 3675 1815 3885 2085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3870 2025 3690 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3780 2025 3780 2070 -4 1 0 50 0 0 12 0.0000 4 120 120 3780 1935 C\001 --6 -6 4005 1800 4275 2115 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4230 2025 4050 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4140 2025 4140 2070 -4 1 0 50 0 0 12 0.0000 4 120 240 4140 1935 BC\001 --6 -6 4365 1800 4635 2115 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4500 2025 4500 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4590 2025 4410 2025 -4 1 0 50 0 0 12 0.0000 4 120 225 4500 1935 LC\001 --6 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 2925 415 415 4545 2925 4960 2925 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 1845 2925 415 415 1845 2925 2260 2925 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 3870 2340 5220 2340 5220 3510 3870 3510 3870 2340 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 3600 2070 5490 2070 5490 3780 3600 3780 3600 2070 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2880 2925 3510 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3960 2925 4140 2925 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 1170 2340 2520 2340 2520 3510 1170 3510 1170 2340 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 900 2070 2790 2070 2790 3780 900 3780 900 2070 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2250 2925 2430 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1260 2925 1440 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 0 2925 810 2925 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - -90 1575 5985 1575 5985 4185 -90 4185 -90 1575 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - -405 1305 6255 1305 6255 4455 -405 4455 -405 1305 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4860 2025 4860 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4950 2025 4770 2025 -4 0 0 50 0 0 12 0.0000 4 75 135 -630 2835 m\001 -4 0 0 50 0 0 12 0.0000 4 75 135 675 2835 m\001 -4 0 0 50 0 0 12 0.0000 4 75 75 3420 2835 s\001 -4 0 0 50 0 0 12 0.0000 4 75 75 2880 2835 s\001 -4 0 0 50 0 0 12 0.0000 4 120 1230 4770 1935 ServiceAttributes\001 -4 0 0 50 0 0 12 1.5708 4 120 375 -495 3420 Main\001 -4 0 0 50 0 0 12 1.5708 4 120 375 810 3420 Main\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3510 3600 Service\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3015 3600 Service\001 -4 1 0 50 0 0 12 0.0000 4 120 375 1845 2970 client\001 -4 1 0 50 0 0 12 0.0000 4 75 435 4545 2970 server\001 diff --git a/web/html/tutorials/fractal/model.gif b/web/html/tutorials/fractal/model.gif deleted file mode 100644 index b9a7dd470cef27b9cb95dad241474679d2201922..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/fractal/model.gif and /dev/null differ diff --git a/web/html/tutorials/fractal/step1.fig b/web/html/tutorials/fractal/step1.fig deleted file mode 100644 index e5af5c4117871b2358bc1283d14878e140540bac..0000000000000000000000000000000000000000 --- a/web/html/tutorials/fractal/step1.fig +++ /dev/null @@ -1,165 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 3900 4560 4110 4830 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 4770 3915 4770 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4005 4770 4005 4815 -4 1 0 50 0 0 12 0.0000 4 120 120 4005 4680 C\001 --6 -6 4230 4545 4500 4860 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 4770 4275 4770 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4365 4770 4365 4815 -4 1 0 50 0 0 12 0.0000 4 120 240 4365 4680 BC\001 --6 -6 4590 4545 4860 4860 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4725 4770 4725 4815 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4815 4770 4635 4770 -4 1 0 50 0 0 12 0.0000 4 120 240 4725 4680 CC\001 --6 -6 3735 5715 3870 5985 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 5760 3780 5940 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 5850 3825 5850 --6 -6 930 2130 1140 2400 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1125 2340 945 2340 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1035 2340 1035 2385 -4 1 0 50 0 0 12 0.0000 4 120 120 1035 2250 C\001 --6 -6 765 3420 900 3690 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 810 3465 810 3645 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 810 3555 855 3555 --6 -6 765 2835 900 3105 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 810 2880 810 3060 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 810 2970 855 2970 --6 -6 4095 5760 4140 5940 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4140 5760 4140 5940 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4140 5850 4095 5850 --6 -6 3600 5175 3870 5445 -6 3735 5175 3870 5445 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 5220 3780 5400 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 5310 3825 5310 --6 -4 1 0 50 0 0 12 1.5708 4 120 105 3735 5310 F\001 --6 -6 765 5760 900 6030 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 810 5805 810 5985 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 810 5895 855 5895 --6 -6 930 4785 1140 5055 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1125 4995 945 4995 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1035 4995 1035 5040 -4 1 0 50 0 0 12 0.0000 4 120 120 1035 4905 C\001 --6 -6 1260 4770 1530 5085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1485 4995 1305 4995 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1395 4995 1395 5040 -4 1 0 50 0 0 12 0.0000 4 120 240 1395 4905 BC\001 --6 -6 1620 4770 2925 5085 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1755 4995 1755 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1845 4995 1665 4995 -4 0 0 50 0 0 12 0.0000 4 120 1230 1665 4905 ServiceAttributes\001 --6 -6 630 5175 900 5445 -6 765 5175 900 5445 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 810 5220 810 5400 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 810 5310 855 5310 --6 -4 1 0 50 0 0 12 1.5708 4 120 105 765 5310 F\001 --6 -6 5850 3150 5895 3330 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5895 3150 5895 3330 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5895 3240 5850 3240 --6 -6 3870 3105 4005 3375 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 3150 3915 3330 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 3240 3960 3240 --6 -6 4035 2130 4245 2400 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4230 2340 4050 2340 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4140 2340 4140 2385 -4 1 0 50 0 0 12 0.0000 4 120 120 4140 2250 C\001 --6 -6 4365 2115 4635 2430 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4590 2340 4410 2340 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4500 2340 4500 2385 -4 1 0 50 0 0 12 0.0000 4 120 240 4500 2250 BC\001 --6 -6 3735 2655 4005 2925 -6 3870 2655 4005 2925 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 2700 3915 2880 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 2790 3960 2790 --6 -4 1 0 50 0 0 12 1.5708 4 120 105 3870 2790 F\001 --6 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 3825 4815 6075 4815 6075 6885 3825 6885 3825 4815 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 855 2385 2745 2385 2745 4095 855 4095 855 2385 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 4095 5085 5805 5085 5805 6615 4095 6615 4095 5085 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 855 5040 2745 5040 2745 6750 855 6750 855 5040 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 3960 2385 5850 2385 5850 4095 3960 4095 3960 2385 -4 0 0 50 0 0 12 0.0000 4 75 135 3600 5760 m\001 -4 0 0 50 0 0 12 1.5708 4 120 375 3735 6345 Main\001 -4 0 0 50 0 0 12 0.0000 4 165 1095 945 3600 GenericFactory\001 -4 0 0 50 0 0 12 0.0000 4 165 900 945 3015 TypeFactory\001 -4 0 0 50 0 0 12 0.0000 4 75 75 675 5805 s\001 -4 0 0 50 0 0 12 1.5708 4 120 525 765 6570 Service\001 -4 1 0 50 0 0 12 0.0000 4 165 945 1845 5985 "ServerImpl"\001 -4 0 0 50 0 0 12 0.0000 4 75 135 3735 3150 m\001 -4 0 0 50 0 0 12 0.0000 4 75 75 5940 3150 s\001 -4 0 0 50 0 0 12 1.5708 4 120 375 3870 3735 Main\001 -4 0 0 50 0 0 12 1.5708 4 120 525 6075 3915 Service\001 -4 1 0 50 0 0 12 0.0000 4 165 900 4905 3330 "ClientImpl"\001 diff --git a/web/html/tutorials/fractal/step1.gif b/web/html/tutorials/fractal/step1.gif deleted file mode 100644 index da24076c13829e028d52dde5ffdeb75a1f73f718..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/fractal/step1.gif and /dev/null differ diff --git a/web/html/tutorials/fractal/step2.fig b/web/html/tutorials/fractal/step2.fig deleted file mode 100644 index 9105fa512fec14710ca9bbcc6aa72cdb2074a6f6..0000000000000000000000000000000000000000 --- a/web/html/tutorials/fractal/step2.fig +++ /dev/null @@ -1,165 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 -495 2790 -360 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 2835 -450 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 2925 -405 2925 --6 -6 -330 1050 -120 1320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -135 1260 -315 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -225 1260 -225 1305 -4 1 0 50 0 0 12 0.0000 4 120 120 -225 1170 C\001 --6 -6 0 1035 270 1350 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 225 1260 45 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 135 1260 135 1305 -4 1 0 50 0 0 12 0.0000 4 120 240 135 1170 BC\001 --6 -6 360 1035 630 1350 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 495 1260 495 1305 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 585 1260 405 1260 -4 1 0 50 0 0 12 0.0000 4 120 240 495 1170 CC\001 --6 -6 2790 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2925 2790 2925 --6 -6 810 2790 945 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2835 855 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2925 900 2925 --6 -6 975 1815 1185 2085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 2025 990 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1080 2025 1080 2070 -4 1 0 50 0 0 12 0.0000 4 120 120 1080 1935 C\001 --6 -6 1305 1800 1575 2115 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 2025 1350 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1440 2025 1440 2070 -4 1 0 50 0 0 12 0.0000 4 120 240 1440 1935 BC\001 --6 -6 3510 2790 3645 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2835 3555 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2925 3600 2925 --6 -6 3675 1815 3885 2085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3870 2025 3690 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3780 2025 3780 2070 -4 1 0 50 0 0 12 0.0000 4 120 120 3780 1935 C\001 --6 -6 4005 1800 4275 2115 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4230 2025 4050 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4140 2025 4140 2070 -4 1 0 50 0 0 12 0.0000 4 120 240 4140 1935 BC\001 --6 -6 -135 2835 -90 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -90 2835 -90 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -90 2925 -135 2925 --6 -6 -330 -1200 -120 -930 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -135 -990 -315 -990 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -225 -990 -225 -945 -4 1 0 50 0 0 12 0.0000 4 120 120 -225 -1080 C\001 --6 -6 -495 90 -360 360 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 135 -450 315 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 225 -405 225 --6 -6 -495 -495 -360 -225 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 -450 -450 -270 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 -360 -405 -360 --6 -6 -675 1665 -360 1935 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -450 1800 -405 1800 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 1710 -450 1890 -4 1 0 50 0 0 12 1.5708 4 120 105 -540 1800 F\001 --6 -6 3330 2205 3645 2475 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3555 2340 3600 2340 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2250 3555 2430 -4 1 0 50 0 0 12 1.5708 4 120 105 3465 2340 F\001 --6 -6 630 2205 945 2475 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 855 2340 900 2340 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2250 855 2430 -4 1 0 50 0 0 12 1.5708 4 120 105 765 2340 F\001 --6 -6 4365 1800 5670 2115 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4500 2025 4500 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4590 2025 4410 2025 -4 0 0 50 0 0 12 0.0000 4 120 1230 4410 1935 ServiceAttributes\001 --6 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2880 2925 3510 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -45 2925 810 2925 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - -405 1305 6255 1305 6255 4455 -405 4455 -405 1305 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 900 2070 2790 2070 2790 3780 900 3780 900 2070 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 3600 2070 5490 2070 5490 3780 3600 3780 3600 2070 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - -135 1575 5985 1575 5985 4185 -135 4185 -135 1575 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - -405 -945 1485 -945 1485 765 -405 765 -405 -945 -4 0 0 50 0 0 12 0.0000 4 75 135 -630 2835 m\001 -4 0 0 50 0 0 12 1.5708 4 120 375 -495 3420 Main\001 -4 0 0 50 0 0 12 0.0000 4 75 135 675 2835 m\001 -4 0 0 50 0 0 12 0.0000 4 75 75 2880 2835 s\001 -4 0 0 50 0 0 12 1.5708 4 120 375 810 3420 Main\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3015 3600 Service\001 -4 1 0 50 0 0 12 0.0000 4 165 900 1845 3015 "ClientImpl"\001 -4 0 0 50 0 0 12 0.0000 4 75 75 3420 2835 s\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3510 3600 Service\001 -4 1 0 50 0 0 12 0.0000 4 165 945 4590 3015 "ServerImpl"\001 -4 0 0 50 0 0 12 0.0000 4 165 1095 -315 270 GenericFactory\001 -4 0 0 50 0 0 12 0.0000 4 165 900 -315 -315 TypeFactory\001 diff --git a/web/html/tutorials/fractal/step2.gif b/web/html/tutorials/fractal/step2.gif deleted file mode 100644 index cb22ae25fa7c3467f03a07c6997faead75088930..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/fractal/step2.gif and /dev/null differ diff --git a/web/html/tutorials/fractal/step3.fig b/web/html/tutorials/fractal/step3.fig deleted file mode 100644 index 92a26c1addcdf907f904189966ecbb8da5139eee..0000000000000000000000000000000000000000 --- a/web/html/tutorials/fractal/step3.fig +++ /dev/null @@ -1,327 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 -495 2790 -360 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 2835 -450 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 2925 -405 2925 --6 -6 -330 1050 -120 1320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -135 1260 -315 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -225 1260 -225 1305 -4 1 0 50 0 0 12 0.0000 4 120 120 -225 1170 C\001 --6 -6 0 1035 270 1350 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 225 1260 45 1260 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 135 1260 135 1305 -4 1 0 50 0 0 12 0.0000 4 120 240 135 1170 BC\001 --6 -6 360 1035 630 1350 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 495 1260 495 1305 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 585 1260 405 1260 -4 1 0 50 0 0 12 0.0000 4 120 240 495 1170 CC\001 --6 -6 2790 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2835 2835 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 2925 2790 2925 --6 -6 810 2790 945 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2835 855 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2925 900 2925 --6 -6 975 1815 1185 2085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 2025 990 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1080 2025 1080 2070 -4 1 0 50 0 0 12 0.0000 4 120 120 1080 1935 C\001 --6 -6 1305 1800 1575 2115 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 2025 1350 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1440 2025 1440 2070 -4 1 0 50 0 0 12 0.0000 4 120 240 1440 1935 BC\001 --6 -6 3510 2790 3645 3060 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2835 3555 3015 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2925 3600 2925 --6 -6 3675 1815 3885 2085 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3870 2025 3690 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3780 2025 3780 2070 -4 1 0 50 0 0 12 0.0000 4 120 120 3780 1935 C\001 --6 -6 4005 1800 4275 2115 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4230 2025 4050 2025 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4140 2025 4140 2070 -4 1 0 50 0 0 12 0.0000 4 120 240 4140 1935 BC\001 --6 -6 3510 6480 3645 6750 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 6525 3555 6705 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 6615 3600 6615 --6 -6 3870 6525 3915 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 6525 3915 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3915 6615 3870 6615 --6 -6 2790 6525 2835 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 6525 2835 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2835 6615 2790 6615 --6 -6 2430 6480 2565 6750 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2475 6525 2475 6705 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2475 6615 2520 6615 --6 -6 810 6480 945 6750 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 855 6525 855 6705 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 6615 900 6615 --6 -6 1170 6525 1215 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 6525 1215 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 6615 1170 6615 --6 -6 -495 6480 -360 6750 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 6525 -450 6705 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 6615 -405 6615 --6 -6 975 5505 1185 5775 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 5715 990 5715 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1080 5715 1080 5760 -4 1 0 50 0 0 12 0.0000 4 120 120 1080 5625 C\001 --6 -6 -330 4740 -120 5010 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -135 4950 -315 4950 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -225 4950 -225 4995 -4 1 0 50 0 0 12 0.0000 4 120 120 -225 4860 C\001 --6 -6 0 4725 270 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 225 4950 45 4950 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 135 4950 135 4995 -4 1 0 50 0 0 12 0.0000 4 120 240 135 4860 BC\001 --6 -6 360 4725 630 5040 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 495 4950 495 4995 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 585 4950 405 4950 -4 1 0 50 0 0 12 0.0000 4 120 240 495 4860 CC\001 --6 -6 720 4725 990 5040 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 855 4950 855 4995 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 4950 765 4950 -4 1 0 50 0 0 12 0.0000 4 120 225 855 4860 LC\001 --6 -6 1305 5490 1575 5805 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 5715 1350 5715 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1440 5715 1440 5760 -4 1 0 50 0 0 12 0.0000 4 120 240 1440 5625 BC\001 --6 -6 1665 5490 1935 5805 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1800 5715 1800 5760 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1890 5715 1710 5715 -4 1 0 50 0 0 12 0.0000 4 120 225 1800 5625 LC\001 --6 -6 3675 5505 3885 5775 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3870 5715 3690 5715 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3780 5715 3780 5760 -4 1 0 50 0 0 12 0.0000 4 120 120 3780 5625 C\001 --6 -6 4005 5490 4275 5805 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4230 5715 4050 5715 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4140 5715 4140 5760 -4 1 0 50 0 0 12 0.0000 4 120 240 4140 5625 BC\001 --6 -6 4365 5490 4635 5805 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4500 5715 4500 5760 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4590 5715 4410 5715 -4 1 0 50 0 0 12 0.0000 4 120 225 4500 5625 LC\001 --6 -6 -330 -1200 -120 -930 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -135 -990 -315 -990 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -225 -990 -225 -945 -4 1 0 50 0 0 12 0.0000 4 120 120 -225 -1080 C\001 --6 -6 -495 90 -360 360 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 135 -450 315 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 225 -405 225 --6 -6 -495 -495 -360 -225 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -450 -450 -450 -270 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 -360 -405 -360 --6 -6 -135 2835 -90 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -90 2835 -90 3015 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -90 2925 -135 2925 --6 -6 -135 6525 -90 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -90 6525 -90 6705 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -90 6615 -135 6615 --6 -6 4365 1800 5670 2115 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4500 2025 4500 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4590 2025 4410 2025 -4 0 0 50 0 0 12 0.0000 4 120 1230 4410 1935 ServiceAttributes\001 --6 -6 -675 1800 -360 2070 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -450 1935 -405 1935 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -450 1845 -450 2025 -4 1 0 50 0 0 12 1.5708 4 120 105 -540 1935 F\001 --6 -6 3330 2250 3645 2520 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3555 2385 3600 2385 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3555 2295 3555 2475 -4 1 0 50 0 0 12 1.5708 4 120 105 3465 2385 F\001 --6 -6 630 2250 945 2520 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 855 2385 900 2385 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 2295 855 2475 -4 1 0 50 0 0 12 1.5708 4 120 105 765 2385 F\001 --6 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 6615 415 415 4545 6615 4960 6615 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 1845 6615 415 415 1845 6615 2260 6615 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2880 2925 3510 2925 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -45 2925 810 2925 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - -405 1305 6255 1305 6255 4455 -405 4455 -405 1305 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 900 2070 2790 2070 2790 3780 900 3780 900 2070 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 3600 2070 5490 2070 5490 3780 3600 3780 3600 2070 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 3870 6030 5220 6030 5220 7200 3870 7200 3870 6030 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 3600 5760 5490 5760 5490 7470 3600 7470 3600 5760 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2880 6615 3510 6615 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3960 6615 4140 6615 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 1170 6030 2520 6030 2520 7200 1170 7200 1170 6030 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 900 5760 2790 5760 2790 7470 900 7470 900 5760 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2250 6615 2430 6615 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1260 6615 1440 6615 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -45 6615 810 6615 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - -405 4995 6255 4995 6255 8145 -405 8145 -405 4995 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4860 5715 4860 5760 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4950 5715 4770 5715 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - -405 -945 1485 -945 1485 765 -405 765 -405 -945 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - -135 1575 5985 1575 5985 4185 -135 4185 -135 1575 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - -135 5265 5985 5265 5985 7875 -135 7875 -135 5265 -4 0 0 50 0 0 12 0.0000 4 75 135 -630 2835 m\001 -4 0 0 50 0 0 12 1.5708 4 120 375 -495 3420 Main\001 -4 0 0 50 0 0 12 0.0000 4 75 135 675 2835 m\001 -4 0 0 50 0 0 12 0.0000 4 75 75 2880 2835 s\001 -4 0 0 50 0 0 12 1.5708 4 120 375 810 3420 Main\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3015 3600 Service\001 -4 1 0 50 0 0 12 0.0000 4 165 900 1845 3015 "ClientImpl"\001 -4 0 0 50 0 0 12 0.0000 4 75 75 3420 2835 s\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3510 3600 Service\001 -4 1 0 50 0 0 12 0.0000 4 165 945 4590 3015 "ServerImpl"\001 -4 0 0 50 0 0 12 0.0000 4 75 135 -630 6525 m\001 -4 0 0 50 0 0 12 0.0000 4 75 135 675 6525 m\001 -4 0 0 50 0 0 12 0.0000 4 75 75 3420 6525 s\001 -4 0 0 50 0 0 12 0.0000 4 75 75 2880 6525 s\001 -4 0 0 50 0 0 12 0.0000 4 120 1230 4770 5625 ServiceAttributes\001 -4 0 0 50 0 0 12 1.5708 4 120 375 -495 7110 Main\001 -4 0 0 50 0 0 12 1.5708 4 120 375 810 7110 Main\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3510 7290 Service\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3015 7290 Service\001 -4 1 0 50 0 0 12 0.0000 4 120 375 1845 6660 client\001 -4 1 0 50 0 0 12 0.0000 4 75 435 4545 6660 server\001 -4 0 0 50 0 0 12 0.0000 4 165 1095 -315 270 GenericFactory\001 -4 0 0 50 0 0 12 0.0000 4 165 900 -315 -315 TypeFactory\001 diff --git a/web/html/tutorials/fractal/step3.gif b/web/html/tutorials/fractal/step3.gif deleted file mode 100644 index 4ac2fcad8cad08c8353bc07737e2dce28cd6dab2..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/fractal/step3.gif and /dev/null differ diff --git a/web/html/tutorials/jmx/FractalAdmin.fractal b/web/html/tutorials/jmx/FractalAdmin.fractal deleted file mode 100644 index 6bf0f53d4869d209025130369f7dfab60262a1ef..0000000000000000000000000000000000000000 --- a/web/html/tutorials/jmx/FractalAdmin.fractal +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/web/html/tutorials/jmx/archi.png b/web/html/tutorials/jmx/archi.png deleted file mode 100644 index cb73fb00324fb82b3f61f861011fb3103cb7aece..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/jmx/archi.png and /dev/null differ diff --git a/web/html/tutorials/jmx/body.html b/web/html/tutorials/jmx/body.html deleted file mode 100644 index ddcc113f610ecf119c481a1e164e3a38551cbc6e..0000000000000000000000000000000000000000 --- a/web/html/tutorials/jmx/body.html +++ /dev/null @@ -1,986 +0,0 @@ -


-
Fractal JMX Tutorial
-


- -
- - - -
AUTHOR :       
N. Rivierre          (France Telecom R&D)
-
- -
- -
- - - -
Version   0.1
Released    March 10, 2004
-
- -
- -


- -

This document is a tutorial for Fractal JMX v0.1, a set of Fractal components that enable JMX management of -Fractal applications through automatic exposition in JMX agents. -

This version of Fractal JMX is based on the -Fractal API and ADL -specification v2.0, and the JavaTM Management extensions -(JMXTM) -Instrumentation and Agent Specification v1.2. -Readers are expected to have a minimal knowledge of these specifications. -Fractal JMX is not Julia dependant except for some additional and optional controllers that allow to equip Fractal -components with basic statistics on method calls. -

The Fractal JMX design has benefited from an initial study with an early prototype in 2003 by Laurent Andrey -(Loria), Eric Bruneton and Thierry Coupaye (France Telecom R&D). -It also uses material from JMX4ODP. -This first version is on an early stage and will evolve in the future. - - - -

-Contents

-1  Introduction -
    1.1  Principle -
    1.2  Naming convention -
2  Instrumentation -
    2.1  Comanche -
    2.2  Instrumenting and browsing Comanche -
    2.3  Simple scenarios -
3  Monitoring -
    3.1  String monitor -
    3.2  Counter monitor -
    3.3  Gauge monitor -
A ADL example -
B Julia configuration with a stat-controller -
  -
 
- -
- - - -

-1  Introduction

-This tutorial covers the steps required to run management-enabled Fractal applications using Fractal JMX. -This section first introduces the principle and naming convention used in Fractal JMX. -Section 2 and 3 illustrate how to instrument and monitor a -Fractal application. - - - -

-1.1 Principle

-The resources that can be managed using Fractal JMX v0.1 are component server interfaces or monitors for observing -component attributes. -Fractal JMX does not impose intrusive management code or extra metadata to enable JMX management of these resources. -The JMX agent level, responsible for delegating all the invocations between the management applications and the -managed resources, is represented in Fractal JMX by a generic and autonomous Fractal agent component, -whose only requirement is to be added in the Fractal application to be managed. -This agent component enables JMX management of its host application by dynamically exploring -the component structure and creating managed beans (MBeans) that represent either component -server interfaces or monitors for observing component attributes. - -

Agent -

The core component of Fractal JMX is the agent component that represents the JMX agent level. -A Fractal application can be managed simply by adding the agent component in its structure. -This Fractal agent component encapsulates a JMX -MBeanServer -and behaves as follows: -

    -
  • -Its -Admin -interface specifies a single method ("expose") that allows to introspect components in the agent scope. -Where the scope of the agent represents its super-components and all sub-components recursively enclosed in its super-components -(or in itself if the agent has no super-components). -
  • -During the introspection, the agent dynamically creates and registers MBeans that represent -either component server interfaces or standard -JMX monitors -for observing component attributes. -
  • -Since hundreds of MBeans can be generated during the introspection, -the agent also provides an -AdminAttributes -interface that allows to filter the relevant MBeans, -to avoid flooding of exposed information and performance penalty. -
- -

For example, in the architecture depicted below, where an agent is added to the composite B: -

-

-

Figure 1

- -

-The component B, C, D and Agent (itself) are in the agent scope and then candidate to expose MBeans representing -their server interfaces or observer on their attributes. -The component A is not in the agent scope, and then cannot be managed, since it is not a super-component of the agent. - - -

In practice, although it is possible to add several agents in a Fractal application, -a typical way of using Fractal JMX is to add a single agent at the root composite level -and to use its filter attributes to select the relevant MBeans. - -
  -

Composite Agent -

The primitive agent component included in the Fractal JMX distribution can be used alone. -In practice, it is typically composed with listener and adaptor components -before to be added in Fractal application to be managed: -

    -
  • -A Listener component implements the -NotificationListener -interface and handles the notifications sent out by the attribute observers, if the agent is -bound to this interface. -It is intended to be customized if specific processing of the notifications is required. -
  • -An Adaptor component represents any additional MBean that needs to registers to the Agent component -for specific (HTLM, RMI...) adaptation reason. -Several adaptors can be used simultaneously. -A typical case is an HTML adaptor, itself implemented as an MBean, that will allow -an HTML browser to manage all MBeans in the agent. -
- -

A possible way of using these components together is depicted in the figure below. -

-
-

Figure 2

- -

This figure shows how these components can be bound to each other to get a functional composite Agent component, -which provides an -Admin -interface. -The resulting composite component (named AgentHost in the figure) behaves as an agent as far it provides an Admin interface, -and can be added in a Fractal application to be managed - -
  - -

Default ADL -

A default ADL definition of the agent architecture depicted in figure 2 -is included in the Fractal JMX distribution. -The composite template: -

-
org.objectweb.fractal.jmx.AgentHost
-
-contains the three following sub-components included in the Fractal JMX distribution: -
    -
  • the primitive -agent -component configured, by default, with its -filter attributes -set to "" (i.e. no MBean can be registered in the agent during introspection).
  • - -
  • a -basic listener -component that writes to user screen the notifications received from the attribute observers. -This component can be customized if specific processing of the notifications, sent out by the observers, is required.
  • - -
  • an -HTML adaptor -component that encapsulates the HTML protocol adaptor provided by the JMXTM 1.2 Reference Implementation. -Other HTML or RMI protocol adaptors can be used in the same way.
  • -
- -This composite agent enables JMX management of Fractal applications, as illustrated below with Comanche. - - -
  -

-1.2 Naming convention

-In JMX, an -ObjectName -represents a reference to an MBean in the agent, or a pattern that can match the names of several MBeans -It is unique within an -MBeanServer -and consists of two parts: the domain name and an unordered list of property-value pairs. -The string representation of an object name must follow the following syntax: -
-
[DomainName]:property=value,[,property=value]*
-
- - -

In Fractal JMX, the object name of an MBean representing a component server interface uses this syntax as follows: -

-
FC/[path]component@id[shared]:itf=interface
-
-where: -
    -
  • -component: is the name of the component, as returned by NameController. - -
  • -interface: is the name of a server interface of the component, as -returned by InterfaceType.
  • - -
  • -path: is a (slash separated) name sequence of the successive super-components -of the component, in the reverse order.
  • - -
  • -shared: is set to "-shared" if the component may be identified by -several paths (i.e. if the component or some component, in its super-component -hierarchy, is shared).
  • - -
  • -id: is an inelegant, but unique, component identifier introduced -to avoid JMX name clashes, since nothing prevents the same Fractal name -sequence to identify several components.
  • -
-For example, in the architecture depicted in figure 1, -the MBean representing the interface I of the component D is named: -
-
FC/A/B/C/D@56e32:itf=I
-
- -where @56e32 represents the unique identifier of component D. -It is generated by the agent and can be ignored. - -

This naming convention: -

    -
  • -requires components to have a -NameController -and to avoid (in component or interface names) characters interpreted in specific ways by -ObjectName -(e.g. ":", "*", "&"...). -
  • is used by the -agent attributes -to filter the relevant MBeans. -Only the MBeans, whose -ObjectName -matches a pattern defined by these attributes, are registered in the agent. -These MBeans represent either component server interfaces or monitors for observing component attributes. -In the latter case, the naming convention used by the agent attributes considers some additional property-value pairs -reserved for the configuration of JMX monitors. -
- - -
  -

-2  Instrumentation

-This section illustrates how to instrument the Comanche application using Fractal JMX. - -

-2.1 Comanche

-Comanche is the minimal HTTP server introduced in "Developing -with Fractal", whose component architecture can be summarized as follows: -
archi.png
- -
  -
The version of Comanche used in this tutorial is unchanged, except -for the component Logger that implements an additional attribute controller -interface, specifying an "Header" attribute:
- -
- - - -
public interface LoggerAttributes -extends AttributeController { -
   String getHeader -(); -
   void setHeader -(String header); -
}
- -

When Comanche is instanciated (see the example provided in the Fractal JMX distribution), -open this URL in a web browser to display a simple test page: -

-
http://localhost:8080/index.html
-
-
- -

-2.2  Instrumenting and browsing Comanche

-In "Developing -with Fractal", the ADL definition describing the root composite of -Comanche is as follows (composed of the Frontend and the Backend sub-components): - -
-<definition name="comanche.Comanche" extends="comanche.ComancheType">
-  <component name="fe" definition="comanche.Frontend"/>
-  <component name="be" definition="comanche.Backend"/>
-  <binding client="this.r" server="fe.r"/>
-  <binding client="fe.rh" server="be.rh"/>
-</definition>
-
- -

From section 1, a possible architecture for instrumenting all Comanche components -is as follows (see appendix A for an alternative ADL definition that will allow to -initialize the default values of the JMX component attributes): - -

-<definition name="comanche.JmxComanche1" extends="comanche.Comanche">
-  <component name="agent"
-             definition="org.objectweb.fractal.jmx.AgentHost"/>
-</definition>
-
- -

The additional agent sub-component refers to the AgentHost composite template definition introduced -in the default ADL section and depicted in figure 2. -It is itself composed of three sub-components (a primitive agent, a basic listener and an HTML adaptor) -included in the JMX Fractal distribution. - - -

To connect a browser to the agent (when the composite JmxComanche1 -is instanciated), open this page in a web browser: -

-
http://host:port
-
-where host is the host name of the machine on which the agent is -running (or localhost if the agent is local) and port is the port -number used by the HTML server in the agent (default: 8082). This HTML -protocol adaptor provides the following main HTML pages for managing MBeans -in the agent (see the reference implementation documentation for more details): -
-
Agent View: Provides a list of object names of all the -MBeans registered in the agent. -
Agent Administration: Registers and unregisters MBeans in the -agent. -
MBean View: Reads and writes MBean attributes and perform operations -on MBeans in the agent.
-
-The first page displayed by the HTML adaptor is the Agent View, where the following MBeans -are registered (by default in Fractal JMX): -
    -
  • -Agent:itf=admin                        -represents the Admin -interface of the agent component.
  • - -
  • -Agent:itf=adminAttributes     represents the -AdminAttributes -interface of the agent component.
  • -
- -
-


- -


-
-

-2.3  Simple scenarios

-This section illustrates how to expose component server interfaces with Fractal JMX, -and then how to update component attributes and invoke component operations. -The syntax of the agent attribute "ItfPatterns", used in this section for filtering component interfaces, -is defined in the AdminAttributes -interface as a sequence of (";" separated) string representations of ObjectName -patterns. Only the component interfaces, whose ObjectName matches one of -these patterns, can be registered in the agent. - - -

First scenario -

This scenario exposes all server interfaces of all Comanche components. -The first step is to set the agent attribute "ItfPatterns", for filtering component interfaces: -

    -
  • -browse the MBean "Agent:itf=adminAttributes" to display the MBean View of -the attribute-controller interface -(AdminAttributes) -of the agent component.
  • - -
  • -set the filter attribute "ItfPatterns" with the value:
  • -
- -
-
*:*
-
-
    -
  • -click the "Apply" button at the bottom of the attributes table and then -the "Back to Agent View" button.
  • -
-At this stage, the value of the filter attribute "ItfPatterns" represents -a pattern that can match all component server interfaces. The second step -is to register MBeans in the agent: -
    -
  • -browse the MBean "Agent:itf=admin" to display the MBean View of -the agent component Admin -interface.
  • - -
  • -click the "expose" operation's button to invoke this operation.
  • - -
  • -click the "Back to Agent View" button.
  • -
-At this stage, all server interfaces of all Comanche components are registered -in the agent and should be exposed in the Agent View. -It is then possible to browse the MBean View of these interfaces in order to get/set components attributes -or invoke component operations. - - -


Second scenario -

This scenario modifies the "Header" attribute of the logger component. -This component is a sub-component of the Backend component, that in turn -is a sub-component of the root composite of comanche (see Comanche). -The first (optional) step is to select the relevant -interfaces, to avoid flooding of exposed information: -

    -
  • -browse the MBean "Agent:itf=adminAttributes".
  • - -
  • -set the filter attribute "ItfPatterns" with the value (see appendix -A to initialize this value from an ADL definition, instead of modifying it from the browser):
  • -
-
-
*/l*:itf=attribute-controller;*/l*:itf=l
-
- -
    -
  • -browse the MBean "Agent:itf=admin" and click the "expose" operation's button
  • -
-At this stage, only the attribute-controller and the fonctional interfaces -l of the logger component are registered in the agent. The second (optional) -step is check the current value of the "Header" attribute of the logger -component (by default, the string "->"). -
    -
  • -browse the MBean "FC/JmxComanche/be/l:itf=l"
  • - -
  • -click its "log" operation's button. If the string "test" is used as argument, -the following message should appear in the console:
  • -
- -
-
-> test
-
-The last step is to modify the header used by the logger: -
    -
  • -browse the MBean "FC/JmxComanche/be/l:itf=attribute-controller".
  • - -
  • -set the attribute "Header" with the value:
  • -
-
-
foo
-
- -
    -
  • -browse the MBean "FC/JmxComanche/be/l:itf=l" and click the "log" operation's -button (again with the string "test" as argument). The following message -should be printed in the console:
  • -
- -
    -
    foo test
    -
- - -


-

-3 Monitoring

-This section illustrates how the standard -JMX monitors -(counter, gauge and string) can be used with Fractal JMX to observe component attributes -of the Comanche application. -Note that the listener component used in this section is the -BasicListener -(see the ADL definition "JmxComanche1"). -This listener writes to user screen the notifications received from the observers. -It can be customized if specific processing of the notifications is required. -
  -

-3.1 String monitor

-The standard -JMX string monitor -enables the observation of attributes of type String. -It can be configured to trigger a notification when the observed attribute matches or differs from a compared string. -In scenario 2, the "Header" attribute of the logger component of Comanche has been modified. -This can be observed with Fractal JMX as follows: - -
    -
  • -browse the MBean "Agent:itf=adminAttributes".
  • - -
  • -set the filter attribute "MonitorStringPatterns" with the value (see appendix -A to initialize this value from an ADL definition, instead of modifying it from the browser):
  • -
- -
    -
    -
    -*:itf=attribute-controller,observedAttribute=Header,granularityPeriod=5000,stringToCompare=foo,notifyDiffer=true,notifyMatch=true
    -
    -
    - -
  • -browse the MBean "Agent:itf=admin" and click the "expose" operation's button
  • -
-The syntax of this filter attribute "MonitorStringPatterns" is defined -in AdminAttributes -as a sequence of (";" separated) string representations of ObjectName -patterns. Where the following properties are reserved for the configuration -of a string -monitor (as defined in the JMX specification): -
    -
  • -observedAttribute: the attribute being observed.
  • - -
  • -granularityPeriod: the granularity period (in milliseconds).
  • - -
  • -stringToCompare: the string to compare with the observed attribute.
  • - -
  • -notifyDiffer: the differing notification's on/off switch value.
  • - -
  • -notifyMatch: the matching notification's on/off switch value.
  • -
-The proposed value for the "MonitorStringPatterns" attribute represents a pattern that can -match the attribute-controller interface of any component, if this interface -specifies a string attribute "Header". This attribute will be monitored -every 5000 ms and compared with the value "foo". Coming back to scenario -2, the following differ -notification should be printed now in the console when the value of -the "Header" attribute first differs from the value "foo" (subsequent differences -from "foo" do not cause further notifications unless the attribute value -matches "foo"): -
-
-
-
*****  String Monitor -
* NotificationType: jmx.monitor.string.differs -
* Src: AgentService:type=stringMonitor,observer=1 -
* ObservedObject: FC/JmxComanche/be/l:itf=attribute-controller -
* ObservedAttribute: Header -
* Trigger: foo -
* DerivedGauge: -> -
*****
-
-
-
-Similarly, the following match -notification should be printed in the console when the value of the -"Header" attribute first matches the value foo (subsequent matchings of -"foo" do not cause further notifications unless the attribute value differs -from "foo"): -
-
-
-
*****  String Monitor -
* NotificationType: jmx.monitor.string.matches -
* Src: AgentService:type=stringMonitor,observer=1 -
* ObservedObject: FC/JmxComanche/be/l:itf=attribute-controller -
* ObservedAttribute: Header -
* Trigger: foo -
* DerivedGauge: foo -
*****
-
-
-
-The format of these messages is described in BasicListener -and relies on the information encapsulated in the received MonitorNotication. -
  -

-3.2 Counter monitor

-The standard -JMX counter monitor -observes the attributes that are integer types and behaves like counters. -This section illustrates how counter monitors can be used with Fractal JMX to observe method calls that have -been made on component server interfaces. -Since the standard JMX -monitors (counter, gauge and string) only allow to observe attributes -(i.e. getter methods), this section also illustrates how to equip Fractal components -with a -stat-controller -that exposes attributes representing statistics on method calls. - -

Note that the stat-controller implementations included in the Fractal JMX distribution -i) are basic, and intended to be customized if more advanced statistics on method calls are required -and ii) are the only part of Fractal JMX that is Julia dependant -(see appendix B for a configuration example). - -


First scenario -

In this scenario, we are interested to send a notification each time -the number of method calls made on the logger component of Comanche reaches -a threshold value. The first step is to equip this component with a -stat-controller -that exposes a "NumberOfMethodCall" attribute acting as a counter (this attribute is incremented each time a method -call is made on the component). -This can be done with the following ADL definition (where "statPrimitive" is an alias defined in the Julia -configuration file, see appendix B): - -

-<definition name="comanche.Logger" extends="comanche.LoggerType">
-  <content class="comanche.BasicLogger"/>
-  <attributes signature="comanche.LoggerAttributes">
-    <attribute name="Header" value="->"/>
-  </attributes>
-  <controller desc="statPrimitive"/>
-</definition>
-
- -

The second step is to set the agent attribute for filtering -counter monitor MBeans: -

    -
  • -browse the MBean "Agent:itf=adminAttributes".
  • - -
  • -set the filter attribute "MonitorCounterPatterns" with the value (see appendix -A to initialize this value from an ADL definition, instead of modifying it from the browser):
  • -
- -
    -
    -
    -*:itf=stat-controller,observedAttribute=NumberOfMethodCall,granularityPeriod=5000,initThreshold=2,modulus=0,offset=3,differenceMode=false
    -
    -
    - -
  • -browse the MBean "Agent:itf=admin" and click the "expose" operation's button
  • -
-The syntax of this filter attribute "MonitorCounterPatterns" is defined -in AdminAttributes -as a sequence of (";" separated) string representations of ObjectName -patterns. Where the following properties are reserved for the configuration -of a counter -monitor (as defined in the JMX specification): -
    -
  • -observedAttribute: the attribute being observed.
  • - -
  • -granularityPeriod: the granularity period (in milliseconds).
  • - -
  • -initThreshold: the initial threshold value.
  • - -
  • -modulus: the modulus value.
  • - -
  • -offset: the offset value.
  • - -
  • -differenceMode: the difference mode flag value.
  • -
-The proposed value for the "MonitorCounterPatterns" attribute represents a pattern that can -match the stat-controller interface of any component, if this interface specifies an integer -attribute "NumberOfMethodCall" (as it the case for BasicStatController). -This attribute will be monitored every 5000 ms, as defined in the JMX specification -for a -counter -monitor configured with: InitThreshold=2, Modulus=0, -Offset=3 and DifferenceMode=false. -

-Threshold -notifications should be printed in the console when the value of this -attribute reaches 2 (since the initial threshold equals 2) and then 5, -8, 11,...  (since the offset equals 3). This can be verified by iterating -several times on the following sequence : -

    -
  • -browse the MBean "FC/JmxComanche/be/l:itf=l"
  • - -
  • -click its "log" operation's button.
  • -
-A more convenient alternative is to browse several times the commanche application -(e.g. on http://localhost:8080/index.html). -The logger component being equiped with a -stat-controller, -the following message should appear in the console when the "log" operation -of the logger component is called the second time (i.e. when the "NumberOfMethodCall" attribute reaches 2): -
-
-
-
*****  Counter Monitor -
* NotificationType: jmx.monitor.counter.threshold -
* Src: AgentService:type=counterMonitor,observer=1,attributeType=java.lang.Integer -
* ObservedObject: FC/JmxComanche/be/l:itf=stat-controller -
* ObservedAttribute: NumberOfMethodCall -
* Trigger: 2 -
* DerivedGauge: 2 -
*****
-
-
-
-Similar messages are printed when the "log" operation of the logger component -is called 5, 8, 11,... times (since the counter monitor is configured with Offset=3). -The format of these messages is described in -BasicListener -and relies on the information encapsulated in the received MonitorNotication. - -
  -

Second scenario (throughput) -

As defined in the JMX specification, the counter -monitor can be configured (with the difference mode flag set to true) to send a -threshold -notification when the difference between two successive observations -reaches a threshold value. Coming back on the previous scenario, it is -then possible to observe if the number of calls to the "log" operation of -the logger component reaches a given througput during a sampling period: -

    -
  • -browse the MBean "Agent:itf=adminAttributes".
  • - -
  • -modify the filter attribute "CounterStringPatterns" as follows (see appendix -A to initialize this value from an ADL definition, instead of modifying it from the browser):
  • -
- - -
    -
    -
    -*:itf=stat-controller,observedAttribute=NumberOfMethodCall,granularityPeriod=5000,initThreshold=2,modulus=0,offset=0,differenceMode=true
    -
    -
    - -
  • -browse the MBean "Agent:itf=admin" and click the "expose" operation's button
  • -
-In this configuration, threshold -notifications should be printed in the console each time the "log" -operation of the logger component is called two (or more) times per sampling -period of  5 seconds (since the difference mode equals true, the initial -threshold equals 2 and the granularity period equals 5000 milliseconds). -Another way of monitoring throuhput is explained in the next section. -   -
  -

-3.3 Gauge monitor

-The standard -JMX gauge monitor -observes the attributes that are integer or floating point types and whose values fluctuate -between high and low thresholds. This section illustrates how gauge monitors -can be used with Fractal JMX to observe the througput of method calls that have been made -on component server interfaces. -As explained for counter monitor, the first step is to use a -stat-controller -that exposes attributes representing statistics on method calls that have -been made on the server interfaces of a component. The second step is to -set the agent attribute for filtering gauge -monitor MBeans: -
    -
  • -browse the MBean "Agent:itf=adminAttributes".
  • - -
  • -set the filter attribute "MonitorGaugePatterns" with the value (see appendix -A to initialize this value from an ADL definition, instead of modifying it from the browser):
  • -
- -
    -
    -
    -*:itf=stat-controller,observedAttribute=RateOfMethodCall,granularityPeriod=5000,lowThreshold=0.01,highThreshold=0.3,differenceMode=false
    -
    -
    - -
  • -browse the MBean "Agent:itf=admin" and click the "expose" operation's button
  • -
-The syntax of this filter attribute "MonitorCounterPatterns" is defined -in AdminAttributes -as a sequence of (";" separated) string representations of ObjectName -patterns. Where the following properties are reserved for the configuration -of a gauge -monitor (as defined in the JMX specification): -
    -
  • -observedAttribute: the attribute being observed.
  • - -
  • -granularityPeriod: the granularity period (in milliseconds).
  • - -
  • -lowThreshold: the low threshold value.
  • - -
  • -lowThreshold: the high threshold value.
  • - -
  • -differenceMode: the difference mode flag value.
  • -
-The proposed value for the attribute filter represents a pattern that can -match the stat-controller interface of any component, if this interface -specifies an integer or floating point attribute "RateOfMethodCall" (as -it the case for BasicStatController). -This attribute will be monitored every 5000 ms, as defined in the JMX specification -for a -gauge -monitor configured with: LowThreshold=0.01, LowThreshold=0.3,  -and DifferenceMode=false. -

Coming back to the counter monitor scenarios, the following -threshold -low notification should be printed now in the console (at the begining of the session): -

-
-
-
*****  Gauge Monitor -
* NotificationType: jmx.monitor.gauge.low -
* Src: AgentService:type=counterMonitor,observer=1,attributeType=java.lang.Integer -
* ObservedObject: FC/JmxComanche/be/l:itf=stat-controller -
* ObservedAttribute: RateOfMethodCall -
* Trigger: 0.01 -
* DerivedGauge: 0.0 -
*****
-
-
-
-This is normal since the "log" operation of the logger component has not be called. -The gauge monitor has a low threshold equals to 0.01 when the observed attribute "RateOfMethodCall" of the -stat-controller -(representing the throuhput observed during the last period) equals 0. - - -

Similarly, a -threshold high notification -should be printed in the console when the "log" operation of the logger component is called several times -(e.g. by browsing several times the commanche application on http://localhost:8080/index.html). For example: -

-
-
-
*****  Gauge Monitor -
* NotificationType: jmx.monitor.gauge.high -
* Src: AgentService:type=counterMonitor,observer=1,attributeType=java.lang.Integer -
* ObservedObject: FC/JmxComanche/be/l:itf=stat-controller -
* ObservedAttribute: RateOfMethodCall -
* Trigger: 0.3 -
* DerivedGauge: 0.587 -
*****
-
-
-
-The gauge monitor has a high threshold equals to 0.3 when the observed attribute "RateOfMethodCall" of the -stat-controller -(representing the throuhput observed during the last period) equals 0.587 calls per second. - - -

The format of these messages is described in -BasicListener -and relies on the information encapsulated in the received MonitorNotication. - - -
  -
  -
  -

-Appendix A: ADL example

-This appendix illustrates how to initialize the JMX component attributes from an ADL definition, -instead of modifying them from the browser. -This new ADL definition of the Comanche root composite (named now "JmxComanche2") has to be compared with the -versions proposed in section 2.2. - -To connect a browser to the agent, when the composite "JmxComanche2" -is instanciated, open this page in a web browser (if the agent is local): -
          http://localhost:8081
        -
- -The JmxComanche2 definition is similar to the JmxComanche1 definition proposed in section 2.2, -i.e. it contains an additional agent sub-component composed of three sub-components (a primitive agent, a basic listener -and an HTML adaptor) as depicted in figure 2. -The only differences come from: -
    -
  • the "port" attribute of the HTML adaptor component that is overloaded with the value 8081 (the default value is 8082). -
  • the attributes of the primitive agent that are overloaded to filter the relevant MBeans, as described in this tutorial. -
- -
-
-<definition name="comanche.JmxComanche2" extends="comanche.Comanche">
-  <component name="agent" definition="org.objectweb.fractal.jmx.AgentHost">
-    <component name="html">
-      <attributes>
-        <attribute name="Port" value="8081"/>
-      </attributes>
-    </component>
-    <component name="agent">
-      <attributes>
-        <attribute name="ItfPatterns" value="*/l*:itf=attribute-controller;*/l*:itf=l"/>
-        <attribute name="MonitorStringPatterns" value="*:itf=attribute-controller,observedAttribute=Header,granularityPeriod=5000,stringToCompare=foo,notifyDiffer=true,notifyMatch=true"/>
-        <attribute name="MonitorCounterPatterns" value="*:itf=stat-controller,observedAttribute=NumberOfMethodCall,granularityPeriod=5000,initThreshold=2,modulus=0,offset=3,differenceMode=false"/>
-        <attribute name="MonitorGaugePatterns" value="*:itf=stat-controller,observedAttribute=RateOfMethodCall,granularityPeriod=5000,lowThreshold=0.01,highThreshold=0.3,differenceMode=false"/>
-      </attributes>
-    </component>
-  </component>
-</definition>
-
- -
  -

-Appendix B: Julia configuration with a stat-controller

-The "statPrimitive" alias can be defined as follows in the Julia configuration -file. It is similar to the usual "Primitive" alias except for an additional -BasicStatController -included in the Fractal JMX distribution. -This controller: -
    -
  • -implements the -StatController -interface and must be associated with the -StatCodeGenerator -that generates interception code. -
  • -can be configured with a parameter representing the minimal time interval -used for rate re-computation, in milliseconds (the proposed value is 5000). -
  • -can be replaced by the -ExponentialSmoothingStatController -(also included in the Fractal JMX distribution) that uses a basic exponential smoothing method for rate computation. -A second parameter is then available to adjust the smoothing constant -used by this implementation (the proposed value is 0.5). -
-
      -
    - - - -
    (statPrimitive -
      ( -
        'interface-class-generator -
        ( -
          'component-itf -
          'binding-controller-itf -
          'super-controller-itf -
          # only if super-controller-itf does -not designate the Julia interface: -
          # 'julia-super-controller-itf -
          'lifecycle-controller-itf -
          # only if lifecycle-controller-itf does -not designate the Julia interface: -
          # 'julia-lifecycle-controller-itf -
          'name-controller-itf -
          (stat-controller -org.objectweb.fractal.jmx.julia.stat.StatController) -
        ) -
        ( -
          'component-impl -
          'container-binding-controller-impl -
          'super-controller-impl -
          'lifecycle-controller-impl -
          'name-controller-impl -
          (org.objectweb.fractal.jmx.julia.stat.BasicStatController 5000) -
          # (org.objectweb.fractal.jmx.julia.stat.ExponentialSmoothingStatController 5000 0.5) -
        ) -
        ( -
          (org.objectweb.fractal.julia.asm.InterceptorClassGenerator -
            org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator -
            -org.objectweb.fractal.jmx.julia.stat.StatCodeGenerator -
          -) -
        ) -
        org.objectweb.fractal.julia.asm.MergeClassGenerator -
        'optimizationLevel -
      ) -
    )
    -
diff --git a/web/html/tutorials/jmx/fractal-agent-view.gif b/web/html/tutorials/jmx/fractal-agent-view.gif deleted file mode 100644 index 0235f9ebe26226fee989a189ab78492a7a70c0b6..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/jmx/fractal-agent-view.gif and /dev/null differ diff --git a/web/html/tutorials/jmx/fractal-jmx-scope.fig b/web/html/tutorials/jmx/fractal-jmx-scope.fig deleted file mode 100644 index 08be652778810ee87cbe1538fd865edb1181700c..0000000000000000000000000000000000000000 --- a/web/html/tutorials/jmx/fractal-jmx-scope.fig +++ /dev/null @@ -1,55 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 1542 3556 2400 4241 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 1542 3556 2400 3556 2400 4241 1542 4241 1542 3556 -4 0 0 50 -1 2 9 0.0000 4 105 330 1612 3727 Agent\001 --6 -6 988 3536 1578 3830 -6 1430 3536 1578 3830 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1540 3684 1467 3684 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1467 3573 1467 3794 --6 -4 2 0 50 -1 0 10 0.0000 4 105 435 1393 3720 Admin\001 --6 -6 3420 3690 3600 4005 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3543 3855 3461 3855 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3461 3740 3461 3966 --6 -6 1530 3285 2610 3600 -6 1530 3420 1890 3600 -6 1530 3420 1890 3600 -6 1546 3426 1848 3591 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1696 3549 1696 3467 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1811 3467 1585 3467 --6 --6 --6 -4 2 0 50 -1 0 10 0.0000 4 105 1110 2603 3426 AdminAttributes\001 --6 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 810 2565 5580 2565 5580 5220 810 5220 810 2565 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 3060 3150 5355 3150 5355 4815 3060 4815 3060 3150 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 3555 3600 4275 3600 4275 4275 3555 4275 3555 3600 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 585 2160 6075 2160 6075 5715 585 5715 585 2160 -4 0 0 50 -1 2 12 0.0000 4 135 135 710 2369 A\001 -4 0 0 50 -1 2 12 0.0000 4 135 135 1035 2880 B\001 -4 0 0 50 -1 2 12 0.0000 4 135 120 3240 3420 C\001 -4 0 0 50 -1 2 12 0.0000 4 135 135 3690 3870 D\001 -4 2 0 50 -1 0 10 0.0000 4 105 60 3375 3915 I\001 diff --git a/web/html/tutorials/jmx/fractal-jmx-scope.gif b/web/html/tutorials/jmx/fractal-jmx-scope.gif deleted file mode 100644 index f8c30626ae1ea21b4259fc4c77f89e587fe532f6..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/jmx/fractal-jmx-scope.gif and /dev/null differ diff --git a/web/html/tutorials/jmx/fractal-jmx.fig b/web/html/tutorials/jmx/fractal-jmx.fig deleted file mode 100644 index c9a3524a97b5d83c95abe95779d3259c135c6f9b..0000000000000000000000000000000000000000 --- a/web/html/tutorials/jmx/fractal-jmx.fig +++ /dev/null @@ -1,97 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -6 684 3058 1542 3743 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 684 3058 1542 3058 1542 3743 684 3743 684 3058 -4 0 0 50 -1 2 9 0.0000 4 120 450 718 3229 Adaptor\001 --6 -6 1543 3093 1617 3317 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1617 3206 1543 3206 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1617 3093 1617 3317 --6 -6 2624 3008 4969 3789 -6 4112 3058 4969 3743 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4112 3058 4969 3058 4969 3743 4112 3743 4112 3058 -4 0 0 50 -1 2 9 0.0000 4 90 450 4147 3229 Listener\001 --6 -6 2624 3296 4147 3610 -6 3991 3296 4147 3610 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4029 3337 4029 3570 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 4107 3452 4029 3452 --6 -6 2624 3375 3951 3492 -4 2 0 50 -1 0 10 0.0000 4 105 1290 3951 3492 NotificationListener\001 --6 --6 --6 -6 733 2942 1069 3107 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 901 3067 901 2982 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1025 2982 775 2982 --6 -6 2397 4771 3255 5456 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2397 4771 3255 4771 3255 5456 2397 5456 2397 4771 -4 0 0 50 -1 2 9 0.0000 4 105 330 2467 4942 Agent\001 --6 -6 2364 4519 3458 4806 -6 2401 4641 2703 4806 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2551 4764 2551 4682 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2666 4682 2440 4682 --6 -4 2 0 50 -1 0 10 0.0000 4 105 1110 3458 4641 AdminAttributes\001 --6 -6 1843 4751 2433 5045 -6 2285 4751 2433 5045 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2395 4899 2322 4899 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 2322 4788 2322 5009 --6 -4 2 0 50 -1 0 10 0.0000 4 105 435 2248 4935 Admin\001 --6 -6 3255 4800 3337 5045 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3337 4924 3255 4924 -2 1 0 1 12 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 3337 4800 3337 5045 --6 -6 0 4815 590 5109 -6 442 4815 590 5109 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 552 4963 479 4963 -2 1 0 2 4 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 479 4852 479 5073 --6 -4 2 0 50 -1 0 10 0.0000 4 105 435 405 4999 Admin\001 --6 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 45.70 91.40 - 3358 4909 4009 3468 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 45.70 91.40 - 1652 3192 2430 4635 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 540 2070 5535 2070 5535 5873 540 5873 540 2070 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 45.70 91.40 - 630 4995 2250 4995 -4 2 0 50 -1 0 10 0.0000 4 135 1200 1947 2942 AdaptorAttributes\001 -4 2 0 50 -1 0 10 0.0000 4 105 615 2250 3240 adminAtt\001 -4 0 0 50 -1 0 10 0.0000 4 105 480 3419 5006 listener\001 -4 0 0 50 -1 2 12 0.0000 4 180 885 710 2369 AgentHost\001 diff --git a/web/html/tutorials/jmx/fractal-jmx.gif b/web/html/tutorials/jmx/fractal-jmx.gif deleted file mode 100644 index 8f6ff4f9bfdb7a3d3c8aa806edfac52dead8f515..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/jmx/fractal-jmx.gif and /dev/null differ diff --git a/web/html/tutorials/julia/body.html b/web/html/tutorials/julia/body.html deleted file mode 100644 index 7fd6086301a37cc05c87d701a742bf9dbff9549d..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/body.html +++ /dev/null @@ -1,826 +0,0 @@ -


-
Julia Tutorial
-


- -
- - - -
AUTHOR :       
E. Bruneton          (France Telecom R&D)
-
- -
- -
- - - -
Version   2.0
Released    November 12, 2003
-
- -
- -


- -

This tutorial explains how to configure the Julia framework, and shows -the results of several configuration options. - -

1 Julia Configuration File

- -

1.1 Generalities

- -When the getBootstrapComponent() method is called for the first time -(see the Fractal Tutorial), and if the -fractal.provider system property is set to -org.objectweb.fractal.julia.Julia, the Julia framework initializes -itself by reading the configuration files whose names are specified in the -julia.config system property (in a comma separated name list such as -"julia.cfg,julia1.cfg,julia2.cfg"). - -

The Julia configuration files must define the "aliases" used in the newFcInstance -method, such as "primitiveTemplate", "compositeTemplate", ... (see -the Fractal Tutorial). -For each such alias, one must define an Interface class generator, -a set of control interface types, a set of controller classes implementing -these control interfaces, a set of interceptors, and an optimization level -(see next section). - -

A Julia configuration file uses a LISP-like syntax, and contains a -set of alias definitions: - -

(alias-name1 alias-definition1) -
(alias-name2 alias-definition2) -
... -
(alias-nameN alias-definitionN) - -

where each definition is a LISP-like term that can contain (backward -or forward) references to other aliases (be careful to avoid recursive -definitions!). A reference to an alias is a term of the form 'alias-name. -If an alias name is defined several times, the last definition overrides -the previous ones. It is therefore possible to define a "generic" and shared -configuration file, that can be extended and partially or completely overriden -by additional, user specific configuration files. - -

1.2 Controller Descriptor Definitions

- -The definitions of the aliases used in the newFcInstance method, -such as "primitiveTemplate" or "composite", called controller descriptors, -must be LISP-like terms of the following form (see ContextClassGenerator -for more details): - -
-

-
-  # controller descriptor
-  (
-    # Interface class generator
-    class descriptor
-
-

-

- -The above class descriptor describes the class generator that will be -used to generate the Interface objects of the component. - -A class descriptor must be either -of the form "className", or of the form "(objectDescriptor arg1 ... argN)". -The first case describes the class "className". The second case describes -the class generated by the class generator instance described by "objectDescriptor" -with the given arguments. - -An object -descriptor must be either of the form "className", or of the form "(classDescriptor -arg1 ... argN)". The first case describes an instance of "className". The -second case describes an instance of the class described by "classDescriptor" -constructed with the given arguments. - -
-

- -
-
-   # control interfaces
-   (
-     (name signature)
-     ...
-     (name signature)
-   )
-
-

-

- -The above list describes the control interfaces of the component, as well as -its hidden interfaces (whose name starts with '/' - see the Julia documentation). -Each element of the list gives the name and the signature (i.e the fully -qualified name of a Java interface) of a control interface. - -
-

- -
-
-   # controller classes
-   (
-     object descriptor
-     ...
-     object descriptor
-   )
-
-

-

- -The above list describes the controller objects of the component. The classes -of these objects classes can be arbitrary, provided they have a default -public constructor. However, if a controller class needs access to other -controller classes, it must implement the Controller -interface. The class described by the first class descriptor must implement the -Component interface. -In these descriptors the 'attributeControllerInterface alias will -be replaced by the name of the actual attribute controller interface declared -in the component's type, if any. - -

Although the controller classes can be normal Java classes, in the standard -Julia configuration file most of the controller classes are generated classes, -generated from mixin classes (see the Julia documentation). -For example the object that implements the -Component -interface is defined as follows: - -

-(component-impl
-  ((org.objectweb.fractal.julia.asm.MixinClassGenerator
-    ComponentImpl
-    org.objectweb.fractal.julia.BasicControllerMixin
-    org.objectweb.fractal.julia.BasicComponentMixin
-    # to check type related constraints, and for collection interfaces support:
-    org.objectweb.fractal.julia.TypeComponentMixin
-  ))
-)
-
- -

This means that the class must be generated by mixing the BasicControllerMixin, -the BasicComponentMixin and the TypeComponentMixin classes, in -this order, which gives a class equivalent to an hypothetical -TypeComponentMixin class subclassing a BasicComponentMixin class, -itself subclassing the BasicControllerMixin class. The first name -after MixinClassGenerator, ComponentImpl, -is the name that is given to this mixed class; this name will appear in the -exception stack traces. - -

-

- -
-
-   ( # interceptors
-     [object descriptor]
-   )
-
-

-

- -This optional object descriptor should describe a -ClassGenerator -object generating -Interceptor -objects (or an empty tree if the component does not need any interceptor -object). This interceptor class generator should be used to generate the -interceptor objects of the component. It should behave like the InterceptorClassGenerator. -In particular, it should accept the same arguments. - -
-

- -
-
-   # optimizations
-   object descriptor
-   optimization level
- )
-
-

-

- -The object descriptor should describe a class generator -that merges several classes into a single class. This class generator should -accept the same arguments as the MergeClassGenerator -generator. - -

The optimization level should be equal to none, -mergeControllers, mergeControllersAndInterceptors, -mergeControllersAndContent or -mergeControllersInterceptorsAndContent. In the first case the -controller objects will be instantiated separately, as well as the interceptors -and the content part of the component. In the second case a class merging the -classes of the controller objects will be generated and instantiated, resulting -in a single controller object, while the interceptors and the content part will -still be instantiated separately. In the third case a merged class will be -generated as before, and the interceptor class generator will be used to -generate a sub class of this class that includes the controllers and -interceptors code. This sub class will then be instantiated, resulting in a -single object playing all the controller and interceptor roles at the same time. -In the last two cases, a sub class of the content class including the -controller - and, in the last case, the interceptor - classes will be generated -and instantiated. In the last case the whole component is therefore instantiated -as a single Java object. - -

2 Configuration Examples

- -This section shows the impact of various Julia configuration options on -deployed applications. It uses the same example as in the Fractal -Tutorial. Since the configuration options of each section are given relatively -to the configuration options of the previous one, the examples must be executed in -the given order. - -

2.1 Initial Configuration

- -Go to the example/helloworld directory and type ant execute. -You should get the following result: - -
-execute:
-     [java] Server: print method called
-     [java]     at ServerImpl.print(ServerImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.Cf359f1f4_0.print(INTERCEPTOR[Service])
-     [java]     at org.objectweb.fractal.julia.generated.Ca49e1bb9_0.print(INTERFACE[Service])
-     [java]     at ClientImpl.main(ClientImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.Cd9152578_0.main(INTERCEPTOR[Main])
-     [java]     at org.objectweb.fractal.julia.generated.C84d15fbd_0.main(INTERFACE[Main])
-     [java]     at HelloWorld.main(HelloWorld.java:206)
-     [java] Server: begin printing...
-     [java] -> hello world
-     [java] Server: print done.
-
- -

The exception stack trace is normal: this is because a printStrackTrace() -instruction is included in the print method of the ServerImpl -class. This stack trace indicates that there are two indirections between -the "external client" HelloWorld and the client component ClientImpl, -and two indirections between the client component and the server component -ServerImpl. These indirections can be explained as follows. - -

With the default Julia configuration file used in this example, the -"primitive" and "composite" aliases are defined by: - -

-(primitive
-  (
-    'interface-class-generator
-    (
-      'component-itf
-      'binding-controller-itf
-      'super-controller-itf
-      'lifecycle-controller-itf
-      'name-controller-itf
-    )
-    (
-      'component-impl
-      'container-binding-controller-impl
-      'super-controller-impl
-      'lifecycle-controller-impl
-      'name-controller-impl
-    )
-    (
-      (org.objectweb.fractal.julia.asm.InterceptorClassGenerator
-        org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator
-      )
-    )
-    org.objectweb.fractal.julia.asm.MergeClassGenerator
-    'optimizationLevel
-  )
-)
-
-(composite
-  (
-    'interface-class-generator
-    (
-      'component-itf
-      'binding-controller-itf
-      'content-controller-itf
-      'super-controller-itf
-      'lifecycle-controller-itf
-      'name-controller-itf
-    )
-    (
-      'component-impl
-      'composite-binding-controller-impl
-      'content-controller-impl
-      'super-controller-impl
-      'composite-lifecycle-controller-impl
-      'name-controller-impl
-    )
-    (
-    )
-    org.objectweb.fractal.julia.asm.MergeClassGenerator
-    'optimizationLevel
-  )
-)
-
- -

As can be seen, the composite component does not have any interceptor -(its life cycle controller is an optimized life cycle controller that does -not need interceptor objects, because it delegates the life cycle management -operations to the life cycle controller of the sub components). On the -other hand, the primitive components have an interceptor used to manage -their life cycle. Given the main Julia data -structures, and the shortcut -algorithm, this configuration explains the previous indirections, as -shown in the figure below: - -

- -

2.2 Effects of intermediate composite components

- -In the example/helloworld/etc/execute.properties file, change -the "run.parameters" line to "run.parameters wrapper". The effect of this change -is to instantiate an application -with an additional composite component around each primitive component, -as shown in the figure below: - -

- -

Then, type ant execute in the example/helloworld directory. -You should get exactly the same result as in the previous section. In other -words, despite the fact that two intermediate composite components have -been added, the number of indirections between the encapsulated components -has not changed. This is because the composite components do not have interceptors, -and therefore several component controllers can be bypassed by the shortcut -algorithm. In fact, the actual links between the components are the following: - -

- -

If the composite components have interceptors, then there are more indirections -between components. In order to see this, uncomment the -(composite 'composite-section2.2) line in the -example/helloworld/julia-tutorial.cfg (the effect of this definition is to add -an interceptor at the server and client interfaces of the composite components, -in order to trace ingoing and outgoing method calls): - -

-(composite-section2.2
-  (
-    'interface-class-generator
-    (
-      'component-itf
-      'binding-controller-itf
-      'content-controller-itf
-      'super-controller-itf
-      'lifecycle-controller-itf
-      'name-controller-itf
-    )
-    (
-      'component-impl
-      'composite-binding-controller-impl
-      'content-controller-impl
-      'super-controller-impl
-      'composite-lifecycle-controller-impl
-      'name-controller-impl
-    )
-    (
-      (org.objectweb.fractal.julia.asm.InterceptorClassGenerator
-        (org.objectweb.fractal.julia.asm.TraceCodeGenerator inout)
-      )
-    )
-    org.objectweb.fractal.julia.asm.MergeClassGenerator
-    'optimizationLevel
-  )
-)
-
- -

This time the result of ant execute is the following: - -

-execute:
-     [java] Entering public abstract void Main.main(java.lang.String[])
-     [java] Entering public abstract void Main.main(java.lang.String[])
-     [java] Entering public abstract void Service.print(java.lang.String)
-     [java] Entering public abstract void Service.print(java.lang.String)
-     [java] Server: print method called
-     [java]     at ServerImpl.print(ServerImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.Cf359f1f4_0.print(INTERCEPTOR[Service])
-     [java]     at org.objectweb.fractal.julia.generated.C6a61e603_0.print(INTERCEPTOR[Service])
-     [java]     at org.objectweb.fractal.julia.generated.C54a577e2_0.print(INTERCEPTOR[Service])
-     [java]     at org.objectweb.fractal.julia.generated.Ca49e1bb9_0.print(INTERFACE[Service])
-     [java]     at ClientImpl.main(ClientImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.Cd9152578_0.main(INTERCEPTOR[Main])
-     [java]     at org.objectweb.fractal.julia.generated.Cc2b70e07_0.main(INTERCEPTOR[Main])
-     [java]     at org.objectweb.fractal.julia.generated.Cc2b70e07_0.main(INTERCEPTOR[Main])
-     [java]     at org.objectweb.fractal.julia.generated.C84d15fbd_0.main(INTERFACE[Main])
-     [java]     at HelloWorld.main(HelloWorld.java:206)
-     [java] Server: begin printing...
-     [java] -> hello world
-     [java] Server: print done.
-     [java] Leaving public abstract void Service.print(java.lang.String)
-     [java] Leaving public abstract void Service.print(java.lang.String)
-     [java] Leaving public abstract void Main.main(java.lang.String[])
-     [java] Leaving public abstract void Main.main(java.lang.String[])
-
- -

The first four lines are printed, in this order, by the input interceptor -of the root composite component, the input interceptor of the composite -component around the client component, the output interceptor of the composite -component around the client component, and finally the input interceptor -of the composite component around the server component. The last four lines -are also printed by these interceptors, in the reverse order. As shown -by the stack trace, there are now four indirections bewteen the components. -Indeed, the actual links between the components are the following: - -

- -

If you change "inout" to "in" in the "composite-section2.2" definition, then no -output interceptor is generated, which removes one trace and one indirection -between the client and server component. If you change "inout" to "out", -then no input interceptor is generated, which removes three traces and -many indirections. - -

2.3 Life cycle management options

- -In the previous examples the life cycle was managed by interceptors in -the primitive components (the role of these interceptors is to suspend -incoming method calls while the component is stopped). The advantage of -this approach is that is does not require life cycle related interceptors -in the composite components, which allows for many shortcut opportunities. -The disadvantage is that there is always at least two indirections between -the primitive components. - -

Another solution is to put the life cycle management interceptors in -the composite component, instead of in the primitive ones. In this case -the minimum number of indirections between two sibling primitive components -is only one. But then there are more indirections between components that -are not in the same composite, and the primitive components can no longer -have their own life cycle controller interface, i.e., they can no longer -be started and stopped individually (they can still be dynamically reconfigured -but, for that, the whole enclosing component must be stopped first). - -

The two approaches can be mixed and used at the same time. For example, -a composite component without interceptor can contain a primitive component with -an interceptor, and a composite component with an interceptor (that itself -contains primitive components without interceptors). The figures below -summarizes all these possibilities. - -

-
Life cycle managed by interceptors in primitive components -

-
Life cyle managed by interceptors in composite components -

-
Mix of the two previous approaches

- -

In order to use interceptors in the composite components but not in -the primitive ones, uncomment the (primitive 'primitive-section2.3) -and (composite 'composite-section2.3) lines in the julia-tutorial.cfg -file (and comment the previously uncommented lines): - -

-(primitive-section2.3
-  (
-    'interface-class-generator
-    (
-      'component-itf
-      'binding-controller-itf
-      'super-controller-itf
-      'name-controller-itf
-    )
-    (
-      'component-impl
-      'container-binding-controller-impl
-      'super-controller-impl
-      'name-controller-impl
-    )
-    (
-    )
-    org.objectweb.fractal.julia.asm.MergeClassGenerator
-    'optimizationLevel
-  )
-)
-
-(composite-section2.3
-  (
-    'interface-class-generator
-    (
-      'component-itf
-      'binding-controller-itf
-      'content-controller-itf
-      'super-controller-itf
-      'lifecycle-controller-itf
-      'name-controller-itf
-    )
-    (
-      'component-impl
-      'composite-binding-controller-impl
-      'content-controller-impl
-      'super-controller-impl
-      'lifecycle-controller-impl
-      'name-controller-impl
-    )
-    (
-      (org.objectweb.fractal.julia.asm.InterceptorClassGenerator
-        org.objectweb.fractal.julia.asm.LifeCycleCodeGenerator
-      )
-    )
-    org.objectweb.fractal.julia.asm.MergeClassGenerator
-    'optimizationLevel
-  )
-)
-
- -

Edit the execute.properties file in order to change the -"run.parameters ..." line to "run.parameters". Then type -ant execute. You should get the following result: - -

-execute:
-     [java] Server: print method called
-     [java]     at ServerImpl.print(ServerImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.Ca49e1bb9_0.print(INTERFACE[Service])
-     [java]     at ClientImpl.main(ClientImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.C55d992cb_0.main(INTERCEPTOR[Main])
-     [java]     at org.objectweb.fractal.julia.generated.C84d15fbd_0.main(INTERFACE[Main])
-     [java]     at HelloWorld.main(HelloWorld.java:206)
-     [java] Server: begin printing...
-     [java] -> hello world
-     [java] Server: print done.
-
- -

As can be seen, there is now only one indirection between the client -and server primitive components. Indeed, the actual links between the components -are the following: - -

- -

2.4 Optimized configuration

- -If some part of an application is composed of components that do not exchange -component interface references dynamically, or that always exchange these -references via the "meta level", by using the Fractal control interfaces -(instead of using the "base level", i.e. business method call parameters), then -it is possible to remove all indirections between these components. In order to -do this, the primitive components (of this part of the application) must not -have life cycle related interceptors, and no life cycle controller interface, as -explained in the previous section. In addition, the binding controller of these -components must include the OptimizedContainerBindingMixin -(this mixin binds the user components to each other directly, without -intermediate Interface objects. It also stores the meta data about -bindings in a private internal map). - -

In order to see this, uncomment the (primitive 'primitive-section2.4) -(composite 'composite-section2.4) lines in the julia-tutorial.cfg file (and -comment the previously uncommented lines): - -

-(primitive-section2.4
-  (
-    'interface-class-generator
-    (
-      'component-itf
-      'binding-controller-itf
-      'super-controller-itf
-      'name-controller-itf
-    )
-    (
-      'component-impl
-      'static-container-binding-controller-impl
-      'super-controller-impl
-      'name-controller-impl
-    )
-    (
-    )
-    org.objectweb.fractal.julia.asm.MergeClassGenerator
-    'optimizationLevel
-  )
-)
-
-(composite-section2.4
-  'composite-section2.3
-)
-
- -

Then type ant execute. You should get the following result, -showing that there is no indirection between the client and server component: - -

-execute:
-     [java] Server: print method called
-     [java]     at ServerImpl.print(ServerImpl.java:31)
-     [java]     at ClientImpl.main(ClientImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.C55d992cb_0.main(INTERCEPTOR[Main])
-     [java]     at org.objectweb.fractal.julia.generated.C84d15fbd_0.main(INTERFACE[Main])
-     [java]     at HelloWorld.main(HelloWorld.java:206)
-     [java] Server: begin printing...
-     [java] -> hello world
-     [java] Server: print done.
-
- -

Indeed, in this case, the actual links between the components are the -following: - -

- -

2.5 Mixin classes

- -TODO. TO BE UPDATED. - -

2.6 Merged classes

- -Julia offers some optimization options to merge some or (almost) all the objects -that make up a component into a single object (see -here). In order to -see the effect of these options, uncomment the -(primitive 'primitive-section2.6) line in the julia-tutorial.cfg file. -The effect of this change is to -print the internal structure of the components of the application, when they -are create. Then, uncomment one of the (optimizationLevel ...) -line in the julia-tutorial.cfg file (and comment the previously uncommented lines), -in order to change the -merge class generator optimization level from none to -mergeControllers, mergeControllersAndInterceptors, -mergeControllersAndContent or -mergeControllersInterceptorsAndContent. Then type ant execute -to launch the application. - -

With the none option, you will get something like this for -the server component: - -

-     [java] COMPONENT CREATED
-     [java] INTERFACES:
-     [java]   attribute-controller org.objectweb.fractal.julia.generated.C8a201a40_0@1e00c26c
-     [java]   component org.objectweb.fractal.julia.generated.C5929b02d_0@bfd7b62c
-     [java]   s org.objectweb.fractal.julia.generated.Ca49e1bb9_0@23087a14
-     [java]   lifecycle-controller org.objectweb.fractal.julia.generated.C18c4c884_0@6e4fa7e4
-     [java]   binding-controller org.objectweb.fractal.julia.generated.Ce7005b70_0@6d7aaef0
-     [java]   super-controller org.objectweb.fractal.julia.generated.C7d0bf956_0@442b008
-     [java] CONTROLLER OBJECTS:
-     [java]   org.objectweb.fractal.julia.generated.C3d06d42e_0@37697
-     [java]   org.objectweb.fractal.julia.generated.C3aa6a740_0@5ecdec
-     [java]   org.objectweb.fractal.julia.generated.Cda074c35_0@21807c
-     [java]   org.objectweb.fractal.julia.generated.Ccac238dc_0@7a7e74
-     [java]   HelloWorld$DebugController@3f74d
-     [java]   org.objectweb.fractal.julia.generated.C87ecd5ad_0@6102dc (Interceptor,impl=ServerImpl@2c01f)
-     [java] CONTENT:
-     [java]   ServerImpl@2c01f
-
- -

This shows that there are 6 objects for the server interfaces, 6 objects for -the controller part (including one interceptor), and one for the content part. -With the mergeControllers option, the five controller objects are -merged into a single one: - -

-     [java] INTERFACES:
-     [java]   attribute-controller org.objectweb.fractal.julia.generated.C8a201a40_0@75ba517c
-     [java]   component org.objectweb.fractal.julia.generated.C5929b02d_0@530b523c
-     [java]   s org.objectweb.fractal.julia.generated.Ca49e1bb9_0@2a968104
-     [java]   lifecycle-controller org.objectweb.fractal.julia.generated.C18c4c884_0@68774c94
-     [java]   binding-controller org.objectweb.fractal.julia.generated.Ce7005b70_0@13f78a30
-     [java]   super-controller org.objectweb.fractal.julia.generated.C7d0bf956_0@8e81dc68
-     [java] CONTROLLER OBJECTS:
-     [java]   org.objectweb.fractal.julia.generated.C254eb21f_0@21807c
-     [java]   org.objectweb.fractal.julia.generated.Ce26412b6_0@7a7e74 (Interceptor,impl=ServerImpl@3f74d)
-     [java] CONTENT:
-     [java]   ServerImpl@3f74d
-
- -

With the mergeControllersAndInterceptors option, the five controller -objects and the interceptor object are merged into a single one: - -

-     [java] INTERFACES:
-     [java]   attribute-controller org.objectweb.fractal.julia.generated.C8a201a40_0@eb345b4b
-     [java]   component org.objectweb.fractal.julia.generated.C5929b02d_0@16bdb73b
-     [java]   s org.objectweb.fractal.julia.generated.Ca49e1bb9_0@18e45d5
-     [java]   lifecycle-controller org.objectweb.fractal.julia.generated.C18c4c884_0@aa23e489
-     [java]   binding-controller org.objectweb.fractal.julia.generated.Ce7005b70_0@49a4db7c
-     [java]   super-controller org.objectweb.fractal.julia.generated.C7d0bf956_0@1a755222
-     [java] CONTROLLER OBJECTS:
-     [java]   org.objectweb.fractal.julia.generated.C91bbe713_0@5ecdec
-     [java] CONTENT:
-     [java]   ServerImpl@21807c
-
- -

Finally, with the mergeControllersInterceptorsAndContent option, -the content is also merged into the controller and interceptor objects: - -

-     [java] INTERFACES:
-     [java]   attribute-controller org.objectweb.fractal.julia.generated.C8a201a40_0@75ba517c
-     [java]   component org.objectweb.fractal.julia.generated.C5929b02d_0@530b523c
-     [java]   s org.objectweb.fractal.julia.generated.Ca49e1bb9_0@2a968104
-     [java]   lifecycle-controller org.objectweb.fractal.julia.generated.C18c4c884_0@68774c94
-     [java]   binding-controller org.objectweb.fractal.julia.generated.Ce7005b70_0@13f78a30
-     [java]   super-controller org.objectweb.fractal.julia.generated.C7d0bf956_0@8e81dc68
-     [java] CONTROLLER OBJECTS:
-     [java]   org.objectweb.fractal.julia.generated.Ca3313c69_0@21807c
-     [java] CONTENT:
-     [java]   org.objectweb.fractal.julia.generated.Ca3313c69_0@21807c
-
- -

2.7 Class generation options

- -In all the previous examples, many classes were automatically and transparently -generated on the fly (the names of some of these classes appear in the -stack traces). It is possible to log all the classes that are generated -during execution. For this, in the execute.properties file, add -the "-Djulia.loader.gen.log=err" argument to the "run.jvm.parameters" property. -With the initial configuration (see section 2.1), the result of ant -execute in then the following: - -
-execute:
-     [java] (org.objectweb.fractal.julia.asm.MixinClassGenerator ...
-     [java] (org.objectweb.fractal.julia.asm.MixinClassGenerator ...
-     [java] (org.objectweb.fractal.julia.asm.MixinClassGenerator ...
-     [java] ((org.objectweb.fractal.julia.asm.InterfaceClassGenerator ...
-     [java] ((org.objectweb.fractal.julia.asm.InterfaceClassGenerator ...
-     [java] ((org.objectweb.fractal.julia.asm.InterfaceClassGenerator ...
-     [java] ((org.objectweb.fractal.julia.asm.InterfaceClassGenerator ...
-...
-     [java] Server: print method called
-     [java]     at ServerImpl.print(ServerImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.Cf359f1f4_0.print(INTERCEPTOR[Service])
-     [java]     at org.objectweb.fractal.julia.generated.Ca49e1bb9_0.print(INTERFACE[Service])
-     [java]     at ClientImpl.main(ClientImpl.java:31)
-     [java]     at org.objectweb.fractal.julia.generated.Cd9152578_0.main(INTERCEPTOR[Main])
-     [java]     at org.objectweb.fractal.julia.generated.C84d15fbd_0.main(INTERFACE[Main])
-     [java]     at HelloWorld.main(HelloWorld.java:206)
-     [java] Server: begin printing...
-     [java] -> hello world
-     [java] Server: print done.
-
- -

The first lines describe the classes that are generated on the fly: -each line is in fact the class descriptor (see section 1.2) of a class -that has just been dynamically generated. - -

With the "-Djulia.loader.gen.log=err" option the previous trace is sent -to the standard error stream. It is also possible to use "out" instead -of "err", to sent the trace to the standard output stream. With any other -name the trace will be stored an a file of that name. It is also possible to -directly store the dynamically generated classes on disk, by using the -"-Djulia.loader.gen.dir=directory" option. - -

The dynamic class generation process heavily relies on the Java Reflection -API, which is not available on all Java environments. In these cases Julia -can still be used but, in order to do this, all the "dynamically generated" -classes must be statically generated and stored on disk (in a directory -that is accessible from the class path) before launching an application. - -

In order to illustrate all the above options, replace "DynamicLoader" -with "BasicLoader" in the execute.properties file. The effect of -this change is that Julia will use a basic class loader, that loads all -classes from the classpath, instead of a class loader that can generate -classes on the fly. If you then type ant execute, you should get -an exception: this is because the "dynamically generated" classes can -neither be generated nor found in the class path. - -

In order to solve the problem, we must statically generate the previous -classes. To do this, first change back "BasicLoader" to "DynamicLoader". -Then add the "-Djulia.loader.gen.dir=build" argument to the "run.jvm.parameters" -system property, and type ant execute to launch the application. -You should get the same trace as above and, in addition, a new -org/objectweb/... directory containing the generated classes -should have been created in the build directory. If you then -type ant execute again, -you will see that no class is dynamically generated: instead, the classes -previously generated are loaded directly from the class path. - -

You can now switch to the "BasicLoader": uncomment the (bootstrap -'bootstrap-section2.7) line in the julia-tutorial.cfg file, -type ant execute (the effect is to generate and store on disk -a new class for the new bootstrap component) and, finally, change -"DynamicLoader" with "BasicLoader" in the execute.properties -file. If you type ant execute again, this time the application -is executed correctly (you can even delete or move to another -directory the julia-asm.jar and the julia-mixins.jar -files, -in the dist/lib directory, the example will still execute -normally: this shows that only the julia-runtime.jar is really -needed at runtime, when the generated classes are statically generated). - -

In order to see what kind of classes are dynamically generated, you -may reexecute the examples of the previous sections with the "-Djulia.loader.gen.dir=/tmp" -option, and by decompiling the generated classes with a decompiler such -as Jad. You may also reexecute -these examples with the none optimisation level changed to -mergeXXX (see section 1.2), in order to see -how controller, interceptors and user component classes are merged. - -

Appendix A Changes

- -
    -
  • July 31, 2002: added a section about mixin classes.
  • -
  • September 2, 2002: updated optimization level options and mixin -alias definition.
  • -
  • November 26, 2002: improved section 1.2, replaced "container" with -"primitive".
  • -
  • December 20, 2002: updated section 1.1 (new generic bootstrap -mechanism).
  • -
  • February 10, 2003: updated class names (julia.control package refactored). -
  • -
  • June 13, 2003: updated stack traces, added section "merged classes". -
  • November 12, 2003: updated content to match Fractal Specification v2.0 and Julia v2.0. -
  • -
diff --git a/web/html/tutorials/julia/break1.fig b/web/html/tutorials/julia/break1.fig deleted file mode 100644 index e733de3ed3ba9f818bfcee2e9547b8d31fb8b8b7..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/break1.fig +++ /dev/null @@ -1,12 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -0 32 #ffff99 -2 3 0 1 32 32 50 0 20 0.000 0 0 -1 0 0 4 - 450 2250 1350 2385 2250 2250 450 2250 diff --git a/web/html/tutorials/julia/break1.gif b/web/html/tutorials/julia/break1.gif deleted file mode 100644 index 3d6b08d8de9a027074b52e0d59ce82b9b56c4093..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/break1.gif and /dev/null differ diff --git a/web/html/tutorials/julia/break2.fig b/web/html/tutorials/julia/break2.fig deleted file mode 100644 index 9b895b242ab16cc98fe4ccf2ab139b18741fccee..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/break2.fig +++ /dev/null @@ -1,12 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -0 32 #ffff99 -2 3 0 1 32 32 50 0 20 0.000 0 0 -1 0 0 6 - 450 1350 450 1215 1350 1350 2250 1215 2250 1350 450 1350 diff --git a/web/html/tutorials/julia/break2.gif b/web/html/tutorials/julia/break2.gif deleted file mode 100644 index dc55ec7597a8324329acb1b7e4392d3053387a08..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/break2.gif and /dev/null differ diff --git a/web/html/tutorials/julia/lifecycle1.fig b/web/html/tutorials/julia/lifecycle1.fig deleted file mode 100644 index 532d334eca316539240ff1d2efe889ac0ccc86cd..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/lifecycle1.fig +++ /dev/null @@ -1,75 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 900 630 8550 4500 -6 1215 630 1485 945 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1350 855 1350 900 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1440 855 1260 855 -4 1 0 50 0 0 12 0.0000 4 135 225 1350 765 LC\001 --6 -6 1890 1305 2160 1620 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 2025 1530 2025 1575 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2115 1530 1935 1530 -4 1 0 50 0 0 12 0.0000 4 135 225 2025 1440 LC\001 --6 -6 2565 1980 2835 2295 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 2700 2205 2700 2250 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2790 2205 2610 2205 -4 1 0 50 0 0 12 0.0000 4 135 225 2700 2115 LC\001 --6 -6 4140 1980 4410 2295 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4275 2205 4275 2250 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4365 2205 4185 2205 -4 1 0 50 0 0 12 0.0000 4 135 225 4275 2115 LC\001 --6 -6 7065 1980 7335 2295 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 7200 2205 7200 2250 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7290 2205 7110 2205 -4 1 0 50 0 0 12 0.0000 4 135 225 7200 2115 LC\001 --6 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 2880 2700 162 162 2880 2700 2970 2835 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 4455 2700 162 162 4455 2700 4545 2835 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 7380 2700 162 162 7380 2700 7470 2835 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 2340 2700 64 64 2340 2700 2404 2700 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 3915 2700 64 64 3915 2700 3979 2700 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 6840 2700 64 64 6840 2700 6904 2700 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2250 2250 3375 2250 3375 3150 2250 3150 2250 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1800 1800 5400 1800 5400 3600 1800 3600 1800 1800 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 3825 2250 4950 2250 4950 3150 3825 3150 3825 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1575 1575 5625 1575 5625 3825 1575 3825 1575 1575 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6750 2250 7875 2250 7875 3150 6750 3150 6750 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2430 2430 3195 2430 3195 2970 2430 2970 2430 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 4005 2430 4770 2430 4770 2970 4005 2970 4005 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6930 2430 7695 2430 7695 2970 6930 2970 6930 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1125 1125 8325 1125 8325 4275 1125 4275 1125 1125 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 900 900 8550 900 8550 4500 900 4500 900 900 --6 -4 0 0 50 0 0 12 1.5708 4 180 840 6705 2655 Interceptor\001 diff --git a/web/html/tutorials/julia/lifecycle1.gif b/web/html/tutorials/julia/lifecycle1.gif deleted file mode 100644 index 4d5d7eb56d70b78de472163b857bf3271a788236..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/lifecycle1.gif and /dev/null differ diff --git a/web/html/tutorials/julia/lifecycle2.fig b/web/html/tutorials/julia/lifecycle2.fig deleted file mode 100644 index 273fa8da0546b5419f6ef94d98cb535e3bb7b4ec..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/lifecycle2.fig +++ /dev/null @@ -1,50 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 1215 630 1485 945 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1350 855 1350 900 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1440 855 1260 855 -4 1 0 50 0 0 12 0.0000 4 135 225 1350 765 LC\001 --6 -6 1890 1305 2160 1620 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 2025 1530 2025 1575 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2115 1530 1935 1530 -4 1 0 50 0 0 12 0.0000 4 135 225 2025 1440 LC\001 --6 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 2880 2700 162 162 2880 2700 2970 2835 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 4455 2700 162 162 4455 2700 4545 2835 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 7380 2700 162 162 7380 2700 7470 2835 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 1665 2700 64 64 1665 2700 1729 2700 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 990 2700 64 64 990 2700 1054 2700 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2250 2250 3375 2250 3375 3150 2250 3150 2250 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1800 1800 5400 1800 5400 3600 1800 3600 1800 1800 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 3825 2250 4950 2250 4950 3150 3825 3150 3825 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1575 1575 5625 1575 5625 3825 1575 3825 1575 1575 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6750 2250 7875 2250 7875 3150 6750 3150 6750 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2430 2430 3195 2430 3195 2970 2430 2970 2430 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 4005 2430 4770 2430 4770 2970 4005 2970 4005 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6930 2430 7695 2430 7695 2970 6930 2970 6930 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1125 1125 8325 1125 8325 4275 1125 4275 1125 1125 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 900 900 8550 900 8550 4500 900 4500 900 900 diff --git a/web/html/tutorials/julia/lifecycle2.gif b/web/html/tutorials/julia/lifecycle2.gif deleted file mode 100644 index 29a35565a2b972bbc7f8f0f29dd98b6cb47a7974..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/lifecycle2.gif and /dev/null differ diff --git a/web/html/tutorials/julia/lifecycle3.fig b/web/html/tutorials/julia/lifecycle3.fig deleted file mode 100644 index ddaf29f704575685755bf444887678b0a0639b80..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/lifecycle3.fig +++ /dev/null @@ -1,57 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 1215 630 1485 945 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1350 855 1350 900 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1440 855 1260 855 -4 1 0 50 0 0 12 0.0000 4 135 225 1350 765 LC\001 --6 -6 1890 1305 2160 1620 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 2025 1530 2025 1575 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2115 1530 1935 1530 -4 1 0 50 0 0 12 0.0000 4 135 225 2025 1440 LC\001 --6 -6 7065 1980 7335 2295 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 7200 2205 7200 2250 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7290 2205 7110 2205 -4 1 0 50 0 0 12 0.0000 4 135 225 7200 2115 LC\001 --6 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 2880 2700 162 162 2880 2700 2970 2835 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 4455 2700 162 162 4455 2700 4545 2835 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 7380 2700 162 162 7380 2700 7470 2835 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 6840 2700 64 64 6840 2700 6904 2700 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 1665 2700 64 64 1665 2700 1729 2700 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2250 2250 3375 2250 3375 3150 2250 3150 2250 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1800 1800 5400 1800 5400 3600 1800 3600 1800 1800 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 3825 2250 4950 2250 4950 3150 3825 3150 3825 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1575 1575 5625 1575 5625 3825 1575 3825 1575 1575 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6750 2250 7875 2250 7875 3150 6750 3150 6750 2250 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2430 2430 3195 2430 3195 2970 2430 2970 2430 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 4005 2430 4770 2430 4770 2970 4005 2970 4005 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 6930 2430 7695 2430 7695 2970 6930 2970 6930 2430 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 1125 1125 8325 1125 8325 4275 1125 4275 1125 1125 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 900 900 8550 900 8550 4500 900 4500 900 900 diff --git a/web/html/tutorials/julia/lifecycle3.gif b/web/html/tutorials/julia/lifecycle3.gif deleted file mode 100644 index bfe927ab5fba8a1cc51550f0bf961a1ef931eb30..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/lifecycle3.gif and /dev/null differ diff --git a/web/html/tutorials/julia/link1.fig b/web/html/tutorials/julia/link1.fig deleted file mode 100644 index e47ba363752efcebcd133c06803774e8a8586f9d..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/link1.fig +++ /dev/null @@ -1,67 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 6840 415 415 4545 6840 4960 6840 -1 2 0 1 24 26 50 0 20 4.000 1 0.0000 3735 6840 90 90 3645 6750 3825 6930 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 3240 6840 90 90 3150 6750 3330 6930 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 540 6840 90 90 450 6750 630 6930 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 1845 6840 415 415 1845 6840 2260 6840 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 -725 6830 90 90 -815 6740 -635 6920 -1 2 0 1 24 26 50 0 20 4.000 1 0.0000 1035 6840 90 90 945 6750 1125 6930 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3330 6840 3645 6840 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 3600 5985 5490 5985 5490 7695 3600 7695 3600 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 3870 6255 5220 6255 5220 7425 3870 7425 3870 6255 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3825 6840 4140 6840 -2 2 1 1 0 33 55 0 -1 4.000 0 0 -1 0 0 5 - -405 5220 6255 5220 6255 8370 -405 8370 -405 5220 -2 2 1 1 0 7 54 0 -1 4.000 0 0 -1 0 0 5 - -135 5490 5985 5490 5985 8100 -135 8100 -135 5490 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 630 6840 945 6840 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1125 6840 1440 6840 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 900 5985 2790 5985 2790 7695 900 7695 900 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 1170 6255 2520 6255 2520 7425 1170 7425 1170 6255 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -720 6930 -720 7155 1035 7155 1035 6930 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2250 6840 3150 6840 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -1710 6840 -810 6840 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -720 6750 -720 6525 540 6525 540 6750 -2 1 0 3 1 7 50 0 -1 0.000 0 0 -1 1 0 6 - 0 0 3.00 90.00 120.00 - -1665 7020 -855 7020 -855 7335 1215 7335 1215 7020 4095 7020 -4 0 4 50 0 0 12 1.5708 4 180 630 3510 6750 impl link\001 -4 0 24 50 0 0 12 1.5708 4 180 960 4050 6750 delegate link\001 -4 0 0 50 0 0 12 1.5708 4 180 855 -585 6480 binding link\001 -4 0 0 50 0 0 12 0.0000 4 135 420 -2205 6885 client\001 -4 0 26 50 0 0 12 1.5708 4 180 840 1080 6705 Interceptor\001 -4 0 4 50 0 0 12 1.5708 4 135 1470 3285 6705 InterfaceReference\001 -4 1 0 50 0 0 12 0.0000 4 135 420 1845 6885 client\001 -4 1 0 50 0 0 12 0.0000 4 90 480 4545 6885 server\001 -4 0 1 50 0 0 12 0.0000 4 180 1110 2475 7200 execution path\001 -4 0 4 50 0 0 12 0.0000 4 180 630 -315 7110 impl link\001 diff --git a/web/html/tutorials/julia/link1.gif b/web/html/tutorials/julia/link1.gif deleted file mode 100644 index d361516aeb49a644620abd00712468fbbfb21964..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/link1.gif and /dev/null differ diff --git a/web/html/tutorials/julia/link2.fig b/web/html/tutorials/julia/link2.fig deleted file mode 100644 index cf823bb22df380270a709b62845f33b436ee09fd..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/link2.fig +++ /dev/null @@ -1,62 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 6840 415 415 4545 6840 4960 6840 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 3240 6840 90 90 3150 6750 3330 6930 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 540 6840 90 90 450 6750 630 6930 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 1845 6840 415 415 1845 6840 2260 6840 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 -725 6830 90 90 -815 6740 -635 6920 -1 2 0 1 24 26 50 0 20 4.000 1 0.0000 -280 6835 90 90 -370 6745 -190 6925 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3330 6840 4140 6840 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 3600 5985 5490 5985 5490 7695 3600 7695 3600 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 3870 6255 5220 6255 5220 7425 3870 7425 3870 6255 -2 2 1 1 0 33 55 0 -1 4.000 0 0 -1 0 0 5 - -405 5220 6255 5220 6255 8370 -405 8370 -405 5220 -2 2 1 1 0 7 54 0 -1 4.000 0 0 -1 0 0 5 - -135 5490 5985 5490 5985 8100 -135 8100 -135 5490 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 900 5985 2790 5985 2790 7695 900 7695 900 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 1170 6255 2520 6255 2520 7425 1170 7425 1170 6255 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2250 6840 3150 6840 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -1710 6840 -810 6840 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -720 6750 -720 6525 540 6525 540 6750 -2 1 0 3 1 7 50 0 -1 0.000 0 0 -1 1 0 6 - 0 0 3.00 90.00 120.00 - -1665 7020 -450 7020 -450 7335 1215 7335 1575 7020 4095 7020 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -630 6840 -360 6840 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 630 6840 1440 6840 -2 1 0 1 24 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -270 6930 -270 7200 1035 7200 1440 6840 -4 0 4 50 0 0 12 1.5708 4 180 630 3510 6750 impl link\001 -4 0 0 50 0 0 12 0.0000 4 135 420 -2205 6885 client\001 -4 1 0 50 0 0 12 0.0000 4 135 420 1845 6885 client\001 -4 1 0 50 0 0 12 0.0000 4 90 480 4545 6885 server\001 -4 0 1 50 0 0 12 0.0000 4 180 1110 2475 7200 execution path\001 -4 0 4 50 0 0 12 1.5708 4 180 630 810 6795 impl link\001 -4 0 4 50 0 0 12 1.5708 4 180 630 -450 6750 impl link\001 -4 0 0 50 0 0 12 1.5708 4 180 855 180 6480 binding link\001 -4 0 24 50 0 0 12 0.0000 4 180 960 -90 7155 delegate link\001 diff --git a/web/html/tutorials/julia/link2.gif b/web/html/tutorials/julia/link2.gif deleted file mode 100644 index 529434c376bff3730a6fa5e798f24692df0b37b6..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/link2.gif and /dev/null differ diff --git a/web/html/tutorials/julia/link3.fig b/web/html/tutorials/julia/link3.fig deleted file mode 100644 index 018ae4d7255c1fdfb98eccf284e8283292dd4e37..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/link3.fig +++ /dev/null @@ -1,63 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 4545 6840 415 415 4545 6840 4960 6840 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 3240 6840 90 90 3150 6750 3330 6930 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 540 6840 90 90 450 6750 630 6930 -1 3 0 1 0 7 50 0 20 0.000 1 0.0000 1845 6840 415 415 1845 6840 2260 6840 -1 2 0 1 4 0 50 0 -1 4.000 1 0.0000 -725 6830 90 90 -815 6740 -635 6920 -1 2 0 1 24 26 50 0 20 4.000 1 0.0000 -280 6835 90 90 -370 6745 -190 6925 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3330 6840 4140 6840 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 3600 5985 5490 5985 5490 7695 3600 7695 3600 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 3870 6255 5220 6255 5220 7425 3870 7425 3870 6255 -2 2 1 1 0 33 55 0 -1 4.000 0 0 -1 0 0 5 - -405 5220 6255 5220 6255 8370 -405 8370 -405 5220 -2 2 1 1 0 7 54 0 -1 4.000 0 0 -1 0 0 5 - -135 5490 5985 5490 5985 8100 -135 8100 -135 5490 -2 2 1 1 0 33 53 0 -1 4.000 0 0 -1 0 0 5 - 900 5985 2790 5985 2790 7695 900 7695 900 5985 -2 2 1 1 0 7 51 0 -1 4.000 0 0 -1 0 0 5 - 1170 6255 2520 6255 2520 7425 1170 7425 1170 6255 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -1710 6840 -810 6840 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -720 6750 -720 6525 540 6525 540 6750 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -630 6840 -360 6840 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 630 6840 1440 6840 -2 1 0 1 24 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -270 6930 -270 7200 1035 7200 1440 6840 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 5 - 0 0 1.00 60.00 120.00 - 2250 6840 2655 6840 2655 7200 3690 7200 4140 6840 -2 1 0 3 1 7 50 0 -1 0.000 0 0 -1 1 0 9 - 0 0 3.00 90.00 120.00 - -1665 7020 -450 7020 -450 7335 1215 7335 1575 7020 2475 7020 - 2475 7335 3915 7335 4365 6975 -4 0 4 50 0 0 12 1.5708 4 180 630 3510 6750 impl link\001 -4 0 0 50 0 0 12 0.0000 4 135 420 -2205 6885 client\001 -4 1 0 50 0 0 12 0.0000 4 135 420 1845 6885 client\001 -4 1 0 50 0 0 12 0.0000 4 90 480 4545 6885 server\001 -4 0 4 50 0 0 12 1.5708 4 180 630 810 6795 impl link\001 -4 0 4 50 0 0 12 1.5708 4 180 630 -450 6750 impl link\001 -4 0 0 50 0 0 12 1.5708 4 180 855 180 6480 binding link\001 -4 0 1 50 0 0 12 0.0000 4 180 1110 -225 7515 execution path\001 -4 0 24 50 0 0 12 0.0000 4 180 960 -90 7155 delegate link\001 diff --git a/web/html/tutorials/julia/link3.gif b/web/html/tutorials/julia/link3.gif deleted file mode 100644 index 805ea6e14733e840d5a2e0ab982fae351a13dcc6..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/link3.gif and /dev/null differ diff --git a/web/html/tutorials/julia/wrapper1.fig b/web/html/tutorials/julia/wrapper1.fig deleted file mode 100644 index deab83c59f8fb9696541173e0855d3f864b236e9..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/wrapper1.fig +++ /dev/null @@ -1,295 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 -375 5145 -165 5415 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -180 5355 -360 5355 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - -270 5355 -270 5400 -4 1 0 50 0 0 12 0.0000 4 120 120 -270 5265 C\001 --6 -6 -45 5130 225 5445 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 180 5355 0 5355 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 90 5355 90 5400 -4 1 0 50 0 0 12 0.0000 4 120 240 90 5265 BC\001 --6 -6 315 5130 585 5445 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 450 5355 450 5400 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 540 5355 360 5355 -4 1 0 50 0 0 12 0.0000 4 120 240 450 5265 CC\001 --6 -6 675 5130 945 5445 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 810 5355 810 5400 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 900 5355 720 5355 -4 1 0 50 0 0 12 0.0000 4 120 225 810 5265 LC\001 --6 -6 480 5820 690 6090 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 675 6030 495 6030 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 585 6030 585 6075 -4 1 0 50 0 0 12 0.0000 4 120 120 585 5940 C\001 --6 -6 810 5805 1080 6120 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1035 6030 855 6030 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 945 6030 945 6075 -4 1 0 50 0 0 12 0.0000 4 120 240 945 5940 BC\001 --6 -6 1170 5805 1440 6120 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1305 6030 1305 6075 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 6030 1215 6030 -4 1 0 50 0 0 12 0.0000 4 120 240 1305 5940 CC\001 --6 -6 1530 5805 1800 6120 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1665 6030 1665 6075 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 6030 1575 6030 -4 1 0 50 0 0 12 0.0000 4 120 225 1665 5940 LC\001 --6 -6 3855 5820 4065 6090 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4050 6030 3870 6030 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 3960 6030 3960 6075 -4 1 0 50 0 0 12 0.0000 4 120 120 3960 5940 C\001 --6 -6 4185 5805 4455 6120 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4410 6030 4230 6030 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4320 6030 4320 6075 -4 1 0 50 0 0 12 0.0000 4 120 240 4320 5940 BC\001 --6 -6 4545 5805 4815 6120 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4680 6030 4680 6075 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4770 6030 4590 6030 -4 1 0 50 0 0 12 0.0000 4 120 240 4680 5940 CC\001 --6 -6 4905 5805 5175 6120 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 5040 6030 5040 6075 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5130 6030 4950 6030 -4 1 0 50 0 0 12 0.0000 4 120 225 5040 5940 LC\001 --6 -6 1380 6495 1590 6765 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 6705 1395 6705 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1485 6705 1485 6750 -4 1 0 50 0 0 12 0.0000 4 120 120 1485 6615 C\001 --6 -6 1710 6480 1980 6795 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 6705 1755 6705 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 1845 6705 1845 6750 -4 1 0 50 0 0 12 0.0000 4 120 240 1845 6615 BC\001 --6 -6 2070 6480 2340 6795 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 2205 6705 2205 6750 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 6705 2115 6705 -4 1 0 50 0 0 12 0.0000 4 120 225 2205 6615 LC\001 --6 -6 4710 6495 4920 6765 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4905 6705 4725 6705 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 4815 6705 4815 6750 -4 1 0 50 0 0 12 0.0000 4 120 120 4815 6615 C\001 --6 -6 4995 6480 5265 6795 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5220 6705 5040 6705 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 5130 6705 5130 6750 -4 1 0 50 0 0 12 0.0000 4 120 240 5130 6615 BC\001 --6 -6 5310 6480 5580 6795 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 5445 6705 5445 6750 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5535 6705 5355 6705 -4 1 0 50 0 0 12 0.0000 4 120 225 5445 6615 LC\001 --6 -6 5625 6480 5895 6795 -2 1 0 2 4 7 52 0 -1 0.000 0 0 -1 0 0 2 - 5760 6705 5760 6750 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5850 6705 5670 6705 -4 1 0 50 0 0 12 0.0000 4 120 240 5760 6615 SA\001 --6 -6 1125 7065 1395 7740 -6 1260 7110 1395 7380 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 7155 1305 7335 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 7245 1350 7245 --6 -4 0 0 50 0 0 12 0.0000 4 75 135 1125 7155 m\001 -4 0 0 50 0 0 12 1.5708 4 120 375 1260 7740 Main\001 --6 -6 225 7065 495 7740 -6 360 7110 495 7380 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 405 7155 405 7335 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 405 7245 450 7245 --6 -4 0 0 50 0 0 12 0.0000 4 75 135 225 7155 m\001 -4 0 0 50 0 0 12 1.5708 4 120 375 360 7740 Main\001 --6 -6 -675 7065 -405 7740 -6 -540 7110 -405 7380 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - -495 7155 -495 7335 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - -495 7245 -450 7245 --6 -4 0 0 50 0 0 12 0.0000 4 75 135 -675 7155 m\001 -4 0 0 50 0 0 12 1.5708 4 120 375 -540 7740 Main\001 --6 -6 3600 7065 3870 7920 -6 3735 7110 3870 7380 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 7155 3780 7335 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 7245 3825 7245 --6 -4 0 0 50 0 0 12 0.0000 4 75 75 3645 7155 s\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3735 7920 Service\001 --6 -6 2475 7065 2700 7920 -6 2475 7155 2520 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2520 7155 2520 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2520 7245 2475 7245 --6 -4 0 0 50 0 0 12 0.0000 4 75 75 2565 7155 s\001 -4 0 0 50 0 0 12 1.5708 4 120 525 2700 7920 Service\001 --6 -6 3150 7065 3375 7920 -6 3150 7155 3195 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3195 7155 3195 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3195 7245 3150 7245 --6 -4 0 0 50 0 0 12 0.0000 4 75 75 3240 7155 s\001 -4 0 0 50 0 0 12 1.5708 4 120 525 3375 7920 Service\001 --6 -6 4500 7065 4770 7920 -6 4635 7110 4770 7380 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4680 7155 4680 7335 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4680 7245 4725 7245 --6 -4 0 0 50 0 0 12 0.0000 4 75 75 4545 7155 s\001 -4 0 0 50 0 0 12 1.5708 4 120 525 4635 7920 Service\001 --6 -6 4905 7155 4950 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4950 7155 4950 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4950 7245 4905 7245 --6 -6 4050 7155 4095 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 7155 4095 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 7245 4050 7245 --6 -6 675 7155 720 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 720 7155 720 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 720 7245 675 7245 --6 -6 -225 7155 -180 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -180 7155 -180 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - -180 7245 -225 7245 --6 -6 1530 7155 1575 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 7155 1575 7335 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 7245 1530 7245 --6 -6 2205 7110 2340 7380 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2250 7155 2250 7335 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2250 7245 2295 7245 --6 -6 2835 7110 2970 7380 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2880 7155 2880 7335 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2880 7245 2925 7245 --6 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5355 7200 162 162 5355 7200 5445 7335 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 1980 7200 162 162 1980 7200 2070 7335 -2 2 0 1 0 7 53 0 20 0.000 0 0 -1 0 0 5 - 675 6300 2925 6300 2925 8100 675 8100 675 6300 -2 2 0 1 0 33 52 0 20 0.000 0 0 -1 0 0 5 - 1350 6750 2475 6750 2475 7650 1350 7650 1350 6750 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 1530 6930 2295 6930 2295 7470 1530 7470 1530 6930 -2 2 0 1 0 7 53 0 20 0.000 0 0 -1 0 0 5 - 4050 6300 6300 6300 6300 8100 4050 8100 4050 6300 -2 2 0 1 0 33 54 0 20 0.000 0 0 -1 0 0 5 - 3825 6075 6525 6075 6525 8325 3825 8325 3825 6075 -2 2 0 1 0 33 52 0 20 0.000 0 0 -1 0 0 5 - 4725 6750 5850 6750 5850 7650 4725 7650 4725 6750 -2 2 0 1 0 7 51 0 20 0.000 0 0 -1 0 0 5 - 4905 6930 5670 6930 5670 7470 4905 7470 4905 6930 -2 2 0 1 0 33 56 0 20 0.000 0 0 -1 0 0 5 - -450 5400 7200 5400 7200 9000 -450 9000 -450 5400 -2 2 0 1 0 7 55 0 20 0.000 0 0 -1 0 0 5 - -225 5625 6975 5625 6975 8775 -225 8775 -225 5625 -2 2 0 1 0 33 54 0 20 0.000 0 0 -1 0 0 5 - 450 6075 3150 6075 3150 8325 450 8325 450 6075 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -135 7245 360 7245 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 765 7245 1260 7245 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4140 7245 4635 7245 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3240 7245 3735 7245 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2565 7245 2835 7245 -4 0 0 50 0 0 12 0.0000 4 120 375 1710 7290 client\001 -4 0 0 50 0 0 12 0.0000 4 75 435 5040 7290 server\001 diff --git a/web/html/tutorials/julia/wrapper1.gif b/web/html/tutorials/julia/wrapper1.gif deleted file mode 100644 index a31515a3860e5ef6cac8ae158b8d185d9937420d..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/wrapper1.gif and /dev/null differ diff --git a/web/html/tutorials/julia/wrapper2.fig b/web/html/tutorials/julia/wrapper2.fig deleted file mode 100644 index 20816571806e89d6d943431b790cd4da53ccceaa..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/wrapper2.fig +++ /dev/null @@ -1,86 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5355 7200 162 162 5355 7200 5445 7335 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 4815 7200 64 64 4815 7200 4879 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 4500 7200 64 64 4500 7200 4564 7200 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 1980 7200 162 162 1980 7200 2070 7335 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 1440 7200 64 64 1440 7200 1504 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 3600 7200 64 64 3600 7200 3664 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 1125 7200 64 64 1125 7200 1189 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 225 7200 64 64 225 7200 289 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 2700 7200 64 64 2700 7200 2764 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 -675 7200 64 64 -675 7200 -611 7200 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - -225 5625 6975 5625 6975 8775 -225 8775 -225 5625 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - -450 5400 7200 5400 7200 9000 -450 9000 -450 5400 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 4725 6750 5850 6750 5850 7650 4725 7650 4725 6750 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 4905 6930 5670 6930 5670 7470 4905 7470 4905 6930 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 1350 6750 2475 6750 2475 7650 1350 7650 1350 6750 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 1530 6930 2295 6930 2295 7470 1530 7470 1530 6930 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 675 6300 2925 6300 2925 8100 675 8100 675 6300 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 450 6075 3150 6075 3150 8325 450 8325 450 6075 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 4050 6300 6300 6300 6300 8100 4050 8100 4050 6300 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 3825 6075 6525 6075 6525 8325 3825 8325 3825 6075 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2160 7200 2655 7200 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4860 7200 5175 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4590 7200 4770 7200 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1485 7200 1800 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1215 7200 1395 7200 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -675 7155 -675 6930 180 6930 180 7155 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 2700 7155 2700 6930 3555 6930 3555 7155 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 3645 7155 3645 6930 4500 6930 4500 7155 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 270 7155 270 6930 1125 6930 1125 7155 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -1260 7200 -720 7200 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -675 7245 -675 7470 1440 7470 1440 7245 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 225 7245 225 7470 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 2700 7245 2700 7470 4815 7470 4815 7245 -2 1 0 1 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3600 7245 3600 7470 -2 1 0 3 1 7 50 0 -1 0.000 0 0 -1 1 0 10 - 0 0 3.00 90.00 120.00 - -1260 7335 -765 7335 -765 7560 1575 7560 1575 7380 2565 7380 - 2565 7560 4950 7560 4950 7335 5220 7335 -4 0 0 50 0 0 12 0.0000 4 135 420 -1755 7245 client\001 diff --git a/web/html/tutorials/julia/wrapper2.gif b/web/html/tutorials/julia/wrapper2.gif deleted file mode 100644 index db2070e2f47a9bb1935f1f1b1902a1d04337429e..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/wrapper2.gif and /dev/null differ diff --git a/web/html/tutorials/julia/wrapper3.fig b/web/html/tutorials/julia/wrapper3.fig deleted file mode 100644 index 16df08f2b9e3ea842ec35a64a36f6d9cd6c47ad2..0000000000000000000000000000000000000000 --- a/web/html/tutorials/julia/wrapper3.fig +++ /dev/null @@ -1,105 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 5355 7200 162 162 5355 7200 5445 7335 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 4815 7200 64 64 4815 7200 4879 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 4500 7200 64 64 4500 7200 4564 7200 -1 3 0 1 0 7 50 0 -1 0.000 1 0.0000 1980 7200 162 162 1980 7200 2070 7335 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 1440 7200 64 64 1440 7200 1504 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 3600 7200 64 64 3600 7200 3664 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 1125 7200 64 64 1125 7200 1189 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 225 7200 64 64 225 7200 289 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 2700 7200 64 64 2700 7200 2764 7200 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 3060 7200 64 64 3060 7200 3124 7200 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 3915 7200 64 64 3915 7200 3979 7200 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 540 7200 64 64 540 7200 604 7200 -1 3 0 1 24 26 50 0 20 0.000 1 0.0000 -360 7200 64 64 -360 7200 -296 7200 -1 3 0 1 4 26 50 0 -1 0.000 1 0.0000 -675 7200 64 64 -675 7200 -611 7200 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - -225 5625 6975 5625 6975 8775 -225 8775 -225 5625 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - -450 5400 7200 5400 7200 9000 -450 9000 -450 5400 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 4725 6750 5850 6750 5850 7650 4725 7650 4725 6750 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 4905 6930 5670 6930 5670 7470 4905 7470 4905 6930 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 1350 6750 2475 6750 2475 7650 1350 7650 1350 6750 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 1530 6930 2295 6930 2295 7470 1530 7470 1530 6930 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 675 6300 2925 6300 2925 8100 675 8100 675 6300 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 450 6075 3150 6075 3150 8325 450 8325 450 6075 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 4050 6300 6300 6300 6300 8100 4050 8100 4050 6300 -2 2 1 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5 - 3825 6075 6525 6075 6525 8325 3825 8325 3825 6075 -2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2160 7200 2655 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2790 7200 2970 7200 -2 1 0 1 24 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 3060 7245 3060 7470 3870 7470 3870 7245 -2 1 0 1 24 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 3960 7245 3960 7470 4815 7470 4815 7245 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4860 7200 5175 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 3690 7200 3870 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4590 7200 4770 7200 -2 1 0 1 24 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1485 7200 1800 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1215 7200 1395 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 315 7200 495 7200 -2 1 0 1 4 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -585 7200 -405 7200 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -675 7155 -675 6930 180 6930 180 7155 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 2700 7155 2700 6930 3555 6930 3555 7155 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 3645 7155 3645 6930 4500 6930 4500 7155 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 270 7155 270 6930 1125 6930 1125 7155 -2 1 0 1 24 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - -360 7245 -360 7470 495 7470 495 7245 -2 1 0 1 24 7 50 0 -1 0.000 0 0 -1 1 0 4 - 0 0 1.00 60.00 120.00 - 585 7245 585 7470 1440 7470 1440 7245 -2 1 0 1 0 0 50 0 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - -1260 7200 -720 7200 -2 1 0 3 1 7 50 0 -1 0.000 0 0 -1 1 0 18 - 0 0 3.00 90.00 120.00 - -1260 7335 -495 7335 -495 7560 405 7560 405 7200 630 7200 - 630 7560 1575 7560 1575 7380 2970 7380 2970 7560 3780 7560 - 3780 7200 4005 7200 4005 7560 4950 7560 4950 7335 5220 7335 -4 0 0 50 0 0 12 0.0000 4 135 420 -1755 7245 client\001 diff --git a/web/html/tutorials/julia/wrapper3.gif b/web/html/tutorials/julia/wrapper3.gif deleted file mode 100644 index 0fc16a3d7ecab93ca2b934887da3e10d1c58526f..0000000000000000000000000000000000000000 Binary files a/web/html/tutorials/julia/wrapper3.gif and /dev/null differ diff --git a/web/latex/specification/example.eps b/web/latex/specification/example.eps deleted file mode 100644 index 36610ee7675f8afeeb538c076b606755c661e72e..0000000000000000000000000000000000000000 --- a/web/latex/specification/example.eps +++ /dev/null @@ -1,236 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: example.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Fri Sep 12 12:13:26 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 312 133 -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def - -end -save -newpath 0 133 moveto 0 0 lineto 312 0 lineto 312 133 lineto closepath clip newpath --15.4 170.8 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.06299 0.06299 sc -% -% Fig objects follow -% -% -% here starts figure with depth 55 -% Polyline -7.500 slw -n 675 675 m 5175 675 l 5175 2700 l 675 2700 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 900 900 m 4950 900 l 4950 2475 l 900 2475 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 1350 1125 m 2700 1125 l 2700 2250 l 1350 2250 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 3150 1125 m 4500 1125 l 4500 2250 l 3150 2250 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% here ends figure; -% -% here starts figure with depth 50 -% Polyline -15.000 slw -n 990 630 m - 810 630 l gs col4 s gr -% Polyline -n 900 630 m - 900 675 l gs col4 s gr -% Polyline -n 1305 630 m - 1125 630 l gs col4 s gr -% Polyline -n 1215 630 m - 1215 675 l gs col4 s gr -% Polyline -n 1620 630 m - 1440 630 l gs col4 s gr -% Polyline -n 1530 630 m - 1530 675 l gs col4 s gr -% Polyline -n 3420 1080 m - 3240 1080 l gs col4 s gr -% Polyline -n 3330 1080 m - 3330 1125 l gs col4 s gr -% Polyline -n 3105 1575 m - 3105 1755 l gs col4 s gr -% Polyline -n 3105 1665 m - 3150 1665 l gs col4 s gr -% Polyline -7.500 slw -n 2745 1575 m - 2745 1755 l gs col12 s gr -% Polyline -n 2745 1665 m - 2700 1665 l gs col12 s gr -% Polyline -15.000 slw -n 1305 1575 m - 1305 1755 l gs col4 s gr -% Polyline -n 1305 1665 m - 1350 1665 l gs col4 s gr -% Polyline -7.500 slw -n 945 1575 m - 945 1755 l gs col12 s gr -% Polyline -n 945 1665 m - 900 1665 l gs col12 s gr -% Polyline -15.000 slw -n 630 1575 m - 630 1755 l gs col4 s gr -% Polyline -n 630 1665 m - 675 1665 l gs col4 s gr -% Polyline -n 1620 1080 m - 1440 1080 l gs col4 s gr -% Polyline -n 1530 1080 m - 1530 1125 l gs col4 s gr -% Polyline -n 1935 1080 m - 1755 1080 l gs col4 s gr -% Polyline -n 1845 1080 m - 1845 1125 l gs col4 s gr -% Polyline -7.500 slw -gs clippath -1275 1695 m 1275 1635 l 1123 1635 l 1243 1665 l 1123 1695 l cp -eoclip -n 990 1665 m - 1260 1665 l gs col0 s gr gr - -% arrowhead -n 1123 1695 m 1243 1665 l 1123 1635 l col0 s -% Polyline -gs clippath -3075 1695 m 3075 1635 l 2923 1635 l 3043 1665 l 2923 1695 l cp -eoclip -n 2790 1665 m - 3060 1665 l gs col0 s gr gr - -% arrowhead -n 2923 1695 m 3043 1665 l 2923 1635 l col0 s -/Times-Roman ff 165.00 scf sf -1125 855 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -1440 855 m -gs 1 -1 sc (CC) col0 sh gr -/Times-Roman ff 165.00 scf sf -810 855 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -3240 1305 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -1755 1305 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -1440 1305 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -2745 1935 m -gs 1 -1 sc (s, S) col0 sh gr -/Times-Roman ff 165.00 scf sf -3105 1485 m -gs 1 -1 sc (s, S) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 165.00 scf sf -630 1485 m -gs 1 -1 sc (m, M) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 165.00 scf sf -1305 1485 m -gs 1 -1 sc (m, M) dup sw pop neg 0 rm col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/specification/example.fig b/web/latex/specification/example.fig deleted file mode 100644 index c62bbcef14735741d26c3304f1b8f315073070da..0000000000000000000000000000000000000000 --- a/web/latex/specification/example.fig +++ /dev/null @@ -1,101 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 765 585 1035 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 990 630 810 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 900 630 900 675 --6 -6 1080 585 1350 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 630 1125 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 630 1215 675 --6 -6 1395 585 1665 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 630 1440 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 630 1530 675 --6 -6 3195 1035 3465 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3420 1080 3240 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3330 1080 3330 1125 --6 -6 3060 1530 3195 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3105 1575 3105 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3105 1665 3150 1665 --6 -6 2700 1575 2745 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2745 1575 2745 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2745 1665 2700 1665 --6 -6 1260 1530 1395 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1575 1305 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1665 1350 1665 --6 -6 900 1575 945 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1575 945 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1665 900 1665 --6 -6 585 1530 720 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1575 630 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1665 675 1665 --6 -6 1395 1035 1665 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 1080 1440 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 1080 1530 1125 --6 -6 1710 1035 1980 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 1080 1755 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1845 1080 1845 1125 --6 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 675 675 5175 675 5175 2700 675 2700 675 675 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 900 900 4950 900 4950 2475 900 2475 900 900 -2 2 0 1 0 33 53 -1 20 0.000 0 0 -1 0 0 5 - 1350 1125 2700 1125 2700 2250 1350 2250 1350 1125 -2 2 0 1 0 33 53 -1 20 0.000 0 0 -1 0 0 5 - 3150 1125 4500 1125 4500 2250 3150 2250 3150 1125 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 990 1665 1260 1665 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2790 1665 3060 1665 -4 0 0 50 -1 0 11 0.0000 4 105 210 1125 855 BC\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 1440 855 CC\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 810 855 C\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 3240 1305 C\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 1755 1305 BC\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 1440 1305 C\001 -4 0 0 50 0 0 11 0.0000 4 135 240 2745 1935 s, S\001 -4 2 0 50 0 0 11 0.0000 4 135 240 3105 1485 s, S\001 -4 2 0 50 0 0 11 0.0000 4 135 375 630 1485 m, M\001 -4 2 0 50 0 0 11 0.0000 4 135 375 1305 1485 m, M\001 diff --git a/web/latex/specification/example2.eps b/web/latex/specification/example2.eps deleted file mode 100644 index b3e8dbf89c1a11c6fc9fd400a4e6043742eb857d..0000000000000000000000000000000000000000 --- a/web/latex/specification/example2.eps +++ /dev/null @@ -1,302 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: example2.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Fri Sep 12 12:12:55 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 312 133 -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def - -end -save -newpath 0 133 moveto 0 0 lineto 312 0 lineto 312 133 lineto closepath clip newpath --15.4 170.8 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.06299 0.06299 sc -% -% Fig objects follow -% -% -% here starts figure with depth 55 -% Polyline -7.500 slw -n 675 675 m 5175 675 l 5175 2700 l 675 2700 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 900 900 m 4950 900 l 4950 2475 l 900 2475 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 1350 1125 m 2700 1125 l 2700 2250 l 1350 2250 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 3150 1125 m 4500 1125 l 4500 2250 l 3150 2250 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 3375 1350 m 4275 1350 l 4275 2025 l 3375 2025 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 1575 1350 m 2475 1350 l 2475 2025 l 1575 2025 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% here ends figure; -% -% here starts figure with depth 50 -% Polyline -15.000 slw -n 990 630 m - 810 630 l gs col4 s gr -% Polyline -n 900 630 m - 900 675 l gs col4 s gr -% Polyline -n 1305 630 m - 1125 630 l gs col4 s gr -% Polyline -n 1215 630 m - 1215 675 l gs col4 s gr -% Polyline -n 1620 630 m - 1440 630 l gs col4 s gr -% Polyline -n 1530 630 m - 1530 675 l gs col4 s gr -% Polyline -n 3420 1080 m - 3240 1080 l gs col4 s gr -% Polyline -n 3330 1080 m - 3330 1125 l gs col4 s gr -% Polyline -n 3105 1575 m - 3105 1755 l gs col4 s gr -% Polyline -n 3105 1665 m - 3150 1665 l gs col4 s gr -% Polyline -7.500 slw -n 2745 1575 m - 2745 1755 l gs col12 s gr -% Polyline -n 2745 1665 m - 2700 1665 l gs col12 s gr -% Polyline -15.000 slw -n 1305 1575 m - 1305 1755 l gs col4 s gr -% Polyline -n 1305 1665 m - 1350 1665 l gs col4 s gr -% Polyline -7.500 slw -n 945 1575 m - 945 1755 l gs col12 s gr -% Polyline -n 945 1665 m - 900 1665 l gs col12 s gr -% Polyline -15.000 slw -n 630 1575 m - 630 1755 l gs col4 s gr -% Polyline -n 630 1665 m - 675 1665 l gs col4 s gr -% Polyline -n 1620 1080 m - 1440 1080 l gs col4 s gr -% Polyline -n 1530 1080 m - 1530 1125 l gs col4 s gr -% Polyline -n 1935 1080 m - 1755 1080 l gs col4 s gr -% Polyline -n 1845 1080 m - 1845 1125 l gs col4 s gr -% Polyline -n 3510 1575 m - 3510 1755 l gs col4 s gr -% Polyline -n 3510 1665 m - 3555 1665 l gs col4 s gr -% Polyline -7.500 slw -n 3555 1530 m 4095 1530 l 4095 1800 l 3555 1800 l - cp gs col33 1.00 shd ef gr gs col0 s gr -/Times-Roman ff 165.00 scf sf -3600 1710 m -gs 1 -1 sc (SImpl) col0 sh gr -% Polyline -15.000 slw -n 1710 1575 m - 1710 1755 l gs col4 s gr -% Polyline -n 1710 1665 m - 1755 1665 l gs col4 s gr -% Polyline -7.500 slw -n 2340 1575 m - 2340 1755 l gs col12 s gr -% Polyline -n 2340 1665 m - 2295 1665 l gs col12 s gr -% Polyline -15.000 slw -n 2025 1485 m - 1845 1485 l gs col4 s gr -% Polyline -n 1935 1485 m - 1935 1530 l gs col4 s gr -% Polyline -7.500 slw -n 1755 1530 m 2295 1530 l 2295 1800 l 1755 1800 l - cp gs col33 1.00 shd ef gr gs col0 s gr -/Times-Roman ff 165.00 scf sf -1800 1710 m -gs 1 -1 sc (CImpl) col0 sh gr -% Polyline -n 3420 1575 m - 3420 1755 l gs col12 s gr -% Polyline -n 3420 1665 m - 3375 1665 l gs col12 s gr -% Polyline -n 1620 1575 m - 1620 1755 l gs col12 s gr -% Polyline -n 1620 1665 m - 1575 1665 l gs col12 s gr -% Polyline -15.000 slw -n 2430 1575 m - 2430 1755 l gs col4 s gr -% Polyline -n 2430 1665 m - 2475 1665 l gs col4 s gr -% Polyline -7.500 slw -gs clippath -1275 1695 m 1275 1635 l 1123 1635 l 1243 1665 l 1123 1695 l cp -eoclip -n 990 1665 m - 1260 1665 l gs col0 s gr gr - -% arrowhead -n 1123 1695 m 1243 1665 l 1123 1635 l col0 s -% Polyline -gs clippath -3075 1695 m 3075 1635 l 2923 1635 l 3043 1665 l 2923 1695 l cp -eoclip -n 2790 1665 m - 3060 1665 l gs col0 s gr gr - -% arrowhead -n 2923 1695 m 3043 1665 l 2923 1635 l col0 s -/Times-Roman ff 165.00 scf sf -1125 855 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -1440 855 m -gs 1 -1 sc (CC) col0 sh gr -/Times-Roman ff 165.00 scf sf -810 855 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -3240 1305 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -1755 1305 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -1440 1305 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -2745 1935 m -gs 1 -1 sc (s, S) col0 sh gr -/Times-Roman ff 165.00 scf sf -3105 1485 m -gs 1 -1 sc (s, S) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 165.00 scf sf -630 1485 m -gs 1 -1 sc (m, M) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 165.00 scf sf -1305 1485 m -gs 1 -1 sc (m, M) dup sw pop neg 0 rm col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/specification/example2.fig b/web/latex/specification/example2.fig deleted file mode 100644 index 079b91f2222f311b26de52f9f9614216d8c68e8a..0000000000000000000000000000000000000000 --- a/web/latex/specification/example2.fig +++ /dev/null @@ -1,157 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 765 585 1035 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 990 630 810 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 900 630 900 675 --6 -6 1080 585 1350 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 630 1125 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 630 1215 675 --6 -6 1395 585 1665 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 630 1440 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 630 1530 675 --6 -6 3195 1035 3465 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3420 1080 3240 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3330 1080 3330 1125 --6 -6 3060 1530 3195 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3105 1575 3105 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3105 1665 3150 1665 --6 -6 2700 1575 2745 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2745 1575 2745 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2745 1665 2700 1665 --6 -6 1260 1530 1395 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1575 1305 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1665 1350 1665 --6 -6 900 1575 945 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1575 945 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1665 900 1665 --6 -6 585 1530 720 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1575 630 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1665 675 1665 --6 -6 1395 1035 1665 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 1080 1440 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 1080 1530 1125 --6 -6 1710 1035 1980 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 1080 1755 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1845 1080 1845 1125 --6 -6 3465 1530 4095 1800 -6 3465 1530 3600 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3510 1575 3510 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3510 1665 3555 1665 --6 -2 2 0 1 0 33 50 0 20 0.000 0 0 -1 0 0 5 - 3555 1530 4095 1530 4095 1800 3555 1800 3555 1530 -4 0 0 50 0 0 11 0.0000 4 135 405 3600 1710 SImpl\001 --6 -6 1665 1440 2340 1800 -6 1665 1530 1800 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1710 1575 1710 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1710 1665 1755 1665 --6 -6 2295 1575 2340 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2340 1575 2340 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2340 1665 2295 1665 --6 -6 1800 1440 2070 1575 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2025 1485 1845 1485 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 1485 1935 1530 --6 -2 2 0 1 0 33 50 0 20 0.000 0 0 -1 0 0 5 - 1755 1530 2295 1530 2295 1800 1755 1800 1755 1530 -4 0 0 50 0 0 11 0.0000 4 135 420 1800 1710 CImpl\001 --6 -6 3375 1575 3420 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3420 1575 3420 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3420 1665 3375 1665 --6 -6 1575 1575 1620 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 1575 1620 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 1665 1575 1665 --6 -6 2385 1530 2520 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2430 1575 2430 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2430 1665 2475 1665 --6 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 675 675 5175 675 5175 2700 675 2700 675 675 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 900 900 4950 900 4950 2475 900 2475 900 900 -2 2 0 1 0 33 53 -1 20 0.000 0 0 -1 0 0 5 - 1350 1125 2700 1125 2700 2250 1350 2250 1350 1125 -2 2 0 1 0 33 53 -1 20 0.000 0 0 -1 0 0 5 - 3150 1125 4500 1125 4500 2250 3150 2250 3150 1125 -2 2 0 1 0 7 52 0 20 0.000 0 0 -1 0 0 5 - 3375 1350 4275 1350 4275 2025 3375 2025 3375 1350 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 990 1665 1260 1665 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2790 1665 3060 1665 -2 2 0 1 0 7 52 0 20 0.000 0 0 -1 0 0 5 - 1575 1350 2475 1350 2475 2025 1575 2025 1575 1350 -4 0 0 50 -1 0 11 0.0000 4 105 210 1125 855 BC\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 1440 855 CC\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 810 855 C\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 3240 1305 C\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 1755 1305 BC\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 1440 1305 C\001 -4 0 0 50 0 0 11 0.0000 4 135 240 2745 1935 s, S\001 -4 2 0 50 0 0 11 0.0000 4 135 240 3105 1485 s, S\001 -4 2 0 50 0 0 11 0.0000 4 135 375 630 1485 m, M\001 -4 2 0 50 0 0 11 0.0000 4 135 375 1305 1485 m, M\001 diff --git a/web/latex/specification/external-view.eps b/web/latex/specification/external-view.eps deleted file mode 100644 index 44d8cd63dbc14de20b3054cdbcfe492b41bb791c..0000000000000000000000000000000000000000 --- a/web/latex/specification/external-view.eps +++ /dev/null @@ -1,148 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: external-view.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Thu Aug 14 15:04:28 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 209 115 -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def - -end -save -newpath 0 115 moveto 0 0 lineto 209 0 lineto 209 115 lineto closepath clip newpath --73.3 170.8 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.06299 0.06299 sc -% -% Fig objects follow -% -% -% here starts figure with depth 55 -% Polyline -7.500 slw -n 1575 900 m 4050 900 l 4050 2700 l 1575 2700 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% here ends figure; -% -% here starts figure with depth 50 -% Polyline -15.000 slw -n 1530 1710 m - 1530 1890 l gs col4 s gr -% Polyline -n 1530 1800 m - 1575 1800 l gs col4 s gr -% Polyline -7.500 slw -n 4095 1395 m - 4095 1575 l gs col12 s gr -% Polyline -n 4095 1485 m - 4050 1485 l gs col12 s gr -% Polyline -n 4095 2025 m - 4095 2205 l gs col12 s gr -% Polyline -n 4095 2115 m - 4050 2115 l gs col12 s gr -/Times-Roman ff 165.00 scf sf -4185 1575 m -gs 1 -1 sc (b, J) col0 sh gr -/Times-Roman ff 165.00 scf sf -4185 2205 m -gs 1 -1 sc (c, K) col0 sh gr -/Times-Roman ff 165.00 scf sf -1395 1890 m -gs 1 -1 sc (a, I) dup sw pop neg 0 rm col0 sh gr -/Times-Italic ff 165.00 scf sf -1665 1080 m -gs 1 -1 sc (component) col0 sh gr -/Times-Italic ff 165.00 scf sf -1665 1845 m -gs 1 -1 sc (server interface) col0 sh gr -/Times-Italic ff 150.00 scf sf -1665 2025 m -gs 1 -1 sc (\(name, language interface\)) col0 sh gr -/Times-Italic ff 165.00 scf sf -3960 1530 m -gs 1 -1 sc (client interface) dup sw pop neg 0 rm col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/specification/external-view.fig b/web/latex/specification/external-view.fig deleted file mode 100644 index 9c811608574aee776743926918b10b1d10ad607a..0000000000000000000000000000000000000000 --- a/web/latex/specification/external-view.fig +++ /dev/null @@ -1,38 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 1485 1665 1620 1935 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 1710 1530 1890 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 1800 1575 1800 --6 -6 4050 1395 4095 1575 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1395 4095 1575 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1485 4050 1485 --6 -6 4050 2025 4095 2205 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 2025 4095 2205 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 2115 4050 2115 --6 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 1575 900 4050 900 4050 2700 1575 2700 1575 900 -4 0 0 50 0 0 11 0.0000 4 135 225 4185 1575 b, J\001 -4 0 0 50 0 0 11 0.0000 4 135 285 4185 2205 c, K\001 -4 2 0 50 0 0 11 0.0000 4 135 225 1395 1890 a, I\001 -4 0 0 50 -1 1 11 0.0000 4 120 690 1665 1080 component\001 -4 0 0 50 -1 1 11 0.0000 4 165 1020 1665 1845 server interface\001 -4 0 0 50 -1 1 10 0.0000 4 135 1575 1665 2025 (name, language interface)\001 -4 2 0 50 -1 1 11 0.0000 4 165 975 3960 1530 client interface\001 diff --git a/web/latex/specification/fractal-specification.lyx b/web/latex/specification/fractal-specification.lyx deleted file mode 100644 index 683b53844c58ddeab29a9df08b31651c10dcc8bf..0000000000000000000000000000000000000000 --- a/web/latex/specification/fractal-specification.lyx +++ /dev/null @@ -1,12285 +0,0 @@ -#LyX 1.3 created this file. For more info see http://www.lyx.org/ -\lyxformat 221 -\textclass scrartcl -\begin_preamble -\usepackage{fancyhdr} - -% commands for tth - -\newif\iftth -\newcommand{\tthvfill}{\iftth\begin{html}


\end{html}\fi} -\newcommand{\tthhrule}{\iftth\hrule\fi} -\newcommand{\tthdump}[1]{#1} - -\iftth\begin{html}\end{html}\fi -\iftth\begin{html}[PDF version]\end{html}\fi -\iftth\begin{html}[PS version]\end{html}\fi - -% normal page headers - -\lhead{The Fractal Component Model} -\rhead{Specification} -\lfoot{The ObjectWeb Consortium} -\rfoot{Draft 2.0-2} -\renewcommand{\headrulewidth}{0.7mm} -\renewcommand{\footrulewidth}{0.7mm} - -% cover page headers - -\fancypagestyle{cover}{ - \fancyhf{} - \cfoot{\hspace{1cm}} - \renewcommand{\headrulewidth}{0.7mm} - \renewcommand{\footrulewidth}{0.7mm} -} - -% environment for code samples - -\tthdump{ -\newsavebox{\hest} -\newenvironment{code} -{\begin{center}\tthdump{\begin{lrbox}{\hest}}\begin{minipage}{0.95\columnwidth}} -{\end{minipage}\tthdump{\end{lrbox}\fbox{\usebox{\hest}}}\end{center}} -} -\iftth -\newenvironment{code} -{\begin{html}
\end{html}} -{\begin{html}
\end{html}} -\fi - -% environment for code listings - -\tthdump{ -\newenvironment{listing} -{\begin{footnotesize}\setlength{\parskip}{0cm}} -{\end{footnotesize}} -} -\iftth -\newenvironment{listing} -{\begin{html}\end{html}} -{\begin{html}\end{html}} -\fi -\end_preamble -\language american -\inputencoding latin1 -\fontscheme default -\graphics default -\paperfontsize 11 -\spacing single -\papersize a4paper -\paperpackage widemarginsa4 -\use_geometry 0 -\use_amsmath 0 -\use_natbib 0 -\use_numerical_citations 0 -\paperorientation portrait -\secnumdepth 3 -\tocdepth 3 -\paragraph_separation skip -\defskip medskip -\quotes_language english -\quotes_times 2 -\papercolumns 1 -\papersides 2 -\paperpagestyle fancy - -\layout Standard -\noindent - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -thispagestyle{cover} -\backslash -tthdump{ -\backslash -emph{ -\backslash -LARGE The ObjectWeb Consortium} -\backslash -hfill -\backslash -includegraphics{objectweb.ps} -\newline - -\backslash -vspace{2mm} -\backslash -hrule -\backslash -vspace{1mm} -\newline -{ -\backslash -LARGE Specification} -\newline - -\backslash -vfill} -\backslash -tthvfill -\end_inset - - -\layout Standard -\align center - -\series bold -\size largest -The Fractal Component Model -\layout Standard -\align center - -\begin_inset Graphics - filename fractal.ps - display none - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vfill -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthvfill -\end_inset - - -\layout Standard -\align right - -\begin_inset Tabular - - - - - - - - -\begin_inset Text - -\layout Standard - - -\series bold -Authors -\series default -: -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -E. - Bruneton -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -(France Telecom R&D) -\end_inset - - - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -T. - Coupaye -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -(France Telecom R&D) -\end_inset - - - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -J.B. - Stefani -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -(INRIA) -\end_inset - - - - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vfill -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -hrule -\end_inset - - -\layout Standard -\align right - -\begin_inset Tabular - - - - - - -\begin_inset Text - -\layout Standard - -Released -\end_inset - - -\begin_inset Text - -\layout Standard - -February 5, 2004 -\end_inset - - - - -\begin_inset Text - -\layout Standard - -Status -\end_inset - - -\begin_inset Text - -\layout Standard - -Draft -\end_inset - - - - -\begin_inset Text - -\layout Standard - -Version -\end_inset - - -\begin_inset Text - -\layout Standard - -2.0-3 -\end_inset - - - - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -pagenumbering{roman} -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthhrule -\end_inset - - -\layout Standard - - -\series bold -General Information -\layout Itemize - -Authors are given in alphabetical order. -\layout Itemize - -Background of front-page image appears courtesy of Giuseppe Zito. -\layout Itemize - -Please send technical comments on this specification to fractal@objectweb.org. - Authors would be glad to hear from people using, implementing or extending - Fractal. -\layout Standard -\align left -Copyright 2002-2003 France Télécom S.A. -\newline -28, chemin du vieux chêne, 38243, Meylan Cedex, France. -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\newline -Copyright 2002-2003 INRIA. -\newline -655 avenue de l'Europe, ZIRST, Montbonnot St Martin, 38334 Saint-Ismier - Cedex, France. -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\newline -All rights reserved. -\layout Standard - - -\series bold -Trademarks -\layout Standard - -All product names mentioned herein are trademarks of their respective owners. -\layout Standard - - -\series bold -Disclaimer of warranties -\layout Standard - - -\emph on -The specification is provided -\begin_inset Quotes eld -\end_inset - -as is -\begin_inset Quotes erd -\end_inset - -. - The specification could include technical inaccuracies or typographical - errors. - Changes are periodically added to the information therein; these changes - will be incorporated into new versions of the specification, if any -\size footnotesize -. - -\size default - France Telecom and INRIA make no representations or warranties, either - express or implied, including but not limited to, warranties of merchantability -, fitness for a particular purpose, or non-infringement that the contents - of the specification are suitable for any purpose or that any practice - or implementation of such contents will not infringe any third party patents, - copyrights, trade secrets or other rights. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthhrule -\end_inset - - -\layout Standard - - -\begin_inset LatexCommand \tableofcontents{} - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthdump{ -\backslash -listoffigures} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthhrule -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -pagenumbering{arabic} -\end_inset - - -\layout Section - -Introduction -\begin_inset LatexCommand \label{sec:Introduction} - -\end_inset - - -\layout Subsection - -Rationale -\begin_inset LatexCommand \label{sub:Rationale} - -\end_inset - - -\layout Standard - -By enforcing a strict separation between interface and implementation and - by making software architecture explicit, component-based programming can - facilitate the implementation and maintenance of complex software systems. - Coupled with the use of meta-programming techniques, component-based programmin -g can hide to application programmers some of the complexities inherent - in the handling of non-functional aspects in a software system, such as - distribution and fault-tolerance, as exemplified e.g. - by the container concept in Enterprise Java Beans (EJB), CORBA Component - Model (CCM), or Microsoft .Net. -\layout Standard - -Existing component-based frameworks and architecture description languages, - however, provide only limited support for extension and adaptation. - This limitation has several important drawbacks: it prevents the easy and - possibly dynamic introduction of different control facilities for components - such as non-functional aspects; it prevents application designers and programme -rs from making important trade-offs such as degree of configurability vs - performance and space consumption; and it can make difficult the use of - these frameworks and languages in different environments, including embedded - systems. -\layout Standard - -The Fractal component model alleviates the above problems by introducing - a notion of component endowed with an open set of control capabilities. - In other terms, components in Fractal are reflective, and their reflective - capabilities are not fixed in the model but can be extended and adapted - to fit the programmer's constraints and objectives. -\layout Subsection - -Overview -\begin_inset LatexCommand \label{sub:Overview} - -\end_inset - - -\layout Standard - -Main goals of the Fractal component model are to implement, deploy and manage - (i.e. - monitor and dynamically reconfigure) complex software systems. - These goals motivate the main features of the Fractal model: composite - components (to have a uniform view of applications at various abstraction - levels), shared components (to model resources), introspection capabilities - (to monitor a running system), and configuration and reconfiguration capabiliti -es (to deploy and dynamically reconfigure an application). - But another goal of the Fractal model is to be applicable to many software, - from embedded software to application servers and information systems. - Unfortunately, the advanced features of the Fractal model have a cost that - is not always compatible with the limited resources of constrained environments. -\layout Standard - -In order to achieve these contradictory goals, the Fractal component model - is not defined as a big, fixed specification that all Fractal components - must follow, but rather as an extensible system of relations between well - defined concepts and corresponding APIs that Fractal components -\emph on -may -\emph default - or -\emph on -may not -\emph default - implement, depending on what they can or want to offer to other components. - This set of specifications can be organized, and is presented in this document - as increasing -\begin_inset Quotes eld -\end_inset - -levels of -\emph on - control -\emph default - -\begin_inset Quotes erd -\end_inset - -, i.e. - in increasing order of -\emph on -reflective -\emph default - capabilities ( -\emph on -introspection -\emph default - and -\emph on -intercession -\emph default -). -\layout Standard - -At the lowest level of control, a Fractal component is a runtime entity - that does not provide any control capability to other components, and is - therefore like an object (such a component can be used in only one way, - namely by calling methods on it). - In fact, an object -\emph on -is -\emph default - a Fractal component without any control capability (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Foundations} - -\end_inset - -). - This feature is useful to handle cases where components have to be connected - to legacy software. -\layout Standard - -At the next level of control capability, which can be called the external - -\begin_inset Quotes eld -\end_inset - -introspection -\begin_inset Quotes erd -\end_inset - - level (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Introspection} - -\end_inset - -), a Fractal component can provide a standard interface, similar to the - -\family sans -IUnknown -\family default - interface in COM, that allows one to discover all its external interfaces - or, in other words, its boundary (like an object, a Fractal component can - provide several interfaces). -\layout Standard - -At the next level of control capability, which can be called the -\begin_inset Quotes eld -\end_inset - -configuration -\begin_inset Quotes erd -\end_inset - - level (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Configuration} - -\end_inset - -), a Fractal component can provide control interfaces to introspect and - modify its -\emph on -content -\emph default -, i.e. - what is inside its boundary. - In the Fractal model, this content is made of other Fractal components, - called its -\emph on -sub components -\emph default -, bound together through -\emph on -bindings -\emph default -. - A Fractal component can therefore choose to provide or not an interface - to control the set of its sub components, the set of bindings between these - sub components, and so on. -\layout Standard - -In addition to these control capabilities, the Fractal model also specifies - a framework for the instantiation of components (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Instantiation} - -\end_inset - -), and a simple type system for Fractal components (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Typing} - -\end_inset - -). - Like the above control capabilities, the instantiation framework and the - simple type system are optional. - In fact, in the Fractal model, -\emph on -everything -\emph default - is optional. - This has advantages and drawbacks, which are discussed in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Options} - -\end_inset - -. -\layout Standard - -As a result of this modular and extensible organization (anyone is free - to define its own control interfaces, in order to provide new introspection - and intercession capabilities), and given the fact that the Fractal component - model is not tied to a specific language, Fractal components can be used - in very different situations, from operating systems to middleware platforms, - from graphical user interfaces to information systems, and from highly - optimized but unreconfigurable configurations, to less optimized but highly - dynamic and reconfigurable systems or applications. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Foundations -\begin_inset LatexCommand \label{sec:Foundations} - -\end_inset - - -\layout Standard - -At the lowest control capability level, a Fractal component does not provide - any introspection or intercession function to other components. - Such a component, called a -\emph on -base component -\emph default -, can be used in only one way, namely by invoking operations on its component - interfaces. - A -\emph on -component interface -\emph default - is an -\emph on -access point -\emph default - to a component that implements a -\emph on -language interface -\emph default -. - -\emph on -Component interfaces and language interfaces should not be mixed up -\emph default -: a component interface is an access point that -\emph on -implements -\emph default - a language interface; a language interface is a -\emph on -type -\emph default -. - Despite of this risk, sentences such as -\begin_inset Quotes eld -\end_inset - -a component has an interface that implements the language interface -\begin_inset Formula $X$ -\end_inset - - -\begin_inset Quotes erd -\end_inset - - will often be abbreviated, in the rest of this document, into -\begin_inset Quotes eld -\end_inset - -a component has an interface -\begin_inset Formula $X$ -\end_inset - - -\begin_inset Quotes erd -\end_inset - -, in order to improve readability. -\layout Standard - -This section defines the pseudo Interface Definition Language used in the - rest of this document to define the language interfaces implemented by - Fractal component interfaces. - It also defines a framework to get access to component interfaces. -\layout Subsection - -Interface Definition Language -\begin_inset LatexCommand \label{sub:IDL} - -\end_inset - - -\layout Standard - -In order to allow Fractal components implemented in potentially distinct - programming languages to interoperate, some standard protocols for local - and remote operation invocations are necessary. - One way to ensure this is to use an Interface Definition Language (IDL), - and mappings from the IDL to existing programming languages. - The IDL compiler can then generate stubs and skeletons to make the conversion - from language specific protocols to standard protocols, and vice versa. -\layout Standard - -Despite of this, in the Fractal component model, -\emph on -IDLs and mappings are optional -\emph default -, as everything else. - This means that Fractal component interfaces can be defined either directly - in -\emph on -any -\emph default - programming language, or indirectly via -\emph on -any -\emph default - IDL. - As a consequence, the constraints and costs associated to the use of an - IDL do not have to be paid for, if interoperability is not needed. -\layout Standard - -In this document the component interfaces are specified in a pseudo IDL - language (see below), in order to show that the Fractal component model - does not enforce the use of any existing programming or interface definition - language. - A possible definition of these interfaces is also given in Java, C and - OMG IDL (see Appendix\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Mappings} - -\end_inset - -). - These definitions can be used as -\begin_inset Quotes eld -\end_inset - -standard -\begin_inset Quotes erd -\end_inset - - definitions to provide interoperability between Java components only, between - C components only, and between any components (respectively). -\layout Standard - -The non normative, pseudo IDL language used in this document for illustration - purposes is a modified subset of Java, so as to be immediately understandable - by Java programmers. - In this language, an interface definition is a Java interface definition - with the following restrictions: -\layout Itemize - -modifiers ( -\family sans -\series bold -public -\family default -\series default -, -\family sans -\series bold -final -\family default -\series default -, ...) are not allowed; -\layout Itemize - -field (i.e. - constant) declarations are allowed only with literal expressions; -\layout Itemize - -inner interface and class definitions are not allowed; -\layout Itemize - -class types are not allowed in array types, formal parameter types and return - types. -\layout Standard - -and with the following extensions: -\layout Itemize - -a new -\family sans -\series bold -any -\family default -\series default - type, meaning any interface type, is available to replace -\family sans -java.lang.Object -\family default -; -\layout Itemize - -a new -\family sans -\series bold -string -\family default -\series default - primitive type is available to replace -\family sans -java.lang.String -\family default -. -\layout Standard - -Exceptions are allowed in operation declarations, -\emph on -but are not considered as classes -\emph default -, as in Java: they are instead considered as abstract names, denoting categories - of errors -\emph on -. -\layout Subsection - -Naming and binding -\begin_inset LatexCommand \label{sub:Naming-and-binding} - -\end_inset - - -\layout Standard - -In order to invoke operations on a component interface, one must first identify - the interface to be called, and then get an access to this interface. - This section defines a framework for doing so, based on names, naming contexts - and binders (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Naming-API} - -\end_inset - -). - This framework is mainly designed to access remote interfaces, but can - also be used in a single address space. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.naming; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -Name { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -NamingContext getNamingContext (); -\family default - -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -byte -\series default -[] encode () -\series bold -throws -\series default - NamingException; -\layout Standard - - -\family sans -} -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -NamingContext { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Name export ( -\series bold -any -\family default -\series default - -\family sans -o, -\family default - -\family sans -\series bold -any -\family default -\series default - -\family sans -hints) -\series bold -throws -\series default - NamingException; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Name decode ( -\series bold -byte -\series default -[] b) -\series bold -throws -\series default - NamingException; -\layout Standard - - -\family sans -} -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -Binder -\family default - -\family sans -\series bold -extends -\family default -\series default - -\family sans -NamingContext { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\family default -\series default - -\family sans -bind (Name n, -\family default - -\family sans -\series bold -any -\family default -\series default - -\family sans -hints) -\series bold -throws -\series default - NamingException; -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Naming API -\begin_inset LatexCommand \label{cap:Naming-API} - -\end_inset - - -\end_inset - - -\layout Standard - -A -\emph on -name -\emph default - designates a component interface. - Names can take many forms, such as Java references or Interoperable Object - References (IORs). - A name does not necessarily give direct access to the interface it designates - (a CORBA IOR does not give direct access to the designated remote interface; - on the contrary, a Java reference can be used directly to call methods - on the designated interface). - A name is represented by the -\family sans -Name -\family default - interface. -\layout Standard - -A name is always associated to a -\emph on -naming context -\emph default -, and is generally invalid outside this context. - For example the naming context of a Java reference is the Java Virtual - Machine (JVM) in which the designated object resides. - This name is meaningless outside this context and, in particular, in another - JVM. - The naming context of an IOR is the CORBA IOR -\begin_inset Quotes eld -\end_inset - -name space -\begin_inset Quotes erd -\end_inset - -. - An IOR is meaningless outside this context and, in particular, in the Java - RMI over JRMP context. - The -\family sans -Name -\family default - interface specifies a -\family sans -getNamingContext -\family default - operation, which returns the naming context of the name on which this operation - is invoked. -\layout Standard - -A name can be serialized in many forms, such as a string or a byte array. - For example a Java reference can be serialized as a string representing - the memory address of the object, in decimal or hexadecimal form. - An IOR can be serialized as a string containing a host name or IP address, - a TCP port number, and an object key. - In serialized form, a name can be sent over a network, or stored in a file - or a database. - The -\family sans -Name -\family default - interface specifies an -\family sans -encode -\family default - operation, which returns an encoded form of the name on which this operation - is invoked, as a byte array. -\layout Standard - -A naming context is represented by the -\family sans -NamingContext -\family default - interface. - A naming context creates and manages names in its context. - In particular, a naming context can create a name for a given component - interface. - The -\family sans -NamingContext -\family default - interface specifies an -\family sans -export -\family default - operation for doing that: this operation takes as argument a component - interface and optional hints, and returns a name for this interface. - A naming context can also deserialize names in serialized form. - The -\family sans -NamingContext -\family default - interface specifies a -\family sans -decode -\family default - operation for doing that: this operation takes as argument a serialized - name, as a byte array, and returns the corresponding name. -\layout Standard - -In order to access the interface designated by a name, a -\emph on -binding -\emph default - must be established to this interface. - For example, in order to access a remote interface designated by an IOR, - a socket must be opened to send an invocation message to the remote interface. - These bindings are created by -\emph on -binders -\emph default -. - A binder is represented by the -\family sans -Binder -\family default - interface, which extends the -\family sans -NamingContext -\family default - interface. - This interface specifies a -\family sans -bind -\family default - operation that takes a name as parameter, creates a binding to the interface - designated by this name, and returns a delegate (or proxy) of this interface, - or the interface itself, to invoke operations on it. -\layout Standard - -The -\family sans -org.objectweb.naming.NamingException -\family default - exception must be thrown when an error occurs in the operations of the - -\family sans -Name -\family default -, -\family sans -NamingContext -\family default - and -\family sans -Binder -\family default - interfaces. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Introspection -\begin_inset LatexCommand \label{sec:Introspection} - -\end_inset - - -\layout Standard - -At the next control capability level, beyond the base level where components - do not provide any control function, a Fractal component can provide introspect -ion functions to introspect its -\emph on - external -\emph default - features, i.e. - its boundary. - This section defines more precisely the external features of Fractal components -, and specifies the interfaces related to the introspection of these features. - -\emph on -The interfaces related to the introspection (and reconfiguration) of the - internal features of Fractal components are specified in the next section. -\layout Subsection - -External component structure -\layout Standard - -Depending on the level of observation, or -\emph on -scale -\emph default -, a Fractal component can be seen as a black box or as a white box. - When seen as black box, i.e. - when its internal organization is not visible, the only visible details - of a Fractal component are some -\emph on -access points -\emph default - to this black box, called its -\emph on -external interfaces -\emph default - (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:External-view} - -\end_inset - -). - Each interface has a name, in order to distinguish it from the other interfaces - of the component (a component can have several interfaces implementing - the same language interface). - All the external interfaces of a component must have distinct names, but - two interfaces in two distinct components may have the same name. - One may distinguish two kinds of interfaces: a -\emph on -client -\emph default - (or -\emph on -required -\emph default -) interface emits operation invocations, while a -\emph on -server -\emph default - (or -\emph on -provided -\emph default -) interface receives them. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard -\align center - -\begin_inset Graphics - filename external-view.eps - display none - -\end_inset - - -\layout Caption - -External view of a Fractal component -\begin_inset LatexCommand \label{cap:External-view} - -\end_inset - - -\end_inset - - -\layout Standard - -The interfaces of a component can be introspected with two language interfaces, - specified in the next two sections: one to get the list of interfaces of - a component, and one to introspect the interfaces themselves. - These two interfaces are of course optional, as everything in the Fractal - model: a component can provide both interfaces, only the first one, or - none of them. -\layout Subsection - -Component introspection -\begin_inset LatexCommand \label{sub:Component-introspection} - -\end_inset - - -\layout Standard - -In order to discover the external interfaces of a component, a component - can provide an interface that implements the -\family sans -Component -\family default - interface (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Component-introspection-API} - -\end_inset - -). - This language interface provides two operations named -\family sans -getFcInterfaces -\family default - and -\family sans -getFcInterface -\family default -, that can be used to retrieve the interfaces of the component. - The first operation takes no arguments, and returns an array containing - all the external interfaces, either client or server, of the component, - including the -\family sans -Component -\family default - interface. - The second operation takes the name of an interface as parameter, and returns - this interface, if it exists. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.fractal.api; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -Component { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\series default -[] getFcInterfaces (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\family default -\series default - -\family sans -getFcInterface ( -\series bold -string -\family default -\series default - -\family sans -itfName) -\series bold - throws -\series default - NoSuchInterfaceException; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Type getFcType (); -\layout Standard - - -\family sans -} -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -Type { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -boolean -\family default -\series default - -\family sans -isFcSubTypeOf (Type t); -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Component introspection API -\begin_inset LatexCommand \label{cap:Component-introspection-API} - -\end_inset - - -\end_inset - - -\layout Standard - -The -\family sans -getFcInterfaces -\family default - and -\family sans -getFcInterface -\family default - operations return references that give access to requested interfaces. - In other words, the references returned by these operations can be used - directly, after an appropriate cast, to invoke operations on the component's - server interfaces (no explicit binding is needed). - For example, if a component has a server interface named -\family sans -account -\family default - implementing the language interface -\family sans -Account -\family default -, then the -\family sans -getBalance -\family default - operation of this interface can be invoked with a code like -\family sans -((Account)c.getFcInterface("account")).getBalance() -\family default -, where -\family sans -c -\family default - is a reference to the -\family sans -Component -\family default - interface of the component. -\layout Standard - -The -\family sans -Component -\family default - interface also provides a -\family sans -getFcType -\family default - operation, which returns the type of the component, as a -\family sans -Type -\family default - reference. - This interface defines a minimal notion of type, which actually defines - only one operation named -\family sans -isFcSubTypeOf -\family default -, whose role is to test if a given type is a sub type or not of another - type. - This interface can be extended to define more useful type systems for component -s and component interfaces, such as the one defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Typing} - -\end_inset - -. -\layout Standard - -The -\family sans -org.objectweb.fractal.api.NoSuchInterfaceException -\family default - exception must be thrown in the -\family sans -getFcInterface -\family default - operation when a requested component interface is not found. -\layout Standard - -A component interface implementing -\family sans -Component -\family default - must be named -\family sans -component -\family default -. -\layout Subsection - -Interface introspection -\begin_inset LatexCommand \label{sub:Interface-introspection} - -\end_inset - - -\layout Standard - -By default the references returned by the -\family sans -getFcInterface -\family default - and -\family sans -getFcInterfaces -\family default - operations provide access to the requested interfaces, and nothing more. - In particular, it is impossible to find the names of these interfaces. - In order to provide such interface introspection functions, a component - can ensure that the references returned by the above operations are castable - into the -\family sans -Interface -\family default - type (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Interface-introspection-API} - -\end_inset - -). - This interface specifies four operations to get the name of a component - interface, to get its type (as a -\family sans -Type -\family default - reference), to get the -\family sans -Component -\family default - interface of the component to which it belongs, and to test if the interface - is internal or not (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Internal-component-structure} - -\end_inset - -). -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.fractal.api; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -Interface { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -string -\family default -\series default - -\family sans -getFcItfName (); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Type getFcItfType (); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Component getFcItfOwner (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -boolean -\family default -\series default - -\family sans -isFcInternalItf (); -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Interface introspection API -\begin_inset LatexCommand \label{cap:Interface-introspection-API} - -\end_inset - - -\end_inset - - -\layout Standard - -Note that the -\family sans -getFcItfOwner -\family default - operation allows one to discover all the interfaces of a component from - any interface of this component, and not only from its -\family sans -Component -\family default - interface. - For example, if -\family sans -a -\family default - is a reference to the -\family sans -Account -\family default - interface of a such component, the -\family sans -Component -\family default - interface of this component can be retrieved with a code like -\family sans -((Interface)a).getFcItfOwner() -\family default -, if the component provides interface introspection functions. - The result can then be used to get the reference of any other interface - of the component. -\layout Comment - -The -\family sans -Interface -\family default - interface inherits from the -\family sans -Name -\family default - interface, in order to show that component interfaces can be sent over - a network, as names. - Furthermore, this name can be seen as a compound name, made of a name that - identifies a component (returned by -\family sans -getFcItfOwner -\family default -), and of a local name (returned by -\family sans -getFcItfName -\family default -) that identifies an interface inside this component. - Note that simple string names are used for local interface names, although - it would have been possible to use instead the general naming and binding - framework defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Naming-and-binding} - -\end_inset - -. -\layout Subsubsection* - -Notes -\layout Itemize - - -\family sans -Component -\family default - and -\family sans -Interface -\family default - have very distinct roles and should not be mixed up. - On the one hand, -\family sans -Component -\family default - is a language interface that is provided by a component just like any other - language interface. - On the other hand, in the case of a component providing interface introspection -, -\family sans -Interface -\family default - is a language interface that is implemented by -\emph on -all -\emph default - the component interfaces: any component interface of a such component implement -s both a specific language interface, such as -\family sans -Account -\family default - or -\family sans -Component -\family default -, -\emph on -and -\emph default - -\family sans -Interface -\family default -. - -\layout Itemize - -A functional interface such as -\family sans -Account -\family default - is likely to provide a -\family sans -getName -\family default - or -\family sans -getOwner -\family default - operation, as the -\family sans -Interface -\family default - interface. - And since, in the case of components that provide interface introspection, - a reference of one type should be castable to the other, there is a risk - of name conflicts (at least in some languages, such as Java). - In order to reduce these risks, the -\family sans -Interface -\family default - operations follow the pattern -\emph on -verb -\family sans -\emph default -Fc -\family default -\emph on -noun -\emph default -, where -\family sans -Fc -\family default - stands for Fractal component. - This pattern has then been generalized to all the Fractal APIs. - -\layout Itemize - -Providing the -\family sans -Component -\family default - interface is quite easy, but supporting the -\family sans -Interface -\family default - interface can imply some runtime time overheads. - This is why this interface is optional. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Configuration (introspection & intercession) -\begin_inset LatexCommand \label{sec:Configuration} - -\end_inset - - -\layout Standard - -At the next level of control capability, beyond the -\begin_inset Quotes eld -\end_inset - -introspection -\begin_inset Quotes erd -\end_inset - - level where components provide interfaces to introspect their external - features, a Fractal component can provide control interfaces to introspect - and reconfigure its -\emph on -internal -\emph default - features. - This section defines these internal features, and specifies some possible - interfaces to introspect and reconfigure them. -\layout Subsection - -Internal component structure -\begin_inset LatexCommand \label{sub:Internal-component-structure} - -\end_inset - - -\layout Standard - -Internally, a Fractal component is formed out of two parts: a -\emph on -controller -\emph default - (also called membrane), and a -\emph on -content -\emph default - (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Internal-view} - -\end_inset - -). - The content of a component is composed of (a finite number of) other components -, called -\emph on -sub components -\emph default -, which are under the control of the controller of the enclosing component. - The Fractal model is thus recursive and allows components to be nested - (i.e. - to appear in the content of enclosing components) at an arbitrary level. - A component that exposes its content is called a -\emph on -composite -\emph default - component. - A component that does not expose its content, but has at least one control - interface (see below), is called a -\emph on -primitive -\emph default - component. - A component without any control interface is called a base component (see - section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Foundations} - -\end_inset - -). -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard -\align center - -\begin_inset Graphics - filename internal-view.eps - display none - -\end_inset - - -\layout Caption - -Internal view of a Fractal component -\begin_inset LatexCommand \label{cap:Internal-view} - -\end_inset - - -\end_inset - - -\layout Standard - -The controller of a component can have -\emph on -external -\emph default - and -\emph on -internal -\emph default - interfaces. - External interfaces are accessible from outside the component, while internal - interfaces are accessible only from the component's sub components. - All the external interfaces of a component must have distinct names, all - its internal interfaces must have distinct names, but a component can have - an external and an internal interface of the same name. - A -\emph on -functional -\emph default - interface is an interface that corresponds to a provided or required functional -ity of a component, while a -\emph on -control -\emph default - interface is a -\emph on -server -\emph default - interface that corresponds to a -\begin_inset Quotes eld -\end_inset - -non functional aspect -\begin_inset Quotes erd -\end_inset - -, such as introspection, configuration or reconfiguration, and so on. - By convention, an interface is considered to be a control interface if - its name is equal to -\family sans -component -\family default -, or ends with -\family sans --controller -\family default -. - All other interfaces are considered to be functional interfaces. -\layout Standard - -The controller of a component embodies the control behavior associated with - a particular component. - In particular, a component controller can: -\layout Itemize - -Provide an explicit and causally connected representation of the component's - sub components; -\layout Itemize - -Intercept oncoming and outgoing operation invocations targeting or originating - from the component's sub components; -\layout Itemize - -Superpose a control behavior to the behavior of the component's sub components, - including suspending, check pointing and resuming activities of these sub - components. - -\layout Standard - -Each component controller can thus be seen as implementing a particular - semantic of composition for the component's sub components. - The control capability of a controller is not limited by the model. - For instance, it can be mainly interception-based as in industrial component - frameworks containers for instance; or it can be void (i.e. - no control is exercised - in this case, the controller can still be useful - for it can provide a representation of its content and manifest a containment - relationship). -\layout Standard - -A component may appear in the content of (be -\emph on -shared -\emph default - by) several distinct enclosing components (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Content-control} - -\end_inset - - and Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Sharing} - -\end_inset - -). - A component that is shared among two or more distinct components is subject - to the control of their respective controllers. - The exact semantics of the resulting configuration (e.g. - which control behavior is enacted) is in general determined by an encompassing - component that encloses all the relevant components in the configuration. -\layout Standard - -A -\emph on -binding -\emph default - is a communication path between component interfaces. - The Fractal model distinguishes between -\emph on -primitive bindings -\emph default - and -\emph on -composite bindings -\emph default -. - A primitive binding is a binding between one client interface and one server - interface, in the same address space, which means that the operation invocation -s emitted by the client interface should be accepted by the specified server - interface. - A primitive binding between a client interface c and a server interface - s of two components C and S must verify one of the following constraints - (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Internal-view} - -\end_inset - -): -\layout Itemize - -c and s are external interfaces, and C and S have a direct common enclosing - component. - Such bindings are called -\emph on -normal bindings -\emph default -. -\layout Itemize - -c is an internal interface, s is an external interface, and S is a sub component - of C. - Such bindings are called -\emph on -export bindings -\emph default -. - -\layout Itemize - -c is an external interface, s is an internal interface, and C is a sub component - of S. - Such bindings are called -\emph on -import bindings -\emph default -. - -\layout Standard - -In addition to these structural constraints, which ensure that primitive - bindings cannot -\begin_inset Quotes eld -\end_inset - -cross -\begin_inset Quotes erd -\end_inset - - component boundaries except through interfaces, a primitive binding can - be established between a client and a server interface only if the server - interface can accept at least all the operation invocations that the client - interface can emit. - In other words, the (language) type of the server interface must be a sub - type of the type of the client interface (the two interfaces can of course - be of the same type since a sub typing relation must be reflexive). - The last constraint is that a client interface can be bound to at most - one server interface, while several client interfaces can be bound to the - same server interface. -\layout Standard - -A composite binding is a communication path between an arbitrary number - of component interfaces, of arbitrary language types. - These bindings are represented as a set of primitive bindings and -\emph on -binding components -\emph default - (stubs, skeletons, adapters, ...). - A binding component is a normal Fractal component, whose role is dedicated - to communication. - Binding components are also called -\emph on -connectors -\emph default -: hence Fractal -\emph on -does -\emph default - have connectors, although this concept is not a core concept here, as component - or interface - this is why there is no special API for them. - It should be noted that the binding concept defined here is exactly is - the same as the binding concept defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Naming-and-binding} - -\end_inset - -: in particular, primitive bindings correspond to local bindings, i.e. - to bindings inside a single address space. -\layout Subsection - -Attribute control -\layout Standard - -An -\emph on -attribute -\emph default - is a configurable property of a component, such as the text or color of - a button, or the maximum size of a pool or cache component. - Attributes are generally of primitive type, and are used to configure the - state of components without needing to use bindings (it is possible to - configure the text of a button, for example, by binding this button component - to a text component; but this is overly complex for what is needed). - A component can provide an -\family sans -AttributeController -\family default - interface to read and write its attributes from outside the component (see - Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Attribute-control-API} - -\end_inset - -). -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.fractal.api.control; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -AttributeController { } -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Attribute control API -\begin_inset LatexCommand \label{cap:Attribute-control-API} - -\end_inset - - -\end_inset - - -\layout Standard - -In this case, the component must actually provide a sub interface of this - interface, since the -\family sans -AttributeController -\family default - interface is in fact empty. - This sub interface must contain one getter and/or setter operation per - configurable attribute. - For example: -\layout Itemize - -a component that wants to provide an -\family sans -AttributeController -\family default - interface for a read only string attribute -\family sans -foo -\family default - must provide a sub interface of this interface containing the following - operation: -\family sans -string getFoo(); -\layout Itemize - -a component that wants to provide an -\family sans -AttributeController -\family default - interface for a write only string attribute -\family sans -foo -\family default - must provide a sub interface of this interface containing the following - operation: -\family sans -void setFoo(string foo); -\layout Itemize - -a component that wants to provide an -\family sans -AttributeController -\family default - interface to configure two string attributes -\family sans -foo -\family default - and -\family sans -bar -\family default - must provide a sub interface of this interface containing the following - operations: -\family sans -string getFoo() -\family default -, -\family sans -void setFoo(string foo) -\family default -, -\family sans -string getBar() -\family default - and -\family sans -void setBar(string bar); -\layout Standard - -It is a requirement of this specification that setters and getters must - follow the lexicographic and typing conventions introduced informally in - the example above with respect to names and signatures of setters and getters - (these conventions are those of the Java Beans component model). -\layout Standard - -A component interface implementing -\family sans -AttributeController -\family default - must be named -\family sans -attribute-controller -\family default -. -\layout Subsection - -Binding control -\layout Standard - -A component can provide the -\family sans -BindingController -\family default - interface to bind and unbind its client interfaces to other components - through -\emph on -primitive -\emph default - bindings (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Binding-control-API} - -\end_inset - -). - -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.fractal.api.control; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -BindingController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -string -\series default -[] listFc (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\family default -\series default - -\family sans -lookupFc ( -\series bold -string -\family default -\series default - -\family sans -clientItfName) -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -throws -\series default - NoSuchInterfaceException; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -void -\family default -\series default - -\family sans -bindFc ( -\series bold -string -\family default -\series default - -\family sans -clientItfName, -\family default - -\family sans -\series bold -any -\family default -\series default - -\family sans -serverItf) -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -throws -\series default - NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -void -\family default -\series default - -\family sans -unbindFc ( -\series bold -string -\family default -\series default - -\family sans -clientItfName) -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -throws -\series default - NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException; -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Binding control API -\begin_inset LatexCommand \label{cap:Binding-control-API} - -\end_inset - - -\end_inset - - -\layout Standard - -This interface defines the following operations: -\layout Itemize - -The -\family sans -listFc -\family default - operation returns the names of the client interfaces of the component. - These names are the names that can be passed as first argument to the -\family sans -lookupFc -\family default - operation. - -\layout Itemize - -The -\family sans -lookupFc -\family default - operation takes as parameter the name of a client interface of the component, - either external or internal, and returns the server interface that is bound - to this client interface, or -\family sans -null -\family default - if there is no such interface. - If the component to which the server interface belongs supports the interface - introspection (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Interface-introspection} - -\end_inset - -), the reference returned by this operation can be cast to -\family sans -Interface -\family default -. - -\layout Itemize - -The -\family sans -bindFc -\family default - operation takes as parameters the name of a client interface of the component, - either external or internal, and a server interface of another component, - and binds these two interfaces together. - As above, the server interface can be cast or not to -\family sans -Interface -\family default -, depending on the introspection capabilities provided by the server component. - -\layout Itemize - -The -\family sans -unbindFc -\family default - operation takes as parameter the name of a client interface of the component, - either external or internal, and unbinds this interface. -\layout Standard - -These operations -\emph on -may -\emph default - throw a -\family sans -NoSuchInterfaceException -\family default - exception if a specified client interface does not exist, an -\family sans -IllegalLifeCycleException -\family default - exception when a component is not in an appropriate state to perform an - operation, and an -\family sans -org.objectweb.fractal.api.control.IllegalBindingException -\family default - exception in case of other errors related to bindings. - -\layout Standard - -A component interface implementing -\family sans -BindingController -\family default - must be named -\family sans -binding-controller -\family default -. -\layout Standard - -Composite bindings are created with the general naming and binding framework - (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Naming-and-binding} - -\end_inset - -). - For example, in order to bind two component interfaces that are not in - the same address space, a binding component must first be created between - the two interfaces, by using the naming and binding framework (typically, - the server interface will be exported in some distributed -\family sans -NamingContext -\family default -, the returned -\family sans -Name -\family default - will be encoded, sent over the network, decoded, and finally a -\family sans -Binder -\family default - will be used to create the binding component from this name; all this can - be done explicitly or implicitly, as the effect of passing an interface - reference in a remote operation invocation). - The -\family sans -BindingController -\family default - interface will then be used to create the primitive bindings between the - client interface and the binding component, and between the binding component - and the server interface. -\layout Subsection - -Content control -\begin_inset LatexCommand \label{sub:Content-control} - -\end_inset - - -\layout Standard - -A component can provide the -\family sans -ContentController -\family default - interface to add and remove sub components in this component (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Content-control-API} - -\end_inset - -). -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.fractal.api.control; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -ContentController { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\series default -[] getFcInternalInterfaces (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\family default -\series default - -\family sans -getFcInternalInterface ( -\series bold -string -\family default -\series default - -\family sans -itfName) -\series bold -throws -\series default - NoSuchInterfaceException; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{1mm} -\end_inset - - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Component[] getFcSubComponents (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -void -\family default -\series default - -\family sans -addFcSubComponent (Component c) -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -throws -\series default - IllegalContentException, IllegalLifeCycleException; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -void -\family default -\series default - -\family sans -removeFcSubComponent (Component c) -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -throws -\series default - IllegalContentException, IllegalLifeCycleException; -\layout Standard - - -\family sans -} -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\series default - SuperController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Component[] getFcSuperComponents (); -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Content control API -\begin_inset LatexCommand \label{cap:Content-control-API} - -\end_inset - - -\end_inset - - -\layout Standard - -This interface defines three operations to get the list of sub components - of a component, and to add and remove sub components in a component: -\layout Itemize - -the -\family sans -getFcSubComponents -\family default - operation returns the list of sub components of the component, as an array - of -\family sans -Component -\family default - references. - The -\family sans -getFcSuperComponents -\family default - operation, in the -\family sans -SuperController -\family default - interface (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Content-control-API} - -\end_inset - -), provides the opposite function: it returns the components that contain - this component, and which are called its -\emph on -super -\emph default - components. - -\layout Itemize - -the -\family sans -addFcSubComponent -\family default - operation takes a component -\begin_inset Formula $c$ -\end_inset - - as parameter, as a -\family sans -Component -\family default - reference, and adds this component to the component's content. - If -\begin_inset Formula $C$ -\end_inset - - and -\begin_inset Formula $C'$ -\end_inset - - are the set of sub components of the component before and after -\begin_inset Formula $c$ -\end_inset - - is added, then -\begin_inset Formula $c\in C'$ -\end_inset - - but -\begin_inset Formula $C'$ -\end_inset - - is not necessarily equal to -\begin_inset Formula $C\cup\{ c\}$ -\end_inset - -. - -\layout Itemize - -the -\family sans -removeFcSubComponent -\family default - operation takes a component as parameter, as a -\family sans -Component -\family default - reference, and removes this component from the component's content. - If -\begin_inset Formula $C$ -\end_inset - - and -\begin_inset Formula $C'$ -\end_inset - - are the set of sub components of the component before and after -\begin_inset Formula $c$ -\end_inset - - is removed, then -\begin_inset Formula $c\notin C'$ -\end_inset - - but -\begin_inset Formula $C'$ -\end_inset - - is not necessarily equal to -\begin_inset Formula $C-\{ c\}$ -\end_inset - -. -\layout Standard - -A given component can be added to several other components. - Such a component is said to be -\emph on -shared -\emph default - between these components. - Shared components are useful, paradoxically, to preserve component encapsulatio -n. - Consider, for example, a menu and a toolbar components (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Sharing} - -\end_inset - -), with an -\begin_inset Quotes eld -\end_inset - -undo -\begin_inset Quotes erd -\end_inset - - toolbar button corresponding to an -\begin_inset Quotes eld -\end_inset - -undo -\begin_inset Quotes erd -\end_inset - - menu item. - It is natural to represent the menu items and toolbar buttons as sub components -, encapsulated in the menu and toolbar components, respectively. - But, without sharing, this solution does not work for the -\begin_inset Quotes eld -\end_inset - -undo -\begin_inset Quotes erd -\end_inset - - button and menu item, which must have the same state (enabled or disabled): - these components, or an associated state component, must be put outside - the menu and toolbar components. - With component sharing, the state component can be shared between the menu - and toolbar components, in order to preserve component encapsulation. - Shared components are also useful to help separate -\begin_inset Quotes eld -\end_inset - -aspects -\begin_inset Quotes erd -\end_inset - - in component based applications. - For example, a shared logger component allows one to avoid adding a -\family sans -Logger -\family default - client interface to many components. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard -\align center - -\begin_inset Graphics - filename sharing.eps - display none - -\end_inset - - -\layout Caption - -Advantages of shared components -\begin_inset LatexCommand \label{cap:Sharing} - -\end_inset - - -\end_inset - - -\layout Standard - -Because of shared components, the structure of a Fractal component, in terms - of direct and indirect sub components, is not necessarily a tree, but can - be a directed acyclic graph (it cannot be an arbitrary graph, because a - component cannot be added inside itself or inside one of its direct or - indirect sub components). - In terms of bindings, this structure can be arbitrary, provided it follows - the constraints of section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Internal-component-structure} - -\end_inset - -. - In particular, bindings can form cycles. -\layout Standard - -The -\family sans -ContentController -\family default - interface also specifies two operations to get the internal interfaces - of the component, which are similar to the -\family sans -getFcInterface -\family default - and -\family sans -getFcInterfaces -\family default - operations. - These operations are useful to bind the internal interfaces to sub components. -\layout Standard - -The content controller operations -\emph on -may -\emph default - throw a -\family sans -NoSuchInterfaceException -\family default - exception if a specified client interface does not exist, an -\family sans -IllegalLifeCycleException -\family default - exception when a component is not in an appropriate state to perform an - operation and, in case of other errors related to content control, an -\family sans -org.objectweb.fractal.api.control.IllegalContentException -\family default - exception. - -\layout Standard - -A component interface implementing -\family sans -ContentController -\family default - (resp. - -\family sans -SuperController -\family default -) must be named -\family sans -content-controller -\family default - (resp. - -\family sans -super-controller -\family default -). -\layout Subsubsection* - -Note -\layout Standard - -In order to associate local names to the sub components of a component, - similar to the local names of the interfaces of a component, a possibility - is to ensure that all these sub components provide the -\family sans -NameController -\family default - interface defined in Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Name-control-API} - -\end_inset - -. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -interface -\series default - NameController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -string -\series default - getFcName (); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - setFcName ( -\series bold -string -\series default - name); -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Name control API -\begin_inset LatexCommand \label{cap:Name-control-API} - -\end_inset - - -\end_inset - - -\layout Standard - -A component interface implementing -\family sans -NameController -\family default - must be named -\family sans -name-controller -\family default -. -\layout Subsection - -Life cycle control -\begin_inset LatexCommand \label{sub:Life-cycle-control} - -\end_inset - - -\layout Standard - -Changing an attribute or a binding, or removing a sub component, with the - above control interfaces, and while components are executing, can be dangerous: - messages can be lost, the application's state may become inconsistent, - or the application may simply crash. - In order to provide a minimal support to help implement such dynamic reconfigur -ations, a component can provide the -\family sans -LifeCycleController -\family default - interface (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Lifecycle-control-API} - -\end_inset - -). -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.fractal.api.control; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -LifeCycleController { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -string -\family default -\series default - -\family sans -getFcState (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -void -\family default -\series default - -\family sans -startFc () -\series bold -throws -\series default - IllegalLifeCycleException; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -void -\family default -\series default - -\family sans -stopFc () -\series bold -throws -\series default - IllegalLifeCycleException; -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Life cycle control API -\begin_inset LatexCommand \label{cap:Lifecycle-control-API} - -\end_inset - - -\end_inset - - -\layout Standard - -This interface provides two operations named -\family sans -startFc -\family default - and -\family sans -stopFc -\family default -, to start and stop a component properly. - As for the -\family sans -addFcSubComponent -\family default - and -\family sans -removeFcSubComponent -\family default - operations, the semantics of these operations is voluntarily as weak as - possible, so that many implementations are possible: these operations may - or may not be recursive, i.e. - starting or stopping a component may or may not automatically start or - stop all its direct and indirect sub components. - Likewise, the effect of these operations on the component's state is voluntaril -y not specified (in fact it cannot be specified here, because the APIs defined - in this document do not provide access to this state). - In particular, the -\family sans -stopFc -\family default - operation can be seen as a clean up operation invoked before the component - is destroyed, or as a suspend operation. - In the first case the component's state will be erased, while in the second - case it will be left unchanged. -\layout Standard - -In addition to these operations, the -\family sans -LifeCycleController -\family default - interface also provides a -\family sans -getFcState -\family default - operation. - This operation returns the current state of the component (in a strict - sense, i.e. - without taking into account its sub components, which can have a different - execution state), as a string. - The -\family sans -STARTED -\family default - and -\family sans -STOPPED -\family default - strings mean that the component is started or stopped, respectively. -\layout Standard - -In the -\family sans -STARTED -\family default - state, i.e. - just after successful completion of a call to -\family sans -startFc -\family default -, a component can emit or accept operation invocations, which are guaranteed - to execute -\begin_inset Quotes eld -\end_inset - -normally -\begin_inset Quotes erd -\end_inset - -. - Note that this does not prevent the -\family sans -unbindFc -\family default - and -\family sans -removeFcSubComponent -\family default - operations to throw the -\family sans -IllegalLifeCycleException -\family default - if they are invoked while the component is in this state (in order to prevent - a component from being reconfigured while it is in an unstable state). -\layout Standard - -In the -\family sans -STOPPED -\family default - state, i.e. - just after successful completion of a call to -\family sans -stopFc -\family default -, a component cannot emit operation invocations, and can accept operation - invocations only through control interfaces. - -\emph on -The result of operation invocations to the functional interfaces of a stopped - component is undefined -\emph default -. - It may be a normal result, an exception, a suspension of the invocation - until the component is restarted, or anything else. -\layout Standard - -The -\family sans -LifeCycleController -\family default - interface corresponds to a minimal life cycle automaton, whose transitions - are represented in the following table: -\layout Standard -\align center - -\begin_inset Tabular - - - - - - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -STOPPED -\end_inset - - -\begin_inset Text - -\layout Standard - -STARTED -\end_inset - - - - -\begin_inset Text - -\layout Standard - -startFc -\end_inset - - -\begin_inset Text - -\layout Standard - -STARTED -\end_inset - - -\begin_inset Text - -\layout Standard - -STARTED -\end_inset - - - - -\begin_inset Text - -\layout Standard - -stopFc -\end_inset - - -\begin_inset Text - -\layout Standard - -STOPPED -\end_inset - - -\begin_inset Text - -\layout Standard - -STOPPED -\end_inset - - - - -\end_inset - - -\layout Standard - -However, some components may require very different life cycles. - Of course, completely arbitrary life cycles can be specified by providing - completely new interfaces, distinct from the -\family sans -LifeCycleController -\family default - interface. - More commonly, life cycles can be adapted from the basic one by extending - the -\family sans -LifeCycleController -\family default - interface to introduce new states and transitions or even to change the - transitions of the basic life cycle. - In this case, it is a requirement of this specification that the semantics - associated to the -\family sans -STARTED -\family default - and -\family sans -STOPPED -\family default - states should be preserved. -\layout Standard - -The -\family sans -org.objectweb.fractal.api.control.IllegalLifeCycleException -\family default - exception may be thrown when a requested transition, in a life cycle automaton, - is not valid. -\layout Standard - -A component interface implementing -\family sans -LifeCycleController -\family default - must be named -\family sans -lifecycle-controller -\family default -. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Instantiation -\begin_inset LatexCommand \label{sec:Instantiation} - -\end_inset - - -\layout Standard - -The frameworks presented in the previous sections allows one to use, introspect, - configure and reconfigure -\emph on -existing -\emph default - components. - In order to be useful, they must be completed with a framework to create - -\emph on -new -\emph default - components. - This section defines such a framework, based on factories. -\layout Subsection - -Factories -\layout Standard - -In the instantiation framework specified in this section, components are - created by other components called component -\emph on -factories -\emph default -. - The Fractal model distinguishes between generic component factories, which - can create several kinds of components, and standard component factories, - which can create only one kind of components, all with the same component - type. - Generic and standard component factories can provide the -\family sans -GenericFactory -\family default - interface and the -\family sans -Factory -\family default - interfaces, respectively (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Instantiation-API} - -\end_inset - - - note that, in accordance with the rule defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Internal-component-structure} - -\end_inset - -, both interfaces are functional interfaces, and not control interfaces). -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default -org.objectweb.fractal.api.factory -\series bold -; -\series default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -GenericFactory { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Component newFcInstance (Type t, -\family default - -\family sans -\series bold -any -\family default -\series default - -\family sans -controllerDesc, -\family default - -\family sans -\series bold -any -\family default -\series default - -\family sans -contentDesc) -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -throws -\series default - InstantiationException; -\family default - -\layout Standard - - -\family sans -} -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -Factory { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Type getFcInstanceType (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\family default -\series default - -\family sans -getFcControllerDesc (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -any -\family default -\series default - -\family sans -getFcContentDesc (); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Component newFcInstance () -\series bold -throws -\series default - InstantiationException; -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Instantiation API -\begin_inset LatexCommand \label{cap:Instantiation-API} - -\end_inset - - -\end_inset - - -\layout Standard - -The -\family sans -GenericFactory -\family default - interface provides only one operation named -\family sans -newFcInstance -\family default -. - This operation takes as parameter the type of the component to be created, - a descriptor of its controller part, and a descriptor of its content part. - This operation creates a component corresponding to the given description, - and returns its -\family sans -Component -\family default - interface. -\layout Standard - -The -\family sans -Factory -\family default - interface also provides a -\family sans -newFcInstance -\family default - operation, but this operation does not take any parameter, which reflects - the fact that all the components created by this operation have the same - type, and the same controller and content descriptors. - These information can be retrieved with the three other operations of this - interface, named -\family sans -getFcInstanceType -\family default -, -\family sans -getFcControllerDesc -\family default - and -\family sans -getFcContentDesc -\family default -. -\layout Standard - -In both interfaces, the component type must describe only the functional - interfaces of the components to be created. - The control interfaces of the components to be created must indeed be specified - in the controller descriptors. - The exact semantics of the controller and content descriptors, in both - interfaces, is however left unspecified in this version of the Fractal - component model specification. -\layout Standard - -Note that, in both interfaces, the -\family sans -newFcInstance -\family default - operation does not necessarily create a new component instance each time - it is invoked. - It can also, for example, always return the same instance (this is the - singleton pattern). - The components created by a factory must be created in the same address - space as the factory component. - But the exact location of the created components, in this address space, - is voluntarily -\emph on -not -\emph default - specified. - In particular, it is not ensured that the components created by a factory - are automatically added to the parent component(s) of the factory component. -\layout Standard - -The -\family sans -org.objectweb.fractal.api.factory.InstantiationException -\family default - exception must be thrown when a component cannot be created, in the -\family sans -newFcInstance -\family default - operations of the -\family sans -Factory -\family default - and -\family sans -GenericFactory -\family default - interfaces. -\layout Standard - -A component interface implementing -\family sans -GenericFactory -\family default - must be named -\family sans -generic-factory -\family default -. - A component interface implementing -\family sans -Factory -\family default - must be named -\family sans -factory -\family default -. -\layout Subsection - -Templates -\layout Standard - -A -\emph on -template -\emph default - is a special kind of standard factory component that creates components - that are quasi -\begin_inset Quotes eld -\end_inset - -isomorphic -\begin_inset Quotes erd -\end_inset - - to itself. - More precisely, the components created by a template component -\emph on -must -\emph default - have the same functional client and server interfaces as the template component - (except for the -\family sans -Factory -\family default - interface, which is provided by the template, but not necessarily by its - instances), but can have arbitrary control interfaces. - The components created by a template component also have the same attributes - as the template. - A template component may contain several sub template components, bound - together through bindings. - The components created by such a template component are components that - contain as many sub components as sub templates in the template, bound - together as the sub templates are bound in the template (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:A-sample-template} - -\end_inset - -). - If some sub templates are shared, the corresponding sub components in the - components created by the template will also be shared. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard -\align center - -\begin_inset Graphics - filename templates.eps - display none - -\end_inset - - -\layout Caption - -A sample template component and a component created from it -\begin_inset LatexCommand \label{cap:A-sample-template} - -\end_inset - - -\end_inset - - -\layout Standard - -If a generic factory component is able to create template components, then - it must be possible to create a template component with a operation invocation, - on this generic factory, of the form -\family sans -newFcInstance(type, templateControllerDesc, {controllerDesc, contentDesc}) -\family default -, where -\family sans -type -\family default - describes the functional client and server interfaces of the components - that the template will create, -\family sans -templateControllerDesc -\family default - is the descriptor of the controller part of the template component to be - created, and -\family sans -controllerDesc -\family default - and -\family sans -contentDesc -\family default - are the descriptors of the controller and content parts of the components - that the template will create (the brackets denote an array). -\layout Standard - -Template components are useful in only one case, namely when several identical - components must be created from a textual representation, such as an Architectu -re Description Language definition. - In this case, instead of parsing the textual representation each time an - instance must be created, it can be more efficient to parse the text file(s) - and to create a corresponding template only once, and then to instantiate - the template each time an instance is needed. - In all other cases, using templates is equivalent, but generally less efficient -, than not using them. -\layout Subsection - -Bootstrap -\layout Standard - -According to the above framework, components are created from component - factories. - But how are created component factories? They can be created from other - component factories, but this leads to an infinite recursion. - In order to stop it, a bootstrap component factory, which does not need - to be created explicitly, and which is accessible from a -\begin_inset Quotes eld -\end_inset - -well-known -\begin_inset Quotes erd -\end_inset - - name, is necessary. - This bootstrap component factory must be able to create several kinds of - components, including component factories. - In other words, it must provide the -\family sans -GenericFactory -\family default - interface. -\layout Subsubsection* - -Note -\layout Standard - -In Java, this bootstrap component must be accessible from the -\family sans -getBootstrapComponent -\family default - static method, defined in the -\family sans -org.objectweb.fractal.api.Fractal -\family default - class. - This method must not take any parameter, and must return the -\family sans -Component -\family default - interface of the bootstrap component. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Typing -\begin_inset LatexCommand \label{sec:Typing} - -\end_inset - - -\layout Standard - -This section defines a simple type system for components and component interface -s. - This type system reflects the main characteristics of component interfaces, - introduced in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Introspection} - -\end_inset - -, i.e. - their name, their language type, and their -\emph on -role -\emph default - (client or server). - It also introduces two new characteristics named -\emph on -contingency -\emph default - and -\emph on -cardinality -\emph default -. -\layout Subsection - -Contingency and cardinality -\begin_inset LatexCommand \label{sub:cardinality} - -\end_inset - - -\layout Standard - -The -\emph on -contingency -\emph default - of an interface indicates if the functionality corresponding to this interface - is guaranteed to be available or not, while the component is running: -\layout Itemize - -the operations of a -\emph on -mandatory -\emph default - interface are guaranteed to be available when the component is running. - This semantic is obvious for a server interface. - For a client interface, which does not have a functionality of its own, - it means that the interface -\emph on -must -\emph default - be bound, and that it must be bound to a mandatory interface. - As a consequence, a component with mandatory client interfaces cannot be - started until all these interfaces are bound to other mandatory interfaces. - -\layout Itemize - -the operations of an -\emph on -optional -\emph default - interface are -\emph on -not -\emph default - guaranteed to be available. - This can happen, for a server interface, when the complementary internal - interface is not bound to a sub component. - This can also happen, for a client interface, when this interface is not - bound. - -\layout Standard - -The -\emph on -cardinality -\emph default - of an interface -\series bold -type -\series default - -\begin_inset Formula $T$ -\end_inset - - indicates how many interfaces of type -\begin_inset Formula $T$ -\end_inset - - a given component may have: -\layout Itemize - -the -\emph on -singleton -\emph default - cardinality means that a given component must have exactly one interface - of type -\begin_inset Formula $T$ -\end_inset - -. - -\layout Itemize - -the -\emph on -collection -\emph default - cardinality means that a given component may have an arbitrary number of - interfaces of type -\begin_inset Formula $T$ -\end_inset - -. - All these interfaces must have a name that -\emph on -begins -\emph default - with the name specified in -\begin_inset Formula $T$ -\end_inset - - (see next section). - Since there is a priori an infinite number of such interfaces, these interfaces - cannot all be created at the same time: they must be created lazily, during - invocations of the -\family sans -getFcInterface -\family default - and -\family sans -bindFc -\family default - operations. - For example, if the name specified in -\begin_inset Formula $T$ -\end_inset - - is -\family sans -listener -\family default -, then an invocation to -\family sans -getFcInterface("listener11") -\family default - or to -\family sans -bindFc("listener11", s) -\family default - will create an interface named -\family sans -listener11 -\family default -, if it does not already exist. - This interface may be removed automatically when it is no longer used by - any binding. - -\layout Standard - -Mandatory and optional interfaces are useful for components that absolutely - require other components to work, and which may also use other components, - if they are present. - For example, a parser component absolutely needs a lexer component, but - can work with or without a logger component. - Collection interfaces are useful for components with a variable number - of required components of the same type, such as a menu component and its - associated menu item components, a model component and its listener components - (in the MVC model), and so on. -\layout Subsection - -Type system -\layout Standard - -In the type system specified here, a component type is just a set of component - interface types. - A component type is represented by the -\family sans -ComponentType -\family default - interface (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Typing-API} - -\end_inset - -). - This interface defines a -\family sans -getFcInterfaceTypes -\family default - operation, which returns the set of component interface types in this component - type, as an array. - It also defines a -\family sans -getFcInterfaceType -\family default - operation, which returns the component interface type whose name is given - as parameter (this operation must throw the -\family sans -NoSuchInterfaceException -\family default - if the requested interface type does not exist). -\layout Standard - -A component interface type is represented by the -\family sans -InterfaceType -\family default - interface. - Such a type is made of a name, a signature, a role, a contingency and a - cardinality. - The name is the name of component interfaces of this type. - The signature is the name of the language interface type that is implemented - by component interfaces of this type (for a client interface, an empty - signature means that this client interface can be connected to any server - interface). - The role indicates if component interfaces of this type are client or server - interfaces. - The contingency indicates if the functionality of interfaces of this type - is guaranteed to be available or not. - Finally, the cardinality indicates how many interfaces of this type a component - may have. -\layout Standard - -Component and component interface types can be created by using a type factory, - represented by the -\family sans -TypeFactory -\family default - interface. - Indeed this interface provides two operations to create component interface - types and component types. - A component interface implementing -\family sans -TypeFactory -\family default - must be named -\family sans -type-factory -\family default -. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -package -\series default - org.objectweb.fractal.api.type; -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -ComponentType -\series bold -extends -\series default - Type { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InterfaceType[] getFcInterfaceTypes (); -\family default - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InterfaceType getFcInterfaceType ( -\series bold -string -\family default -\series default - -\family sans -itfName) -\series bold -throws -\series default - NoSuchInterfaceException; -\layout Standard - - -\family sans -} -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -InterfaceType -\series bold -extends -\series default - Type { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -string -\family default -\series default - -\family sans -getFcItfName (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -string -\family default -\series default - -\family sans -getFcItfSignature (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -boolean -\family default -\series default - -\family sans -isFcClientItf (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -boolean -\family default -\series default - -\family sans -isFcOptionalItf (); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -boolean -\family default -\series default - -\family sans -isFcCollectionItf (); -\layout Standard - - -\family sans -} -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\layout Standard - - -\family sans -\series bold -interface -\family default -\series default - -\family sans -TypeFactory { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InterfaceType createFcItfType ( -\series bold -string -\family default -\series default - -\family sans -name, -\family default - -\family sans -\series bold -string -\family default -\series default - -\family sans -signature, -\series bold -boolean -\family default -\series default - -\family sans -isClient, -\family default - -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -boolean -\family default -\series default - -\family sans -isOptional, -\family default - -\family sans -\series bold -boolean -\family default -\series default - -\family sans -isCollection) -\series bold -throws -\series default - InstantiationException; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ComponentType createFcType (InterfaceType[] itfTypes) -\series bold -throws -\series default - InstantiationException; -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Caption - -Typing API -\begin_inset LatexCommand \label{cap:Typing-API} - -\end_inset - - -\end_inset - - -\layout Standard - -A component of type -\begin_inset Formula $T$ -\end_inset - - must have as many external interfaces as described in -\begin_inset Formula $T$ -\end_inset - - (and, in particular, in the interface cardinalities), and all these interfaces - must have the name, language type and role described in the corresponding - component interface type. - Likewise, if this component also exposes its content, and in particular - its internal interfaces, then it must also have, -\emph on -at most -\emph default -, as many internal -\emph on -functional -\emph default - interfaces as described in -\begin_inset Formula $T$ -\end_inset - -, and each of these interfaces must have the name, language type and role - described in the corresponding component interface type. - This implies that each internal functional interface has a -\emph on -complementary -\emph default - external interface of the same name, signature, contingency and cardinality, - and of opposite role (but the converse is not necessarily true). - Note that this property is ensured by the type system specified in this - section: in the general case, nothing more than what is explicitely stated - in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Internal-component-structure} - -\end_inset - - is ensured (and so an internal interface may not have a complementary external - interface). -\layout Standard - -Note that if, in general, the number of interfaces of a Fractal component - may change during its life time, the number of interfaces of a Fractal - component -\emph on -that uses the type system presented here -\emph default - cannot change during its lifetime (except for interface collections). - Indeed the -\family sans -ComponentType -\family default - and -\family sans -InterfaceType -\family default - interfaces do not offer any operations to modify an existing type, and - the other interfaces specified in this document do not offer a operation - to change the type of a component or of an interface. - But a Fractal component may perfectly provide a -\family sans -setFcType -\family default - operation, if needed, since the Fractal model is extensible. -\layout Subsection - -Sub typing relation -\layout Standard - -This section defines a sub typing relation for component and component interface - types, based on -\emph on -substitutability -\emph default -. - This relation provides a sufficient (but not necessary) condition such - that if a component type -\begin_inset Formula $T_{1}$ -\end_inset - - is a sub type of -\begin_inset Formula $T_{2}$ -\end_inset - -, then a component of type -\begin_inset Formula $T_{1}$ -\end_inset - - can replace a component of type -\begin_inset Formula $T_{2}$ -\end_inset - - in any environment, this environment (other components and bindings) being - left unchanged, and -\emph on -both components being seen as black boxes -\emph default -. -\layout Standard - -An interface type -\begin_inset Formula $I_{1}$ -\end_inset - - is a sub type of a -\emph on -server -\emph default - interface type -\begin_inset Formula $I_{2}$ -\end_inset - - if the following conditions are satisfied: -\begin_inset Formula $I_{1}$ -\end_inset - - has the same name and the same role as -\begin_inset Formula $I_{2}$ -\end_inset - -; the language interface corresponding to -\begin_inset Formula $I_{1}$ -\end_inset - - is a sub interface of the language interface corresponding to -\begin_inset Formula $I_{2}$ -\end_inset - -; if the contingency of -\begin_inset Formula $I_{2}$ -\end_inset - - is mandatory, then the contingency of -\begin_inset Formula $I_{1}$ -\end_inset - - is mandatory too; if the cardinality of -\begin_inset Formula $I_{2}$ -\end_inset - - is collection, then the cardinality of -\begin_inset Formula $I_{1}$ -\end_inset - - is collection too. -\layout Standard - -An interface type -\begin_inset Formula $I_{1}$ -\end_inset - - is a sub type of a -\emph on -client -\emph default - interface type -\begin_inset Formula $I_{2}$ -\end_inset - - if the following conditions are satisfied: -\begin_inset Formula $I_{1}$ -\end_inset - - has the same name and the same role as -\begin_inset Formula $I_{2}$ -\end_inset - -; the language interface corresponding to -\begin_inset Formula $I_{1}$ -\end_inset - - is a super interface of the language interface corresponding to -\begin_inset Formula $I_{2}$ -\end_inset - -; if the contingency of -\begin_inset Formula $I_{2}$ -\end_inset - - is optional, then the contingency of -\begin_inset Formula $I_{1}$ -\end_inset - - is optional too; if the cardinality of -\begin_inset Formula $I_{2}$ -\end_inset - - is collection, then the cardinality of -\begin_inset Formula $I_{1}$ -\end_inset - - is collection too. -\layout Standard - -A component type -\begin_inset Formula $T_{1}$ -\end_inset - - is a sub type of a component type -\begin_inset Formula $T_{2}$ -\end_inset - - if and only if each client interface type defined in -\begin_inset Formula $T_{1}$ -\end_inset - - is a sub type of an interface type defined in -\begin_inset Formula $T_{2}$ -\end_inset - -, and each server interface type defined in -\begin_inset Formula $T_{2}$ -\end_inset - - is a super type of an interface type defined in -\begin_inset Formula $T_{1}$ -\end_inset - -. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Options -\begin_inset LatexCommand \label{sec:Options} - -\end_inset - - -\layout Standard - -As said in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Overview} - -\end_inset - -, in the Fractal component model, everything is optional. - For example, a Fractal component may provide or not the -\family sans -Component -\family default - interface, it may support or not the -\family sans -Interface -\family default - interface, it may provide or not the control interfaces defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Configuration} - -\end_inset - -, it may use or not the type system defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Typing} - -\end_inset - -, and so on. -\layout Standard - -In addition, a Fractal component may provide or use new or alternative control - interfaces, type systems, or even component semantics. - For example, a Fractal component may provide a new -\family sans -ConcurrencyController -\family default - interface to control concurrent accesses to the component. - It may also provide an alternative -\family sans -BindingController -\family default - interface, named for example -\family sans -InternalBindingController -\family default -, to control the bindings between sub components directly from the enclosing - component. - It can also use an empty type system, with a unique type, sub type of itself, - used for all components and component interfaces. - A Fractal component may even define a new semantic for the communication - between its sub components: instead of specifying that operation invocations - follow bindings, as defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Internal-component-structure} - -\end_inset - -, it can for example specify that operation invocations are broadcasted - to all the sub components, in order to model an asynchronous, reactive - -\begin_inset Quotes eld -\end_inset - -space -\begin_inset Quotes erd -\end_inset - -. - Bindings are then useless (another possiblity is to define parallel components, - where all the sub components have the same type as the enclosing component, - and where each operation invocation received on this component is executed - in parallel by all its sub components). - A Fractal component may also refine the internal component structure defined - in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Internal-component-structure} - -\end_inset - -, by specifying that the component's controller can, like the component's - content, contain sub components. - Such a Fractal component can then provide new control interfaces to introspect - and reconfigure the sub components of its controller part. -\layout Standard - -The advantage of this extreme modularity and extensibility is that the Fractal - component model can be applied to many situations. - The drawback is that two arbitrary Fractal components will generally not - be able to work together, because they will generally use very different, - and potentially incompatible, options or extensions of the Fractal model. - In order to reduce this problem, this section defines some set of options, - and gives them a symbolic name called a conformance -\emph on -level -\emph default -. - The goal is to be able to say, or even certify, that a given Fractal applicatio -n or tool is conform to the Fractal model of level -\begin_inset Formula $X$ -\end_inset - -. - It will then be easy to know which Fractal applications and tools can work - together, by comparing their conformance level to the Fractal model. -\layout Subsection - -Conformance levels -\begin_inset LatexCommand \label{sub:Conformance-levels} - -\end_inset - - -\layout Standard - -This specification defines the following conformance levels (new conformance - levels can of course be defined as needed): -\layout Itemize - -level -\begin_inset Formula $0$ -\end_inset - -: at this level nothing is mandatory. - Fractal components are like simple objects. - A Java object, a Java Bean, or an Enterprise Java Bean, for example, are - conform to the Fractal component model of level 0. - -\begin_deeper -\layout Itemize - -level -\begin_inset Formula $0.1$ -\end_inset - -: same as level -\begin_inset Formula $0$ -\end_inset - -, with the additional requirements that all components with configurable - attributes must provide the -\family sans -AttributeController -\family default - interface, that all components with client interfaces must provide the - -\family sans -BindingController -\family default - interface, that all components that expose their content must provide the - -\family sans -ContentController -\family default - interface, and that all components that expose their life cycle must provide - the -\family sans -LifeCycleController -\family default - interface. - Of course, these requirements do not prevent components from providing - additional control interfaces, including extensions and alternatives of - the previous interfaces. -\end_deeper -\layout Itemize - -level -\begin_inset Formula $1$ -\end_inset - -: same as level -\begin_inset Formula $0$ -\end_inset - -, with the additional requirement that all components must provide, at least, - the -\family sans -Component -\family default - interface. - -\begin_deeper -\layout Itemize - -level -\begin_inset Formula $1.1$ -\end_inset - -: same as level -\begin_inset Formula $1$ -\end_inset - -, with the same additional requirements as for level -\begin_inset Formula $0.1$ -\end_inset - -, concerning the control interfaces. - -\end_deeper -\layout Itemize - -level -\begin_inset Formula $2$ -\end_inset - -: same as level -\begin_inset Formula $1$ -\end_inset - -, with the additional requirement that all component interface references - must be castable to -\family sans -Interface -\family default -. - -\begin_deeper -\layout Itemize - -level -\begin_inset Formula $2.1$ -\end_inset - -: same as level -\begin_inset Formula $2$ -\end_inset - -, with the same additional requirements as for levels -\begin_inset Formula $0.1$ -\end_inset - - and -\begin_inset Formula $1.1$ -\end_inset - -, concerning the control interfaces. - -\end_deeper -\layout Itemize - -level -\begin_inset Formula $3$ -\end_inset - -: same as level -\begin_inset Formula $2$ -\end_inset - -, with the additional requirement that all the components must use (an extension - of) the type system defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Typing} - -\end_inset - -. - -\begin_deeper -\layout Itemize - -level -\begin_inset Formula $3.1$ -\end_inset - -: same as level -\begin_inset Formula $3$ -\end_inset - -, with the same additional requirements as for levels -\begin_inset Formula $0.1$ -\end_inset - -, -\begin_inset Formula $1.1$ -\end_inset - - and -\begin_inset Formula $2.1$ -\end_inset - -, concerning the control interfaces. - -\layout Itemize - -level -\begin_inset Formula $3.2$ -\end_inset - -: same as level -\begin_inset Formula $3.1$ -\end_inset - -, with the additional requirement that a bootstrap component must be accessible - from a -\begin_inset Quotes eld -\end_inset - -well-known -\begin_inset Quotes erd -\end_inset - - name. - This bootstrap component must provide a -\family sans -GenericFactory -\family default - and a -\family sans -TypeFactory -\family default - interface. - Moreover, the -\family sans -GenericFactory -\family default - interface must be able to create components with any control interfaces - in the set of control interfaces defined in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Configuration} - -\end_inset - - (and, in particular, primitive and composite components). - Finally, this interface must also be able to create ( -\begin_inset Formula $3.2$ -\end_inset - - level) primitive components encapsulating -\begin_inset Formula $0.1$ -\end_inset - - level components (see below for more details). - -\layout Itemize - -level -\begin_inset Formula $3.3$ -\end_inset - -: same as level -\begin_inset Formula $3.2$ -\end_inset - -, with the additional requirement that the -\family sans -GenericFactory -\family default - interface of the bootstrap component must be able to create primitive and - composite template components. - -\end_deeper -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard -\align center - -\begin_inset Tabular - - - - - - - - - - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -C -\end_inset - - -\begin_inset Text - -\layout Standard - -I -\end_inset - - -\begin_inset Text - -\layout Standard - -CT, IT -\end_inset - - -\begin_inset Text - -\layout Standard - -AC, BC, CC, LC -\end_inset - - -\begin_inset Text - -\layout Standard - -F -\end_inset - - -\begin_inset Text - -\layout Standard - -T -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $0$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $0.1$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $1$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $1.1$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $2$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $2.1$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $3$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $3.1$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $3.2$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -\SpecialChar ~ - -\end_inset - - - - -\begin_inset Text - -\layout Standard - - -\begin_inset Formula $3.3$ -\end_inset - - -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - -\begin_inset Text - -\layout Standard - -x -\end_inset - - - - -\end_inset - - -\layout Caption - -Conformance levels to the Fractal component model -\begin_inset LatexCommand \label{cap:Conformance-levels} - -\end_inset - - -\end_inset - - -\layout Standard - -These conformance levels can summarized as shown in Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Conformance-levels} - -\end_inset - -, where C, I, CT, IT, AC, BC, CC, LC, F and T represent the component, interface -, component type, interface type, attribute controller, binding controller, - life cycle controller, factory and -\begin_inset Quotes eld -\end_inset - -template -\begin_inset Quotes erd -\end_inset - - interfaces, respectively, and where an x denotes a mandatory feature. -\layout Standard - -Note that a level -\begin_inset Formula $3$ -\end_inset - - component is also a level -\begin_inset Formula $2$ -\end_inset - -, -\begin_inset Formula $1$ -\end_inset - - or -\begin_inset Formula $0$ -\end_inset - - component, a level -\begin_inset Formula $2$ -\end_inset - - component is also a level -\begin_inset Formula $1$ -\end_inset - - or -\begin_inset Formula $0$ -\end_inset - - component, a level -\begin_inset Formula $3.3$ -\end_inset - - component is also a level -\begin_inset Formula $3.2$ -\end_inset - -, -\begin_inset Formula $3.1$ -\end_inset - - or -\begin_inset Formula $3$ -\end_inset - - component, but a level -\begin_inset Formula $3$ -\end_inset - -, -\begin_inset Formula $2$ -\end_inset - - or -\begin_inset Formula $1$ -\end_inset - - component is -\emph on -not -\emph default - a level -\begin_inset Formula $0.1$ -\end_inset - -, -\begin_inset Formula $1.1$ -\end_inset - - or -\begin_inset Formula $2.1$ -\end_inset - - component. - More generally, if -\begin_inset Formula $l_{1}$ -\end_inset - - is greater than -\begin_inset Formula $l_{2}$ -\end_inset - - in alphabetical order, a level -\begin_inset Formula $l_{2}$ -\end_inset - - component is -\emph on -not -\emph default - necessarily also a level -\begin_inset Formula $l_{1}$ -\end_inset - - component (this desirable rule cannot always be respected, because the - alphabetical order is a total order, while the set inclusion order is only - a partial order). -\layout Subsubsection* - -Encapsulated components -\layout Standard - -As specified above, at the -\begin_inset Formula $3.2$ -\end_inset - - level, the bootstrap generic factory must be able to create -\begin_inset Formula $3.2$ -\end_inset - - primitive components that encapsulate -\begin_inset Formula $0.1$ -\end_inset - - level components. - These encapsulating components (which do not have a -\family sans -ContentController -\family default - interface, and therefore are -\emph on -not -\emph default - composite components) must -\begin_inset Quotes eld -\end_inset - -delegate -\begin_inset Quotes erd -\end_inset - - all the operation invocations they receive on their functional and control - interfaces to their encapsulated component, if the encapsulated component - has a corresponding interface. - For example, if the -\family sans -bindFc -\family default - or -\family sans -startFc -\family default - operation is invoked on an encapsulating component, this component must - in turn invoke this operation on its encapsulated component, if it provides - the -\family sans -BindingController -\family default - or -\family sans -LifeCycleController -\family default - interface. - The encapsulating component can of course do some pre and post computations - before and after calling its encapsulated component. -\layout Standard - -If the encapsulated component provides a -\family sans -BindingController -\family default - interface, then the encapsulating component must invoke, during its initializat -ion, the -\family sans -bindFc -\family default - operation of this interface with, as arguments, the -\family sans -component -\family default - name and the reference of its -\family sans -Component -\family default - interface, so that the encapsulated component can get a reference to the - -\family sans -Component -\family default - interface of its encapsulating component. -\layout Subsection - -Extensions -\layout Standard - -The above conformance levels may not be sufficient to fully compare two - Fractal systems. - In particular, for Fractal systems dedicated to a specific language, such - as C or Java, the language is as important as the conformance level. - And, even for Fractal systems based on the same language, other -\begin_inset Quotes eld -\end_inset - -details -\begin_inset Quotes erd -\end_inset - - (such as, in Java, the class loading policy - one class loader per component - vs a single class loader for all the components), unspecified here, may - cause incompatibilities. - However, if needed, these other features can be captured in new conformance - levels, such as -\begin_inset Formula $C.x.y$ -\end_inset - - or -\begin_inset Formula $J.x.y$ -\end_inset - -, for C and Java respectively. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Example -\begin_inset LatexCommand \label{sec:Example} - -\end_inset - - -\layout Standard - -This section shows how a 3.3 level, Java Fractal platform can be used, in - order to illustrate how the APIs defined in this specification can be used - to create, assemble and reconfigure component configurations. -\layout Standard - -The example used throughout this section is a very simple application made - of two primitive components inside a composite component (see Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Example} - -\end_inset - -). - The first primitive component is a -\begin_inset Quotes eld -\end_inset - -server -\begin_inset Quotes erd -\end_inset - - component that provides an interface -\family sans -s -\family default - of type -\family sans -S -\family default -. - The other primitive component is a -\begin_inset Quotes eld -\end_inset - -client -\begin_inset Quotes erd -\end_inset - - component, bound to the previous server interface. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard -\align center - -\begin_inset Graphics - filename example.eps - display none - scale 80 - -\end_inset - - -\layout Caption - -A sample component based application -\begin_inset LatexCommand \label{cap:Example} - -\end_inset - - -\end_inset - - -\layout Subsection - -Instantiation -\layout Standard - -The above components can be instantiated as follows. - The first step is to create the component and component interface types. - In order to do this, we get a reference to the bootstrap component, and - then to its -\family sans -TypeFactory -\family default - interface: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -Component boot = Fractal.getBootstrapComponent(); -\layout Standard - - -\family sans -TypeFactory tf = (TypeFactory)boot.getFcInterface("type-factory"); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We can now create the types of the root, client and server components as - follows: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -ComponentType rType = tf.createFcType( -\series bold -new -\series default - InterfaceType[] { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -tf.createFcItfType("m", "M", -\series bold -false -\series default -, -\series bold -false -\series default -, -\series bold -false -\series default -) -\layout Standard - - -\family sans -}); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -ComponentType cType = tf.createFcType( -\series bold -new -\series default - InterfaceType[] { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -tf.createFcItfType("m", "M", -\series bold -false -\series default -, -\series bold -false -\series default -, -\series bold -false -\series default -), -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -tf.createFcItfType("s", "S", -\series bold -true -\series default -, -\series bold -false -\series default -, -\series bold -false -\series default -) -\layout Standard - - -\family sans -}); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -ComponentType sType = tf.createFcType( -\series bold -new -\series default - InterfaceType[] { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -tf.createFcItfType("s", "S", -\series bold -false -\series default -, -\series bold -false -\series default -, -\series bold -false -\series default -) -\layout Standard - - -\family sans -}); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We could now create the components directly, but we will use intermediate - template components here, in order to show how they can be used. - These component templates can be created as follows: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -GenericFactory gf = (GenericFactory)boot.getFcInterface("generic-factory"); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -Component rTmpl = gf.newFcInstance( -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -rType, "compositeTemplate", -\series bold -new -\series default - Object[] {"composite", null}); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -Component cTmpl = gf.newFcInstance( -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -cType, "template", -\series bold -new -\series default - Object[] {"primitive", "CImpl"}); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -Component sTmpl = gf.newFcInstance( -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -sType, "template", -\series bold -new -\series default - Object[] {"primitive", "SImpl"}); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -Here the -\family sans -template -\family default - (resp. - -\family sans -compositeTemplate -\family default -) descriptor is supposed to describe components with a -\family sans -BindingController -\family default - interface (resp. - with a -\family sans -BindingController -\family default - and a -\family sans -ContentController -\family default - interfaces). - The -\family sans -primitive -\family default - and -\family sans -composite -\family default - descriptors are supposed to describe similar components, but with an additional - -\family sans -LifeCycleController -\family default - interface. - Finally, -\family sans -CImpl -\family default - and -\family sans -SImpl -\family default - are the names of the Java classes of the -\begin_inset Formula $0.1$ -\end_inset - - level Fractal components that will be -\emph on -encapsulated -\emph default - in the client and server components (see end of section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Conformance-levels} - -\end_inset - -). - The -\family sans -CImpl -\family default - class, for example, has the following form: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - CImpl -\series bold -implements -\series default - M, BindingController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - S s; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - String[] listFc () { -\series bold -return -\series default - -\series bold -new -\series default - String[] { "s" }; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object lookupFc (String name) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (name.equals("s")) -\series bold -return -\series default - s; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -return -\series default - null; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object bindFc (String name, Object itf) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (name.equals("s")) s = (S)itf; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object unbindFc (String name) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (name.equals("s")) s = -\series bold -null -\series default -; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -// ... -\layout Standard - - -\family sans -} -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We can then either instantiate each template one by one, put the resulting - primitive components inside the composite component, connect all these - components, and finally start them. - But we can also put the primitive templates inside the composite template, - connect these templates together, and then instantiate the whole application - by just instantiating the composite template component. - This is what we do here. -\layout Standard - -We begin by putting the primitive template components inside the composite - one (here we assume a strong semantic for the -\family sans -addFcSubComponent -\family default - method, i.e. - we assume that -\begin_inset Formula $C'=C\cup\{ c\}$ -\end_inset - - - see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Content-control} - -\end_inset - -): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -ContentController cc = (ContentController)rTmpl.getFcInterface("content-controlle -r"); -\layout Standard - - -\family sans -cc.addFcSubComponent(cTmpl); -\layout Standard - - -\family sans -cc.addFcSubComponent(sTmpl); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We then bind the internal client interface -\family sans -m -\family default - of the composite template to the server interface -\family sans -m -\family default - of the client template: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -((BindingController)rTmpl.getFcInterface("binding-controller")) -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -.bindFc("m", cTmpl.getFcInterface("m")); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -Finally, we bind the client interface -\family sans -s -\family default - of the client template to the server interface -\family sans -s -\family default - of the server template: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -((BindingController)cTmpl.getFcInterface("binding-controller")) -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -.bindFc("s", sTmpl.getFcInterface("s")); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -At this stage the template components are like the components depicted in - Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Example} - -\end_inset - -, with just an additional -\family sans -Factory -\family default - interface. - Now that the template components have been created and bound to each other, - the application components can be instantiated and bound to each other - automatically, by just calling the -\family sans -newFcInstance -\family default - method on the root template component: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -Component r = ((Factory)rTmpl.getFcInterface("factory")).newFcInstance(); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -The result is depicted in Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Example2} - -\end_inset - -. - As can be seen, the -\begin_inset Formula $0.1$ -\end_inset - - level components -\family sans -CImpl -\family default - and -\family sans -SImpl -\family default - have been encapsulated in -\begin_inset Formula $3.2$ -\end_inset - - level components, which provide them component and interface introspection - functions. -\layout Standard - - -\begin_inset Float figure -placement h -wide false -collapsed true - -\layout Standard -\align center - -\begin_inset Graphics - filename example2.eps - display none - scale 80 - -\end_inset - - -\layout Caption - -Result of the instantiation of the application depicted in Figure\SpecialChar ~ - -\begin_inset LatexCommand \ref{cap:Example} - -\end_inset - - -\begin_inset LatexCommand \label{cap:Example2} - -\end_inset - - -\end_inset - - -\layout Standard - -All the application components can now be started automatically by just - calling the -\family sans -startFc -\family default - method on the root application component (here we assume a stronger semantic - than the default one for the -\family sans -startFc -\family default - method, i.e. - we assume it to be recursive - see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Life-cycle-control} - -\end_inset - -): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -((LifeCycleController)r.getFcInterface("lifecycle-controller")).startFc(); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Subsection - -Reconfiguration -\layout Standard - -Let us suppose we want to dynamically change the server component. - In order to do this, we need to unbind the client component, remove the - server component, create a new server component, add the server component - in the composite component, and finally bind the client component to the - new server. - But the binding and component removals cannot be done while the client - and the composite component, respectively, are not stopped. - So we must first stop these components (here again we assume this method - to be recursive; we also assume that it does not change the states of the - components, and that method calls to functional interfaces while the components - are stopped are only suspended until the components are restarted): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -((LifeCycleController)r.getFcInterface("lifecycle-controller")).stopFc(); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We then retrieve the references of the client and server components (more - precisely of the -\begin_inset Formula $3.2$ -\end_inset - - level components that encapsulate the -\begin_inset Formula $0.1$ -\end_inset - - level components -\family sans -CImpl -\family default - and -\family sans -SImpl -\family default -): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -Component c = ((Interface)((BindingController)r. -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -getFcInterface("binding-controller")).lookupFc("m")).getFcItfOwner(); -\layout Standard - - -\family sans -Component s = ((Interface)((BindingController)c. -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -getFcInterface("binding-controller")).lookupFc("s")).getFcItfOwner(); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We can now unbind the client and server components, and remove the server - component from the composite component (we assume a strong semantic for - -\family sans -removeFcSubComponent -\family default -): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -((BindingController)c.getFcInterface("binding-controller")).unbindFc("s"); -\layout Standard - - -\family sans -((ContentController)r.getFcInterface("content-controller")).removeFcSubComponent(s -); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We can now create the new server component, i.e. - a new -\begin_inset Formula $3.2$ -\end_inset - - level component encapsulating a new -\begin_inset Formula $0.1$ -\end_inset - - level component. - Instead of using a template component for doing that, as in the previous - section, we use here the bootstrap generic factory directly: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -Component newS = gf.newFcInstance(sType, "primitive", "NewSImpl"); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -We can now add this new component in the composite component, bind it to - the client component, and finally resume the application's execution (we - make the same semantic hypotheses as in the previous section for the -\family sans -addFcSubComponent -\family default - and -\family sans -startFc -\family default - methods): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -((ContentController)r.getFcInterface("content-controller")).addFcSubComponent(newS -); -\layout Standard - - -\family sans -((BindingController)c.getFcInterface("binding-controller")).bindFc("s", newS); -\layout Standard - - -\family sans -((LifeCycleController)r.getFcInterface("lifecycle-controller")).startFc(); -\family default - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section -\start_of_appendix -Fractal APIs -\begin_inset LatexCommand \label{sec:Mappings} - -\end_inset - - -\layout Standard - -This section defines the Fractal API in Java, C and OMG IDL. - These definitions can be used as -\begin_inset Quotes eld -\end_inset - -standard -\begin_inset Quotes erd -\end_inset - - definitions to provide interoperability between Java components only, between - C components only, and between any components (respectively). - They are the result of straightforward transformations of the pseudo IDL - interface definitions from section -\begin_inset LatexCommand \ref{sec:Foundations} - -\end_inset - - to -\begin_inset LatexCommand \ref{sec:Typing} - -\end_inset - -. -\layout Subsection* - -Java API -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{listing} -\end_inset - - -\layout Standard - - -\series bold -package -\series default - org.objectweb.naming; -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - Name { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -NamingContext getNamingContext (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -byte -\series default -[] encode () -\series bold -throws -\series default - NamingException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - NamingContext { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Name export (Object o, Object hints) -\series bold -throws -\series default - NamingException; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Name decode ( -\series bold -byte -\series default -[] b) -\series bold -throws -\series default - NamingException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - Binder -\series bold -extends -\series default - NamingContext { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object bind (Name n, Object hints) -\series bold -throws -\series default - NamingException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -class -\series default - NamingException -\series bold -extends -\series default - Exception { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - NamingException (String msg) { -\series bold -super -\series default -(msg); } -\layout Standard - -} -\layout Standard - - -\series bold -package -\series default - org.objectweb.fractal.api; -\layout Standard - - -\series bold -import -\series default - org.objectweb.fractal.api.factory.InstantiationException; -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - Component { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Type getFcType (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object[] getFcInterfaces (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object getFcInterface (String interfaceName) -\series bold -throws -\series default - NoSuchInterfaceException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - Interface { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Component getFcItfOwner (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -String getFcItfName (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Type getFcItfType (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcInternalItf (); -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - Type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcSubTypeOf (Type type); -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -class -\series default - Fractal { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -static -\series default - Component getBootstrapComponent () -\series bold -throws -\series default - InstantiationException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -class -\series default - NoSuchInterfaceException -\series bold -extends -\series default - Exception { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - NoSuchInterfaceException (String itfName) { -\series bold -super -\series default -(itfName); } -\layout Standard - -} -\layout Standard - - -\series bold -package -\series default - org.objectweb.fractal.api.control; -\layout Standard - - -\series bold -import -\series default - org.objectweb.fractal.api.Component; -\layout Standard - - -\series bold -import -\series default - org.objectweb.fractal.api.NoSuchInterfaceException; -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - AttributeController { } -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - BindingController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -String[] listFc (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object lookupFc (String clientItfName) -\series bold -throws -\series default - NoSuchInterfaceException; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - bindFc (String clientItfName, Object serverItf) -\series bold -throws -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - unbindFc (String clientItfName) -\series bold -throws -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -NoSuchInterfaceException, IllegalBindingException, IllegalLifeCycleException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - ContentController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object[] getFcInternalInterfaces (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object getFcInternalInterface (String interfaceName) -\series bold -throws -\series default - NoSuchInterfaceException; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Component[] getFcSubComponents (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - addFcSubComponent (Component subComponent) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -throws -\series default - IllegalContentException, IllegalLifeCycleException; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - removeFcSubComponent (Component subComponent) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -throws -\series default - IllegalContentException, IllegalLifeCycleException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - SuperController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Component[] getFcSuperComponents (); -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - LifeCycleController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -String getFcState (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - startFc () -\series bold -throws -\series default - IllegalLifeCycleException; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - stopFc () -\series bold -throws -\series default - IllegalLifeCycleException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - NameController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -String getFcName (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - setFcName (String name); -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -class -\series default - IllegalBindingException -\series bold -extends -\series default - Exception { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - IllegalBindingException (String msg) { -\series bold -super -\series default -(msg); } -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -class -\series default - IllegalContentException -\series bold -extends -\series default - Exception { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - IllegalContentException (String msg) { -\series bold -super -\series default -(msg); } -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -class -\series default - IllegalLifeCycleException -\series bold -extends -\series default - Exception { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - IllegalLifeCycleException (String msg) { -\series bold -super -\series default -(msg); } -\layout Standard - -} -\layout Standard - - -\series bold -package -\series default - org.objectweb.fractal.api.factory; -\layout Standard - - -\series bold -import -\series default - org.objectweb.fractal.api.Component; -\layout Standard - - -\series bold -import -\series default - org.objectweb.fractal.api.Type; -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - Factory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Type getFcInstanceType (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object getFcControllerDesc (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Object getFcContentDesc (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Component newFcInstance () -\series bold -throws -\series default - InstantiationException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - GenericFactory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Component newFcInstance (Type type, Object controllerDesc, Object contentDesc) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -throws -\series default - InstantiationException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -class -\series default - InstantiationException -\series bold -extends -\series default - Exception { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - InstantiationException (String msg) { -\series bold -super -\series default -(msg); } -\layout Standard - -} -\layout Standard - - -\series bold -package -\series default - org.objectweb.fractal.api.type; -\layout Standard - - -\series bold -import -\series default - org.objectweb.fractal.api.NoSuchInterfaceException; -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - ComponentType -\series bold -extends -\series default - org.objectweb.fractal.api.Type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -InterfaceType[] getFcInterfaceTypes (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -InterfaceType getFcInterfaceType (String name) -\series bold -throws -\series default - NoSuchInterfaceException; -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - InterfaceType -\series bold -extends -\series default - org.objectweb.fractal.api.Type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -String getFcItfName (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -String getFcItfSignature (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcClientItf (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcOptionalItf (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcCollectionItf (); -\layout Standard - -} -\layout Standard - - -\series bold -public -\series default - -\series bold -interface -\series default - TypeFactory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -InterfaceType createFcItfType ( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -String name, String signature, -\series bold -boolean -\series default - isClient, -\series bold -boolean -\series default - isOptional, -\series bold -boolean -\series default - isCollection) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -throws -\series default - org.objectweb.fractal.api.factory.InstantiationException; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -ComponentType createFcType (InterfaceType[] interfaceTypes) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -throws -\series default - org.objectweb.fractal.api.factory.InstantiationException; -\layout Standard - -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{listing} -\end_inset - - -\layout Subsection* - - -\size normal -C API -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{listing} -\end_inset - - -\layout Standard - - -\series bold -typedef -\series default - -\series bold -unsigned -\series default - -\series bold -char -\series default - jboolean; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -unsigned -\series default - -\series bold -short -\series default - jchar; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -signed -\series default - -\series bold -char -\series default - jbyte; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -signed -\series default - -\series bold -short -\series default - jshort; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -signed -\series default - -\series bold -int -\series default - jint; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -signed -\series default - -\series bold -long -\series default - -\series bold -long -\series default - jlong; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -float -\series default - jfloat; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -double -\series default - jdouble; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_naming_Name { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_naming_NamingContext* (*getNamingContext)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jbyte* (*encode)( -\series bold -void -\series default - *_this); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_naming_NamingContext { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_naming_Name* (*export)( -\series bold -void -\series default - *_this, -\series bold -void* -\series default - o, -\series bold -void* -\series default - hints); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_naming_Name* (*decode)( -\series bold -void -\series default - *_this, jbyte* b); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_naming_Binder { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_naming_Name* (*export)( -\series bold -void -\series default - *_this, -\series bold -void* -\series default - o, -\series bold -void* -\series default - hints); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_naming_Name* (*decode)( -\series bold -void -\series default - *_this, jbyte* b); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void* -\series default - (*bind)( -\series bold -void -\series default - *_this, Rorg_objectweb_naming_Name* n, -\series bold -void* -\series default - hints); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_Component { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Type* (*getFcType)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default -** (*getFcInterfaces)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default -* (*getFcInterface)( -\series bold -void -\series default - *_this, -\series bold -char -\series default -* interfaceName); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_Interface { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Component* (*getFcItfOwner)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -char -\series default -* (*getFcItfName)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Type* (*getFcItfType)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jboolean (*isFcInternalItf)( -\series bold -void -\series default - *_this); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_Type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jboolean (*isFcSubTypeOf)( -\series bold -void -\series default - *_this, Rorg_objectweb_fractal_api_Type* type); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_control_AttributeController { }; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_control_BindingController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -char -\series default -** (*listFc)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default -* (*lookupFc)( -\series bold -void -\series default - *_this, -\series bold -char -\series default -* clientItfName); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - (*bindFc)( -\series bold -void -\series default - *_this, -\series bold -char -\series default -* clientItfName, -\series bold -void -\series default -* serverItf); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - (*unbindFc)( -\series bold -void -\series default - *_this, -\series bold -char -\series default -* clientItfName); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_control_ContentController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default -** (*getFcInternalInterfaces)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default -* (*getFcInternalInterface)( -\series bold -void -\series default - *_this, -\series bold -char -\series default -* interfaceName); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Component** (*getFcSubComponents)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - (*addFcSubComponent)( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - *_this, Rorg_objectweb_fractal_api_Component* subComponent); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - (*removeFcSubComponent)( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - *_this, Rorg_objectweb_fractal_api_Component* subComponent); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_control_SuperController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Component** (*getFcSuperComponents)( -\series bold -void -\series default - *_this); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_control_LifeCycleController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -char -\series default -* (*getFcState)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - (*startFc)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - (*stopFc)( -\series bold -void -\series default - *_this); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_control_NameController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -char -\series default -* (*getFcName)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - (*setFcName)( -\series bold -vo -\series default -i -\series bold -d -\series default - *_this, -\series bold -char -\series default -* name); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_factory_Factory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Type* (*getFcInstanceType)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default -* (*getFcControllerDesc)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default -* (*getFcContentDesc)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Component* (*newFcInstance)( -\series bold -void -\series default - *_this); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_factory_GenericFactory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Component* (*newFcInstance)( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - *_this, \SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_Type* type, -\series bold -void -\series default -* ctrlDesc, -\series bold -void -\series default -* cntntDesc); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_type_ComponentType { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jboolean (*isFcSubTypeOf)( -\series bold -void -\series default - *_this, Rorg_objectweb_fractal_api_Type* type); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_type_InterfaceType** (*getFcInterfaceTypes)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_type_InterfaceType* (*getFcInterfaceType)( -\series bold -void -\series default - *_this, -\series bold -char -\series default -* name); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_type_InterfaceType { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jboolean (*isFcSubTypeOf)( -\series bold -void -\series default - *_this, Rorg_objectweb_fractal_api_Type* type); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -char -\series default -* (*getFcItfName)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -char -\series default -* (*getFcItfSignature)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jboolean (*isFcClientItf)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jboolean (*isFcOptionalItf)( -\series bold -void -\series default - *_this); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -jboolean (*isFcCollectionItf)( -\series bold -void -\series default - *_this); -\layout Standard - -}; -\layout Standard - - -\series bold -struct -\series default - Morg_objectweb_fractal_api_type_TypeFactory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_type_InterfaceType* (*createFcItfType)( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - *_this, -\series bold -char -\series default -* name, -\series bold -char -\series default -* signature, -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -jboolean isClient, jboolean isOptional, jboolean isCollection); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -Rorg_objectweb_fractal_api_type_ComponentType* (*createFcType)( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - *_this, Rorg_objectweb_fractal_api_type_InterfaceType** interfaceTypes); -\layout Standard - -}; -\layout Standard - -// where R -\emph on -xyz -\emph default - types are defined by: -\layout Standard - -// -\series bold -typedef -\series default - -\series bold -struct -\series default - { -\layout Standard - -// \SpecialChar ~ -\SpecialChar ~ - -\series bold -struct -\series default - M -\emph on -xyz -\emph default - *meth; -\layout Standard - -// \SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - *selfdata; -\layout Standard - -// } R -\emph on -xyz -\emph default -; -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{listing} -\end_inset - - -\layout Subsection* - -OMG IDL API -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{listing} -\end_inset - - -\layout Standard - - -\series bold -typedef -\series default - -\series bold -sequence -\series default - ObjectArray; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -sequence -\series default - stringArray; -\layout Standard - - -\series bold -typedef -\series default - -\series bold -sequence -\series default - octetArray; -\layout Standard - - -\series bold -module -\series default - org_objectweb_naming { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -exception -\series default - NamingException { }; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - NamingContext; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - Name { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -NamingContext getNamingContext (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -octetArray encode () -\series bold -raises -\series default -(NamingException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - NamingContext { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Name export ( -\series bold -in -\series default - Object o, -\series bold -in -\series default - Object hints) -\series bold -raises -\series default -(NamingException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Name decode ( -\series bold -in -\series default - octetArray b) -\series bold -raises -\series default -(NamingException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - Binder : NamingContext { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Object bind ( -\series bold -in -\series default - Name n, -\series bold -in -\series default - Object hints) -\series bold -raises -\series default -(NamingException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -}; -\layout Standard - - -\series bold -module -\series default - org_objectweb_fractal_api { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -exception -\series default - NoSuchInterfaceException { }; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - Type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcSubTypeOf (in Type type); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - Component { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Type getFcType (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ObjectArray getFcInterfaces (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Object getFcInterface ( -\series bold -in -\series default - -\series bold -string -\series default - interfaceName) -\series bold - raises -\series default -(NoSuchInterfaceException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -typedef -\series default - -\series bold -sequence -\series default - ComponentArray; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - Interface { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Component getFcItfOwner (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -string -\series default - getFcItfName (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Type getFcItfType (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcInternalItf (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -}; -\layout Standard - - -\series bold -module -\series default - org_objectweb_fractal_api_control { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -exception -\series default - IllegalBindingException { }; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -exception -\series default - IllegalContentException { }; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -exception -\series default - IllegalLifeCycleException { }; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - AttributeController { }; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - BindingController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -stringArray listFc (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Object lookupFc ( -\series bold -in -\series default - -\series bold -string -\series default - clientItfName) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(org_objectweb_fractal_api::NoSuchInterfaceException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - bindFc ( -\series bold -in -\series default - -\series bold -string -\series default - clientItfName, -\series bold -in -\series default - Object serverItf) -\series bold -raises -\series default -(IllegalBindingException, -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -IllegalLifeCycleException, org_objectweb_fractal_api::NoSuchInterfaceException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - unbindFc ( -\series bold -in -\series default - -\series bold -string -\series default - clientItfName) -\series bold -raises -\series default -(IllegalBindingException, -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -IllegalLifeCycleException, org_objectweb_fractal_api::NoSuchInterfaceException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - ContentController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ObjectArray getFcInternalInterfaces (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Object getFcInternalInterface ( -\series bold -in -\series default - -\series bold -string -\series default - interfaceName) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(org_objectweb_fractal_api::NoSuchInterfaceException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -org_objectweb_fractal_api::ComponentArray getFcSubComponents (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - addFcSubComponent ( -\series bold -in -\series default - org_objectweb_fractal_api::Component subComponent) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(IllegalContentException, IllegalLifeCycleException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - removeFcSubComponent ( -\series bold -in -\series default - org_objectweb_fractal_api::Component subComponent) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(IllegalContentException, IllegalLifeCycleException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - SuperController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -org_objectweb_fractal_api::ComponentArray getFcSuperComponents (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - LifeCycleController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -string -\series default - getFcState (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - startFc () -\series bold -raises -\series default -(IllegalLifeCycleException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - stopFc () -\series bold -raises -\series default -(IllegalLifeCycleException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - NameController { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -string -\series default - getFcName (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - setFcName ( -\series bold -in -\series default - -\series bold -string -\series default - name); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -}; -\layout Standard - - -\series bold -module -\series default - org_objectweb_fractal_api_factory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -exception -\series default - InstantiationException { }; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - GenericFactory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -org_objectweb_fractal_api::Component newFcInstance ( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -in -\series default - org_objectweb_fractal_api::Type type, -\series bold -in -\series default - Object controllerDesc, -\series bold -in -\series default - Object contentDesc) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(InstantiationException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - Factory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -org_objectweb_fractal_api::Type getFcInstanceType (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Object getFcControllerDesc (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Object getFcContentDesc (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -org_objectweb_fractal_api::Component newFcInstance () -\series bold - raises -\series default -(InstantiationException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -}; -\layout Standard - - -\series bold -module -\series default - org_objectweb_fractal_api_type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - InterfaceType : org_objectweb_fractal_api::Type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -string -\series default - getFcItfName (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -string -\series default - getFcItfSignature (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcClientItf (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcOptionalItf (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -boolean -\series default - isFcCollectionItf (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -typedef -\series default - -\series bold -sequence -\series default - InterfaceTypeArray; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - ComponentType : org_objectweb_fractal_api::Type { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InterfaceTypeArray getFcInterfaceTypes (); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InterfaceType getFcInterfaceType ( -\series bold -in -\series default - -\series bold -string -\series default - name) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(org_objectweb_fractal_api::NoSuchInterfaceException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ - -\series bold -interface -\series default - TypeFactory { -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InterfaceType createFcItfType ( -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -in -\series default - -\series bold -string -\series default - name, -\series bold - in -\series default - -\series bold -string -\series default - signature, -\series bold - -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -in -\series default - -\series bold -boolean -\series default - isClient, -\series bold - in -\series default - -\series bold -boolean -\series default - isOptional, -\series bold - in -\series default - -\series bold -boolean -\series default - isCollection) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(org_objectweb_fractal_api_factory::InstantiationException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ComponentType createFcType ( -\series bold -in -\series default - InterfaceTypeArray interfaceTypes) -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -raises -\series default -(org_objectweb_fractal_api_factory::InstantiationException); -\layout Standard - -\SpecialChar ~ -\SpecialChar ~ -}; -\layout Standard - -}; -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{listing} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Glossary -\begin_inset LatexCommand \label{sec:Glossary} - -\end_inset - - -\layout Standard - -This section defines the core concepts of the Fractal model. -\layout Standard - - -\series bold -binder -\series default -: a naming context that can also give access (reference) to the interfaces - designated by the names it manages. -\layout Standard - - -\series bold -binding -\series default -: a primitive, local communication path between a client and a server interface. - More complex -\begin_inset Quotes eld -\end_inset - -bindings -\begin_inset Quotes erd -\end_inset - - are made of bindings and of binding components. -\layout Standard - - -\series bold -concept -\series default -: an abstract representation composed of the properties common to a set - of concrete representations of directly observable entities. -\layout Standard - - -\series bold -cardinality -\series default -: a property of an interface type that indicates how many interfaces of - this type a given component may have. - The cardinality is either -\family sans -singleton -\family default - or -\family sans -collection -\family default -. -\layout Standard - - -\series bold -component -\series default -: a runtime entity exhibiting a recursive structure and reflexive capabilities. - A component is composed of a controller and a content. - A component has well defined access points called interfaces, and provides - more or less introspection and control capabilities (intercession) to other - components. - -\layout Itemize - - -\series bold -base component -\series default -: a component that does not have any control interface. -\layout Itemize - - -\series bold -primitive component -\series default -: a component with some control interfaces, but that does not expose its - content. -\layout Itemize - - -\series bold -composite component -\series default -: a component that exposes its content. -\layout Itemize - - -\series bold -sub component -\series default -: a component that is contained in another component. -\layout Itemize - - -\series bold -super component -\series default -: relatively to a (sub) component: a component that contains this (sub) - component. - Due to component sharing, a component may have several super components. -\layout Itemize - - -\series bold -shared component -\series default -: a component that is contained in several super components. -\layout Itemize - - -\series bold -binding component -\series default -: a component dedicated to the communication between other components. - Similar to a connector in other component models. - -\layout Standard - - -\series bold -conformance level -\series default - : a symbolic name that designates a set of options or extensions of the - Fractal component model. - A Fractal system is conform to a given conformance level if it supports - all the options designated by this level. -\layout Standard - - -\series bold -content -\series default -: one of the two parts of a component, the other one being its controller. - A content is an abstract entity controlled by a controller. - The content of a component is (recursively) made of sub components and - bindings. -\layout Standard - - -\series bold -contingency -\series default -: a property of an interface indicates if the functionality of this interface - is guaranteed to be available or not, while its component is running. - The contingency is either -\family sans -optional -\family default - or -\family sans -mandatory -\family default -. -\layout Standard - - -\series bold -controller -\series default -: one of the two parts of a component, the other one being its content. - A controller is an abstract entity that embodies the control behavior associate -d with a particular component. - A controller can exercise an arbitrary control over the content of the - component it is part of (intercept incoming and outgoing operation invocations - for instance). -\layout Standard - - -\series bold -entity -\series default -: anything having existence. -\layout Standard - - -\series bold -factory -\series default -: a component that can create other components. - Generic factories can create several kinds of components, while standard - component factories create only one kind of components. -\layout Standard - - -\series bold -fractal -\series default -: a property that characterizes entities (objects in nature; sets, functions - in mathematics; software components in the case of Fractal) which exhibit - a structure at all scales or at least at numerous scales, i.e. - whose structure depends explicitly on the resolution at which they are - being observed. - Some fractal systems are scale invariants - which means they exhibit in - fact the same structure at all scales. - Fractal software systems are scale invariant. - They are modelled as interacting Fractal components which are self similar: - they are not identical (of course!) but exhibit the same structure expressed - in terms of interfaces, bindings, attributes and controllers at any resolution - they are being observed. -\layout Standard - - -\series bold -intercession -\series default -: the ability of a component (seen as a program) to modify its own execution - state; or to alter its own interpretation or semantics. -\layout Standard - - -\series bold -interface -\series default -: an access point to a component, also called a component interface; or - a language interface, i.e. - a type made of several operation declarations. -\layout Itemize - - -\series bold -component interface -\series default -: an access point to a component, i.e., a place where operation invocations - can be emitted or received. -\layout Itemize - - -\series bold -language interface -\series default -: a type made of several operation declarations. -\layout Itemize - - -\series bold -client interface -\series default -: a component interface that emits operation invocations. -\layout Itemize - - -\series bold -server interface -\series default -: a component interface that receives operation invocations. -\layout Itemize - - -\series bold -optional interface -\series default -: a component interface whose functionality is -\emph on -not -\emph default - guaranteed to be available, while the component is running. -\layout Itemize - - -\series bold -mandatory interface -\series default -: a component interface whose functionality is guaranteed to be available, - while the component is running. -\layout Itemize - - -\series bold -external interface -\series default -: a component interface that is only accessible from outside the component. -\layout Itemize - - -\series bold -internal interface -\series default -: a component interface that is only accessible from inside the component, - i.e. - from its sub components. -\layout Itemize - - -\series bold -complementary interface -\series default -: of an interface I, a component interface with the same name, signature, - contingency, and cardinality as I, but with opposite role and visibility - (external or internal). -\layout Itemize - - -\series bold -functional interface -\series default -: a component interface that corresponds to a provided or required functionality - of a component, as opposed to a control interface. -\layout Itemize - - -\series bold -control interface -\series default -: a component interface that manages a -\begin_inset Quotes eld -\end_inset - -non functional aspect -\begin_inset Quotes erd -\end_inset - - of a component, such as introspection, configuration or reconfiguration, - and so on. - By convention, control interfaces are server interfaces whose name ends - with -\family sans --controller -\family default -, or is equal to -\family sans -component -\family default -. -\layout Standard - - -\series bold -introspection: -\series default -the ability of a component (seen as a program) to observe and reason about - its own execution state. -\layout Standard - - -\series bold -model: -\series default -a system of relations between selected concepts - built explicitly at ends - of description, explanation or forecast. -\layout Standard - - -\series bold -name -\series default -: a value that designates a component interface, but that does not necessarily - give access to (reference) it. -\layout Standard - - -\series bold -naming context -\series default -: a entity that creates and manages names. - Naming contexts can be nested and overlapping, allowing names to be valid - in different naming contexts. - A component controller constitutes a primitive naming context. -\layout Standard - - -\series bold -reflection (reflective capabilities) -\series default -: the ability of a component (seen as a program) to manipulate as data the - entities that represent its execution state during its own execution. - This manipulation can take two forms: introspection and intercession. -\layout Standard - - -\series bold -role -\series default -: a property of a component interface, indicates if this interface is a - client or server interface. -\layout Standard - - -\series bold -signature -\series default -: of a component interface, is the name of the language interface type correspon -ding to this component interface. -\layout Standard - - -\series bold -template -\series default -: a special kind of factory that creates components that are -\begin_inset Quotes eld -\end_inset - -isomorphic -\begin_inset Quotes erd -\end_inset - - to itself. -\layout Standard - - -\series bold -type -\series default -: a set of structural properties common to a set of entities (components - and interfaces for instance). -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Change History -\layout Subsection* - -Changes from version 2.0 -\layout Standard - -Changes in the document: -\layout Itemize - -The Rationale (section 1.1) has been rewritten. -\layout Itemize - -Section 2.1 and Appendix A have been rewritten (the IDL is now clearly presented - as a pseudo, non normative IDL, used only for documentation purposes). -\layout Subsection* - -Changes from version 1.0 -\layout Standard - -The document has been completely rewritten. - It is now focused exclusively on the Fractal component model, i.e. - the considerations about the Fractal framework and the associated roles - have been removed. - All features of the Fractal model have been made optional, so that the - model can be used in many situations, from embedded software to application - servers. - Finally the Fractal model itself has been revised, in order to clarify - and/or simplify some points (binding control, interface collections...). -\layout Standard - -Changes in the document: -\layout Itemize - -Some sections have been completely removed: Requirements (2.2), General Model - (3.1), Framework Increments (4.2), Roles and Responsibilities (6), Framework - Packaging (7), and Bibliography (Appendix B). - The material of the remaining sections has been completely reorganized - to improve clarity. - -\layout Itemize - -Some completely new sections have been added: Interface Definition Language - ( -\begin_inset LatexCommand \ref{sub:IDL} - -\end_inset - -), Options ( -\begin_inset LatexCommand \ref{sec:Options} - -\end_inset - -), Glossary (Appendix -\begin_inset LatexCommand \ref{sec:Glossary} - -\end_inset - -). -\layout Standard - -Major changes in the API: -\layout Itemize - -The API is now presented with an abstract IDL, not strictly dedicated to - Java. - -\layout Itemize - -The naming and binding framework which was defined in version 0.7.3, and removed - in version 0.8, has been added back. - -\layout Itemize - - -\family sans -ComponentIdentity -\family default - and -\family sans -InterfaceReference -\family default - have been renamed and decoupled, and both interfaces are now optional. - As a consequence, -\family sans -InterfaceReference -\family default - has been replaced with -\family sans -\series bold -any -\family default -\series default - in the signature of the -\family sans -getFc -\family default -[ -\family sans -Internal -\family default -] -\family sans -Interface -\family default -[ -\family sans -s -\family default -], -\family sans -lookupFc -\family default -, and -\family sans -bindFc -\family default - operations. -\layout Itemize - -The -\family sans -BindingController -\family default - interface has been modified so that -\family sans -UserBindingController -\family default - is no longer necessary. - This latter interface has then been removed. -\layout Itemize - -Attributes can now be readable, writable or both: attribute controllers - are not forced anymore to define a pair of accessors (getters and setters). -\layout Itemize - -Addition of the -\family sans -SuperController -\family default - and -\family sans -NameController -\family default - interfaces. -\layout Itemize - -Templates are now optional. - The -\family sans -Template -\family default - interface has been slightly modified and renamed into -\family sans -Factory -\family default -. - -\family sans -TemplateFactory -\family default - has been simplified and renamed into -\family sans -GenericFactory -\family default -. - -\layout Itemize - -The type system semantic has been slightly modified, but not its API. -\layout Itemize - -All exceptions are now checked exceptions. -\layout Subsection* - -Changes from version 0.9 -\layout Standard - -Changes in the document: -\layout Itemize - -Minor typographic changes. -\layout Itemize - -Sections 4.14 and 5 have been updated to take into account the API changes - (see below). -\layout Itemize - -Addition of a -\begin_inset Quotes eld -\end_inset - -Rationale -\begin_inset Quotes erd -\end_inset - - paragraph in Section 4.2.1. -\layout Itemize - -Addition of an appendix -\begin_inset Quotes eld -\end_inset - -Features Deferred to Future Releases -\begin_inset Quotes erd -\end_inset - -. -\layout Standard - -Major changes in the API: -\layout Itemize - -Removal of -\family sans -setFCControllerDesc -\family default - and -\family sans -setFCContentDesc -\family default - operations in -\family sans -Template -\family default -. - These operations have been replaced with two new parameters in -\family sans -TemplateFactory -\family default -. -\family sans -createTemplate -\family default -. -\layout Standard - -Minor changes in the API: -\layout Itemize - -The ...FC... - pattern has been replaced with ...Fc... -\layout Subsection* - -Changes from version 0.8-0 -\layout Standard - -Changes in the document: -\layout Itemize - -Section -\begin_inset Quotes eld -\end_inset - -Roles and Contracts -\begin_inset Quotes erd -\end_inset - - has moved from Section 3 to Section 6. - The role Framework Provider has been refined (and the section has been - renamed -\begin_inset Quotes eld -\end_inset - -Roles and Responsibilities -\begin_inset Quotes erd -\end_inset - -). -\layout Itemize - -Section -\begin_inset Quotes eld -\end_inset - -Framework Increments -\begin_inset Quotes erd -\end_inset - - has been developed - especially the section -\begin_inset Quotes eld -\end_inset - -Programming Support Increments -\begin_inset Quotes erd -\end_inset - -. -\layout Itemize - -Section -\begin_inset Quotes eld -\end_inset - -Programming Support Increments -\begin_inset Quotes erd -\end_inset - - has been removed for it was mostly Julia-specific. - As such it should be available in the fore coming Julia documentation. - This point is linked to the two points above. -\layout Standard - -Major changes in the API: -\layout Itemize - -Removal of the naming system introduced in the previous version of Fractal. - This point is linked to discussions about a potential ObjectWeb naming - system. - -\layout Itemize - -Introduction of the interface -\family sans -UserBindingController -\family default -. - It is very close from the interface -\family sans -LocalBindingController -\family default - of version 0.7.2. - Its purpose is to ease call-backs implementation by programmers in -\begin_inset Quotes eld -\end_inset - -user components -\begin_inset Quotes erd -\end_inset - -, i.e. - Java objects. -\layout Itemize - -Refinement of the exceptions management: introduction of Fractal specific - exceptions: -\begin_deeper -\layout Itemize - - -\family sans -NoSuchInterfaceException -\family default -, -\family sans -IllegalBindingException -\family default -, -\family sans -IllegalContentException -\family default -, -\family sans -IllegalLifeCycleException -\family default -, -\family sans -InstantiationException -\family default -. -\end_deeper -\layout Itemize - -Refinement of the instantiation phase of components: introduction of an - additional parameter in the template creation operation -\family sans -createFCTemplate -\family default - in -\family sans -TemplateFactory -\family default - and of two operations -\family sans -setFCControllerDesc -\family default - and -\family sans -setFCContentDesc -\family default - in -\family sans -Template -\family default -. -\layout Standard - -Minor changes in the API: -\layout Itemize - -The Fractal API previously defined in the -\family sans -org.objectweb.fractal -\family default - package is now defined in the -\family sans -org.objectweb.fractal.api -\family default - package. - Fractal implementations will be defined in -\family sans -org.objectweb.fractal. -\emph on -xxx -\family default -\emph default - packages: the Fractal Reference Implementation for instance is defined - in -\family sans -org.objectweb.fractal.julia -\family default -. -\layout Itemize - -Systematization on the usage of a naming convention to prevent name clashes. - All method names are built using the naming convention: verb+ -\begin_inset Quotes erd -\end_inset - -FC -\begin_inset Quotes erd -\end_inset - -+noun as in -\family sans -getFCInterfaces -\family default -. -\layout Subsection* - -Changes from version 0.7.3-0 -\layout Standard - -Changes in the document: -\layout Itemize - -A separate section is now devoted to the running example. -\layout Itemize - -Removal of the appendix -\begin_inset Quotes eld -\end_inset - -Features Deferred To Future Releases -\begin_inset Quotes erd -\end_inset - - (which was empty anyway). -\layout Itemize - -Addition of the appendix -\begin_inset Quotes eld -\end_inset - -Bibliography -\begin_inset Quotes erd -\end_inset - - and bibliographic references in text. -\layout Standard - -Major changes in the API: -\layout Itemize - -Introduction of a naming framework that defines interfaces -\family sans -Name -\family default - and -\family sans -NamingContext -\family default -. - Interface -\family sans -InterfaceReference -\family default - (defined in package -\family sans -org.objectweb.fractal -\family default -) now inherits from -\family sans -Name -\family default - (defined in -\family sans -org.objectweb.naming -\family default -). -\layout Itemize - -Typed interfaces references: an interface reference ( -\family sans -InterfaceReference -\family default -) now has the Java type of the interface it references. - This is a major change with respect to the Fractal programming model. - The major consequences are: 1) explicit binding operations (bind) can be - avoided (but cast operations are needed instead) and 2) the bootstrap process - is simpler (a bootstrap component does not have to be a container anymore). -\layout Itemize - -Binding controllers now only deal with local bindings (same address space, - same enclosing component). - The interface -\family sans -LocalBindingController -\family default - has been suppressed. - A method -\family sans -check -\family default - has been introduced (see below). -\layout Standard - -Minor changes in the API: -\layout Itemize - -Name of the java package are changed from -\family sans -org.objectweb.compfw -\family default - to -\family sans -org.objectweb.fractal -\family default -. -\layout Itemize - -Replacement of methods -\family sans -create -\emph on -XXX -\emph default -InterfaceType -\family default - with one single method -\family sans -createFCItfType -\family default - with Boolean parameters ( -\family sans -isClient -\family default -, -\family sans -isOptional -\family default -, -\family sans -isCollection -\family default -) in interface -\family sans -TypeFactory -\family default -. -\layout Itemize - -Addition of a method -\family sans -check -\family default - (which checks that bindings between components are really local) in interface - -\family sans -ContentController -\family default -. -\the_end diff --git a/web/latex/specification/internal-view.eps b/web/latex/specification/internal-view.eps deleted file mode 100644 index 8ad11af1d61c83937044795ad8225920f4b52c45..0000000000000000000000000000000000000000 --- a/web/latex/specification/internal-view.eps +++ /dev/null @@ -1,316 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: internal-view.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Fri Sep 12 12:13:57 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 365 232 -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def - -end -save -newpath 0 232 moveto 0 0 lineto 365 0 lineto 365 232 lineto closepath clip newpath --73.3 284.2 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.06299 0.06299 sc -% -% Fig objects follow -% -% -% here starts figure with depth 55 -% Polyline -7.500 slw -n 1575 900 m 6525 900 l 6525 4500 l 1575 4500 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 1800 1125 m 6300 1125 l 6300 4275 l 1800 4275 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 4500 2925 m 5850 2925 l 5850 3825 l 4500 3825 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 2700 1620 m 4050 1620 l 4050 2520 l 2700 2520 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% here ends figure; -% -% here starts figure with depth 50 -% Polyline -15.000 slw -n 1530 1710 m - 1530 1890 l gs col4 s gr -% Polyline -n 1530 1800 m - 1575 1800 l gs col4 s gr -% Polyline -7.500 slw -n 1845 1710 m - 1845 1890 l gs col12 s gr -% Polyline -n 1845 1800 m - 1800 1800 l gs col12 s gr -% Polyline -15.000 slw -n 6255 1710 m - 6255 1890 l gs col4 s gr -% Polyline -n 6255 1800 m - 6300 1800 l gs col4 s gr -% Polyline -n 6255 2385 m - 6255 2565 l gs col4 s gr -% Polyline -n 6255 2475 m - 6300 2475 l gs col4 s gr -% Polyline -n 2115 855 m - 1935 855 l gs col4 s gr -% Polyline -n 2025 855 m - 2025 900 l gs col4 s gr -% Polyline -n 2430 855 m - 2250 855 l gs col4 s gr -% Polyline -n 2340 855 m - 2340 900 l gs col4 s gr -% Polyline -n 2745 855 m - 2565 855 l gs col4 s gr -% Polyline -n 2655 855 m - 2655 900 l gs col4 s gr -% Polyline -7.500 slw -n 6570 1710 m - 6570 1890 l gs col12 s gr -% Polyline -n 6570 1800 m - 6525 1800 l gs col12 s gr -% Polyline -n 6570 2385 m - 6570 2565 l gs col12 s gr -% Polyline -n 6570 2475 m - 6525 2475 l gs col12 s gr -% Polyline -n 5895 3015 m - 5895 3195 l gs col12 s gr -% Polyline -n 5895 3105 m - 5850 3105 l gs col12 s gr -% Polyline -15.000 slw -n 2655 1710 m - 2655 1890 l gs col4 s gr -% Polyline -n 2655 1800 m - 2700 1800 l gs col4 s gr -% Polyline -7.500 slw -n 4095 1710 m - 4095 1890 l gs col12 s gr -% Polyline -n 4095 1800 m - 4050 1800 l gs col12 s gr -% Polyline -n 4095 2205 m - 4095 2385 l gs col12 s gr -% Polyline -n 4095 2295 m - 4050 2295 l gs col12 s gr -% Polyline -15.000 slw -n 4455 3015 m - 4455 3195 l gs col4 s gr -% Polyline -n 4455 3105 m - 4500 3105 l gs col4 s gr -% Polyline -n 2970 1575 m - 2790 1575 l gs col4 s gr -% Polyline -n 2880 1575 m - 2880 1620 l gs col4 s gr -% Polyline -n 3285 1575 m - 3105 1575 l gs col4 s gr -% Polyline -n 3195 1575 m - 3195 1620 l gs col4 s gr -% Polyline -n 4815 2880 m - 4635 2880 l gs col4 s gr -% Polyline -n 4725 2880 m - 4725 2925 l gs col4 s gr -% Polyline -n 5130 2880 m - 4950 2880 l gs col4 s gr -% Polyline -n 5040 2880 m - 5040 2925 l gs col4 s gr -% Polyline -n 3600 1575 m - 3420 1575 l gs col4 s gr -% Polyline -n 3510 1575 m - 3510 1620 l gs col4 s gr -% Polyline -n 2745 1170 m - 2565 1170 l gs col4 s gr -% Polyline -n 2655 1170 m - 2655 1125 l gs col4 s gr -% Polyline -7.500 slw -gs clippath -2625 1830 m 2625 1770 l 2473 1770 l 2593 1800 l 2473 1830 l cp -eoclip -n 1890 1800 m - 2610 1800 l gs col0 s gr gr - -% arrowhead -n 2473 1830 m 2593 1800 l 2473 1770 l col0 s -% Polyline -gs clippath -6225 1830 m 6225 1770 l 6073 1770 l 6193 1800 l 6073 1830 l cp -eoclip -n 4140 1800 m - 6210 1800 l gs col0 s gr gr - -% arrowhead -n 6073 1830 m 6193 1800 l 6073 1770 l col0 s -% Polyline -gs clippath -6243 2473 m 6188 2449 l 6128 2588 l 6203 2490 l 6183 2612 l cp -eoclip -n 5940 3105 m - 6210 2475 l gs col0 s gr gr - -% arrowhead -n 6183 2612 m 6203 2490 l 6128 2588 l col0 s -% Polyline -gs clippath -4386 3128 m 4443 3109 l 4395 2965 l 4405 3089 l 4338 2984 l cp -eoclip -n 4140 2295 m - 4410 3105 l gs col0 s gr gr - -% arrowhead -n 4338 2984 m 4405 3089 l 4395 2965 l col0 s -/Times-Roman ff 165.00 scf sf -1395 1890 m -gs 1 -1 sc (a, I) dup sw pop neg 0 rm col0 sh gr -/Times-Italic ff 165.00 scf sf -1890 4185 m -gs 1 -1 sc (content) col0 sh gr -/Times-Italic ff 165.00 scf sf -1620 4455 m -gs 1 -1 sc (controller) col0 sh gr -/Times-Italic ff 165.00 scf sf -1485 1980 m -gs 1 -1 sc 90.0 rot (external interface) dup sw pop neg 0 rm col0 sh gr -/Times-Italic ff 165.00 scf sf -1980 1980 m -gs 1 -1 sc 90.0 rot (internal interface) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 165.00 scf sf -6660 1890 m -gs 1 -1 sc (b, J) col0 sh gr -/Times-Roman ff 165.00 scf sf -6660 2565 m -gs 1 -1 sc (c, K) col0 sh gr -/Times-Italic ff 165.00 scf sf -3375 2700 m -gs 1 -1 sc (sub component) dup sw pop 2 div neg 0 rm col0 sh gr -/Times-Italic ff 165.00 scf sf -4320 2655 m -gs 1 -1 sc (normal binding) col0 sh gr -/Times-Italic ff 165.00 scf sf -5085 1710 m -gs 1 -1 sc (import binding) dup sw pop 2 div neg 0 rm col0 sh gr -/Times-Italic ff 165.00 scf sf -2250 1710 m -gs 1 -1 sc (binding) dup sw pop 2 div neg 0 rm col0 sh gr -/Times-Italic ff 165.00 scf sf -2250 1530 m -gs 1 -1 sc (export) dup sw pop 2 div neg 0 rm col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/specification/internal-view.fig b/web/latex/specification/internal-view.fig deleted file mode 100644 index 830545bbd3ae64cab3946ae9ccf014c118f1e556..0000000000000000000000000000000000000000 --- a/web/latex/specification/internal-view.fig +++ /dev/null @@ -1,163 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 1485 1665 1620 1935 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 1710 1530 1890 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 1800 1575 1800 --6 -6 1800 1710 1845 1890 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1845 1710 1845 1890 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1845 1800 1800 1800 --6 -6 6210 1665 6345 1935 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 1710 6255 1890 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 1800 6300 1800 --6 -6 6210 2340 6345 2610 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 2385 6255 2565 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6255 2475 6300 2475 --6 -6 1890 810 2160 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2115 855 1935 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2025 855 2025 900 --6 -6 2205 810 2475 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2430 855 2250 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2340 855 2340 900 --6 -6 2520 810 2790 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2745 855 2565 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 855 2655 900 --6 -6 6525 1710 6570 1890 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6570 1710 6570 1890 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6570 1800 6525 1800 --6 -6 6525 2385 6570 2565 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6570 2385 6570 2565 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6570 2475 6525 2475 --6 -6 5850 3015 5895 3195 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5895 3015 5895 3195 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5895 3105 5850 3105 --6 -6 2610 1665 2745 1935 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 1710 2655 1890 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 1800 2700 1800 --6 -6 4050 1710 4095 1890 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1710 4095 1890 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1800 4050 1800 --6 -6 4050 2205 4095 2385 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 2205 4095 2385 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 2295 4050 2295 --6 -6 4410 2970 4545 3240 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 3015 4455 3195 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 3105 4500 3105 --6 -6 2745 1530 3015 1665 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2970 1575 2790 1575 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2880 1575 2880 1620 --6 -6 3060 1530 3330 1665 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3285 1575 3105 1575 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3195 1575 3195 1620 --6 -6 4590 2835 4860 2970 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4815 2880 4635 2880 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4725 2880 4725 2925 --6 -6 4905 2835 5175 2970 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 5130 2880 4950 2880 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5040 2880 5040 2925 --6 -6 3375 1530 3645 1665 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3600 1575 3420 1575 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3510 1575 3510 1620 --6 -6 2520 1080 2790 1215 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2745 1170 2565 1170 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 1170 2655 1125 --6 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 1575 900 6525 900 6525 4500 1575 4500 1575 900 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 1800 1125 6300 1125 6300 4275 1800 4275 1800 1125 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1890 1800 2610 1800 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4140 1800 6210 1800 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 4500 2925 5850 2925 5850 3825 4500 3825 4500 2925 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5940 3105 6210 2475 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 2700 1620 4050 1620 4050 2520 2700 2520 2700 1620 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4140 2295 4410 3105 -4 2 0 50 0 0 11 0.0000 4 135 225 1395 1890 a, I\001 -4 0 0 50 -1 1 11 0.0000 4 90 465 1890 4185 content\001 -4 0 0 50 -1 1 11 0.0000 4 105 630 1620 4455 controller\001 -4 2 0 50 -1 1 11 1.5708 4 165 1140 1485 1980 external interface\001 -4 2 0 50 -1 1 11 1.5708 4 165 1110 1980 1980 internal interface\001 -4 0 0 50 0 0 11 0.0000 4 135 225 6660 1890 b, J\001 -4 0 0 50 0 0 11 0.0000 4 135 285 6660 2565 c, K\001 -4 1 0 50 -1 1 11 0.0000 4 135 945 3375 2700 sub component\001 -4 0 0 50 -1 1 11 0.0000 4 150 960 4320 2655 normal binding\001 -4 1 0 50 -1 1 11 0.0000 4 150 930 5085 1710 import binding\001 -4 1 0 50 -1 1 11 0.0000 4 150 465 2250 1710 binding\001 -4 1 0 50 -1 1 11 0.0000 4 120 405 2250 1530 export\001 diff --git a/web/latex/specification/makefile b/web/latex/specification/makefile deleted file mode 100644 index e3bd8cb871887a1f6e1d6606d1ca9a0392ac633c..0000000000000000000000000000000000000000 --- a/web/latex/specification/makefile +++ /dev/null @@ -1,23 +0,0 @@ -SRC = fractal-specification -DST = ../../html/specification - -all: prepare tex pdf ps html - -mkdir ${DST} - -mv ${SRC}.pdf ${SRC}.ps.gz ${SRC}.html *.png ${DST} - -rm *.ps *.tex *.aux *.dvi *.lof *.log *.toc *.tlg - -prepare: - unzip postscript.zip - -tex: - lyx -e latex ${SRC}.lyx - -pdf: - lyx -e pdf ${SRC}.lyx - -ps: - lyx -e ps ${SRC}.lyx - gzip ${SRC}.ps - -html: tex - sed s/\textsf/\texttt/g ${SRC}.tex | tth -a -r -e2 -L${SRC} | sed '/begincode/,/endcode/s/
<\/div>/
/g' | sed 's/

//g' | sed ':loop N;s/\n<\/a>/<\/a>/;t label;P;D;b loop;:label;p;d;b loop' > ${SRC}.html diff --git a/web/latex/specification/postscript.zip b/web/latex/specification/postscript.zip deleted file mode 100644 index 1f827c3d24536daa0d379c8c00a5c9eef25e8d74..0000000000000000000000000000000000000000 Binary files a/web/latex/specification/postscript.zip and /dev/null differ diff --git a/web/latex/specification/sharing.eps b/web/latex/specification/sharing.eps deleted file mode 100644 index 992b6334790d5555c647d9ea451214e5ff179792..0000000000000000000000000000000000000000 --- a/web/latex/specification/sharing.eps +++ /dev/null @@ -1,694 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: sharing.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Tue Aug 19 09:00:13 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 334 227 -%%Magnification: 0.5000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def -/col34 {0.863 0.863 0.863 srgb} bind def - -end -save -newpath 0 227 moveto 0 0 lineto 334 0 lineto 334 227 lineto closepath clip newpath --13.8 252.3 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.03150 0.03150 sc -% -% Fig objects follow -% -% -% here starts figure with depth 55 -% Polyline -7.500 slw -n 450 900 m 5850 900 l 5850 7425 l 450 7425 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 6750 900 m 10800 900 l 10800 7425 l 6750 7425 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 675 1125 m 5625 1125 l 5625 7200 l 675 7200 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 6975 1125 m 10575 1125 l 10575 7200 l 6975 7200 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 900 1350 m 4050 1350 l 4050 4050 l 900 4050 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 900 4275 m 4050 4275 l 4050 6975 l 900 6975 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 7200 1350 m 10350 1350 l 10350 4050 l 7200 4050 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 7200 4275 m 10350 4275 l 10350 6975 l 7200 6975 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 1125 1575 m 3825 1575 l 3825 3825 l 1125 3825 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 1125 4500 m 3825 4500 l 3825 6750 l 1125 6750 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 7425 1575 m 10125 1575 l 10125 3825 l 7425 3825 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 7425 4500 m 10125 4500 l 10125 6750 l 7425 6750 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 4500 1800 m 5400 1800 l 5400 2250 l 4500 2250 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 1350 1800 m 2250 1800 l 2250 3150 l 1350 3150 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 2700 3150 m 3600 3150 l 3600 3600 l 2700 3600 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 2700 2475 m 3600 2475 l 3600 2925 l 2700 2925 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 1350 4725 m 2250 4725 l 2250 6075 l 1350 6075 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 2700 4725 m 3600 4725 l 3600 5175 l 2700 5175 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 2700 5400 m 3600 5400 l 3600 5850 l 2700 5850 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 7650 1800 m 8550 1800 l 8550 3150 l 7650 3150 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 9000 3150 m 9900 3150 l 9900 3600 l 9000 3600 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 9000 2475 m 9900 2475 l 9900 2925 l 9000 2925 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 7650 4725 m 8550 4725 l 8550 6075 l 7650 6075 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 9000 4725 m 9900 4725 l 9900 5175 l 9000 5175 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 9000 5400 m 9900 5400 l 9900 5850 l 9000 5850 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline - [60] 0 sd -n 9000 6075 m 9900 6075 l 9900 6525 l 9000 6525 l - cp gs col34 1.00 shd ef gr gs col0 s gr [] 0 sd -% Polyline - [60] 0 sd -n 9000 1800 m 9900 1800 l 9900 2250 l 9000 2250 l - cp gs col34 1.00 shd ef gr gs col0 s gr [] 0 sd -% Polyline -15.000 slw -n 990 855 m - 810 855 l gs col4 s gr -% Polyline -n 900 855 m - 900 900 l gs col4 s gr -% Polyline -n 1305 855 m - 1125 855 l gs col4 s gr -% Polyline -n 1215 855 m - 1215 900 l gs col4 s gr -% Polyline -n 1620 855 m - 1440 855 l gs col4 s gr -% Polyline -n 1530 855 m - 1530 900 l gs col4 s gr -% Polyline -n 1305 1890 m - 1305 2070 l gs col4 s gr -% Polyline -n 1305 1980 m - 1350 1980 l gs col4 s gr -% Polyline -n 855 1665 m - 855 1845 l gs col4 s gr -% Polyline -n 855 1755 m - 900 1755 l gs col4 s gr -% Polyline -7.500 slw -n 1170 1665 m - 1170 1845 l gs col12 s gr -% Polyline -n 1170 1755 m - 1125 1755 l gs col12 s gr -% Polyline -n 2295 1890 m - 2295 2070 l gs col12 s gr -% Polyline -n 2295 1980 m - 2250 1980 l gs col12 s gr -% Polyline -n 2295 2115 m - 2295 2295 l gs col12 s gr -% Polyline -n 2295 2205 m - 2250 2205 l gs col12 s gr -% Polyline -n 2295 2340 m - 2295 2520 l gs col12 s gr -% Polyline -n 2295 2430 m - 2250 2430 l gs col12 s gr -% Polyline -15.000 slw -n 2655 2565 m - 2655 2745 l gs col4 s gr -% Polyline -n 2655 2655 m - 2700 2655 l gs col4 s gr -% Polyline -n 2655 3240 m - 2655 3420 l gs col4 s gr -% Polyline -n 2655 3330 m - 2700 3330 l gs col4 s gr -% Polyline -n 1305 4815 m - 1305 4995 l gs col4 s gr -% Polyline -n 1305 4905 m - 1350 4905 l gs col4 s gr -% Polyline -n 855 4590 m - 855 4770 l gs col4 s gr -% Polyline -n 855 4680 m - 900 4680 l gs col4 s gr -% Polyline -7.500 slw -n 1170 4590 m - 1170 4770 l gs col12 s gr -% Polyline -n 1170 4680 m - 1125 4680 l gs col12 s gr -% Polyline -n 2295 4815 m - 2295 4995 l gs col12 s gr -% Polyline -n 2295 4905 m - 2250 4905 l gs col12 s gr -% Polyline -n 2295 5040 m - 2295 5220 l gs col12 s gr -% Polyline -n 2295 5130 m - 2250 5130 l gs col12 s gr -% Polyline -n 2295 5265 m - 2295 5445 l gs col12 s gr -% Polyline -n 2295 5355 m - 2250 5355 l gs col12 s gr -% Polyline -15.000 slw -n 2655 4815 m - 2655 4995 l gs col4 s gr -% Polyline -n 2655 4905 m - 2700 4905 l gs col4 s gr -% Polyline -n 2655 5490 m - 2655 5670 l gs col4 s gr -% Polyline -n 2655 5580 m - 2700 5580 l gs col4 s gr -% Polyline -n 3780 1890 m - 3780 2070 l gs col4 s gr -% Polyline -n 3780 1980 m - 3825 1980 l gs col4 s gr -% Polyline -7.500 slw -n 4095 1890 m - 4095 2070 l gs col12 s gr -% Polyline -n 4095 1980 m - 4050 1980 l gs col12 s gr -% Polyline -15.000 slw -n 4455 1890 m - 4455 2070 l gs col4 s gr -% Polyline -n 4455 1980 m - 4500 1980 l gs col4 s gr -/Times-Roman ff 180.00 scf sf -4590 2025 m -gs 1 -1 sc (UNDO) col0 sh gr -% Polyline -n 3780 6300 m - 3780 6480 l gs col4 s gr -% Polyline -n 3780 6390 m - 3825 6390 l gs col4 s gr -% Polyline -7.500 slw -n 4095 6300 m - 4095 6480 l gs col12 s gr -% Polyline -n 4095 6390 m - 4050 6390 l gs col12 s gr -% Polyline -15.000 slw -n 7290 855 m - 7110 855 l gs col4 s gr -% Polyline -n 7200 855 m - 7200 900 l gs col4 s gr -% Polyline -n 7605 855 m - 7425 855 l gs col4 s gr -% Polyline -n 7515 855 m - 7515 900 l gs col4 s gr -% Polyline -n 7920 855 m - 7740 855 l gs col4 s gr -% Polyline -n 7830 855 m - 7830 900 l gs col4 s gr -% Polyline -n 7605 1890 m - 7605 2070 l gs col4 s gr -% Polyline -n 7605 1980 m - 7650 1980 l gs col4 s gr -% Polyline -n 7155 1665 m - 7155 1845 l gs col4 s gr -% Polyline -n 7155 1755 m - 7200 1755 l gs col4 s gr -% Polyline -7.500 slw -n 7470 1665 m - 7470 1845 l gs col12 s gr -% Polyline -n 7470 1755 m - 7425 1755 l gs col12 s gr -% Polyline -n 8595 1890 m - 8595 2070 l gs col12 s gr -% Polyline -n 8595 1980 m - 8550 1980 l gs col12 s gr -% Polyline -n 8595 2115 m - 8595 2295 l gs col12 s gr -% Polyline -n 8595 2205 m - 8550 2205 l gs col12 s gr -% Polyline -n 8595 2340 m - 8595 2520 l gs col12 s gr -% Polyline -n 8595 2430 m - 8550 2430 l gs col12 s gr -% Polyline -15.000 slw -n 8955 1890 m - 8955 2070 l gs col4 s gr -% Polyline -n 8955 1980 m - 9000 1980 l gs col4 s gr -% Polyline -n 8955 2565 m - 8955 2745 l gs col4 s gr -% Polyline -n 8955 2655 m - 9000 2655 l gs col4 s gr -% Polyline -n 8955 3240 m - 8955 3420 l gs col4 s gr -% Polyline -n 8955 3330 m - 9000 3330 l gs col4 s gr -% Polyline -n 7605 4815 m - 7605 4995 l gs col4 s gr -% Polyline -n 7605 4905 m - 7650 4905 l gs col4 s gr -% Polyline -n 7155 4590 m - 7155 4770 l gs col4 s gr -% Polyline -n 7155 4680 m - 7200 4680 l gs col4 s gr -% Polyline -7.500 slw -n 7470 4590 m - 7470 4770 l gs col12 s gr -% Polyline -n 7470 4680 m - 7425 4680 l gs col12 s gr -% Polyline -n 8595 4815 m - 8595 4995 l gs col12 s gr -% Polyline -n 8595 4905 m - 8550 4905 l gs col12 s gr -% Polyline -n 8595 5040 m - 8595 5220 l gs col12 s gr -% Polyline -n 8595 5130 m - 8550 5130 l gs col12 s gr -% Polyline -n 8595 5265 m - 8595 5445 l gs col12 s gr -% Polyline -n 8595 5355 m - 8550 5355 l gs col12 s gr -% Polyline -15.000 slw -n 8955 4815 m - 8955 4995 l gs col4 s gr -% Polyline -n 8955 4905 m - 9000 4905 l gs col4 s gr -% Polyline -n 8955 5490 m - 8955 5670 l gs col4 s gr -% Polyline -n 8955 5580 m - 9000 5580 l gs col4 s gr -% Polyline -n 8955 6165 m - 8955 6345 l gs col4 s gr -% Polyline -n 8955 6255 m - 9000 6255 l gs col4 s gr -% Polyline -7.500 slw -gs clippath -3750 2010 m 3750 1950 l 3598 1950 l 3718 1980 l 3598 2010 l cp -eoclip -n 2340 1980 m - 3735 1980 l gs col0 s gr gr - -% arrowhead -n 3598 2010 m 3718 1980 l 3598 1950 l col0 s -% Polyline -gs clippath -2591 2683 m 2643 2652 l 2564 2522 l 2601 2641 l 2513 2553 l cp -eoclip -n 2340 2205 m - 2610 2655 l gs col0 s gr gr - -% arrowhead -n 2513 2553 m 2601 2641 l 2564 2522 l col0 s -% Polyline -gs clippath -2585 3352 m 2643 3335 l 2599 3190 l 2605 3314 l 2541 3207 l cp -eoclip -n 2340 2430 m - 2610 3330 l gs col0 s gr gr - -% arrowhead -n 2541 3207 m 2605 3314 l 2599 3190 l col0 s -% Polyline -gs clippath -1233 2000 m 1292 1988 l 1262 1840 l 1257 1964 l 1204 1852 l cp -eoclip -n 1215 1755 m - 1260 1980 l gs col0 s gr gr - -% arrowhead -n 1204 1852 m 1257 1964 l 1262 1840 l col0 s -% Polyline -gs clippath -1233 4925 m 1292 4913 l 1262 4765 l 1257 4889 l 1204 4777 l cp -eoclip -n 1215 4680 m - 1260 4905 l gs col0 s gr gr - -% arrowhead -n 1204 4777 m 1257 4889 l 1262 4765 l col0 s -% Polyline -gs clippath -2625 4935 m 2625 4875 l 2473 4875 l 2593 4905 l 2473 4935 l cp -eoclip -n 2340 4905 m - 2610 4905 l gs col0 s gr gr - -% arrowhead -n 2473 4935 m 2593 4905 l 2473 4875 l col0 s -% Polyline -gs clippath -2591 5608 m 2643 5577 l 2564 5447 l 2601 5566 l 2513 5478 l cp -eoclip -n 2340 5130 m - 2610 5580 l gs col0 s gr gr - -% arrowhead -n 2513 5478 m 2601 5566 l 2564 5447 l col0 s -% Polyline -gs clippath -4440 2011 m 4380 2008 l 4371 2159 l 4409 2042 l 4431 2163 l cp -eoclip -n 4140 6390 m - 4410 2025 l gs col0 s gr gr - -% arrowhead -n 4431 2163 m 4409 2042 l 4371 2159 l col0 s -% Polyline -gs clippath -4425 2010 m 4425 1950 l 4273 1950 l 4393 1980 l 4273 2010 l cp -eoclip -n 4140 1980 m - 4410 1980 l gs col0 s gr gr - -% arrowhead -n 4273 2010 m 4393 1980 l 4273 1950 l col0 s -% Polyline -gs clippath -3750 6420 m 3750 6360 l 3598 6360 l 3718 6390 l 3598 6420 l cp -eoclip -n 2340 5355 m 2610 6390 l - 3735 6390 l gs col0 s gr gr - -% arrowhead -n 3598 6420 m 3718 6390 l 3598 6360 l col0 s -% Polyline -gs clippath -8925 2010 m 8925 1950 l 8773 1950 l 8893 1980 l 8773 2010 l cp -eoclip -n 8640 1980 m - 8910 1980 l gs col0 s gr gr - -% arrowhead -n 8773 2010 m 8893 1980 l 8773 1950 l col0 s -% Polyline -gs clippath -8891 2683 m 8943 2652 l 8864 2522 l 8901 2641 l 8813 2553 l cp -eoclip -n 8640 2205 m - 8910 2655 l gs col0 s gr gr - -% arrowhead -n 8813 2553 m 8901 2641 l 8864 2522 l col0 s -% Polyline -gs clippath -8885 3352 m 8943 3335 l 8899 3190 l 8905 3314 l 8841 3207 l cp -eoclip -n 8640 2430 m - 8910 3330 l gs col0 s gr gr - -% arrowhead -n 8841 3207 m 8905 3314 l 8899 3190 l col0 s -% Polyline -gs clippath -7533 2000 m 7592 1988 l 7562 1840 l 7557 1964 l 7504 1852 l cp -eoclip -n 7515 1755 m - 7560 1980 l gs col0 s gr gr - -% arrowhead -n 7504 1852 m 7557 1964 l 7562 1840 l col0 s -% Polyline -gs clippath -7533 4925 m 7592 4913 l 7562 4765 l 7557 4889 l 7504 4777 l cp -eoclip -n 7515 4680 m - 7560 4905 l gs col0 s gr gr - -% arrowhead -n 7504 4777 m 7557 4889 l 7562 4765 l col0 s -% Polyline -gs clippath -8925 4935 m 8925 4875 l 8773 4875 l 8893 4905 l 8773 4935 l cp -eoclip -n 8640 4905 m - 8910 4905 l gs col0 s gr gr - -% arrowhead -n 8773 4935 m 8893 4905 l 8773 4875 l col0 s -% Polyline -gs clippath -8885 6277 m 8943 6260 l 8899 6115 l 8905 6239 l 8841 6132 l cp -eoclip -n 8640 5355 m - 8910 6255 l gs col0 s gr gr - -% arrowhead -n 8841 6132 m 8905 6239 l 8899 6115 l col0 s -% Polyline -gs clippath -8891 5608 m 8943 5577 l 8864 5447 l 8901 5566 l 8813 5478 l cp -eoclip -n 8640 5130 m - 8910 5580 l gs col0 s gr gr - -% arrowhead -n 8813 5478 m 8901 5566 l 8864 5447 l col0 s -/Times-Roman ff 180.00 scf sf -945 1530 m -gs 1 -1 sc (MENU) col0 sh gr -/Times-Roman ff 180.00 scf sf -1575 1890 m -gs 1 -1 sc 90.0 rot (MENU) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 180.00 scf sf -2790 2700 m -gs 1 -1 sc (SELECT) col0 sh gr -/Times-Roman ff 180.00 scf sf -2790 3375 m -gs 1 -1 sc (OPTIONS) col0 sh gr -/Times-Roman ff 180.00 scf sf -945 4455 m -gs 1 -1 sc (TOOLBAR) col0 sh gr -/Times-Roman ff 180.00 scf sf -1575 4815 m -gs 1 -1 sc 90.0 rot (TOOLBAR) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 180.00 scf sf -2790 4950 m -gs 1 -1 sc (NEW) col0 sh gr -/Times-Roman ff 180.00 scf sf -2790 5625 m -gs 1 -1 sc (OPEN) col0 sh gr -/Times-Roman ff 330.00 scf sf -3150 7875 m -gs 1 -1 sc (solution without shared components) dup sw pop 2 div neg 0 rm col0 sh gr -/Times-Roman ff 180.00 scf sf -7245 1530 m -gs 1 -1 sc (MENU) col0 sh gr -/Times-Roman ff 180.00 scf sf -7875 1890 m -gs 1 -1 sc 90.0 rot (MENU) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 180.00 scf sf -9090 2025 m -gs 1 -1 sc (UNDO) col0 sh gr -/Times-Roman ff 180.00 scf sf -9090 2700 m -gs 1 -1 sc (SELECT) col0 sh gr -/Times-Roman ff 180.00 scf sf -9090 3375 m -gs 1 -1 sc (OPTIONS) col0 sh gr -/Times-Roman ff 180.00 scf sf -7245 4455 m -gs 1 -1 sc (TOOLBAR) col0 sh gr -/Times-Roman ff 180.00 scf sf -7875 4815 m -gs 1 -1 sc 90.0 rot (TOOLBAR) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 180.00 scf sf -9090 4950 m -gs 1 -1 sc (NEW) col0 sh gr -/Times-Roman ff 180.00 scf sf -9090 5625 m -gs 1 -1 sc (OPEN) col0 sh gr -/Times-Roman ff 180.00 scf sf -9090 6300 m -gs 1 -1 sc (UNDO) col0 sh gr -/Times-Roman ff 330.00 scf sf -8775 7920 m -gs 1 -1 sc (solution with shared components) dup sw pop 2 div neg 0 rm col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/specification/sharing.fig b/web/latex/specification/sharing.fig deleted file mode 100644 index 59c28d8834b6fda90740b7cdb4b5f825d933b990..0000000000000000000000000000000000000000 --- a/web/latex/specification/sharing.fig +++ /dev/null @@ -1,413 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -50.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -0 34 #dddddd -6 765 810 1035 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 990 855 810 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 900 855 900 900 --6 -6 1080 810 1350 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 855 1125 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 855 1215 900 --6 -6 1395 810 1665 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 855 1440 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 855 1530 900 --6 -6 1260 1845 1395 2115 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1890 1305 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1980 1350 1980 --6 -6 810 1620 945 1890 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 855 1665 855 1845 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 1755 900 1755 --6 -6 1125 1665 1170 1845 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 1665 1170 1845 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 1755 1125 1755 --6 -6 2250 1890 2295 2070 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 1890 2295 2070 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 1980 2250 1980 --6 -6 2250 2115 2295 2295 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 2115 2295 2295 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 2205 2250 2205 --6 -6 2250 2340 2295 2520 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 2340 2295 2520 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 2430 2250 2430 --6 -6 2610 2520 2745 2790 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 2565 2655 2745 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 2655 2700 2655 --6 -6 2610 3195 2745 3465 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 3240 2655 3420 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 3330 2700 3330 --6 -6 1260 4770 1395 5040 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 4815 1305 4995 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 4905 1350 4905 --6 -6 810 4545 945 4815 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 855 4590 855 4770 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 4680 900 4680 --6 -6 1125 4590 1170 4770 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 4590 1170 4770 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 4680 1125 4680 --6 -6 2250 4815 2295 4995 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 4815 2295 4995 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 4905 2250 4905 --6 -6 2250 5040 2295 5220 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 5040 2295 5220 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 5130 2250 5130 --6 -6 2250 5265 2295 5445 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 5265 2295 5445 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 5355 2250 5355 --6 -6 2610 4770 2745 5040 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 4815 2655 4995 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 4905 2700 4905 --6 -6 2610 5445 2745 5715 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 5490 2655 5670 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 5580 2700 5580 --6 -6 3735 1845 3870 2115 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 1890 3780 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 1980 3825 1980 --6 -6 4050 1890 4095 2070 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1890 4095 2070 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 1980 4050 1980 --6 -6 4410 1800 5400 2250 -6 4410 1845 4545 2115 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 1890 4455 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 1980 4500 1980 --6 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 4500 1800 5400 1800 5400 2250 4500 2250 4500 1800 -4 0 0 50 -1 0 12 0.0000 4 120 540 4590 2025 UNDO\001 --6 -6 3735 6255 3870 6525 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 6300 3780 6480 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3780 6390 3825 6390 --6 -6 4050 6300 4095 6480 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 6300 4095 6480 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4095 6390 4050 6390 --6 -6 7065 810 7335 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7290 855 7110 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7200 855 7200 900 --6 -6 7380 810 7650 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7605 855 7425 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7515 855 7515 900 --6 -6 7695 810 7965 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7920 855 7740 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7830 855 7830 900 --6 -6 7560 1845 7695 2115 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7605 1890 7605 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7605 1980 7650 1980 --6 -6 7110 1620 7245 1890 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7155 1665 7155 1845 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7155 1755 7200 1755 --6 -6 7425 1665 7470 1845 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7470 1665 7470 1845 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7470 1755 7425 1755 --6 -6 8550 1890 8595 2070 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 1890 8595 2070 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 1980 8550 1980 --6 -6 8550 2115 8595 2295 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 2115 8595 2295 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 2205 8550 2205 --6 -6 8550 2340 8595 2520 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 2340 8595 2520 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 2430 8550 2430 --6 -6 8910 1845 9045 2115 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 1890 8955 2070 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 1980 9000 1980 --6 -6 8910 2520 9045 2790 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 2565 8955 2745 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 2655 9000 2655 --6 -6 8910 3195 9045 3465 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 3240 8955 3420 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 3330 9000 3330 --6 -6 7560 4770 7695 5040 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7605 4815 7605 4995 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7605 4905 7650 4905 --6 -6 7110 4545 7245 4815 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7155 4590 7155 4770 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7155 4680 7200 4680 --6 -6 7425 4590 7470 4770 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7470 4590 7470 4770 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7470 4680 7425 4680 --6 -6 8550 4815 8595 4995 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 4815 8595 4995 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 4905 8550 4905 --6 -6 8550 5040 8595 5220 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 5040 8595 5220 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 5130 8550 5130 --6 -6 8550 5265 8595 5445 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 5265 8595 5445 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 5355 8550 5355 --6 -6 8910 4770 9045 5040 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 4815 8955 4995 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 4905 9000 4905 --6 -6 8910 5445 9045 5715 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 5490 8955 5670 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 5580 9000 5580 --6 -6 8910 6120 9045 6390 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 6165 8955 6345 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 6255 9000 6255 --6 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 1350 1800 2250 1800 2250 3150 1350 3150 1350 1800 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 2700 3150 3600 3150 3600 3600 2700 3600 2700 3150 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 2700 2475 3600 2475 3600 2925 2700 2925 2700 2475 -2 2 0 1 0 7 52 0 20 0.000 0 0 -1 0 0 5 - 1125 1575 3825 1575 3825 3825 1125 3825 1125 1575 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 900 1350 4050 1350 4050 4050 900 4050 900 1350 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2340 1980 3735 1980 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2340 2205 2610 2655 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2340 2430 2610 3330 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1215 1755 1260 1980 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 1215 4680 1260 4905 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2340 4905 2610 4905 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2340 5130 2610 5580 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 1350 4725 2250 4725 2250 6075 1350 6075 1350 4725 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 2700 4725 3600 4725 3600 5175 2700 5175 2700 4725 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 2700 5400 3600 5400 3600 5850 2700 5850 2700 5400 -2 2 0 1 0 7 52 0 20 0.000 0 0 -1 0 0 5 - 1125 4500 3825 4500 3825 6750 1125 6750 1125 4500 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 900 4275 4050 4275 4050 6975 900 6975 900 4275 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 675 1125 5625 1125 5625 7200 675 7200 675 1125 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 450 900 5850 900 5850 7425 450 7425 450 900 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4140 6390 4410 2025 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4140 1980 4410 1980 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 2340 5355 2610 6390 3735 6390 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 7650 1800 8550 1800 8550 3150 7650 3150 7650 1800 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 9000 3150 9900 3150 9900 3600 9000 3600 9000 3150 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 9000 2475 9900 2475 9900 2925 9000 2925 9000 2475 -2 2 0 1 0 7 52 0 20 0.000 0 0 -1 0 0 5 - 7425 1575 10125 1575 10125 3825 7425 3825 7425 1575 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 7200 1350 10350 1350 10350 4050 7200 4050 7200 1350 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 8640 1980 8910 1980 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 8640 2205 8910 2655 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 8640 2430 8910 3330 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 7515 1755 7560 1980 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 7515 4680 7560 4905 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 8640 4905 8910 4905 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 8640 5355 8910 6255 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 8640 5130 8910 5580 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 6975 1125 10575 1125 10575 7200 6975 7200 6975 1125 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 6750 900 10800 900 10800 7425 6750 7425 6750 900 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 7650 4725 8550 4725 8550 6075 7650 6075 7650 4725 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 9000 4725 9900 4725 9900 5175 9000 5175 9000 4725 -2 2 0 1 0 33 51 0 20 0.000 0 0 -1 0 0 5 - 9000 5400 9900 5400 9900 5850 9000 5850 9000 5400 -2 2 1 1 0 34 51 0 20 4.000 0 0 -1 0 0 5 - 9000 6075 9900 6075 9900 6525 9000 6525 9000 6075 -2 2 0 1 0 7 52 0 20 0.000 0 0 -1 0 0 5 - 7425 4500 10125 4500 10125 6750 7425 6750 7425 4500 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 7200 4275 10350 4275 10350 6975 7200 6975 7200 4275 -2 2 1 1 0 34 51 0 20 4.000 0 0 -1 0 0 5 - 9000 1800 9900 1800 9900 2250 9000 2250 9000 1800 -4 0 0 50 -1 0 12 0.0000 4 120 540 945 1530 MENU\001 -4 2 0 50 -1 0 12 1.5708 4 120 540 1575 1890 MENU\001 -4 0 0 50 -1 0 12 0.0000 4 120 645 2790 2700 SELECT\001 -4 0 0 50 -1 0 12 0.0000 4 120 780 2790 3375 OPTIONS\001 -4 0 0 50 -1 0 12 0.0000 4 120 855 945 4455 TOOLBAR\001 -4 2 0 50 -1 0 12 1.5708 4 120 855 1575 4815 TOOLBAR\001 -4 0 0 50 -1 0 12 0.0000 4 120 405 2790 4950 NEW\001 -4 0 0 50 -1 0 12 0.0000 4 120 480 2790 5625 OPEN\001 -4 1 0 50 -1 0 22 0.0000 4 300 4815 3150 7875 solution without shared components\001 -4 0 0 50 -1 0 12 0.0000 4 120 540 7245 1530 MENU\001 -4 2 0 50 -1 0 12 1.5708 4 120 540 7875 1890 MENU\001 -4 0 0 50 -1 0 12 0.0000 4 120 540 9090 2025 UNDO\001 -4 0 0 50 -1 0 12 0.0000 4 120 645 9090 2700 SELECT\001 -4 0 0 50 -1 0 12 0.0000 4 120 780 9090 3375 OPTIONS\001 -4 0 0 50 -1 0 12 0.0000 4 120 855 7245 4455 TOOLBAR\001 -4 2 0 50 -1 0 12 1.5708 4 120 855 7875 4815 TOOLBAR\001 -4 0 0 50 -1 0 12 0.0000 4 120 405 9090 4950 NEW\001 -4 0 0 50 -1 0 12 0.0000 4 120 480 9090 5625 OPEN\001 -4 0 0 50 -1 0 12 0.0000 4 120 540 9090 6300 UNDO\001 -4 1 0 50 -1 0 22 0.0000 4 300 4395 8775 7920 solution with shared components\001 diff --git a/web/latex/specification/templates.eps b/web/latex/specification/templates.eps deleted file mode 100644 index c1fb06e2e376182c9d294c9797d857dd8f8442e4..0000000000000000000000000000000000000000 --- a/web/latex/specification/templates.eps +++ /dev/null @@ -1,405 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: templates.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Thu Aug 28 09:19:33 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 405 161 -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def - -end -save -newpath 0 161 moveto 0 0 lineto 405 0 lineto 405 161 lineto closepath clip newpath --38.3 199.2 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.06299 0.06299 sc -% -% Fig objects follow -% -% -% here starts figure with depth 55 -% Polyline -7.500 slw -n 675 675 m 3600 675 l 3600 3150 l 675 3150 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 4050 675 m 6975 675 l 6975 3150 l 4050 3150 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 900 900 m 3375 900 l 3375 2925 l 900 2925 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 4275 900 m 6750 900 l 6750 2925 l 4275 2925 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 1350 1125 m 2250 1125 l 2250 1755 l 1350 1755 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 1980 2070 m 2880 2070 l 2880 2700 l 1980 2700 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 4725 1125 m 5625 1125 l 5625 1755 l 4725 1755 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 5355 2070 m 6255 2070 l 6255 2700 l 5355 2700 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% here ends figure; -% -% here starts figure with depth 50 -% Polyline -15.000 slw -n 990 630 m - 810 630 l gs col4 s gr -% Polyline -n 900 630 m - 900 675 l gs col4 s gr -% Polyline -n 1305 630 m - 1125 630 l gs col4 s gr -% Polyline -n 1215 630 m - 1215 675 l gs col4 s gr -% Polyline -n 630 2070 m - 630 2250 l gs col4 s gr -% Polyline -n 630 2160 m - 675 2160 l gs col4 s gr -% Polyline -n 630 1215 m - 630 1395 l gs col4 s gr -% Polyline -n 630 1305 m - 675 1305 l gs col4 s gr -% Polyline -7.500 slw -n 945 1215 m - 945 1395 l gs col12 s gr -% Polyline -n 945 1305 m - 900 1305 l gs col12 s gr -% Polyline -15.000 slw -n 3330 1215 m - 3330 1395 l gs col4 s gr -% Polyline -n 3330 1305 m - 3375 1305 l gs col4 s gr -% Polyline -7.500 slw -n 3645 1215 m - 3645 1395 l gs col12 s gr -% Polyline -n 3645 1305 m - 3600 1305 l gs col12 s gr -% Polyline -15.000 slw -n 1305 1485 m - 1305 1665 l gs col4 s gr -% Polyline -n 1305 1575 m - 1350 1575 l gs col4 s gr -% Polyline -n 1305 1215 m - 1305 1395 l gs col4 s gr -% Polyline -n 1305 1305 m - 1350 1305 l gs col4 s gr -% Polyline -n 1620 1080 m - 1440 1080 l gs col4 s gr -% Polyline -n 1530 1080 m - 1530 1125 l gs col4 s gr -% Polyline -7.500 slw -n 2295 1215 m - 2295 1395 l gs col12 s gr -% Polyline -n 2295 1305 m - 2250 1305 l gs col12 s gr -% Polyline -n 2295 1485 m - 2295 1665 l gs col12 s gr -% Polyline -n 2295 1575 m - 2250 1575 l gs col12 s gr -% Polyline -15.000 slw -n 1935 2430 m - 1935 2610 l gs col4 s gr -% Polyline -n 1935 2520 m - 1980 2520 l gs col4 s gr -% Polyline -n 1935 2160 m - 1935 2340 l gs col4 s gr -% Polyline -n 1935 2250 m - 1980 2250 l gs col4 s gr -% Polyline -n 2250 2025 m - 2070 2025 l gs col4 s gr -% Polyline -n 2160 2025 m - 2160 2070 l gs col4 s gr -% Polyline -7.500 slw -n 2925 2160 m - 2925 2340 l gs col12 s gr -% Polyline -n 2925 2250 m - 2880 2250 l gs col12 s gr -% Polyline -15.000 slw -n 4365 630 m - 4185 630 l gs col4 s gr -% Polyline -n 4275 630 m - 4275 675 l gs col4 s gr -% Polyline -n 4680 630 m - 4500 630 l gs col4 s gr -% Polyline -n 4590 630 m - 4590 675 l gs col4 s gr -% Polyline -n 4005 1215 m - 4005 1395 l gs col4 s gr -% Polyline -n 4005 1305 m - 4050 1305 l gs col4 s gr -% Polyline -7.500 slw -n 4320 1215 m - 4320 1395 l gs col12 s gr -% Polyline -n 4320 1305 m - 4275 1305 l gs col12 s gr -% Polyline -15.000 slw -n 6705 1215 m - 6705 1395 l gs col4 s gr -% Polyline -n 6705 1305 m - 6750 1305 l gs col4 s gr -% Polyline -7.500 slw -n 7020 1215 m - 7020 1395 l gs col12 s gr -% Polyline -n 7020 1305 m - 6975 1305 l gs col12 s gr -% Polyline -15.000 slw -n 4680 1215 m - 4680 1395 l gs col4 s gr -% Polyline -n 4680 1305 m - 4725 1305 l gs col4 s gr -% Polyline -n 4995 1080 m - 4815 1080 l gs col4 s gr -% Polyline -n 4905 1080 m - 4905 1125 l gs col4 s gr -% Polyline -7.500 slw -n 5670 1215 m - 5670 1395 l gs col12 s gr -% Polyline -n 5670 1305 m - 5625 1305 l gs col12 s gr -% Polyline -n 5670 1485 m - 5670 1665 l gs col12 s gr -% Polyline -n 5670 1575 m - 5625 1575 l gs col12 s gr -% Polyline -15.000 slw -n 5310 2160 m - 5310 2340 l gs col4 s gr -% Polyline -n 5310 2250 m - 5355 2250 l gs col4 s gr -% Polyline -n 5625 2025 m - 5445 2025 l gs col4 s gr -% Polyline -n 5535 2025 m - 5535 2070 l gs col4 s gr -% Polyline -7.500 slw -n 6300 2160 m - 6300 2340 l gs col12 s gr -% Polyline -n 6300 2250 m - 6255 2250 l gs col12 s gr -% Polyline -gs clippath -3318 1345 m 3261 1325 l 3212 1469 l 3280 1366 l 3268 1489 l cp -eoclip -n 2970 2250 m - 3285 1350 l gs col0 s gr gr - -% arrowhead -n 3268 1489 m 3280 1366 l 3212 1469 l col0 s -% Polyline -gs clippath -1275 1335 m 1275 1275 l 1123 1275 l 1243 1305 l 1123 1335 l cp -eoclip -n 990 1305 m - 1260 1305 l gs col0 s gr gr - -% arrowhead -n 1123 1335 m 1243 1305 l 1123 1275 l col0 s -% Polyline -gs clippath -3300 1335 m 3300 1275 l 3148 1275 l 3268 1305 l 3148 1335 l cp -eoclip -n 2340 1305 m - 3285 1305 l gs col0 s gr gr - -% arrowhead -n 3148 1335 m 3268 1305 l 3148 1275 l col0 s -% Polyline -gs clippath -1905 2280 m 1905 2220 l 1753 2220 l 1873 2250 l 1753 2280 l cp -eoclip -n 2340 1575 m 2520 1575 l 2520 1890 l 1620 1890 l 1620 2250 l - 1890 2250 l gs col0 s gr gr - -% arrowhead -n 1753 2280 m 1873 2250 l 1753 2220 l col0 s -% Polyline -gs clippath -6693 1345 m 6636 1325 l 6587 1469 l 6655 1366 l 6643 1489 l cp -eoclip -n 6345 2250 m - 6660 1350 l gs col0 s gr gr - -% arrowhead -n 6643 1489 m 6655 1366 l 6587 1469 l col0 s -% Polyline -gs clippath -4650 1335 m 4650 1275 l 4498 1275 l 4618 1305 l 4498 1335 l cp -eoclip -n 4365 1305 m - 4635 1305 l gs col0 s gr gr - -% arrowhead -n 4498 1335 m 4618 1305 l 4498 1275 l col0 s -% Polyline -gs clippath -6675 1335 m 6675 1275 l 6523 1275 l 6643 1305 l 6523 1335 l cp -eoclip -n 5715 1305 m - 6660 1305 l gs col0 s gr gr - -% arrowhead -n 6523 1335 m 6643 1305 l 6523 1275 l col0 s -% Polyline -gs clippath -5280 2280 m 5280 2220 l 5128 2220 l 5248 2250 l 5128 2280 l cp -eoclip -n 5715 1575 m 5895 1575 l 5895 1890 l 4995 1890 l 4995 2250 l - 5265 2250 l gs col0 s gr gr - -% arrowhead -n 5128 2280 m 5248 2250 l 5128 2220 l col0 s -/Times-Roman ff 165.00 scf sf -945 2250 m -gs 1 -1 sc (Factory) col0 sh gr -/Times-Italic ff 165.00 scf sf -720 3105 m -gs 1 -1 sc (template) col0 sh gr -/Times-Roman ff 165.00 scf sf -1440 1665 m -gs 1 -1 sc (Factory) col0 sh gr -/Times-Roman ff 165.00 scf sf -2070 2610 m -gs 1 -1 sc (Factory) col0 sh gr -/Times-Italic ff 165.00 scf sf -4095 3105 m -gs 1 -1 sc (instance) col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/specification/templates.fig b/web/latex/specification/templates.fig deleted file mode 100644 index 9f526cb2f0a1a7676e1eb63b85a50a2e7b82db25..0000000000000000000000000000000000000000 --- a/web/latex/specification/templates.fig +++ /dev/null @@ -1,230 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 765 585 1035 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 990 630 810 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 900 630 900 675 --6 -6 1080 585 1350 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 630 1125 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1215 630 1215 675 --6 -6 585 2025 720 2295 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 630 2070 630 2250 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 630 2160 675 2160 --6 -6 585 1170 720 1440 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1215 630 1395 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1305 675 1305 --6 -6 900 1215 945 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1215 945 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1305 900 1305 --6 -6 3285 1170 3420 1440 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 3330 1215 3330 1395 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3330 1305 3375 1305 --6 -6 3600 1215 3645 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3645 1215 3645 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3645 1305 3600 1305 --6 -6 1260 1440 1395 1710 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1485 1305 1665 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1575 1350 1575 --6 -6 1260 1170 1395 1440 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1215 1305 1395 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1305 1350 1305 --6 -6 1395 1035 1665 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 1080 1440 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1530 1080 1530 1125 --6 -6 2250 1215 2295 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 1215 2295 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 1305 2250 1305 --6 -6 2250 1485 2295 1665 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 1485 2295 1665 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 1575 2250 1575 --6 -6 1890 2385 2025 2655 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 2430 1935 2610 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 2520 1980 2520 --6 -6 1890 2115 2025 2385 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 2160 1935 2340 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 2250 1980 2250 --6 -6 2025 1980 2295 2115 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2250 2025 2070 2025 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2160 2025 2160 2070 --6 -6 2880 2160 2925 2340 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 2160 2925 2340 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2925 2250 2880 2250 --6 -6 4140 585 4410 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4365 630 4185 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4275 630 4275 675 --6 -6 4455 585 4725 720 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4680 630 4500 630 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4590 630 4590 675 --6 -6 3960 1170 4095 1440 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4005 1215 4005 1395 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4005 1305 4050 1305 --6 -6 4275 1215 4320 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4320 1215 4320 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4320 1305 4275 1305 --6 -6 6660 1170 6795 1440 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 1215 6705 1395 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6705 1305 6750 1305 --6 -6 6975 1215 7020 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7020 1215 7020 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7020 1305 6975 1305 --6 -6 4635 1170 4770 1440 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4680 1215 4680 1395 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4680 1305 4725 1305 --6 -6 4770 1035 5040 1170 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4995 1080 4815 1080 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4905 1080 4905 1125 --6 -6 5625 1215 5670 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5670 1215 5670 1395 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5670 1305 5625 1305 --6 -6 5625 1485 5670 1665 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5670 1485 5670 1665 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5670 1575 5625 1575 --6 -6 5265 2115 5400 2385 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 5310 2160 5310 2340 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5310 2250 5355 2250 --6 -6 5400 1980 5670 2115 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 5625 2025 5445 2025 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5535 2025 5535 2070 --6 -6 6255 2160 6300 2340 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6300 2160 6300 2340 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6300 2250 6255 2250 --6 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2970 2250 3285 1350 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 990 1305 1260 1305 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2340 1305 3285 1305 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 900 900 3375 900 3375 2925 900 2925 900 900 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 675 675 3600 675 3600 3150 675 3150 675 675 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 6 - 0 0 1.00 60.00 120.00 - 2340 1575 2520 1575 2520 1890 1620 1890 1620 2250 1890 2250 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 1350 1125 2250 1125 2250 1755 1350 1755 1350 1125 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 1980 2070 2880 2070 2880 2700 1980 2700 1980 2070 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6345 2250 6660 1350 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 4365 1305 4635 1305 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5715 1305 6660 1305 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 4275 900 6750 900 6750 2925 4275 2925 4275 900 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 4050 675 6975 675 6975 3150 4050 3150 4050 675 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 6 - 0 0 1.00 60.00 120.00 - 5715 1575 5895 1575 5895 1890 4995 1890 4995 2250 5265 2250 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 4725 1125 5625 1125 5625 1755 4725 1755 4725 1125 -2 2 0 1 0 33 53 0 20 0.000 0 0 -1 0 0 5 - 5355 2070 6255 2070 6255 2700 5355 2700 5355 2070 -4 0 0 50 0 0 11 0.0000 4 135 495 945 2250 Factory\001 -4 0 0 50 -1 1 11 0.0000 4 135 555 720 3105 template\001 -4 0 0 50 0 0 11 0.0000 4 135 495 1440 1665 Factory\001 -4 0 0 50 0 0 11 0.0000 4 135 495 2070 2610 Factory\001 -4 0 0 50 -1 1 11 0.0000 4 105 525 4095 3105 instance\001 diff --git a/web/latex/tutorial/archi.eps b/web/latex/tutorial/archi.eps deleted file mode 100644 index 2041829f241e14004494ff6c86a531147959954c..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/archi.eps +++ /dev/null @@ -1,237 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: archi.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Thu Sep 4 13:48:35 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 456 220 -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def - -end -save -newpath 0 220 moveto 0 0 lineto 456 0 lineto 456 220 lineto closepath clip newpath --55.9 465.6 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.06299 0.06299 sc -% -% Fig objects follow -% -% -% here starts figure with depth 50 -% Polyline -7.500 slw -n 1350 4500 m 2025 4500 l 2025 4950 l 1350 4950 l - cp gs col0 s gr -% Polyline -n 2700 5400 m 3375 5400 l 3375 5850 l 2700 5850 l - cp gs col0 s gr -% Polyline -n 4500 4500 m 5175 4500 l 5175 4950 l 4500 4950 l - cp gs col0 s gr -% Polyline -n 6750 4500 m 7425 4500 l 7425 4950 l 6750 4950 l - cp gs col0 s gr -% Polyline -gs clippath -2638 5653 m 2688 5621 l 2605 5494 l 2646 5611 l 2555 5526 l cp -eoclip -n 2070 4725 m - 2655 5625 l gs col0 s gr gr - -% arrowhead -n 2555 5526 m 2646 5611 l 2605 5494 l col0 s -% Polyline -gs clippath -6720 4755 m 6720 4695 l 6568 4695 l 6688 4725 l 6568 4755 l cp -eoclip -n 5220 4725 m - 6705 4725 l gs col0 s gr gr - -% arrowhead -n 6568 4755 m 6688 4725 l 6568 4695 l col0 s -% Polyline -gs clippath -6690 5775 m 6654 5726 l 6532 5817 l 6647 5770 l 6568 5865 l cp -eoclip -n 6120 6165 m - 6660 5760 l gs col0 s gr gr - -% arrowhead -n 6568 5865 m 6647 5770 l 6532 5817 l col0 s -% Polyline -n 5175 5220 m 7650 5220 l 7650 6930 l 5175 6930 l - cp gs col4 s gr -% Polyline -n 6750 5535 m 7425 5535 l 7425 5985 l 6750 5985 l - cp gs col0 s gr -% Polyline -n 5400 5940 m 6075 5940 l 6075 6390 l 5400 6390 l - cp gs col0 s gr -% Polyline -n 1125 4140 m 3600 4140 l 3600 6075 l 1125 6075 l - cp gs col4 s gr -% Polyline -n 900 3915 m 8100 3915 l 8100 7380 l 900 7380 l - cp gs col4 s gr -% Polyline -n 4275 4140 m 7875 4140 l 7875 7155 l 4275 7155 l - cp gs col4 s gr -% Polyline -n 6750 6255 m 7425 6255 l 7425 6705 l 6750 6705 l - cp gs col0 s gr -% Polyline -gs clippath -6703 6513 m 6732 6460 l 6598 6388 l 6690 6472 l 6570 6441 l cp -eoclip -n 6120 6165 m - 6705 6480 l gs col0 s gr gr - -% arrowhead -n 6570 6441 m 6690 6472 l 6598 6388 l col0 s -/Times-Roman ff 165.00 scf sf -1350 4410 m -gs 1 -1 sc (Request receiver) col0 sh gr -/Times-Roman ff 165.00 scf sf -2700 5310 m -gs 1 -1 sc (Scheduler) col0 sh gr -/Times-Roman ff 165.00 scf sf -4500 4410 m -gs 1 -1 sc (Request analyzer) col0 sh gr -/Times-Roman ff 165.00 scf sf -6750 4410 m -gs 1 -1 sc (Logger) col0 sh gr -/Times-Roman ff 165.00 scf sf -5400 5625 m -gs 1 -1 sc (Request) col0 sh gr -/Times-Roman ff 165.00 scf sf -5400 5850 m -gs 1 -1 sc (dispatcher) col0 sh gr -/Times-Roman ff 165.00 scf sf -6795 5490 m -gs 1 -1 sc (File) col0 sh gr -/Times-Roman ff 165.00 scf sf -6795 5715 m -gs 1 -1 sc (request) col0 sh gr -/Times-Roman ff 165.00 scf sf -6795 5940 m -gs 1 -1 sc (handler) col0 sh gr -/Times-Italic ff 165.00 scf sf -2970 4635 m -gs 1 -1 sc (uses) col0 sh gr -/Times-Roman ff 165.00 scf sf -5265 6840 m -gs 1 -1 sc (Request handler) col0 sh gr -/Times-Roman ff 165.00 scf sf -1215 5985 m -gs 1 -1 sc (Frontend) col0 sh gr -/Times-Roman ff 165.00 scf sf -4410 7065 m -gs 1 -1 sc (Backend) col0 sh gr -/Times-Roman ff 165.00 scf sf -990 7290 m -gs 1 -1 sc (Comanche) col0 sh gr -/Times-Roman ff 165.00 scf sf -6795 6210 m -gs 1 -1 sc (Error) col0 sh gr -/Times-Roman ff 165.00 scf sf -6795 6435 m -gs 1 -1 sc (request) col0 sh gr -/Times-Roman ff 165.00 scf sf -6795 6660 m -gs 1 -1 sc (handler) col0 sh gr -% Polyline -gs clippath -4470 4755 m 4470 4695 l 4318 4695 l 4438 4725 l 4318 4755 l cp -eoclip -n 2070 4725 m - 4455 4725 l gs col0 s gr gr - -% arrowhead -n 4318 4755 m 4438 4725 l 4318 4695 l col0 s -% Polyline -gs clippath -5370 6195 m 5370 6135 l 5218 6135 l 5338 6165 l 5218 6195 l cp -eoclip -n 4815 4995 m 4815 6165 l - 5355 6165 l gs col0 s gr gr - -% arrowhead -n 5218 6195 m 5338 6165 l 5218 6135 l col0 s -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/tutorial/archi.fig b/web/latex/tutorial/archi.fig deleted file mode 100644 index 8081b9b9b299b52dafdfe8e738eceebf39c14255..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/archi.fig +++ /dev/null @@ -1,66 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -100.00 -Single --2 -1200 2 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 1350 4500 2025 4500 2025 4950 1350 4950 1350 4500 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2700 5400 3375 5400 3375 5850 2700 5850 2700 5400 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4500 4500 5175 4500 5175 4950 4500 4950 4500 4500 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 6750 4500 7425 4500 7425 4950 6750 4950 6750 4500 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2070 4725 2655 5625 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 2070 4725 4455 4725 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 5220 4725 6705 4725 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 1 0 3 - 0 0 1.00 60.00 120.00 - 4815 4995 4815 6165 5355 6165 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6120 6165 6660 5760 -2 2 0 1 4 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 5175 5220 7650 5220 7650 6930 5175 6930 5175 5220 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 6750 5535 7425 5535 7425 5985 6750 5985 6750 5535 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 5400 5940 6075 5940 6075 6390 5400 6390 5400 5940 -2 2 0 1 4 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 1125 4140 3600 4140 3600 6075 1125 6075 1125 4140 -2 2 0 1 4 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 900 3915 8100 3915 8100 7380 900 7380 900 3915 -2 2 0 1 4 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4275 4140 7875 4140 7875 7155 4275 7155 4275 4140 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 6750 6255 7425 6255 7425 6705 6750 6705 6750 6255 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 0 0 1.00 60.00 120.00 - 6120 6165 6705 6480 -4 0 0 50 -1 0 11 0.0000 4 150 1095 1350 4410 Request receiver\001 -4 0 0 50 -1 0 11 0.0000 4 105 645 2700 5310 Scheduler\001 -4 0 0 50 -1 0 11 0.0000 4 150 1110 4500 4410 Request analyzer\001 -4 0 0 50 -1 0 11 0.0000 4 150 465 6750 4410 Logger\001 -4 0 0 50 -1 0 11 0.0000 4 150 510 5400 5625 Request\001 -4 0 0 50 -1 0 11 0.0000 4 135 660 5400 5850 dispatcher\001 -4 0 0 50 -1 0 11 0.0000 4 105 255 6795 5490 File\001 -4 0 0 50 -1 0 11 0.0000 4 135 465 6795 5715 request\001 -4 0 0 50 -1 0 11 0.0000 4 105 480 6795 5940 handler\001 -4 0 0 50 -1 1 11 0.0000 4 75 270 2970 4635 uses\001 -4 0 0 50 -1 0 11 0.0000 4 150 1035 5265 6840 Request handler\001 -4 0 0 50 -1 0 11 0.0000 4 105 570 1215 5985 Frontend\001 -4 0 0 50 -1 0 11 0.0000 4 105 555 4410 7065 Backend\001 -4 0 0 50 -1 0 11 0.0000 4 105 690 990 7290 Comanche\001 -4 0 0 50 -1 0 11 0.0000 4 105 360 6795 6210 Error\001 -4 0 0 50 -1 0 11 0.0000 4 135 465 6795 6435 request\001 -4 0 0 50 -1 0 11 0.0000 4 105 480 6795 6660 handler\001 diff --git a/web/latex/tutorial/archi2.eps b/web/latex/tutorial/archi2.eps deleted file mode 100644 index 03378e51a95e66facaff0dc99a01ab3762d7b525..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/archi2.eps +++ /dev/null @@ -1,667 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: archi2.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Thu Oct 2 15:58:18 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 457 221 -%%Magnification: 0.5000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def - -end -save -newpath 0 221 moveto 0 0 lineto 457 0 lineto 457 221 lineto closepath clip newpath --26.2 342.0 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.03150 0.03150 sc -% -% Fig objects follow -% -% -% here starts figure with depth 59 -% Polyline -7.500 slw -n 900 3915 m 15300 3915 l 15300 10845 l 900 10845 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 1125 4140 m 15075 4140 l 15075 10620 l 1125 10620 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 1350 4365 m 6300 4365 l 6300 8235 l 1350 8235 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 7515 4365 m 14850 4365 l 14850 10395 l 7515 10395 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 1575 4590 m 6075 4590 l 6075 8010 l 1575 8010 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 7740 4590 m 14625 4590 l 14625 10170 l 7740 10170 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 9450 6525 m 14400 6525 l 14400 9945 l 9450 9945 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 9675 6750 m 14175 6750 l 14175 9720 l 9675 9720 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% here ends figure; -% -% here starts figure with depth 50 -% Polyline -7.500 slw -n 3195 5445 m - 3195 5625 l gs col12 s gr -% Polyline -n 3195 5535 m - 3150 5535 l gs col12 s gr -% Polyline -15.000 slw -n 1755 5445 m - 1755 5625 l gs col4 s gr -% Polyline -n 1755 5535 m - 1800 5535 l gs col4 s gr -% Polyline -7.500 slw -n 1620 5445 m - 1620 5625 l gs col12 s gr -% Polyline -n 1620 5535 m - 1575 5535 l gs col12 s gr -% Polyline -15.000 slw -n 1305 5445 m - 1305 5625 l gs col4 s gr -% Polyline -n 1305 5535 m - 1350 5535 l gs col4 s gr -% Polyline -7.500 slw -n 1170 5445 m - 1170 5625 l gs col12 s gr -% Polyline -n 1170 5535 m - 1125 5535 l gs col12 s gr -% Polyline -15.000 slw -n 855 5445 m - 855 5625 l gs col4 s gr -% Polyline -n 855 5535 m - 900 5535 l gs col4 s gr -% Polyline -n 6030 5445 m - 6030 5625 l gs col4 s gr -% Polyline -n 6030 5535 m - 6075 5535 l gs col4 s gr -% Polyline -7.500 slw -n 6345 5445 m - 6345 5625 l gs col12 s gr -% Polyline -n 6345 5535 m - 6300 5535 l gs col12 s gr -% Polyline -15.000 slw -n 4455 7245 m - 4455 7425 l gs col4 s gr -% Polyline -n 4455 7335 m - 4500 7335 l gs col4 s gr -% Polyline -n 7470 5445 m - 7470 5625 l gs col4 s gr -% Polyline -n 7470 5535 m - 7515 5535 l gs col4 s gr -% Polyline -7.500 slw -n 7785 5445 m - 7785 5625 l gs col12 s gr -% Polyline -n 7785 5535 m - 7740 5535 l gs col12 s gr -% Polyline -15.000 slw -n 8055 5445 m - 8055 5625 l gs col4 s gr -% Polyline -n 8055 5535 m - 8100 5535 l gs col4 s gr -% Polyline -7.500 slw -n 9495 5445 m - 9495 5625 l gs col12 s gr -% Polyline -n 9495 5535 m - 9450 5535 l gs col12 s gr -% Polyline -15.000 slw -n 12555 5445 m - 12555 5625 l gs col4 s gr -% Polyline -n 12555 5535 m - 12600 5535 l gs col4 s gr -% Polyline -n 12555 7515 m - 12555 7695 l gs col4 s gr -% Polyline -n 12555 7605 m - 12600 7605 l gs col4 s gr -% Polyline -7.500 slw -n 11565 8190 m - 11565 8370 l gs col12 s gr -% Polyline -n 11565 8280 m - 11520 8280 l gs col12 s gr -% Polyline -n 11565 8460 m - 11565 8640 l gs col12 s gr -% Polyline -n 11565 8550 m - 11520 8550 l gs col12 s gr -% Polyline -15.000 slw -n 10125 8325 m - 10125 8505 l gs col4 s gr -% Polyline -n 10125 8415 m - 10170 8415 l gs col4 s gr -% Polyline -n 9405 8325 m - 9405 8505 l gs col4 s gr -% Polyline -n 9405 8415 m - 9450 8415 l gs col4 s gr -% Polyline -7.500 slw -n 9720 8325 m - 9720 8505 l gs col12 s gr -% Polyline -n 9720 8415 m - 9675 8415 l gs col12 s gr -% Polyline -n 3195 5715 m - 3195 5895 l gs col12 s gr -% Polyline -n 3195 5805 m - 3150 5805 l gs col12 s gr -% Polyline -n 8820 6030 m - 8640 6030 l gs col12 s gr -% Polyline -n 8730 6030 m - 8730 5985 l gs col12 s gr -% Polyline -15.000 slw -n 1125 3870 m - 945 3870 l gs col4 s gr -% Polyline -n 1035 3870 m - 1035 3915 l gs col4 s gr -% Polyline -n 1485 3870 m - 1305 3870 l gs col4 s gr -% Polyline -n 1395 3870 m - 1395 3915 l gs col4 s gr -% Polyline -n 1845 3870 m - 1665 3870 l gs col4 s gr -% Polyline -n 1755 3870 m - 1755 3915 l gs col4 s gr -% Polyline -n 2205 3870 m - 2025 3870 l gs col4 s gr -% Polyline -n 2115 3870 m - 2115 3915 l gs col4 s gr -% Polyline -n 1575 4320 m - 1395 4320 l gs col4 s gr -% Polyline -n 1485 4320 m - 1485 4365 l gs col4 s gr -% Polyline -n 1935 4320 m - 1755 4320 l gs col4 s gr -% Polyline -n 1845 4320 m - 1845 4365 l gs col4 s gr -% Polyline -n 2295 4320 m - 2115 4320 l gs col4 s gr -% Polyline -n 2205 4320 m - 2205 4365 l gs col4 s gr -% Polyline -n 2655 4320 m - 2475 4320 l gs col4 s gr -% Polyline -n 2565 4320 m - 2565 4365 l gs col4 s gr -% Polyline -n 7740 4320 m - 7560 4320 l gs col4 s gr -% Polyline -n 7650 4320 m - 7650 4365 l gs col4 s gr -% Polyline -n 8100 4320 m - 7920 4320 l gs col4 s gr -% Polyline -n 8010 4320 m - 8010 4365 l gs col4 s gr -% Polyline -n 8460 4320 m - 8280 4320 l gs col4 s gr -% Polyline -n 8370 4320 m - 8370 4365 l gs col4 s gr -% Polyline -n 8820 4320 m - 8640 4320 l gs col4 s gr -% Polyline -n 8730 4320 m - 8730 4365 l gs col4 s gr -% Polyline -n 9675 6480 m - 9495 6480 l gs col4 s gr -% Polyline -n 9585 6480 m - 9585 6525 l gs col4 s gr -% Polyline -n 10035 6480 m - 9855 6480 l gs col4 s gr -% Polyline -n 9945 6480 m - 9945 6525 l gs col4 s gr -% Polyline -n 10395 6480 m - 10215 6480 l gs col4 s gr -% Polyline -n 10305 6480 m - 10305 6525 l gs col4 s gr -% Polyline -n 10755 6480 m - 10575 6480 l gs col4 s gr -% Polyline -n 10665 6480 m - 10665 6525 l gs col4 s gr -% Polyline -n 8325 5040 m - 8145 5040 l gs col4 s gr -% Polyline -n 8235 5040 m - 8235 5085 l gs col4 s gr -% Polyline -n 8685 5040 m - 8505 5040 l gs col4 s gr -% Polyline -n 8595 5040 m - 8595 5085 l gs col4 s gr -% Polyline -n 9045 5040 m - 8865 5040 l gs col4 s gr -% Polyline -n 8955 5040 m - 8955 5085 l gs col4 s gr -% Polyline -n 10395 7920 m - 10215 7920 l gs col4 s gr -% Polyline -n 10305 7920 m - 10305 7965 l gs col4 s gr -% Polyline -n 10755 7920 m - 10575 7920 l gs col4 s gr -% Polyline -n 10665 7920 m - 10665 7965 l gs col4 s gr -% Polyline -n 11115 7920 m - 10935 7920 l gs col4 s gr -% Polyline -n 11025 7920 m - 11025 7965 l gs col4 s gr -% Polyline -n 2025 5040 m - 1845 5040 l gs col4 s gr -% Polyline -n 1935 5040 m - 1935 5085 l gs col4 s gr -% Polyline -n 2385 5040 m - 2205 5040 l gs col4 s gr -% Polyline -n 2295 5040 m - 2295 5085 l gs col4 s gr -% Polyline -n 2745 5040 m - 2565 5040 l gs col4 s gr -% Polyline -n 2655 5040 m - 2655 5085 l gs col4 s gr -% Polyline -n 12555 8955 m - 12555 9135 l gs col4 s gr -% Polyline -n 12555 9045 m - 12600 9045 l gs col4 s gr -% Polyline -n 4725 6840 m - 4545 6840 l gs col4 s gr -% Polyline -n 4635 6840 m - 4635 6885 l gs col4 s gr -% Polyline -n 5085 6840 m - 4905 6840 l gs col4 s gr -% Polyline -n 4995 6840 m - 4995 6885 l gs col4 s gr -% Polyline -n 12825 5040 m - 12645 5040 l gs col4 s gr -% Polyline -n 12735 5040 m - 12735 5085 l gs col4 s gr -% Polyline -n 13185 5040 m - 13005 5040 l gs col4 s gr -% Polyline -n 13095 5040 m - 13095 5085 l gs col4 s gr -% Polyline -n 12825 7110 m - 12645 7110 l gs col4 s gr -% Polyline -n 12735 7110 m - 12735 7155 l gs col4 s gr -% Polyline -n 13185 7110 m - 13005 7110 l gs col4 s gr -% Polyline -n 13095 7110 m - 13095 7155 l gs col4 s gr -% Polyline -n 12825 8550 m - 12645 8550 l gs col4 s gr -% Polyline -n 12735 8550 m - 12735 8595 l gs col4 s gr -% Polyline -n 13185 8550 m - 13005 8550 l gs col4 s gr -% Polyline -n 13095 8550 m - 13095 8595 l gs col4 s gr -% Polyline -7.500 slw -n 4500 6885 m 5850 6885 l 5850 7785 l 4500 7785 l - cp gs col33 1.00 shd ef gr gs col0 s gr -/Times-Roman ff 330.00 scf sf -1800 4905 m -gs 1 -1 sc (Receiver) col0 sh gr -/Times-Roman ff 330.00 scf sf -4500 6705 m -gs 1 -1 sc (Scheduler) col0 sh gr -/Times-Roman ff 330.00 scf sf -8100 4905 m -gs 1 -1 sc (Analyzer) col0 sh gr -/Times-Roman ff 330.00 scf sf -12599 4905 m -gs 1 -1 sc (Logger) col0 sh gr -/Times-Roman ff 330.00 scf sf -1665 7920 m -gs 1 -1 sc (Frontend) col0 sh gr -/Times-Roman ff 330.00 scf sf -1215 10530 m -gs 1 -1 sc (Comanche) col0 sh gr -/Times-Roman ff 330.00 scf sf -9765 9630 m -gs 1 -1 sc (Handler) col0 sh gr -/Times-Roman ff 330.00 scf sf -7830 10080 m -gs 1 -1 sc (Backend) col0 sh gr -/Times-Roman ff 165.00 scf sf -945 4095 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -1305 4095 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -1665 4095 m -gs 1 -1 sc (CC) col0 sh gr -/Times-Roman ff 165.00 scf sf -2025 4095 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 165.00 scf sf -1395 4545 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -1755 4545 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -2115 4545 m -gs 1 -1 sc (CC) col0 sh gr -/Times-Roman ff 165.00 scf sf -2475 4545 m -gs 1 -1 sc (LC) col0 sh gr -% Polyline -n 8100 5085 m 9449 5085 l 9449 5985 l 8100 5985 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 3240 5805 m - 4410 7335 l gs col0 s gr -% Polyline -n 3240 5535 m - 5985 5535 l gs col0 s gr -% Polyline -n 8729 6075 m 8729 8415 l - 9360 8415 l gs col0 s gr -% Polyline -n 10169 7965 m 11519 7965 l 11519 8865 l 10169 8865 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 6390 5535 m - 7425 5535 l gs col0 s gr -% Polyline -n 7830 5535 m - 8010 5535 l gs col0 s gr -% Polyline -n 1665 5535 m - 1710 5535 l gs col0 s gr -% Polyline -n 1215 5535 m - 1260 5535 l gs col0 s gr -% Polyline -n 1800 5085 m 3150 5085 l 3150 5985 l 1800 5985 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 12599 5085 m 13949 5085 l 13949 5985 l 12599 5985 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 12599 7155 m 13949 7155 l 13949 8055 l 12599 8055 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 12599 8595 m 13949 8595 l 13949 9495 l 12599 9495 l - cp gs col33 1.00 shd ef gr gs col0 s gr -/Times-Roman ff 165.00 scf sf -8145 5265 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -8505 5265 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -8865 5265 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 165.00 scf sf -10215 8145 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -10575 8145 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -10935 8145 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 165.00 scf sf -1845 5265 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -2205 5265 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -2565 5265 m -gs 1 -1 sc (LC) col0 sh gr -% Polyline -n 9539 5535 m - 12509 5535 l gs col0 s gr -% Polyline -n 11610 8280 m - 12510 7605 l gs col0 s gr -% Polyline -n 11610 8550 m - 12510 9045 l gs col0 s gr -% Polyline -n 9764 8415 m - 10080 8415 l gs col0 s gr -/Times-Roman ff 165.00 scf sf -7560 4545 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -7920 4545 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -8280 4545 m -gs 1 -1 sc (CC) col0 sh gr -/Times-Roman ff 165.00 scf sf -8640 4545 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 165.00 scf sf -9495 6705 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -9855 6705 m -gs 1 -1 sc (BC) col0 sh gr -/Times-Roman ff 165.00 scf sf -10215 6705 m -gs 1 -1 sc (CC) col0 sh gr -/Times-Roman ff 165.00 scf sf -10575 6705 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 330.00 scf sf -10170 7785 m -gs 1 -1 sc (Dispatcher) col0 sh gr -/Times-Roman ff 330.00 scf sf -12780 7740 m -gs 1 -1 sc (File) col0 sh gr -/Times-Roman ff 330.00 scf sf -12780 9225 m -gs 1 -1 sc (Error) col0 sh gr -/Times-Roman ff 165.00 scf sf -4545 7065 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -4905 7065 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 165.00 scf sf -12645 5265 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -13005 5265 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 165.00 scf sf -12645 7335 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -13005 7335 m -gs 1 -1 sc (LC) col0 sh gr -/Times-Roman ff 165.00 scf sf -12645 8775 m -gs 1 -1 sc (C) col0 sh gr -/Times-Roman ff 165.00 scf sf -13005 8775 m -gs 1 -1 sc (LC) col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/tutorial/archi2.fig b/web/latex/tutorial/archi2.fig deleted file mode 100644 index b307f6db00e386441311ff61d810f90f24e6a850..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/archi2.fig +++ /dev/null @@ -1,449 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -A4 -50.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 3150 5445 3195 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3195 5445 3195 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3195 5535 3150 5535 --6 -6 1710 5400 1845 5670 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 5445 1755 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 5535 1800 5535 --6 -6 1575 5445 1620 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 5445 1620 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1620 5535 1575 5535 --6 -6 1260 5400 1395 5670 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 5445 1305 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 5535 1350 5535 --6 -6 1125 5445 1170 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 5445 1170 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1170 5535 1125 5535 --6 -6 810 5400 945 5670 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 855 5445 855 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 855 5535 900 5535 --6 -6 5985 5400 6120 5670 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 6030 5445 6030 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6030 5535 6075 5535 --6 -6 6300 5445 6345 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6345 5445 6345 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6345 5535 6300 5535 --6 -6 4410 7200 4545 7470 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 7245 4455 7425 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4455 7335 4500 7335 --6 -6 7425 5400 7560 5670 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7470 5445 7470 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7470 5535 7515 5535 --6 -6 7740 5445 7785 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7785 5445 7785 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7785 5535 7740 5535 --6 -6 8010 5400 8145 5670 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8055 5445 8055 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8055 5535 8100 5535 --6 -6 9450 5445 9495 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9495 5445 9495 5625 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9495 5535 9450 5535 --6 -6 12510 5400 12645 5670 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 12555 5445 12555 5625 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 12555 5535 12600 5535 --6 -6 12510 7470 12645 7740 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 12555 7515 12555 7695 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 12555 7605 12600 7605 --6 -6 11520 8190 11565 8370 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 11565 8190 11565 8370 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 11565 8280 11520 8280 --6 -6 11520 8460 11565 8640 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 11565 8460 11565 8640 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 11565 8550 11520 8550 --6 -6 10080 8280 10215 8550 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 10125 8325 10125 8505 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 10125 8415 10170 8415 --6 -6 9360 8280 9495 8550 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 9405 8325 9405 8505 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9405 8415 9450 8415 --6 -6 9675 8325 9720 8505 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9720 8325 9720 8505 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9720 8415 9675 8415 --6 -6 3150 5715 3195 5895 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3195 5715 3195 5895 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3195 5805 3150 5805 --6 -6 8640 5985 8820 6030 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8820 6030 8640 6030 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8730 6030 8730 5985 --6 -6 900 3825 1170 3960 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1125 3870 945 3870 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1035 3870 1035 3915 --6 -6 1260 3825 1530 3960 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1485 3870 1305 3870 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1395 3870 1395 3915 --6 -6 1620 3825 1890 3960 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1845 3870 1665 3870 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1755 3870 1755 3915 --6 -6 1980 3825 2250 3960 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2205 3870 2025 3870 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2115 3870 2115 3915 --6 -6 1350 4275 1620 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 4320 1395 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1485 4320 1485 4365 --6 -6 1710 4275 1980 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 4320 1755 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1845 4320 1845 4365 --6 -6 2070 4275 2340 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 4320 2115 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2205 4320 2205 4365 --6 -6 2430 4275 2700 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 4320 2475 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2565 4320 2565 4365 --6 -6 7515 4275 7785 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 7740 4320 7560 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 7650 4320 7650 4365 --6 -6 7875 4275 8145 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8100 4320 7920 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8010 4320 8010 4365 --6 -6 8235 4275 8505 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8460 4320 8280 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8370 4320 8370 4365 --6 -6 8595 4275 8865 4410 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8820 4320 8640 4320 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8730 4320 8730 4365 --6 -6 9450 6435 9720 6570 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 9675 6480 9495 6480 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9585 6480 9585 6525 --6 -6 9810 6435 10080 6570 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 10035 6480 9855 6480 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 9945 6480 9945 6525 --6 -6 10170 6435 10440 6570 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 10395 6480 10215 6480 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 10305 6480 10305 6525 --6 -6 10530 6435 10800 6570 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 10755 6480 10575 6480 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 10665 6480 10665 6525 --6 -6 8100 4995 9090 5265 -6 8100 4995 8370 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8325 5040 8145 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8235 5040 8235 5085 --6 -6 8460 4995 8730 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 8685 5040 8505 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8595 5040 8595 5085 --6 -6 8820 4995 9090 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 9045 5040 8865 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 8955 5040 8955 5085 --6 -4 0 0 48 -1 0 11 0.0000 4 105 105 8145 5265 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 8505 5265 BC\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 8865 5265 LC\001 --6 -6 10170 7875 11160 8145 -6 10170 7875 10440 8010 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 10395 7920 10215 7920 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 10305 7920 10305 7965 --6 -6 10530 7875 10800 8010 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 10755 7920 10575 7920 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 10665 7920 10665 7965 --6 -6 10890 7875 11160 8010 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 11115 7920 10935 7920 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 11025 7920 11025 7965 --6 -4 0 0 48 -1 0 11 0.0000 4 105 105 10215 8145 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 10575 8145 BC\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 10935 8145 LC\001 --6 -6 1800 4995 2790 5265 -6 1800 4995 2070 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2025 5040 1845 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1935 5040 1935 5085 --6 -6 2160 4995 2430 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2385 5040 2205 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2295 5040 2295 5085 --6 -6 2520 4995 2790 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 2745 5040 2565 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2655 5040 2655 5085 --6 -4 0 0 48 -1 0 11 0.0000 4 105 105 1845 5265 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 2205 5265 BC\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 2565 5265 LC\001 --6 -6 12510 8910 12645 9180 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 12555 8955 12555 9135 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 12555 9045 12600 9045 --6 -6 4500 6795 4770 6930 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 4725 6840 4545 6840 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4635 6840 4635 6885 --6 -6 4860 6795 5130 6930 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 5085 6840 4905 6840 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4995 6840 4995 6885 --6 -6 12600 4995 12870 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 12825 5040 12645 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 12735 5040 12735 5085 --6 -6 12960 4995 13230 5130 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 13185 5040 13005 5040 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 13095 5040 13095 5085 --6 -6 12600 7065 12870 7200 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 12825 7110 12645 7110 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 12735 7110 12735 7155 --6 -6 12960 7065 13230 7200 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 13185 7110 13005 7110 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 13095 7110 13095 7155 --6 -6 12600 8505 12870 8640 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 12825 8550 12645 8550 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 12735 8550 12735 8595 --6 -6 12960 8505 13230 8640 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 13185 8550 13005 8550 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 13095 8550 13095 8595 --6 -2 2 0 1 0 33 50 -1 20 0.000 0 0 -1 0 0 5 - 4500 6885 5850 6885 5850 7785 4500 7785 4500 6885 -2 2 0 1 0 33 49 -1 20 0.000 0 0 -1 0 0 5 - 8100 5085 9449 5085 9449 5985 8100 5985 8100 5085 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 2 - 3240 5805 4410 7335 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 2 - 3240 5535 5985 5535 -2 1 0 1 0 7 48 -1 -1 0.000 0 0 -1 0 0 2 - 9539 5535 12509 5535 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 3 - 8729 6075 8729 8415 9360 8415 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 9450 6525 14400 6525 14400 9945 9450 9945 9450 6525 -2 2 0 1 0 7 58 0 20 0.000 0 0 -1 0 0 5 - 1125 4140 15075 4140 15075 10620 1125 10620 1125 4140 -2 2 0 1 0 33 49 -1 20 0.000 0 0 -1 0 0 5 - 10169 7965 11519 7965 11519 8865 10169 8865 10169 7965 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 2 - 6390 5535 7425 5535 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 2 - 7830 5535 8010 5535 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 2 - 1665 5535 1710 5535 -2 1 0 1 0 7 49 -1 -1 0.000 0 0 -1 0 0 2 - 1215 5535 1260 5535 -2 1 0 1 0 7 48 -1 -1 0.000 0 0 -1 0 0 2 - 11610 8280 12510 7605 -2 1 0 1 0 7 48 -1 -1 0.000 0 0 -1 0 0 2 - 11610 8550 12510 9045 -2 1 0 1 0 7 48 -1 -1 0.000 0 0 -1 0 0 2 - 9764 8415 10080 8415 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 9675 6750 14175 6750 14175 9720 9675 9720 9675 6750 -2 2 0 1 0 7 56 0 20 0.000 0 0 -1 0 0 5 - 1575 4590 6075 4590 6075 8010 1575 8010 1575 4590 -2 2 0 1 0 33 57 0 20 0.000 0 0 -1 0 0 5 - 1350 4365 6300 4365 6300 8235 1350 8235 1350 4365 -2 2 0 1 0 33 59 0 20 0.000 0 0 -1 0 0 5 - 900 3915 15300 3915 15300 10845 900 10845 900 3915 -2 2 0 1 0 33 49 -1 20 0.000 0 0 -1 0 0 5 - 1800 5085 3150 5085 3150 5985 1800 5985 1800 5085 -2 2 0 1 0 33 49 -1 20 0.000 0 0 -1 0 0 5 - 12599 5085 13949 5085 13949 5985 12599 5985 12599 5085 -2 2 0 1 0 33 49 -1 20 0.000 0 0 -1 0 0 5 - 12599 7155 13949 7155 13949 8055 12599 8055 12599 7155 -2 2 0 1 0 33 49 -1 20 0.000 0 0 -1 0 0 5 - 12599 8595 13949 8595 13949 9495 12599 9495 12599 8595 -2 2 0 1 0 7 56 0 20 0.000 0 0 -1 0 0 5 - 7740 4590 14625 4590 14625 10170 7740 10170 7740 4590 -2 2 0 1 0 33 57 0 20 0.000 0 0 -1 0 0 5 - 7515 4365 14850 4365 14850 10395 7515 10395 7515 4365 -4 0 0 50 -1 0 22 0.0000 4 225 1185 1800 4905 Receiver\001 -4 0 0 50 -1 0 22 0.0000 4 225 1320 4500 6705 Scheduler\001 -4 0 0 50 -1 0 22 0.0000 4 300 1215 8100 4905 Analyzer\001 -4 0 0 50 -1 0 22 0.0000 4 300 945 12599 4905 Logger\001 -4 0 0 50 -1 0 22 0.0000 4 225 1185 1665 7920 Frontend\001 -4 0 0 50 -1 0 22 0.0000 4 225 1425 1215 10530 Comanche\001 -4 0 0 50 -1 0 22 0.0000 4 225 1065 9765 9630 Handler\001 -4 0 0 50 -1 0 22 0.0000 4 225 1170 7830 10080 Backend\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 945 4095 C\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 1305 4095 BC\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 1665 4095 CC\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 2025 4095 LC\001 -4 0 0 50 -1 0 11 0.0000 4 105 105 1395 4545 C\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 1755 4545 BC\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 2115 4545 CC\001 -4 0 0 50 -1 0 11 0.0000 4 105 210 2475 4545 LC\001 -4 0 0 48 -1 0 11 0.0000 4 105 105 7560 4545 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 7920 4545 BC\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 8280 4545 CC\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 8640 4545 LC\001 -4 0 0 48 -1 0 11 0.0000 4 105 105 9495 6705 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 9855 6705 BC\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 10215 6705 CC\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 10575 6705 LC\001 -4 0 0 48 -1 0 22 0.0000 4 300 1440 10170 7785 Dispatcher\001 -4 0 0 48 -1 0 22 0.0000 4 225 510 12780 7740 File\001 -4 0 0 48 -1 0 22 0.0000 4 225 675 12780 9225 Error\001 -4 0 0 48 -1 0 11 0.0000 4 105 105 4545 7065 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 4905 7065 LC\001 -4 0 0 48 -1 0 11 0.0000 4 105 105 12645 5265 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 13005 5265 LC\001 -4 0 0 48 -1 0 11 0.0000 4 105 105 12645 7335 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 13005 7335 LC\001 -4 0 0 48 -1 0 11 0.0000 4 105 105 12645 8775 C\001 -4 0 0 48 -1 0 11 0.0000 4 105 210 13005 8775 LC\001 diff --git a/web/latex/tutorial/fractal-programming.lyx b/web/latex/tutorial/fractal-programming.lyx deleted file mode 100644 index 4fb32100a9f5a3ea66d3dc3fc26273f71fe9b10f..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/fractal-programming.lyx +++ /dev/null @@ -1,7766 +0,0 @@ -#LyX 1.3 created this file. For more info see http://www.lyx.org/ -\lyxformat 221 -\textclass scrartcl -\begin_preamble -\usepackage{fancyhdr} - -%\renewcommand{\cleardoublepage}{} - -% commands for tth - -\newif\iftth -\newcommand{\tthvfill}{\iftth\begin{html}


\end{html}\fi} -\newcommand{\tthhrule}{\iftth\hrule\fi} -\newcommand{\tthdump}[1]{#1} -%%tth:\renewcommand{\textbackslash}[1]{$\backslash$} - -\iftth\begin{html}\end{html}\fi -\iftth\begin{html}[PDF version]\end{html}\fi -\iftth\begin{html}[PS version]\end{html}\fi - -% normal page headers - -\lhead{Developing with Fractal} -\rhead{Tutorial} -\lfoot{The ObjectWeb Consortium} -\rfoot{Version 1.0} -\renewcommand{\headrulewidth}{0.7mm} -\renewcommand{\footrulewidth}{0.7mm} - -% cover page headers - -\fancypagestyle{cover}{ - \fancyhf{} - \cfoot{\hspace{1cm}} - \renewcommand{\headrulewidth}{0.7mm} - \renewcommand{\footrulewidth}{0.7mm} -} - -% environment for code samples - -\tthdump{ -\newenvironment{code} -{\small\vspace{1em}\setlength{\parindent}{2.5mm}\setlength{\parskip}{0mm}} -{\vspace{1em}} -} -\iftth -\newenvironment{code} -{\begin{html}
\end{html}} -{\begin{html}
\end{html}} -\fi - -% environment for summaries - -\tthdump{ -\newsavebox{\hest} -\newenvironment{summary} -{\begin{center}\tthdump{\begin{lrbox}{\hest}}\begin{minipage}{0.90\columnwidth}} -{\end{minipage}\tthdump{\end{lrbox}\fbox{\usebox{\hest}}}\end{center}} -} -\iftth -\newenvironment{summary} -{\begin{html}
\end{html}} -{\begin{html}
\end{html}} -\fi -\end_preamble -\language american -\inputencoding latin1 -\fontscheme default -\graphics default -\paperfontsize 11 -\spacing single -\papersize a4paper -\paperpackage widemarginsa4 -\use_geometry 0 -\use_amsmath 0 -\use_natbib 0 -\use_numerical_citations 0 -\paperorientation portrait -\secnumdepth 3 -\tocdepth 3 -\paragraph_separation skip -\defskip medskip -\quotes_language english -\quotes_times 2 -\papercolumns 1 -\papersides 2 -\paperpagestyle fancy - -\layout Standard -\noindent - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -thispagestyle{cover} -\backslash -tthdump{ -\backslash -emph{ -\backslash -LARGE The ObjectWeb Consortium} -\backslash -hfill -\backslash -includegraphics{objectweb.ps} -\newline - -\backslash -vspace{2mm} -\backslash -hrule -\backslash -vspace{1mm} -\newline -{ -\backslash -LARGE Tutorial} -\newline - -\backslash -vfill} -\backslash -tthvfill -\end_inset - - -\layout Standard -\align center - -\series bold -\size largest -Developing with Fractal -\layout Standard -\align center - -\begin_inset Graphics - filename fractal.ps - display none - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vfill -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthvfill -\end_inset - - -\layout Standard -\align right - -\begin_inset Tabular - - - - - - - - -\begin_inset Text - -\layout Standard - - -\series bold -\shape smallcaps -Author -\series default -: -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -E. - Bruneton -\end_inset - - -\begin_inset Text - -\layout Standard - -\end_inset - - -\begin_inset Text - -\layout Standard - -(France Telecom R&D) -\end_inset - - - - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vfill -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -hrule -\end_inset - - -\layout Standard -\align right - -\begin_inset Tabular - - - - - - -\begin_inset Text - -\layout Standard - -Released -\end_inset - - -\begin_inset Text - -\layout Standard - -March 10, 2004 -\end_inset - - - - -\begin_inset Text - -\layout Standard - -Status -\end_inset - - -\begin_inset Text - -\layout Standard - -Final -\end_inset - - - - -\begin_inset Text - -\layout Standard - -Version -\end_inset - - -\begin_inset Text - -\layout Standard - -1.0.3 -\end_inset - - - - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -pagenumbering{roman} -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthhrule -\end_inset - - -\layout Standard - - -\series bold -\shape smallcaps -General Information -\layout Itemize - -Background of front-page image appears courtesy of Giuseppe Zito. - -\layout Itemize - -Please send technical comments on this document to fractal@objectweb.org - -\layout Standard -\align left -Copyright 2003 France Télécom S.A. -\newline -28, chemin du vieux chêne, 38243, Meylan Cedex, France. -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -vspace{2mm} -\end_inset - - -\newline -All rights reserved. -\layout Standard - - -\series bold -\shape smallcaps -Trademarks -\layout Standard - -All product names mentioned herein are trademarks of their respective owners. -\layout Standard - - -\series bold -\shape smallcaps -Disclaimer of warranties -\layout Standard - - -\emph on -This document is provided -\begin_inset Quotes eld -\end_inset - -as is -\begin_inset Quotes erd -\end_inset - -. - France Télécom makes no representations or warranties, either express or - implied, including but not limited to, warranties of merchantability, fitness - for a particular purpose, or non-infringement that the contents of this - document are suitable for any purpose or that any practice or implementation - of such contents will not infringe any third party patents, copyrights, - trade secrets or other rights. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthhrule -\end_inset - - -\layout Standard - - -\begin_inset LatexCommand \tableofcontents{} - -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\layout Standard -\align center -\SpecialChar ~ - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -newpage -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -tthhrule -\end_inset - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -pagenumbering{arabic} -\end_inset - - -\layout Section - -Introduction -\begin_inset LatexCommand \label{sec:Introduction} - -\end_inset - - -\layout Subsection - -What is Fractal? -\layout Standard - -Fractal is a modular and extensible component model that can be used with - various programming languages to design, implement, deploy and reconfigure - various systems and applications, from operating systems to middleware - platforms and to graphical user interfaces. - Fractal is also a project with several sub projects, dealing with the definitio -n of the model, its implementations, and the implementation of reusable - components and tools on top of it. -\layout Standard - -The Fractal component model heavily uses the -\series bold -\emph on -separation of concerns -\series default -\emph default - design principle. - The idea of this principle is to separate into distinct pieces of code - or runtime entities the various -\emph on -concerns -\emph default - or -\emph on -aspects -\emph default - of an application: implementing the service provided by the application, - but also making the application configurable, secure, available, ... - In particular, the Fractal component model uses three specific cases of - the separation of concerns principle: namely -\emph on -separation of interface and implementation -\emph default -, -\emph on -component oriented programming -\emph default -, and -\emph on -inversion of control -\emph default -. - The first pattern, also called the bridge pattern, corresponds to the separatio -n of the design and implementation concerns. - The second pattern corresponds to the separation of the implementation - concern into several composable, smaller concerns, implemented in well - separated entities called components. - The last pattern corresponds to the separation of the functional and configurat -ion concerns: instead of finding and configuring themselves the components - and resources they need, Fractal components are configured and deployed - by an external, separated entity. -\layout Standard - -The separation of concerns principle is also applied to the structure of - the Fractal components. - A Fractal component is indeed composed of two parts: a -\emph on -content -\emph default - that manages the functional concerns, and a -\emph on -controller -\emph default - that manages zero or more non functional concerns (introspection, configuration -, security, transactions, ....). - The content is made of other Fractal components, i.e. - Fractal components can be -\emph on -nested -\emph default - at arbitrary levels (Fractal components can also be -\emph on -shared -\emph default -, i.e. - be nested in several components at the same time). - The introspection and configuration interfaces that can be provided by - the controllers allow components to be deployed and reconfigured dynamically. - These control interfaces can be used either programmatically, or through - tools based on them, such as deployment or supervision tools. -\layout Standard - -More information about Fractal, including the complete specification of - the component model, and several tutorials, can be found at -\family typewriter -http://fractal.objectweb.org -\family default -. -\layout Subsection - -Content of this document -\layout Standard - -This tutorial is an introduction to the Fractal component model. - It explains informally how to design (section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Design} - -\end_inset - -), implement (section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Implementation} - -\end_inset - -), deploy (section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Configuration} - -\end_inset - -), and dynamically reconfigure (section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Reconfiguration} - -\end_inset - -) component based applications with Fractal (and with some associated tools), - in Java, by using a concrete example, namely an extremely minimal web server. - -\layout Subsection - -Target audience -\layout Standard - -This document is intended for those that do not know Fractal, and want to - get an overview of this component model, of its motivations and benefits. - If you are in this case, you should read this document first, before reading - any other document about Fractal and, in particular, before reading the - Fractal component model specification. -\layout Subsection* - -Summary -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{summary} -\end_inset - -The main characteristics of the Fractal model are recursion, reflexion and - sharing. - The Fractal project is made of four sub projects: model, implementations, - components and tools. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{summary} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Design -\begin_inset LatexCommand \label{sec:Design} - -\end_inset - - -\layout Standard - -Before programming a component based software system with Fractal, one must - first -\emph on -design -\emph default - it with components and, in particular, identify the components to be implemente -d. - Note that this -\emph on -component oriented design -\emph default - task is quite independent from the subsequent -\emph on -component oriented programming -\emph default - task: at programming time, it is possible to merge several or even all - the design time components into a single, monolithic piece of code, if - desired (but then, of course, one looses the advantages of component oriented - -\emph on -programming -\emph default -: modularity, adaptability, ...). -\layout Standard - -This section explains how to design component based applications, by using - a concrete example. - The next sections reuse this example to illustrate how to implement and - deploy Fractal component based applications. - This example application is Comanche, an extremely minimal HTTP server. - A classical, non component oriented implementation of this application, - in Java, is shown below: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - Server -\series bold -implements -\series default - Runnable { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Socket s; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Server (Socket s) { -\series bold -this -\series default -.s = s; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -static -\series default - -\series bold -void -\series default - main (String[] args) -\series bold -throws -\series default - IOException { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ServerSocket s = -\series bold -new -\series default - ServerSocket(8080); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -while -\series default - ( -\series bold -true -\series default -) { -\series bold -new -\series default - Thread( -\series bold -new -\series default - Server(s.accept())).start(); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - run () { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -try -\series default - { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InputStreamReader in = -\series bold -new -\series default - InputStreamReader(s.getInputStream()); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -PrintStream out = -\series bold -new -\series default - PrintStream(s.getOutputStream()); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -String rq = -\series bold -new -\series default - LineNumberReader(in).readLine(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -System.out.println(rq); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (rq.startsWith("GET ")) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -File f = -\series bold -new -\series default - File(rq.substring(5, rq.indexOf(' ', 4))); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (f.exists() && !f.isDirectory()) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InputStream is = -\series bold -new -\series default - FileInputStream(f); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -byte[] data = -\series bold -new -\series default - byte[is.available()]; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -is.read(data); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -is.close(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -out.print("HTTP/1.0 200 OK -\backslash -n -\backslash -n"); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -out.write(data); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\series bold -else -\series default - { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -out.print("HTTP/1.0 404 Not Found -\backslash -n -\backslash -n"); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -out.print("Document not found."); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -out.close(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -s.close(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\series bold -catch -\series default - (IOException _) { } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -As can be seen from the source code, this server accepts connections on - a server socket and, for each connection, starts a new thread to handle - it (in the -\family sans -main -\family default - method). - Each connection is handled in two steps, in the -\family sans -run -\family default - method: the request is analyzed and logged to the standard output, and - then the requested file is sent back to the client (or an error is returned - if the file is not found). -\layout Subsection - -Finding the components -\begin_inset LatexCommand \label{sub:Finding-the-components} - -\end_inset - - -\layout Standard - -In a component based application, some components are -\emph on -dynamic -\emph default -, i.e they can be created and destroyed dynamically, possibly quite frequently, - while other components are -\emph on -static -\emph default -, i.e. - their life time is equal to the life time of the application itself. - The dynamic components generally correspond to -\emph on -datas -\emph default -, while the static ones generally correspond to -\emph on -services -\emph default -. -\layout Standard - -In order to identify components in an application, it is easier to begin - by identifying its static components. - In other words, one should begin by identifying the services that are used - in the application. - In the case of Comanche, we can immediately identify two main services, - namely a request receiver service and a request processor service (correspondin -g to the content of the two methods of the -\family sans -Server -\family default - class). - But it is also possible to identify other, lower level services. - For example, we can see that the request receiver service uses a thread - factory service, to create a new thread for each request. - This thread factory service can be generalized into a scheduler service - that can be implemented in several ways: sequential, multi thread, multi - thread with a thread pool, and so on. - Likewise, we can see that the request processor uses a request analyzer - service, and a logger service, before effectively responding to a request. - This response is itself constructed by using a file server service, or - an error manager service. - This can be generalized into a request dispatcher service that dispatches - requests to several request handlers sequentially, until one handler can - handle the request (we can then imagine file handlers, servlet handlers, - and so on). -\layout Standard - -After the services have been specified, one can look for the main data structure -s, in order to identify the dynamic components. - But the identification of the dynamic components is not mandatory, and - is generally not done, because dynamic components themselves are rarely - used (this means that, at programming time, data structures are generally - not implemented as components, but as ordinary objects - if the programming - language is object oriented). - Indeed components do not have many benefits in the case of highly dynamic, - short lived structures (introspection and dynamic reconfiguration, for - instance, are not very useful in this case). - In the case of Comanche we can consider sockets, HTTP requests, files, - streams, and even threads as such data structures. - But we will not map them to dynamic components. -\layout Standard - -After the services have been specified, one must assign them to components. - Each component can provide one or more services but, unless two services - are very strongly coupled, it is better to use one component per service. - In the case of Comanche, we will use one component per service. - We therefore have the seven following components: request receiver, request - analyzer, request dispatcher, file request handler, error request handler, - scheduler and logger. -\layout Subsection - -Defining the component architecture -\begin_inset LatexCommand \label{sub:Architecture} - -\end_inset - - -\layout Standard - -After the components have been identified, it is easy to find the dependencies - between them, and to organize them into composite components. - Indeed the service dependencies are generally identified at the same time - as the services themselves. - If it is not the case, dependencies can also be found by looking at some - use cases or scenarios. - Likewise, services are generally identified from high level to lower level - services (or vice versa). - It is then easy to find the dependencies and the abstraction level of each - component, since the components correspond to the previous services. -\layout Standard - -This is particularly clear in the case of Comanche: indeed, by re reading - the previous section, one can see that the service dependencies have already - been identified. - For example, the request receiver service uses the scheduler service and - the request analyzer, the request analyzer uses the request dispatcher, - which itself uses the file and error request handlers. - One can also see that the abstraction levels have already been found: the - request receiver is -\begin_inset Quotes eld -\end_inset - -made of -\begin_inset Quotes erd -\end_inset - - the request receiver itself, plus the scheduler; the request processor - is made of the request analyzer, the logger, and the request handler; the - request handler is itself made of the request dispatcher, and of the file - and error request handlers. - All this can be summarized in the following component architecture: -\layout Standard -\align center - -\begin_inset Graphics - filename archi.eps - display none - scale 90 - -\end_inset - - -\layout Subsection - -Defining the component contracts -\begin_inset LatexCommand \label{sub:Contracts} - -\end_inset - - -\layout Standard - -After the services have been found and organized into components, and after - the component hierarchy and the component dependencies have been found, - only one thing remains to be done to finish the design phase, namely to - define precisely the contracts between the components, at the syntaxic - and semantic level (if possible with a formal language - such as pre and - post conditions, temporal logic formulas, and so on). - Classical object oriented design tools, such as scenarios and use cases, - can be used here. -\layout Standard - -The component contracts must be designed with care, so as to be the most - stable as possible (changing a contract requires to change several components, - and is therefore more difficult than changing a component). - In particular, these contracts must deal only with the services provided - by the components: nothing related to the implementation or configuration - of the components themselves should appear in these contracts. - For example, a -\family sans -setLogger -\family default - operation has nothing to do in a component contract definition: this operation - is only needed to set a reference between a component and a logger component. - In other words, contracts must be defined with -\series bold -\emph on -separation of concerns -\series default -\emph default - in mind (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Introduction} - -\end_inset - -): contracts must deal only with functional concerns; configuration concerns - will be dealt with separately, as well as other concerns such as security, - life cycle, transactions... -\layout Standard - -In the case of Comanche, we will use minimalistic contracts, defined directly - in Java: -\layout Itemize - -The logger service will provide a single -\family sans -log -\family default - method, with a single -\family sans -String -\family default - parameter; -\layout Itemize - -The scheduler component will provide a single -\family sans -schedule -\family default - method, with a single -\family sans -Runnable -\family default - parameter (the role of this method is to execute the given -\family sans -Runnable -\family default - at some time after the method has been called, possibly in a different - thread than the caller thread); -\layout Itemize - -The request analyzer, the request dispatcher and the file and error request - handlers will all provide a single -\family sans -handleRequest -\family default - method, with a single -\family sans -Request -\family default - parameter that will contain information about a request: its socket, the - input and output streams of this socket, and the requested URL. - This single -\family sans -handleRequest -\family default - method will be implemented in several ways, in the different components: - -\begin_deeper -\layout Itemize - -the request analyzer will construct the input and output streams, and will - read the input stream to get the requested URL; -\layout Itemize - -the request dispatcher will forward each request to its associated request - handlers, sequentially, until one request handler successfully handles - the request; -\layout Itemize - -the file request handler will try to find and to send back to the client - the file whose name corresponds to the requested URL, if it exists; -\layout Itemize - -the error request handler will send back to the client an error message, - and will always succeed. -\end_deeper -\layout Subsection* - -Summary -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{summary} -\end_inset - -The first step to design a component based application is to define its - components. - This is done by finding the -\emph on -services -\emph default - used in this application. - The second step is to find the dependencies and hierarchical levels of - these components. - The last step is to define precisely the contracts between the components. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{summary} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Implementation -\begin_inset LatexCommand \label{sec:Implementation} - -\end_inset - - -\layout Standard - -This section explains how to program Fractal component based applications, - by using the Comanche example. - It also introduces and motivates the concepts and APIs of Fractal that - are used. -\layout Subsection - -Choosing the components' granularity -\layout Standard - -As explained in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Design} - -\end_inset - -, component oriented design is quite independent from component oriented - implementation. - In particular, at programming time, it is possible to merge several or - even all the design time components into a single, monolithic piece of - code, if desired. - For example, in the case of Comanche, one may choose to implement all the - design time components into a single class, as shown in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Design} - -\end_inset - -. - One may also choose to implement each component in its own class, or to - implement some components in their own class, and to merge some other component -s (such as the request dispatcher and its associated request handlers) into - a single class. - -\layout Standard - -Using one runtime component per design time component gives maximum flexibility - and extensibility, but can be less efficient that merging several design - time components into a single runtime component. - When in doubt, -\emph on -the first solution should be preferred -\emph default -: optimizations can be done later on, if needed. - In the case of Comanche, we will therefore use one runtime component per - design time component. -\layout Subsection - -Implementing the component interfaces -\layout Standard - -Before implementing the component themselves, the first step is to implement - their -\emph on -interfaces -\emph default -. - Indeed the Fractal component model requires a strict -\series bold -\emph on -separation between interfaces and implementation -\series default -\emph default - for all components (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Introduction} - -\end_inset - -). - This design pattern is indeed useful to easily replace one component implementa -tion with another, without worrying about class inheritance problems. - It also offers the possibility to add interposition objects between a client - and a component implementation, in order to transparently manage some non - functional concerns of the component (as in the Enterprise Java Beans model - - see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Reconfiguration} - -\end_inset - -). - The only drawback of this design pattern is that it is a little less efficient - than a solution without interfaces. - This is why it may sometimes be needed to merge several design time components - into a single Fractal component. -\layout Standard - -The component interfaces can be implemented easily, since most, if not all, - of the work has been done during the definition of the component contracts - (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Contracts} - -\end_inset - -). - In the case of Comanche, three interfaces must be implemented. - They are given below (see Appendix\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Comanche-source-code} - -\end_inset - - for the full source code of Comanche): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - Logger { -\series bold - void -\series default - log (String msg); } -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - Scheduler { -\series bold - void -\series default - schedule (Runnable task); } -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - RequestHandler { -\series bold - void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException; } -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -Note that requests are represented as instances of the -\family sans -Request -\family default - -\emph on -class -\emph default -. - This choice was made here only to show that classes can be used in interface - method parameters, -\emph on -although this is not recommended -\emph default -. - It is indeed better to use interfaces, even for data structures that are - not represented as components: these data structures can then be implemented - in various ways (including as components), without needing to change the - interfaces that refer to them. - Note also that it would have been better to introduce a request factory - component (this was not done for simplification purposes). -\layout Subsection - -Implementing the components -\begin_inset LatexCommand \label{sub:Implementing-the-components} - -\end_inset - - -\layout Standard - -Now that the component interfaces have been implemented, we can implement - the components themselves. - The components that do not have any dependencies to other components can - be programmed like ordinary Java classes. - For example, the logger and scheduler components can be implemented as - follows: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - BasicLogger -\series bold -implements -\series default - Logger { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public void -\series default - log (String msg) { System.out.println(msg); } -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - SequentialScheduler -\series bold -implements -\series default - Scheduler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -synchronized -\series default - -\series bold -void -\series default - schedule (Runnable task) { task.run(); } -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - MultiThreadScheduler -\series bold -implements -\series default - Scheduler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - schedule (Runnable task) { -\series bold - new -\series default - Thread(task).start(); } -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -In component oriented programming, and in Fractal in particular, the components - that have dependencies to other components must be programmed in a specific - way. - Consider for example the request receiver component. - A possible way to implement it, in classical object oriented programming, - is as follows: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestReceiver { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Scheduler s = -\series bold -new -\series default - MultiThreadScheduler(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - RequestHandler rh = -\series bold -new -\series default - RequestAnalyzer(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// rest of the code not shown -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -This approach is clearly not usable in component oriented programming, since - modularity is lost: with this implementation, it is impossible to change - the implementation of the scheduler or of the request analyzer component - used by the request receiver component, without modifying and recompiling - the source code of this component. - A better approach is to use -\series bold -\emph on -inversion of control -\series default -\emph default - (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Introduction} - -\end_inset - -): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestReceiver { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Scheduler s; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - RequestHandler rh; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - RequestReceiver (Scheduler s, RequestHandler rh) { -\series bold - this -\series default -.s = s; -\series bold -this -\series default -.rh = rh; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// rest of the code not shown -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -This approach solves the modularity problem, but only at deployment time: - it is still impossible to change the scheduler or the request analyzer - used by the request receiver -\emph on -at runtime -\emph default -. - Since one of the goals of Fractal is to support dynamic reconfigurations, - the inversion of control principle must be used in a better way. - In fact, in Fractal, a component with dependencies (or -\emph on -bindings -\emph default -) to other components must implement the -\family sans -BindingController -\family default - interface, defined in the Fractal specification. - This interface defines four generic methods -\family sans -listFc -\family default -, -\family sans -lookupFc -\family default -, -\family sans -bindFc -\family default - and -\family sans -unbindFc -\family default - to manage component bindings. - In Fractal, the request receiver component must therefore be implemented - as follows: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestReceiver -\series bold -implements -\series default - Runnable, BindingController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Scheduler s; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - RequestHandler rh; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// configuration concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - String[] listFc () { -\series bold -return -\series default - -\series bold -new -\series default - String[] { "s", "rh" }; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object lookupFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("s")) { -\series bold -return -\series default - s; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { -\series bold -return -\series default - rh; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -return -\series default - null; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - bindFc (String itfName, Object itfValue) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("s")) { s = (Scheduler)itfValue; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { rh = (RequestHandler)itfValue; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - unbindFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("s")) { s = -\series bold -null -\series default -; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { rh = -\series bold -null -\series default -; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// functional concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - run () { /* see Appendix\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Comanche-source-code} - -\end_inset - - */ } -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -As can be seen, the -\family sans -listFc -\family default - method returns the names of the dependencies of the component, and the - -\family sans -lookupFc -\family default -, -\family sans -bindFc -\family default - and -\family sans -unbindFc -\family default - methods are used to read, set and unset the corresponding bindings (the - -\family sans -s -\family default - and -\family sans -rh -\family default - strings do not have to be equal to the names of the corresponding fields). - The distinction between the -\emph on -controller -\emph default - and -\emph on -content -\emph default - part of Fractal components (see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Introduction} - -\end_inset - -) can also be clearly seen here: the controller part corresponds to the - -\family sans -BindingController -\family default - interface, and the content part to the -\family sans -Runnable -\family default - interface (in the logger and scheduler components, the controller part - was empty). -\layout Standard - -For components that can use a -\emph on -collection -\emph default - of similar bindings to other components, such as the request dispatcher - component, each binding must have a name of the form -\family sans -prefix -\emph on -postfix -\family default -\emph default - where -\family sans -prefix -\family default - is common to all the bindings of the collection, and where -\family sans -\emph on -postfix -\family default -\emph default - is arbitrary, but distinct for each binding. - The request dispatcher component must therefore be implemented as follows - (here the prefix is -\family sans -h -\family default -; the map used is sorted, in order to be able to specify a dispatch order - through the binding names, but this is not mandatory): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestDispatcher -\series bold -implements -\series default - RequestHandler, BindingController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Map handlers = -\series bold -new -\series default - TreeMap(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// configuration concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - String[] listFc () { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -return -\series default - (String[])handlers.keySet().toArray(new String[handlers.size()]); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object lookupFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.startsWith("h")) { -\series bold -return -\series default - handlers.get(itfName); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -return -\series default - null; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - bindFc (String itfName, Object itfValue) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.startsWith("h")) { handlers.put(itfName, itfValue); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - unbindFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.startsWith("h")) { handlers.remove(itfName); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// functional concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException { /* see Appendix -\begin_inset LatexCommand \ref{sec:Comanche-source-code} - -\end_inset - - */ } -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Subsection* - -Summary -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{summary} -\end_inset - -Components must be implemented with an appropriate granularity, resulting - from a compromise between adaptability and performance. - Their interfaces must be separated from their implementation (this rule - must also be applied for data structures). - The implementation must not contain explicit dependencies to other components - to allow static and dynamic reconfigurations. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{summary} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Configuration -\begin_inset LatexCommand \label{sec:Configuration} - -\end_inset - - -\layout Standard - -This section presents several methods to assemble and deploy Fractal components, - always by using the Comanche example. - It also introduces and motivates the Fractal tools that are used. -\layout Subsection - -Programmatic configuration -\begin_inset LatexCommand \label{sub:Programmatic-configuration} - -\end_inset - - -\layout Standard - -The most direct, but also the lowest level method to assemble and deploy - Fractal components is to write a specific program to do that. - The role of this program is to create the components, to bind them to each - other, and finally to start the application. - In the case of Comanche, this deployment program is the following: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - Server { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -static -\series default - -\series bold -void -\series default - main (String[] args) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -RequestReceiver rr = -\series bold -new -\series default - RequestReceiver(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -RequestAnalyzer ra = -\series bold -new -\series default - RequestAnalyzer(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -RequestDispatcher rd = -\series bold -new -\series default - RequestDispatcher(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -FileRequestHandler frh = -\series bold -new -\series default - FileRequestHandler(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ErrorRequestHandler erh = -\series bold -new -\series default - ErrorRequestHandler(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Scheduler s = -\series bold -new -\series default - MultiThreadScheduler(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Logger l = -\series bold -new -\series default - BasicLogger(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -rr.bindFc("rh", ra); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -rr.bindFc("s", s); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ra.bindFc("rh", rd); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ra.bindFc("l", l); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -rd.bindFc("h0", frh); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -rd.bindFc("h1", erh); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -rr.run(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Subsection - -ADL based configuration -\layout Standard - -The previous configuration and deployment method has several drawbacks: - it is error prone (it is easy to forget a binding or to create a wrong - binding), the component architecture is not directly visible (the component's - hierarchy description, in particular, is completely lost) and, most importantly -, -\emph on -this method mixes two separate concerns, namely architecture description - and deployment -\emph default - (it is impossible to deploy a given component architecture in several ways, - without rewriting the configuration/deployment program). - -\layout Standard - -In order to solve these problems, a solution is to use an Architecture Descripti -on Language (ADL). - As its name implies, an ADL definition describes a component architecture, - and only that, i.e. - its does not describe the instantiation method. - This solves the most important drawback of the previous configuration method. - An ADL is also generally strongly typed, which allows the ADL parser to - perform verifications about the declared component architecture. - Using an ADL is therefore less error prone than using the programmatic - approach. -\layout Standard - -Fractal ADL is a possible, XML based ADL that can be used to describe Fractal - component configurations. - A simplified ADL, not based on XML, can also be used, and other ADLs can - be created if needed (indeed these ADLs are not part of the Fractal component - model itself: they are just tools based on this model). - Fractal ADL is strongly typed. - The first step to define a component architecture is therefore to define - the types of the components. - Each component type must specify what components of this type provide to, - and require from other components. - For example, the type of the file and error handler components (but also - of the request handler and backend components - see section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Architecture} - -\end_inset - -), in Comanche, can be defined as follows (these components provide a -\family sans -RequestHandler -\family default - interface, and do not have dependencies): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -Components with dependencies are declared in a similar way. - For example, the type of the request dispatcher component, in Comanche, - can be defined as follows: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -Note that this type is declared to -\emph on -extend -\emph default - the previous handler type: this means that the provided and required interface - types declared in the handler type are inherited by the dispatcher type. - Note also the optional -\emph on -cardinality -\emph default - attribute in the interface type definition: it means that components of - this type can have a variable number of bindings (see end of section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Implementing-the-components} - -\end_inset - -). -\layout Standard - -After the component types have been defined, the components themselves can - be defined. - Here Fractal ADL distinguishes between components that do not expose their - content, called primitive components, and components that do expose it, - called composite components. - A primitive component is defined by specifying its component type and the - Java class that implements it. - For example, the file handler component can be defined as follows: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -Composite components are defined by specifying their sub components, and - the bindings between these sub components. - For example, the Comanche composite component, which represents the whole - application, and which contains the frontend and backend components, can - be defined as follows (see Appendix\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Comanche-architecture-definition} - -\end_inset - - for the definitions of the sub components): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -This definition says that the Comanche component provides a -\family sans -Runnable -\family default - interface (to start the application), that it contains two sub components - named -\family sans -fe -\family default - and -\family sans -be -\family default -, that the -\family sans -Runnable -\family default - interface provided by Comanche ( -\family sans -this.r -\family default -) is provided by the -\family sans -Runnable -\family default - interface of its frontend sub component ( -\family sans -fe.r -\family default -), and that the request handler required by the frontend sub component ( -\family sans -fe.rh -\family default -) is provided by the backend component ( -\family sans -be.rh -\family default -). -\layout Standard - -Once the application's architecture has been defined, it can either be compiled, - which gives a Java class, in source code, similar to the -\family sans -Server -\family default - class shown in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Programmatic-configuration} - -\end_inset - -, or it can be directly interpreted. - In both case, the Fractal ADL parser performs preliminary verifications - to check the architecture and, in particular, to check that there is no - missing or invalid binding. -\layout Subsection - -GUI based configuration -\layout Standard - -Using an ADL is better than using a programmatic approach, but does not - help a lot to visualize the architecture of an application. - To solve this problem, the best solution is to use a graphical tool such - as Fractal GUI, which is shown below: -\layout Standard -\align center - -\begin_inset Graphics - filename fractalgui.ps - display none - clip - -\end_inset - - -\layout Standard - -This tool can be used to graphically and interactively visualize, define - or modify component architectures. - The edited architectures can then be saved in various ADLs (currently only - the Fractal ADL is supported). -\layout Subsection* - -Summary -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{summary} -\end_inset - -Components can be configured and deployed in three different ways. - The programmatic approach is the most direct but mixes different concerns. - The ADL based approach correctly separates these concerns. - The graphical and interactive approach also solves this problem and, in - addition, provides a better architectural representation. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{summary} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Reconfiguration -\begin_inset LatexCommand \label{sec:Reconfiguration} - -\end_inset - - -\layout Standard - -This section explains how Fractal component based applications can be dynamicall -y reconfigured. - It also introduces and motivates the concepts and APIs of Fractal that - are used. -\layout Subsection - -Life cycle management -\layout Standard - -In order to reconfigure an application, the easiest solution is to stop - it, to modify its architecture description, and then to restart it. - But this solution is not always possible, in particular if the service - provided by the application must not be interrupted. - In these cases, the application must be reconfigured at runtime, i.e. - while it is in execution. - But this solution has its own drawbacks: in general, if the reconfiguration - process is not carefully synchronized with the normal application activities, - the application's state may become inconsistent, or the application may - simply crash. - A basic practice to realize this synchronization is to temporarily -\emph on -suspend -\emph default - the normal application activities in the (hopefully small) part of the - application that needs to be reconfigured. - This is what is called -\emph on -life cycle -\emph default - management in Fractal. -\layout Standard - -As an example, let us suppose we want to replace, in a Comanche server, - the file request handler component with a new implementation that can manage - both files and directories. - We will consider here that the HTTP server must be always available, so - that the previous change must be done dynamically, while the server is - running. - If -\family sans -rd -\family default - is a reference to the request dispatcher component, this reconfiguration - can be done with the following instructions: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -RequestHandler rh = -\series bold -new -\series default - FileAndDirectoryRequestHandler(); -\layout Standard - - -\family sans -rd.unbindFc("h0"); -\layout Standard - - -\family sans -rd.bindFc("h0", rh); -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -But this reconfiguration method may produce undefined results, or even errors. - Indeed the -\family sans -RequestDispatcher -\family default - component uses a -\family sans -TreeMap -\family default - to manage its bindings (see end of section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sub:Implementing-the-components} - -\end_inset - -), but this class does not support concurrent accesses. - Modifying this map in a reconfiguration thread, while it is also accessed, - via an iterator, in the applicative threads that execute the -\family sans -handleRequest -\family default - method, may therefore cause errors or inconsistencies. -\layout Standard - -In order to solve this problem, a generic solution is to 1) temporarily - suspend the application activities in the request dispatcher component, - 2) execute the above reconfiguration instructions, and 3) resume the applicatio -n activities. - In order to do that the request dispatcher component must implement the - -\family sans -LifeCycleController -\family default - interface, defined in the Fractal specification. - This interface defines two methods -\family sans -startFc -\family default - and -\family sans -stopFc -\family default -, to suspend and resume the application activities in a component, and an - additional -\family sans -getFcState -\family default - method. - A possible way to implement this interface is to use a counter of the number - of threads that are currently executing a functional method, and to wait - for this counter to become null to stop the component: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestDispatcher -\series bold -implements -\series default - RequestHandler, BindingController, LifeCycleController { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -private -\series default - -\series bold -boolean -\series default - started; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -private -\series default - -\series bold -int -\series default - counter; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - String getFcState () { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -return -\series default - started ? STARTED : STOPPED; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - -\series bold -synchronized -\series default - -\series bold -void -\series default - startFc () { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -started = -\series bold -true -\series default -; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -notifyAll(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - -\series bold -synchronized -\series default - -\series bold -void -\series default - stopFc () { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -while -\series default - (counter > 0) { -\series bold -try -\series default - { wait(); } -\series bold -catch -\series default - (InterruptedException _) {} } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -started = -\series bold -false -\series default -; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -synchronized -\series default - ( -\series bold -this -\series default -) { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -while -\series default - (counter == 0 && !started) { -\series bold -try -\series default - { wait(); } -\series bold -catch -\series default - (InterruptedException _) {} } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -++counter; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -try -\series default - { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -// original code -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\series bold -finally -\series default - { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -synchronized -\series default - ( -\series bold -this -\series default -) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ ---counter; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -if -\series default - (counter == 0) { notifyAll(); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// rest of the class unchanged -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -A better solution is to completely separate this life cycle management concern - from the functional concern, in order to be able to instantiate the request - dispatcher component with or without life cycle management (this management - adds an overhead to the functional methods, which we do not want to pay - if dynamic reconfigurations are not needed). - This can be done easily, thanks to the separation between interface and - implementation, by using, between the request analyzer and the (unmodified) - request dispatcher component, an interceptor of the following form: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - Interceptor -\series bold -implements -\series default - RequestHandler, LifeCycleController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - RequestHandler delegate; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -private -\series default - -\series bold -boolean -\series default - started; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -private -\series default - -\series bold -int -\series default - counter; -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - String getFcState () { /* as above */ } -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - -\series bold -synchronized -\series default - -\series bold -void -\series default - startFc () { /* as above */ } -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - -\series bold -synchronized -\series default - -\series bold -void -\series default - stopFc () { /* as above */ } -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -public -\series default - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -synchronized -\series default - ( -\series bold -this -\series default -) { /* as above */ } -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -try -\series default - { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -delegate.handleRequest(r); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\series bold -finally -\series default - { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -synchronized -\series default - ( -\series bold -this -\series default -) { /* as above */ } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -This interceptor can also implement the -\family sans -BindingController -\family default - interface by delegation. - It can therefore becomes equivalent to the modified request dispatcher - component described above, and can in fact be seen as a request dispatcher - component with life cycle management, -\emph on -encapsulating -\emph default - a request dispatcher component without this control interface. - This can be represented as follows: -\layout Standard -\align center - -\begin_inset Graphics - filename lifecycle.eps - display none - scale 90 - -\end_inset - - -\layout Standard - -We can see here the advantages of separating the architecture description - from the instantiation method. - Indeed the Comanche architecture, described only once, can now be instantiated - either as described in section\SpecialChar ~ - -\begin_inset LatexCommand \ref{sec:Configuration} - -\end_inset - -, or with -\emph on -automatically generated -\emph default - encapsulating components, i.e. - -\begin_inset Quotes eld -\end_inset - -interceptors -\begin_inset Quotes erd -\end_inset - - like the above one, around some or all the primitive components. - -\layout Standard - -We can also see here that the distinction between the controller and content - parts is mainly a design distinction (controllers and contents are defined - as -\emph on -abstract -\emph default - entities in the Fractal specification): in practice, these two parts are - not necessarily implemented by distinct objects (the controller and content - parts of the nested component are in a single object, but the controller - and content part of the encapsulating component are distinct objects - - but this is not mandatory: the encapsulating component can also be automaticall -y generated as a -\emph on -sub class -\emph default - of the nested component's class!). -\layout Subsection - -Introspection -\layout Standard - -In order to dynamically reconfigure a component based application, one must - first get the reference of the components to be reconfigured. - For example, in the example of the previous section, the reference -\family sans -rd -\family default - of the request dispatcher component was needed. - One way of doing this is to start from the reference of a -\begin_inset Quotes eld -\end_inset - -well known -\begin_inset Quotes erd -\end_inset - - component, and to navigate in the application with the -\family sans -BindingController.lookupFc -\family default - method. - For example, the -\family sans -rd -\family default - reference can be obtained from the reference -\family sans -rr -\family default - of the request receiver component with the following expression: -\family sans -((BindingController)rr.lookupFc("rh")).lookupFc("rh") -\family default -. - But this method only works for small applications. - For more complicated applications, with hundreds of components and many - hierarchical levels of composite components, and for applications whose - architecture evolves at runtime, it is not very realistic. - In such cases, a more realistic solution is to create and to maintain consisten -t, at runtime, a full description of the component architecture, including - the composite components, so that the component architecture can be fully - -\emph on -introspected -\emph default - dynamically. -\layout Standard - -This full introspection can be done, in the Fractal component model, by - instantiating, in addition to the primitive components (and optional encapsulat -ing components to manage some non functional concerns), the composite components - described in the component architecture. - In addition, it must also be ensured that all these components provide - the necessary interfaces to provide information about themselves. - -\family sans -BindingController -\family default - is one of these interfaces (with its -\family sans -listFc -\family default - and -\family sans -lookupFc -\family default - methods), but it is not sufficient. - One must also be able to find the sub components of a composite component - and, before that, one must also be able to find the interfaces provided - by a component. - The -\family sans -ContentController -\family default - and -\family sans -Component -\family default - interfaces, specified in the Fractal component model, are defined precisely - for this goal. - In Java, these interfaces are defined as follows (see the Fractal specification - for more details): -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - Component { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -Object[] getFcInterfaces (); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -Object getFcInterface (String itfName); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -Type getFcType (); -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - ContentController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -Object[] getFcInternalInterfaces (); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -Object getFcInterfaceInterface(String itfName); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -Component[] getFcSubComponents (); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - addFcSubComponent (Component c); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - removeFcSubComponent(Component c); -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - -When the Comanche application is instantiated with full introspection capabiliti -es, the result is the following architecture ( -\family sans -C -\family default -, -\family sans -BC -\family default -, -\family sans -CC -\family default - and -\family sans -LC -\family default - stands for -\family sans -Component -\family default -, -\family sans -BindingController -\family default -, -\family sans -ContentController -\family default - and -\family sans -LifeCycleController -\family default - respectively; note also that the components without life cycle management - encapsulated in the primitive components are not shown): -\layout Standard -\align center - -\begin_inset Graphics - filename archi2.eps - display none - scale 90 - -\end_inset - - -\layout Subsection* - -Summary -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{summary} -\end_inset - -Fractal provides some basic tools to allow dynamic reconfiguration, namely - reflexion and life cycle management. - But dynamic reconfiguration is difficult and not yet completely solved - in Fractal (in particular, state management is not yet specified). -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{summary} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Conclusion -\begin_inset LatexCommand \label{sec:Conclusion} - -\end_inset - - -\layout Standard - -The Fractal component model uses well known design patterns, and organizes - them into a uniform, language independent model, that can be applied to - operating systems, middleware platforms or graphical user interfaces. -\layout Standard - -The Fractal component model brings several benefits: it enforces the definition - of a good, modular design; it enforces the separation of interface and - implementation, which ensures a minimum level of flexibility; it enforces - the separation between the functional, configuration and deployment concerns, - which allows the application's architecture to be described separately - from the code, for example by using an Architecture Description Language, - and allows applications to be instantiated in various ways (from fully - optimized but unreconfigurable configurations to less efficient but fully - dynamically reconfigurable configurations). - All these features should reduce the development time, and should also - increase the reusability of components and component architectures, i.e. - they should increase -\emph on -productivity -\emph default -. -\layout Standard - -The Fractal component model and its associated tools, although not yet as - stable as other component models such the Enterprise Java Beans model, - are ready to be used, and have already been used successfully in several - applications such as THINK, a library of Fractal components to build operating - system kernels, Speedo, an implementation of the Java Data Object (JDO) - specification, or Fractal GUI, the graphical tool to edit Fractal component - configurations. -\layout Standard - -More information about Fractal, including the complete specification of - the component model, and several tutorials, can be found at -\family typewriter -http://fractal.objectweb.org -\family default -. -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section -\start_of_appendix -Comanche source code -\begin_inset LatexCommand \label{sec:Comanche-source-code} - -\end_inset - - -\layout Standard - -Here is the full source code of Comanche: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans -/* =============== Component interfaces =============== */ -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - RequestHandler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException; -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - Scheduler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - schedule (Runnable task); -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -interface -\series default - Logger { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -void -\series default - log (String msg); -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - Request { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Socket s; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Reader in; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - PrintStream out; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - String url; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Request (Socket s) { -\series bold -this -\series default -.s = s; } -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -/* =============== Component implementations =============== */ -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - BasicLogger -\series bold -implements -\series default - Logger { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public void -\series default - log (String msg) { System.out.println(msg); } -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - SequentialScheduler -\series bold -implements -\series default - Scheduler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -synchronized -\series default - -\series bold -void -\series default - schedule (Runnable task) { task.run(); } -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - MultiThreadScheduler -\series bold -implements -\series default - Scheduler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - schedule (Runnable task) { -\series bold - new -\series default - Thread(task).start(); } -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - FileRequestHandler -\series bold -implements -\series default - RequestHandler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -File f = -\series bold -new -\series default - File(r.url); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -if (f.exists() && !f.isDirectory()) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -InputStream is = -\series bold -new -\series default - FileInputStream(f); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -byte[] data = -\series bold -new -\series default - byte[is.available()]; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -is.read(data); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -is.close(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.out.print("HTTP/1.0 200 OK -\backslash -n -\backslash -n"); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.out.write(data); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\series bold -else -\series default - { -\series bold - throw -\series default - -\series bold -new -\series default - IOException("File not found"); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - ErrorRequestHandler -\series bold -implements -\series default - RequestHandler { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.out.print("HTTP/1.0 404 Not Found -\backslash -n -\backslash -n"); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.out.print("Document not found."); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestDispatcher -\series bold -implements -\series default - RequestHandler, BindingController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Map handlers = -\series bold -new -\series default - TreeMap(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// configuration concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - String[] listFc () { -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -return -\series default - (String[])handlers.keySet().toArray(new String[handlers.size()]); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object lookupFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.startsWith("h")) { -\series bold -return -\series default - handlers.get(itfName); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -return -\series default - null; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - bindFc (String itfName, Object itfValue) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.startsWith("h")) { handlers.put(itfName, itfValue); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - unbindFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.startsWith("h")) { handlers.remove(itfName); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// functional concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -Iterator i = handlers.values().iterator(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -while -\series default - (i.hasNext()) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -try -\series default - { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -((RequestHandler)i.next()).handleRequest(r); -\layout Standard - - -\family sans -\series bold -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -return -\series default -; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\series bold -catch -\series default - (IOException _) { } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestAnalyzer -\series bold -implements -\series default - RequestHandler, BindingController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Logger l; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - RequestHandler rh; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// configuration concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - String[] listFc () { -\series bold -return -\series default - -\series bold -new -\series default - String[] { "l", "rh" }; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object lookupFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("l")) { -\series bold -return -\series default - l; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { -\series bold -return -\series default - rh; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -return -\series default - null; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - bindFc (String itfName, Object itfValue) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("l")) { l = (Logger)itfValue; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { rh = (RequestHandler)itfValue; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - unbindFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("l")) { l = -\series bold -null -\series default -; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { rh = -\series bold -null -\series default -; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// functional concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - handleRequest (Request r) -\series bold -throws -\series default - IOException { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.in = -\series bold -new -\series default - InputStreamReader(r.s.getInputStream()); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.out = -\series bold -new -\series default - PrintStream(r.s.getOutputStream()); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -String rq = -\series bold -new -\series default - LineNumberReader(r.in).readLine(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -l.log(rq); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (rq.startsWith("GET ")) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.url = rq.substring(5, rq.indexOf(' ', 4)); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -rh.handleRequest(r); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.out.close(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -r.s.close(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans -\series bold -public -\series default - -\series bold -class -\series default - RequestReceiver -\series bold -implements -\series default - Runnable, BindingController { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - Scheduler s; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -private -\series default - RequestHandler rh; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// configuration concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - String[] listFc () { -\series bold -return -\series default - -\series bold -new -\series default - String[] { "s", "rh" }; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - Object lookupFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("s")) { -\series bold -return -\series default - s; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { -\series bold -return -\series default - rh; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -return -\series default - null; -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - bindFc (String itfName, Object itfValue) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("s")) { s = (Scheduler)itfValue; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { rh = (RequestHandler)itfValue; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - unbindFc (String itfName) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -if -\series default - (itfName.equals("s")) { s = -\series bold -null -\series default -; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -else -\series default - -\series bold -if -\series default - (itfName.equals("rh")) { rh = -\series bold -null -\series default -; } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -// functional concern -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - run () { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -try -\series default - { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -ServerSocket ss = -\series bold -new -\series default - ServerSocket(8080); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -while -\series default - (true) { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -final -\series default - Socket socket = ss.accept(); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -s.schedule( -\series bold -new -\series default - Runnable () { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -public -\series default - -\series bold -void -\series default - run () { -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ - -\series bold -try -\series default - { rh.handleRequest( -\series bold -new -\series default - Request(socket)); } -\series bold -catch -\series default - (IOException _) { } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -}); -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -\SpecialChar ~ -} -\series bold -catch -\series default - (IOException e) { e.printStackTrace(); } -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ -} -\layout Standard - - -\family sans -} -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -cleardoublepage -\end_inset - - -\layout Section - -Comanche architecture definition -\begin_inset LatexCommand \label{sec:Comanche-architecture-definition} - -\end_inset - - -\layout Standard - -Here are the Fractal ADL definitions describing the Comanche architecture: -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -begin{code} -\end_inset - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans -\SpecialChar ~ -\SpecialChar ~ - -\layout Standard - - -\family sans - -\layout Standard - - -\begin_inset ERT -status Collapsed - -\layout Standard - -\backslash -end{code} -\end_inset - - -\the_end diff --git a/web/latex/tutorial/lifecycle.eps b/web/latex/tutorial/lifecycle.eps deleted file mode 100644 index 12846106e57397073118e25e398969855287a4ff..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/lifecycle.eps +++ /dev/null @@ -1,180 +0,0 @@ -%!PS-Adobe-2.0 EPSF-2.0 -%%Title: lifecycle.fig -%%Creator: fig2dev Version 3.2 Patchlevel 4 -%%CreationDate: Wed Sep 3 16:34:00 2003 -%%For: bruneter@g-c700-13 (Eric Bruneton) -%%BoundingBox: 0 0 346 118 -%%Magnification: 1.0000 -%%EndComments -/$F2psDict 200 dict def -$F2psDict begin -$F2psDict /mtrx matrix put -/col-1 {0 setgray} bind def -/col0 {0.000 0.000 0.000 srgb} bind def -/col1 {0.000 0.000 1.000 srgb} bind def -/col2 {0.000 1.000 0.000 srgb} bind def -/col3 {0.000 1.000 1.000 srgb} bind def -/col4 {1.000 0.000 0.000 srgb} bind def -/col5 {1.000 0.000 1.000 srgb} bind def -/col6 {1.000 1.000 0.000 srgb} bind def -/col7 {1.000 1.000 1.000 srgb} bind def -/col8 {0.000 0.000 0.560 srgb} bind def -/col9 {0.000 0.000 0.690 srgb} bind def -/col10 {0.000 0.000 0.820 srgb} bind def -/col11 {0.530 0.810 1.000 srgb} bind def -/col12 {0.000 0.560 0.000 srgb} bind def -/col13 {0.000 0.690 0.000 srgb} bind def -/col14 {0.000 0.820 0.000 srgb} bind def -/col15 {0.000 0.560 0.560 srgb} bind def -/col16 {0.000 0.690 0.690 srgb} bind def -/col17 {0.000 0.820 0.820 srgb} bind def -/col18 {0.560 0.000 0.000 srgb} bind def -/col19 {0.690 0.000 0.000 srgb} bind def -/col20 {0.820 0.000 0.000 srgb} bind def -/col21 {0.560 0.000 0.560 srgb} bind def -/col22 {0.690 0.000 0.690 srgb} bind def -/col23 {0.820 0.000 0.820 srgb} bind def -/col24 {0.500 0.190 0.000 srgb} bind def -/col25 {0.630 0.250 0.000 srgb} bind def -/col26 {0.750 0.380 0.000 srgb} bind def -/col27 {1.000 0.500 0.500 srgb} bind def -/col28 {1.000 0.630 0.630 srgb} bind def -/col29 {1.000 0.750 0.750 srgb} bind def -/col30 {1.000 0.880 0.880 srgb} bind def -/col31 {1.000 0.840 0.000 srgb} bind def -/col32 {0.500 0.500 0.500 srgb} bind def -/col33 {0.727 0.715 0.727 srgb} bind def - -end -save -newpath 0 118 moveto 0 0 lineto 346 0 lineto 346 118 lineto closepath clip newpath -48.3 156.7 translate -1 -1 scale - -/cp {closepath} bind def -/ef {eofill} bind def -/gr {grestore} bind def -/gs {gsave} bind def -/sa {save} bind def -/rs {restore} bind def -/l {lineto} bind def -/m {moveto} bind def -/rm {rmoveto} bind def -/n {newpath} bind def -/s {stroke} bind def -/sh {show} bind def -/slc {setlinecap} bind def -/slj {setlinejoin} bind def -/slw {setlinewidth} bind def -/srgb {setrgbcolor} bind def -/rot {rotate} bind def -/sc {scale} bind def -/sd {setdash} bind def -/ff {findfont} bind def -/sf {setfont} bind def -/scf {scalefont} bind def -/sw {stringwidth} bind def -/tr {translate} bind def -/tnt {dup dup currentrgbcolor - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add - 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} - bind def -/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul - 4 -2 roll mul srgb} bind def -/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def -/$F2psEnd {$F2psEnteredState restore end} def - -$F2psBegin -10 setmiterlimit -0 slj 0 slc - 0.06299 0.06299 sc -% -% Fig objects follow -% -% -% here starts figure with depth 55 -% Polyline -7.500 slw -n 675 900 m 3150 900 l 3150 2475 l 675 2475 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% Polyline -n 900 1125 m 2925 1125 l 2925 2250 l 900 2250 l - cp gs col7 1.00 shd ef gr gs col0 s gr -% Polyline -n 1350 1350 m 2700 1350 l 2700 2025 l 1350 2025 l - cp gs col33 1.00 shd ef gr gs col0 s gr -% here ends figure; -% -% here starts figure with depth 51 -% Polyline -n -765 630 m 4725 630 l 4725 2475 l -765 2475 l - cp -% Polyline -15.000 slw -n 1575 1305 m - 1395 1305 l gs col4 s gr -% Polyline -n 1485 1305 m - 1485 1350 l gs col4 s gr -% Polyline -n 1305 1575 m - 1305 1755 l gs col4 s gr -% Polyline -n 1305 1665 m - 1350 1665 l gs col4 s gr -% Polyline -7.500 slw -n 945 1575 m - 945 1755 l gs col12 s gr -% Polyline -n 945 1665 m - 900 1665 l gs col12 s gr -% Polyline -15.000 slw -n 630 1575 m - 630 1755 l gs col4 s gr -% Polyline -n 630 1665 m - 675 1665 l gs col4 s gr -% Polyline -n 900 855 m - 720 855 l gs col4 s gr -% Polyline -n 810 855 m - 810 900 l gs col4 s gr -% Polyline -n 1575 855 m - 1395 855 l gs col4 s gr -% Polyline -n 1485 855 m - 1485 900 l gs col4 s gr -% Polyline -7.500 slw -n 1485 1170 m - 1485 1260 l gs col0 s gr -% Polyline -n 990 1665 m - 1260 1665 l gs col0 s gr -/Times-Italic ff 165.00 scf sf -720 2430 m -gs 1 -1 sc (controller) col0 sh gr -/Times-Italic ff 165.00 scf sf -945 2205 m -gs 1 -1 sc (content) col0 sh gr -/Times-Roman ff 165.00 scf sf -1395 1530 m -gs 1 -1 sc (BindingController) col0 sh gr -/Times-Roman ff 165.00 scf sf -585 1755 m -gs 1 -1 sc (RequestHandler) dup sw pop neg 0 rm col0 sh gr -/Times-Roman ff 165.00 scf sf -1350 765 m -gs 1 -1 sc (BindingController) col0 sh gr -/Times-Roman ff 165.00 scf sf -945 765 m -gs 1 -1 sc (LifeCycleController) dup sw pop neg 0 rm col0 sh gr -% here ends figure; -$F2psEnd -rs -showpage diff --git a/web/latex/tutorial/lifecycle.fig b/web/latex/tutorial/lifecycle.fig deleted file mode 100644 index e60a1f6743a8de5161db40757b2b57ba0d65dee1..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/lifecycle.fig +++ /dev/null @@ -1,65 +0,0 @@ -#FIG 3.2 -Landscape -Center -Metric -Letter -100.00 -Single --2 -1200 2 -0 32 #808080 -0 33 #bab7ba -6 1350 1260 1620 1395 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 1305 1395 1305 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1485 1305 1485 1350 --6 -6 1260 1530 1395 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1575 1305 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1305 1665 1350 1665 --6 -6 900 1575 945 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1575 945 1755 -2 1 0 1 12 7 50 0 -1 0.000 0 0 -1 0 0 2 - 945 1665 900 1665 --6 -6 585 1530 720 1800 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1575 630 1755 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 630 1665 675 1665 --6 -6 675 810 945 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 900 855 720 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 810 855 810 900 --6 -6 1350 810 1620 945 -2 1 0 2 4 4 50 0 -1 0.000 0 0 -1 0 0 2 - 1575 855 1395 855 -2 1 0 2 4 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1485 855 1485 900 --6 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 1485 1170 1485 1260 -2 2 0 1 0 33 53 -1 20 0.000 0 0 -1 0 0 5 - 1350 1350 2700 1350 2700 2025 1350 2025 1350 1350 -2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 - 990 1665 1260 1665 -2 2 0 1 0 7 54 0 20 0.000 0 0 -1 0 0 5 - 900 1125 2925 1125 2925 2250 900 2250 900 1125 -2 2 0 1 0 33 55 0 20 0.000 0 0 -1 0 0 5 - 675 900 3150 900 3150 2475 675 2475 675 900 -2 2 0 0 0 7 51 -1 -1 0.000 0 0 -1 0 0 5 - -765 630 4725 630 4725 2475 -765 2475 -765 630 -4 0 0 50 -1 1 11 0.0000 4 105 630 720 2430 controller\001 -4 0 0 50 -1 1 11 0.0000 4 90 465 945 2205 content\001 -4 0 0 50 -1 0 11 0.0000 4 150 1155 1395 1530 BindingController\001 -4 2 0 50 0 0 11 0.0000 4 150 1035 585 1755 RequestHandler\001 -4 0 0 50 -1 0 11 0.0000 4 150 1155 1350 765 BindingController\001 -4 2 0 50 -1 0 11 0.0000 4 135 1320 945 765 LifeCycleController\001 diff --git a/web/latex/tutorial/makefile b/web/latex/tutorial/makefile deleted file mode 100644 index ec96d38a17c2bbba490bfabba9639b0cb3346744..0000000000000000000000000000000000000000 --- a/web/latex/tutorial/makefile +++ /dev/null @@ -1,23 +0,0 @@ -SRC = fractal-programming -DST = ../../html/tutorial - -all: prepare tex pdf ps html - -mkdir ${DST} - mv ${SRC}.pdf ${SRC}.ps.gz ${SRC}.html *.png ${DST} - -rm *.ps *.tex *.aux *.dvi *.lof *.log *.toc *.tlg - -prepare: - unzip postscript.zip - -tex: - lyx -e latex ${SRC}.lyx - -pdf: - lyx -e pdf ${SRC}.lyx - -ps: - lyx -e ps ${SRC}.lyx - gzip ${SRC}.ps - -html: tex - sed s/\textsf/\texttt/g ${SRC}.tex | sed s/textbackslash\{\}/textbackslash\{\\\\char\`\\\\\\\\}/g | tth -a -r -e2 -L${SRC} | sed '/begincode/,/endcode/s/
<\/div>/
/g' | sed 's/

//g' | sed ':loop N;s/\n<\/a>/<\/a>/;t label;P;D;b loop;:label;p;d;b loop' > ${SRC}.html diff --git a/web/latex/tutorial/postscript.zip b/web/latex/tutorial/postscript.zip deleted file mode 100644 index d98574aef58c8dd14cb238ae46c6713686be0ab4..0000000000000000000000000000000000000000 Binary files a/web/latex/tutorial/postscript.zip and /dev/null differ diff --git a/web/lib/ow_util_ant_tasks.jar b/web/lib/ow_util_ant_tasks.jar deleted file mode 100644 index 4b5dc8efaa5b09b955103cc6d85299898cd2085d..0000000000000000000000000000000000000000 Binary files a/web/lib/ow_util_ant_tasks.jar and /dev/null differ diff --git a/web/lib/xalan.jar b/web/lib/xalan.jar deleted file mode 100644 index 55430d0075329ead702e843efc0cb271d7f21a6f..0000000000000000000000000000000000000000 Binary files a/web/lib/xalan.jar and /dev/null differ diff --git a/web/lib/xerces1_0_2.jar b/web/lib/xerces1_0_2.jar deleted file mode 100644 index b49a3060249529f53d8660f9d75409b8c3607335..0000000000000000000000000000000000000000 Binary files a/web/lib/xerces1_0_2.jar and /dev/null differ diff --git a/web/postprocess.sh b/web/postprocess.sh deleted file mode 100755 index e150c9fb7d072d556f1084108c2fb970cc343bb8..0000000000000000000000000000000000000000 --- a/web/postprocess.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -cd tutorial -sed -e '/TOBEREPLACED/r fractal-programming.html' -e '/TOBEREPLACED/d' index-holder.html > index.html -sed -e '/TOBEREPLACED/r fractal-programming.html' -e '/TOBEREPLACED/d' index-holder_print.html > index_print.html - -cd ../specification -sed -e '/TOBEREPLACED/r fractal-specification.html' -e '/TOBEREPLACED/d' index-holder.html > index.html -sed -e '/TOBEREPLACED/r fractal-specification.html' -e '/TOBEREPLACED/d' index-holder_print.html > index_print.html - -cd ../tutorials/adl -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' index-holder.html > index.html -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' -e '/- ADL tutorial/d' index-holder_print.html > index_print.html - -cd ../fractal -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' index-holder.html > index.html -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' -e '/- Tutorial/d' index-holder_print.html > index_print.html - -cd ../julia -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' index-holder.html > index.html -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' -e '/- Julia tutorial/d' index-holder_print.html > index_print.html - -cd ../jmx -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' index-holder.html > index.html -sed -e '/TOBEREPLACED/r body.html' -e '/TOBEREPLACED/d' -e '/- Fractal JMX tutorial/d' index-holder_print.html > index_print.html diff --git a/web/xml/project/project.xml b/web/xml/project/project.xml deleted file mode 100644 index da92769f7cda0a278982490e0ddaaa86bb50e4b1..0000000000000000000000000000000000000000 --- a/web/xml/project/project.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - Fractal - - Fractal is a general software composition framework that supports component-based programming, including components (type) definition, configuration, composition and administration.. - - Fractal,component,composition,framework,composite,configuration, administration,open,source,free,software,LGPL - - - - Project Links - Home - Download - Documentation - Mailing List - Partners - License - History - - - - Developers' Corner - Workplan - CVS Repository - ObjectWeb Forge Site - - - - About - Community - Contacts - Team - - - - diff --git a/web/xml/root/doc/index.xml b/web/xml/root/doc/index.xml deleted file mode 100644 index 5871f1bb05a4bedecb0323d92eeec3892a35897e..0000000000000000000000000000000000000000 --- a/web/xml/root/doc/index.xml +++ /dev/null @@ -1,165 +0,0 @@ - - - - - - - - fractal-team - Documentation - index.xml - .. - - - - -

Here are some links to documents about the Fractal sub projects.

- - Getting Started - -

If you do not know anything about Fractal, we advise you to read - this Getting Started document - first, before reading anything else. - This document introduces the Fractal model and its associated - tools through a concrete example, with lots of code samples.

- - Sub Project 1: Component Model - -

The goal of this sub project is to specify the Fractal - component model.

- -

The Fractal component model is completely defined in the - Fractal Specification - (we advise you - to read the Getting Started - document before reading this specification). The - Fractal - API corresponds to the Java mapping of the interfaces specified in - this document. The Fractal - Tutorial is a more detailed version of the "Example" section of the - Fractal Specification. -

- - Sub Project 2: Implementations - -

The goal of this sub project is to provide implementations - of the Fractal component model.

- -

Julia is the reference implementation of the Fractal component - model in Java. The Julia - Tutorial explains how Julia can be configured. The - Julia - API documentation explains how Julia is designed and - implemented.

- - - - Sub Project 3: Components - -

The goal of this sub project is to provide reusable Fractal - components.

- -

The currently available Fractal components are listed below. - The first ones are developped in the Fractal project, while the - last ones are developped in other ObjectWeb projects.

- -
    - -
  • The Fractal RMI components are a set of - protocol, binder, and stub factory components that can be used - to provide remote method calls between Fractal - components. The - Fractal - RMI API documentation explains the architecture of these - components. The Fractal RMI components are included in the - Fractal distribution.
  • - -
  • The Fractal JMX components are a set of - components that enable JMX management of Fractal applications through - automatic exposition in JMX agents. The - Fractal JMX tutorial explains - how to use these components. The - Fractal - JMX API documentation explains the architecture of these - components. The Fractal JMX components are included in the - Fractal distribution.
  • - -
    - -
  • The Perseus - components are - a set of general purpose components for cache management, pool - management, concurrency management, and persistence management.
  • - -
  • The Think - components are a - set of components to build operating system kernels. These - components are implemented in C.
  • - -
- - Sub Project 4: Tools - -

The goal of this sub project is to provide Fractal based - applications dedicated to Fractal.

- -

The currently available Fractal tools are listed below. They - are all developped in the Fractal project.

- -
    - -
  • The Fractal ADL parser is a tool made of several - Fractal components that can parse - Fractal ADL - architecture definitions, and instantiate the corresponding - components. The - Fractal - ADL API documentation explains the architecture of this tool. - The Fractal ADL parser is included in the - Fractal distribution.
  • - -
  • The Fractal GUI editor is a tool made of several - Fractal components that provides a graphical tool to edit Fractal - component configurations. The - Fractal - GUI API documentation explains the architecture of this tool. - The Fractal GUI editor is included in the - Fractal distribution.
  • - -
- - Publications - -
    - -
  • E. Bruneton, T. Coupaye, and J.B. Stefani. Recursive and - Dynamic Software Composition with Sharing. Seventh International - Workshop on Component-Oriented Programming (WCOP02), Monday, June 10, - 2002 - At ECOOP 2002, Malaga, Spain (June 10-14, 2002) [PDF]
  • - -
- - Slides - - - -
- -
diff --git a/web/xml/root/download/index.xml b/web/xml/root/download/index.xml deleted file mode 100644 index 7786056a15de8e6e25c466783a2842d30fe496e6..0000000000000000000000000000000000000000 --- a/web/xml/root/download/index.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - Fractal team - Download - index.xml - .. - - - - - -

The Fractal Distribution contains the code related - to the four sub projects of the Fractal project, i.e. the Fractal - API, the Julia reference implementation, the - Fractal RMI ORB, the Fractal ADL parser, and the - Fractal GUI tool (see the - documentation page for more details). - It can be downloaded in several ways:

- - Fractal Stable Releases - -

Fractal stable releases can be downloaded from the ObjectWeb Forge. -

- - Fractal CVS Repository - -

You can also download Fractal from the ObjectWeb Forge - CVS.

-

The available modules are:

-
    -
  • .: used to get the whole Fractal repository.
  • -
  • fractal: used to get the Fractal API.
  • -
  • fractaladl: used to get the Fractal ADL tool.
  • -
  • fractalgui: used to get the Fractal GUI tool.
  • -
  • fractalrmi: used to get the Fractal RMI ORB.
  • -
  • fractaljmx: used to get the Fractal JMX agent.
  • -
  • fractalswing: used to get the Fractal Swing components.
  • -
  • julia: used to get the Julia reference implementation.
  • -
  • examples: used to get the Fractal examples.
  • -
  • web: used to get the Fractal web site.
  • -
-

Note that the latest snapshot of the CVS repository is - available for - download. - This snapshot is generated each night at 00:00 AM CEST.

- -
- - - -
- diff --git a/web/xml/root/history.xml b/web/xml/root/history.xml deleted file mode 100644 index 34b0c72667dfb88f0dab3cead0e8c1b502938a29..0000000000000000000000000000000000000000 --- a/web/xml/root/history.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - Fractal team - History - history.xml - . - - - - - - - September 2003 - -

Release of the Fractal 2.0 specification.

- - September 2002 - -

Opening of the Fractal framework web site.

- - - August 2002 - -

Vote of acceptance of the Fractal 1.0 specification.

- - - July 2002 - -

Opening of the Fractal Source Forge Project.

- - - June 2002 - -

Submission of the Fractal 0.9 specification as the 'Proposed Final - Draft' by France Telecom R&D and INRIA.

- - - Jannuary 2002 - -

Initial proposition of the Fractal framework by France Telecom - R&D and INRIA.

- -
- - - - 17 March 2004: - -
    -
  • New version of the Fractal ADL language and parser
  • -
  • Addition of the Fractal JMX module
  • -
  • Distributed deployment through Fractal ADL with Fractal RMI
  • -
  • Experimental runtime administration/reconfiguration tools in FractalGUI
  • -
  • CVS tags per CVS module:
  • -
      -
    • fractal: FRACTAL_API_2_0
    • -
    • fractaladl: FRACTAL_ADL_2_0
    • -
    • fractalgui: FRACTAL_GUI_0_3
    • -
    • fractaljmx: FRACTAL_JMX_0_1
    • -
    • fractalrmi: FRACTAL_RMI_0_2
    • -
    • fractalswing: FRACTAL_SWING_0_2
    • -
    • examples: FRACTAL_EXAMPLES_2_0
    • -
    • julia: JULIA_2_0
    • -
    -
- - - 24 November 2003: Fractal 2.0 (cvs-tag: FRACTAL_2_0) - -
    -
  • upgraded code to version 2 of the Fractal Specification
  • -
- - - 9 July 2003: Fractal 1.1 (cvs-tag: FRACTAL_1_1) - -
    -
  • Bug fixes
  • -
  • Added a new, simplified ADL
  • -
  • Added a registry for Fractal RMI
  • -
  • Added Fractal GUI, a GUI tool to edit Fractal ADL files
  • -
- - - 11 February 2003: Fractal 1.0.6 (cvs-tag: FRACTAL_1_0_6) - -
    -
  • Refactored the julia.control package
  • -
  • Added support for distribution, based on Jonathan's framework
  • -
  • Added Fractal ADL and Fractal ADL parser
  • -
  • Added standard bootstrap mechanism
  • -
  • Added some "ready to use" interceptor class generators
  • -
- - - 11 December 2002: Fractal 1.0.5 (cvs-tag: FRACTAL_1_0_5) - -
    -
  • Added naming framework
  • -
  • Improved documentation and tutorials
  • -
  • Added support for output interceptors in primitive components
  • -
  • Improved exception handling code
  • -
- - - 10 September 2002: Fractal 1.0.4 (cvs-tag: FRACTAL_1_0_4) - -
    -
  • Added web site
  • -
- - - 2 September 2002: Fractal 1.0.3 (cvs-tag: FRACTAL_1_0_3) - -
    -
  • Improved interception code generation framework
  • -
  • More optimization options (merge content)
  • -
  • Added one example named "protoactive" (replaces "interceptor")
  • -
- - - 1 August 2002: Fractal 1.0.2 (cvs-tag: FRACTAL_1_0_2) - -
    -
  • Added "mixins" classes
  • -
  • NameController moved to juliax
  • -
- - - 23 July 2002: Fractal 1.0.1 (cvs-tag: FRACTAL_1_0_1) - -
    -
  • Added examples and comments
  • -
  • Bug fixes
  • -
- - - 15 July 2002: Fractal 1.0 (cvs-tag: FRACTAL_1_0) - -
    -
  • First public version
  • -
- -
- - -
diff --git a/web/xml/root/index.xml b/web/xml/root/index.xml deleted file mode 100644 index 4d29261f790877cb14ed08270a8fdeab995e2de8..0000000000000000000000000000000000000000 --- a/web/xml/root/index.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - Fractal team - Home Page - index.xml - . - - - - - - - - - - -
- -Fractal logo -
-Background image appears courtesy of Guiseppe Zito. - -
- - Overview - -

Fractal is a modular and extensible component model that can be used -with various programming languages to design, implement, deploy and -reconfigure various systems and applications, from operating systems -to middleware platforms and to graphical user interfaces.

- - Goals - -

The goal of Fractal is to reduce the development, deployment -and maintenance costs of software systems in general, and of -ObjectWeb projects in particular. The Fractal model already -uses some well known design patterns, such as separation of -interface and implementation and, more generally, separation -of concerns, in order to achieve this goal. There is -also ongoing research work to get even closer to this goal.

- - Sub projects - -

The Fractal Project is made of four sub projects:

- -
    - -
  • The Component Model sub project deals with the -definition of the component model. -The main characteristics of this model are recursivity (components can be -nested in composite components - hence the "Fractal" name) and -reflexivity (components have full introspection and intercession -capabilities). The Fractal model is also language independent, and fully -modular and extensible.
  • - -
  • The Implementations sub project deals with the -implementation of Fractal component platforms, which allow the creation, -configuration and reconfiguration of Fractal components. Julia, the -reference implementation, is developped in this sub project.
  • - -
  • The Components sub project deals with the -implementation of reusable, ready to use Fractal components, such -as protocol or Swing components.
  • - -
  • The Tools sub project deals with -the implementation of Fractal based applications dedicated to Fractal, such -as tools to define component configurations.
  • - -
- -
- - -
diff --git a/web/xml/root/license.xml b/web/xml/root/license.xml deleted file mode 100644 index 4e9dee46f91060d14eb5ebaadd28dc59a29544db..0000000000000000000000000000000000000000 --- a/web/xml/root/license.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - Fractal team - License Status - license.xml - . - - - - -

The Fractal API and its reference implementation, named Julia, - as well as the associated tools Fractal RMI and Fractal GUI, are - licensed under the - GNU Lesser - General Public License.

-
- -
diff --git a/web/xml/root/partners.xml b/web/xml/root/partners.xml deleted file mode 100644 index cf5494f91a99f6c694ededbd1ffda21cc0d1dea1..0000000000000000000000000000000000000000 --- a/web/xml/root/partners.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - Fractal team - Partners - partners.xml - . - - - - - - - - - - - - - - -
- - France Telecom R&D logo - France - Telecom R&D is the France Telecom's Centre Research and - Development for innovation and service creation. -
- - INRIA logo - INRIA is the - French National Institute for Research in Computer Science and - Control. It is a scientific and technological institute operating - under the dual authority of the Ministry of Research and the Ministry - of Industry. -
- -
- - -
diff --git a/web/xml/root/specification/index-holder.xml b/web/xml/root/specification/index-holder.xml deleted file mode 100644 index d45be473d7211e690440a327cd7f241fb4928543..0000000000000000000000000000000000000000 --- a/web/xml/root/specification/index-holder.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - fractal-team - Specification - index.xml - .. - - - - - - diff --git a/web/xml/root/team.xml b/web/xml/root/team.xml deleted file mode 100644 index 86ec4724044566d28e55fadc8a2229b4b6e86978..0000000000000000000000000000000000000000 --- a/web/xml/root/team.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - Fractal team - Team - team.xml - . - - - - -

Currently the Fractal team is composed of:

- -
- - - -

We would also like to thank all the following people who have also contributed to Fractal:

- -
- - -
diff --git a/web/xml/root/tutorial/index-holder.xml b/web/xml/root/tutorial/index-holder.xml deleted file mode 100644 index 0b28ba174a1265b028117fc1e1108aee7a34e964..0000000000000000000000000000000000000000 --- a/web/xml/root/tutorial/index-holder.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - fractal-team - Tutorial - index.xml - .. - - - - - - diff --git a/web/xml/root/tutorials/adl/index-holder.xml b/web/xml/root/tutorials/adl/index-holder.xml deleted file mode 100644 index 1c7ac391fd322b18f0eec91bc727a19a03f23ddf..0000000000000000000000000000000000000000 --- a/web/xml/root/tutorials/adl/index-holder.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - fractal-team - ADL tutorial - index.xml - ../.. - - - - - - diff --git a/web/xml/root/tutorials/fractal/index-holder.xml b/web/xml/root/tutorials/fractal/index-holder.xml deleted file mode 100644 index a6d7cd3087d56b90c297da53456f565e4623c1bc..0000000000000000000000000000000000000000 --- a/web/xml/root/tutorials/fractal/index-holder.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - fractal-team - Tutorial - index.xml - ../.. - - - - - - diff --git a/web/xml/root/tutorials/jmx/index-holder.xml b/web/xml/root/tutorials/jmx/index-holder.xml deleted file mode 100644 index e691787e3c6df06dd12e78e39080f4bf22493c01..0000000000000000000000000000000000000000 --- a/web/xml/root/tutorials/jmx/index-holder.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - fractal-team - Fractal JMX tutorial - index.xml - ../.. - - - - - - diff --git a/web/xml/root/tutorials/julia/index-holder.xml b/web/xml/root/tutorials/julia/index-holder.xml deleted file mode 100644 index 9d8c381aec3d58ddc9d0f12663ea15b866bba98f..0000000000000000000000000000000000000000 --- a/web/xml/root/tutorials/julia/index-holder.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - fractal-team - Julia tutorial - index.xml - ../.. - - - - - - diff --git a/web/xml/root/users.xml b/web/xml/root/users.xml deleted file mode 100644 index 8b78aefb45044adfa2d88013a567cf07b304e74b..0000000000000000000000000000000000000000 --- a/web/xml/root/users.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - fractal-team - Community - users.xml - . - - - - - -

Here is a list of projects that use Fractal, or that are doing - research on it. ObjectWeb projects are in bold, - while external projects are not.

- - Users - - - - - - - - - - - - - - - - - - -
- CLIF logo - - CLIF is a starting development activity of - ObjectWeb's JMOB project. - CLIF aims at providing a generic load injection platform for - benchmarking middleware. CLIF's interest in Fractal is double: from a - general point of view, the neat component model favors a good design - for CLIF distributed framework; from a specific point of view, Fractal - meets our needs in terms of transparent deployment and runtime - implementation changes. -
- Jironde - Jironde, a part of - JOTM, is a flexible - framework for to make components transactional. Jironde is - based on the use of several component controllers that manage - transactional functionality on behalf of components. For a - component, to be transactional, the only requirement is to - fulfill a component contract which is specific to different - transactional controller implementations. Thanks to the flexibility and - reflective nature of Fractal, it is possible to achieve different levels - of component transactional functionality by combining different - transactional controllers, with only taking their component contracts - into account. -
- JOTDF - JOTDF (Java Open Transaction - Demarcation Framework) is about integration of transaction demarcation - functionality in component-oriented platforms. JOTDF is based - on the definition of propagation policies which defines the - scenario to apply for propagating or not the client transaction - context to the component. JOTDF is platform independent (EJB, - CCM, AOP, ...) and transaction manager indentpendent (JTA, OTS, - ...). JOTDF policies are designed as Fractal components - themselves which could be assembled using Fractal ADL. -
- - Speedo logo - Speedo is an open source - implementation of the - JDO specification. Speedo uses Fractal to have a clear and modular - architecture.
- - Research projects - - - - - - - - - - - - - - - - - - - - - -
- ARTS - ARTS (Adaptable and Reflexive Technical Services). - The component-based model is one possible response to the increased - heterogeneity of distributed systems. This model allows developers to - focus on applicative logic and leaves the implementation of the - technical (or non-functional) aspects to the component platform. - However, the technical services themselves do not reap the advantages - provided by the components, particularly as concerns the granularity and - increased reusability that comes from expressing the required APIs as - receptacles and facets. In this project, we propose structuring the - technical services as Fractal components in order to provide adaptable - technical services. Moreover, we try to define ways to use statically - and dynamically those adaptable services thanks to application - construction rules and tools to build such applications. -
- DREAM - DREAM (Dynamic Reflective Asynchronous Middleware) - is a framework dedicated to the construction of asynchronous middleware. - Our goal is to provide a set of components that can be dynamically - composed to build different asynchronous communication paradigms: - message-passing, event-reaction, publish-subscribe, ... Dynamicity and - composition are greatly eased by the use of the Fractal component model. -
- NOAH - Noah is a framework in which software - entities can communicate without knowing their interlocutors. - Indeed, the implantation code of entities does not need to reference - others entities they interact with. As the communication is abstracted - away (via the ISL language), Noah offers interoperability. On another - hand, Noah can be thought as a dynamic aspect repository with a weaver - using an aspect composition mechanism to ensure commutable and - associative adaptations. -
- Nowadays Noah makes Java RMI objects, EJB and .Net components interact - together. We are currently working on an extension so as to take into - account fractal components. A Fractal component will only have to use - a specific controller that manages component interactions to be - Noah-compliant. Due to the externalization of component communication, - one will not need to use "container" controller anymore for primitive - components and one will be able to make a Fractal component cooperate - with others software entities. -
- SATIN - The SATIN (SAfety model for componenT adaptatIoNs) - project follows the MDA recommendation. Indeed, safety properties - (assembly and behavior composition consistency, semantic of use - preservation, global properties such as deadlock or divergence, ...) - are defined and proven at a meta level that identifies the key elements - implied in the process of component adaptation. Then, the properties - proofs validated on the meta level ensure that no bugs will appear at - runtime after an adaptation has occurred in specific component models - where properties proofs are projected. -
- We are currently looking at projections into Noah, Fractal/Julia and - Sofa frameworks. As the structure of the Julia model differs on many - points from the Satin model, we target Julia to determine to what - extent the Satin model has the right level of abstraction and is - reusable. On the other hand, this work will provide and assess the - safeness of Julia adaptations. -
- -
- - -
diff --git a/web/xml/root/workplan.xml b/web/xml/root/workplan.xml deleted file mode 100644 index 29de0897dd790c090437213ba6c97c097c9a5262..0000000000000000000000000000000000000000 --- a/web/xml/root/workplan.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - Fractal team - Workplan - workplan.xml - . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ThemeTargetTime FrameResponsible
Components distribution (Fractal & Jonathan)Fractal Core
Components passivation (state management)Fractal Core
Consistance of components reconfigurationFractal Core
Configuration continuum & optimisationFractal/Julia
JMX instrumentationFractal Administration Extensions
Development of an administration consoleFractal Administration Extensions
- -
- - - -
    -
  • - Fix underspecified issues in Fractal 1.0 specification (see Appendix - C of the specification document).
  • -
- -
- -