diff --git a/fractaladl/toolchain/.classpath b/.classpath similarity index 100% rename from fractaladl/toolchain/.classpath rename to .classpath diff --git a/fractaladl/toolchain/.project b/.project similarity index 100% rename from fractaladl/toolchain/.project rename to .project diff --git a/fractaladl/toolchain/README.txt b/README.txt similarity index 100% rename from fractaladl/toolchain/README.txt rename to README.txt diff --git a/README_MAVEN.txt b/README_MAVEN.txt deleted file mode 100644 index 5d6ee229c3956cf2d5e92e20349020d5cbbd69cf..0000000000000000000000000000000000000000 --- a/README_MAVEN.txt +++ /dev/null @@ -1,151 +0,0 @@ -############################################################### -!! How to use Fractal Maven artifacts in your 3rd party project -############################################################### - -Add the following in your pom.xml - - - - - - - objectweb-release - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2 - - true - - - false - - - - objectweb-snapshot - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2-snapshot - - false - - - true - daily - - - - - - - objectweb-release - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2 - - true - - - false - - - - objectweb-snapshot - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2-snapshot - - false - - - true - daily - - - - - - - - -#################################################################### -!! How to setup the environment to develop a Fractal sub-project -!! that you have checkout from the SVN -#################################################################### - -If you want to just check out a single Fractal sub project (i.e. "julia") and wants to work on it, -you need to put this (once and forever) in your .m2/settings.xml: - - - - - - - objectweb - - - objectweb-release - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2 - - true - - - false - - - - objectweb-snapshot - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2-snapshot - - false - - - true - daily - - - - - - - objectweb-release - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2 - - true - - - false - - - - objectweb-snapshot - ObjectWeb Maven Repository - http://maven.objectweb.org/maven2-snapshot - - false - - - true - daily - - - - - - - - - objectweb - - - - - - -################################################################## -################################################################## - -For other informations have a look at the Fractal Web Site: - http://fractal.objectweb.org/maven.html - diff --git a/aokell/.classpath b/aokell/.classpath deleted file mode 100644 index d9dd09048d0cee3ab8b6b485a5aaa88f1b53abfa..0000000000000000000000000000000000000000 --- a/aokell/.classpath +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/.project b/aokell/.project deleted file mode 100644 index 388ecf04a13f6390ef0473f28dde5ea348bf34e9..0000000000000000000000000000000000000000 --- a/aokell/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - aokell - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/aokell/LICENCE.txt b/aokell/LICENCE.txt deleted file mode 100644 index 0b7830fc50305a98341ccd7fc2d80bceb1ca2280..0000000000000000000000000000000000000000 --- a/aokell/LICENCE.txt +++ /dev/null @@ -1,22 +0,0 @@ -============================================================================ -AOKell -Copyright (C) 2005-2006 INRIA, France Telecom, USTL - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact: Lionel.Seinturier@lifl.fr - -Author: Lionel Seinturier -============================================================================ diff --git a/aokell/README-binary.txt b/aokell/README-binary.txt deleted file mode 100644 index a6f769b61a037939c127d8333e3c7dfd20956692..0000000000000000000000000000000000000000 --- a/aokell/README-binary.txt +++ /dev/null @@ -1,72 +0,0 @@ -============================================================================ -AOKell -Copyright (C) 2005-2006 INRIA, France Telecom, USTL - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact: Lionel.Seinturier@lifl.fr - -Author: Lionel Seinturier -============================================================================ - - -AOKell 2.0 Binary Distribution -------------------------------- - -AOKell is the INRIA and France Telecom implementation of the Fractal -specifications. AOKell is a free software distributed under the terms of the -GNU Lesser General Public license. AOKell is written in Java. - - -Table of content ----------------- - 1. Requirements - 2. Running the examples distributed with AOKell - - -1. Requirements ---------------- -The following software is required to run and use AOKell: - - J2SE >= 1.5 - - Ant >= 1.6 - -If you want to customize the AOKell framework, please download the source -distribution. - - -2. Running the examples distributed with AOKell ------------------------------------------------ -Several examples are distributed with AOKell. The source code of these examples -is located under the examples/ directory. The list of available examples -follows. - - - helloworld: Hello world - - comanche: The comanche web server - - - bench: JACBenchmark application - - benchsep: a second version of the JACBenchmark application - - collection: A simple example with auto-binding components - - estore: A simple example with collection interfaces - - -To run the examples, type (xxx is the example name): - cd examples/xxx - ant execute - -Typying simply "ant" in the example directory displays a short description of -the example. - - -For any question concerning AOKell, please contact Lionel.Seinturier@lifl.fr diff --git a/aokell/README.txt b/aokell/README.txt deleted file mode 100644 index 21415f106e9fe7cce8fc653df3da2293ffd13df9..0000000000000000000000000000000000000000 --- a/aokell/README.txt +++ /dev/null @@ -1,155 +0,0 @@ -============================================================================ -AOKell -Copyright (C) 2005-2006 INRIA, France Telecom, USTL - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact: Lionel.Seinturier@lifl.fr - -Author: Lionel Seinturier -============================================================================ - - -AOKell 2.0 Source Distribution ------------------------------- - -AOKell is the INRIA and France Telecom implementation of the Fractal -specifications. AOKell is a free software distributed under the terms of the -GNU Lesser General Public license. AOKell is written in Java. - - -Table of content ----------------- - 1. Requirements - 2. Compiling AOKell - 3. Running the examples distributed with AOKell - 4. Software included with AOKell - 5. The feature mechanism - 6. Note on AspectJ - - -1. Requirements ---------------- -The following software is required to compile, run and use AOKell: - - J2SE >= 1.5 (1.4 if AspectJ is used instead of Spoon - see below) - - Ant 1.6.x (1.7.x is not supported) - - -2. Compiling AOKell -------------------- -When compiling AOKell, the following directories come into play: - - src/ the main source files of AOKell - config/ some .jar files needed to compile AOKell - externals/ some .jar files needed to compile and run AOKell - features/ some additional source modules - - output/build/ the directory where .class files are stored - -To compile AOKell, from the root directory where AOKell has been installed, -type: - ant compile - - -3. Running the examples distributed with AOKell ------------------------------------------------ -Several examples are distributed with AOKell. The source code of these examples -is located under the src/examples/ directory. The list of available examples -follows. - - - helloworld: Hello world - - comanche: The comanche web server - - - bench: JACBenchmark application - - benchsep: a second version of the JACBenchmark application - - collection: A simple example with auto-binding components - - estore: A simple example with collection interfaces - - -To run the examples, type (xxx is the example name): - ant examples - cd output/dist/examples/xxx - ant execute - -Typying simply "ant" in the example directory displays a short description of -the example. - - -4. Software included with AOKell --------------------------------- -AOKell includes the following software: - - - ASM 2.2 - - AspectJ 1.2.1 - - Fractal API 2 - - Fractal ADL 2 - - Spoon 1.0 - - -5. The feature mechanism ------------------------- -The AOKell framework is decomposed in modules called features. -The purpose of this decomposition is to introduce some degrees of variability in -the framework and to let developers change the implementation of these features. - -Different implementations of these features are provided with AOKell. While a -default implementation is provided for each feature, the developer can still -choose an alternative version or provide her/his own version by configuring the -properties defined in the build.properties file and recompiling AOKell. - -The list of available features and their values follows: - -- fcinterface: generation of Fractal interfaces - - rt (default): Fractal interfaces are generated at run-time with ASM - - ct: Fractal interfaces are precompiled - -- glue: gluing the control and the content - - spoon (default): the glue is implemented with Spoon processors - - aspectj: the glue is implemented with AspectJ aspects - -- loggable: logging Fractal components - - off (default) - - on - -- membrane: control membrane implementation - - oo (default): membranes are sets of objects - - comp: control membranes are componentized - -- platform: deals with the targeted Java platform (J2SE or J2ME) - - j2se (default): a standard J2SE platform - - j2me-cdc: a J2ME CDC compliant platform - - j2me-cldc: a J2ME CLDC compliant platform such as the KVM - - -6. Note on AspectJ ------------------- -When the glue feature is configured with the aspectj value, the aspect-oriented -language AspectJ is used. For this purpose, the AOKell distribution includes -version 1.2.1 of AspectJ. See http://www.eclipse.org/aspectj for further -details on AspectJ. - -When programming new applications, if you intend to use another version of -AspectJ (especially a newer one), you will have to recompile AOKell with *your* -version of AspectJ. This is due to versioning incompatibilities between AspectJ -releases, i.e. your code compiled with another version of AspectJ won't work -with the .jar files of AOKell compiled with AspectJ 1.2.1. - -This case may also occur if you are using a plug-in such as the AJDT (see -http://www.eclipse.org/ajdt) AspectJ plug-in for Eclipse which embeds its own -version of the AspectJ compiler. It is recommended to recompile AOKell with the -version of AspectJ provided by the plug-in. - - -For any question concerning AOKell, please contact Lionel.Seinturier@lifl.fr diff --git a/aokell/archive/aokell-component.mf b/aokell/archive/aokell-component.mf deleted file mode 100644 index bf9b6265d56d10b492464ac2b556567147072004..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-component.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "AOKell Components" -Implementation-Version: "2.0" -Implementation-Vendor: "INRIA - France Telecom" - diff --git a/aokell/archive/aokell-component.xml b/aokell/archive/aokell-component.xml deleted file mode 100644 index 1c7a05a395ba5b9024d8e17378d929c777628f95..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-component.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/archive/aokell-glue.mf b/aokell/archive/aokell-glue.mf deleted file mode 100644 index dfa934eec505dbab691a91c7481660ad8eba68ea..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-glue.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "AOKell Glue" -Implementation-Version: "2.0" -Implementation-Vendor: "INRIA - France Telecom" - diff --git a/aokell/archive/aokell-glue.xml b/aokell/archive/aokell-glue.xml deleted file mode 100644 index ac1ab83c24d07e645d9568c3bc08ef6400a7718b..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-glue.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/archive/aokell-lib.xml b/aokell/archive/aokell-lib.xml deleted file mode 100644 index 102ac9712741628cc6ac1fccbf8f4b2edbc52ead..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-lib.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/archive/aokell-src.mf b/aokell/archive/aokell-src.mf deleted file mode 100644 index 76ee371ca42972cb9ec81908b05c7e6a0330f78e..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-src.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "AOKell Source Files" -Implementation-Version: "2.0" -Implementation-Vendor: "INRIA - France Telecom" - diff --git a/aokell/archive/aokell-src.xml b/aokell/archive/aokell-src.xml deleted file mode 100644 index 8af1c1e3a1b156aa5803b7b3746f376946b9f483..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-src.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/archive/aokell-tools.mf b/aokell/archive/aokell-tools.mf deleted file mode 100644 index e3615a789fe30aa9eda33a6dc9d12b7ddf1c1b55..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-tools.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "AOKell Tools" -Implementation-Version: "2.0" -Implementation-Vendor: "INRIA - France Telecom" - diff --git a/aokell/archive/aokell-tools.xml b/aokell/archive/aokell-tools.xml deleted file mode 100644 index c3d736939937891c038f8e83a0366f842100ce49..0000000000000000000000000000000000000000 --- a/aokell/archive/aokell-tools.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - diff --git a/aokell/archive/julia-api.mf b/aokell/archive/julia-api.mf deleted file mode 100644 index 46011ccc060e0a825362260323a648b7e7ee0304..0000000000000000000000000000000000000000 --- a/aokell/archive/julia-api.mf +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Implementation-Title: "Julia API" -Implementation-Version: "2.1.3" -Implementation-Vendor: "France Telecom" - diff --git a/aokell/archive/julia-api.xml b/aokell/archive/julia-api.xml deleted file mode 100644 index 8739c5241279d3d924395d22c415b9dd7cab6386..0000000000000000000000000000000000000000 --- a/aokell/archive/julia-api.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/build-binary.xml b/aokell/build-binary.xml deleted file mode 100644 index 472840952b6a81db1a6682c1c89aad5da3a0f709..0000000000000000000000000000000000000000 --- a/aokell/build-binary.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/build.properties b/aokell/build.properties deleted file mode 100644 index 9a4a2c6a96d76226374ec6a96af077eeab6aeb5a..0000000000000000000000000000000000000000 --- a/aokell/build.properties +++ /dev/null @@ -1,88 +0,0 @@ -============================================================================ -AOKell -Copyright (C) 2005-2006 INRIA, France Telecom, USTL - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact: Lionel.Seinturier@lifl.fr - -Author: Lionel Seinturier -============================================================================ - -product.name AOKell -product.version 2.0 - - -# --------------- -# AOKell features -# --------------- - -# The fcinterface feature determines the way Fractal interface instances are -# generated. Fractal interfaces may be generated at run-time with ASM (which -# is the default case), or Fractal interfaces may be pre-compiled. -# Uncomment the following property for the version of AOKell with pre-compiled -# interfaces (the pre-compiler is -# org.objectweb.fractal.aokell.lib.tools.interf.InterfaceGenerator). - -# feature.fcinterface.ct true - -# The glue feature determines which solution is used to glue components with -# the control level. The glue may be performed with AspectJ or with Spoon -# (which is the default case). -# Uncomment the following property to use AspectJ. - -# feature.glue.aspectj true - -# The membrane feature determines the way control membrane are implemented. -# Control membranes may be implemented with objects (which is the default -# case), or control membranes may be implemented with components. -# Uncomment the following property for using the version of AOKell with -# componentized membranes. - -# feature.membrane.comp true - -# The loggable feature determines whether primitive components are equipped -# with a monolog logger or not (which is the default case). -# Uncomment the following property for using primitive components equipped -# with a monolog logger. - -# feature.loggable.on true - -# The platform feature determines the targeted Java platform. The platform may -# be J2SE (which is the default case), J2ME with the CDC configuration or J2ME -# with the CLDC configuration. Information on the CDC and CLDC configurations of -# J2ME may found on http://java.sun.com/j2me/ -# Uncomment one of the following lines for generating a J2ME (CDC or CLDC) -# compliant version of AOKell. - -# feature.platform j2me-cdc -# feature.platform j2me-cldc - - -# ----------------- -# Common properties -# ----------------- - -# Library paths - -objectweb.ant.tasks.path ${basedir}/config/ow_util_ant_tasks.jar -junit.path ${basedir}/test/lib/junit.jar - -# URLs of external Javadocs - -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 -aspectjrt.url http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api diff --git a/aokell/build.xml b/aokell/build.xml deleted file mode 100644 index d06789db6d85783963f9149975762c704a4813eb..0000000000000000000000000000000000000000 --- a/aokell/build.xml +++ /dev/null @@ -1,520 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/config/README.txt b/aokell/config/README.txt deleted file mode 100644 index 4978babb44fb4f93c7d819e50bedad09c7086b79..0000000000000000000000000000000000000000 --- a/aokell/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/aokell/config/ow_util_ant_tasks.jar b/aokell/config/ow_util_ant_tasks.jar deleted file mode 100644 index 4a502465e2d690a80931068d96563d895d9cb5b5..0000000000000000000000000000000000000000 Binary files a/aokell/config/ow_util_ant_tasks.jar and /dev/null differ diff --git a/aokell/doc/javadoc/examples/ALoggerController.aj b/aokell/doc/javadoc/examples/ALoggerController.aj deleted file mode 100644 index 88e99516a1a05df779b51925d4c6ea4260c99f9b..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/ALoggerController.aj +++ /dev/null @@ -1,86 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -/** - * This aspect introduces the features provided by the logger controller. - * These features are introduced for all classes that implement the - * LoggerType marker interface. - * - * @author Lionel Seinturier - */ - -import aokell.dream.lib.control.logger.LoggerControllerItf; -import aokell.dream.lib.membrane.marker.LoggerType; -import aokell.lib.util.MFractalHelper; - -import org.objectweb.dream.control.logger.Loggable; - -public aspect ALoggerController { - - // ----------------------------------------------------------- - // Introduction of the LoggerController interface - // Delegate calls to an instance - // ----------------------------------------------------------- - - public void LoggerType.setBaseName(String name) { - LoggerControllerItf _loggerc = (LoggerControllerItf) MFractalHelper.lookupFcController(getFcMembrane(),"logger-controller"); - _loggerc.setBaseName(name); - } - - public String LoggerType.getBaseName() { - LoggerControllerItf _loggerc = (LoggerControllerItf) MFractalHelper.lookupFcController(getFcMembrane(),"logger-controller"); - return _loggerc.getBaseName(); - } - - public int LoggerType.getLoggerLevel(String loggerName) { - LoggerControllerItf _loggerc = (LoggerControllerItf) MFractalHelper.lookupFcController(getFcMembrane(),"logger-controller"); - return _loggerc.getLoggerLevel(loggerName); - } - - public void LoggerType.setLoggerLevel(String loggerName, int level) { - LoggerControllerItf _loggerc = (LoggerControllerItf) MFractalHelper.lookupFcController(getFcMembrane(),"logger-controller"); - _loggerc.setLoggerLevel(loggerName,level); - } - - public String[] LoggerType.getLoggerNames() { - LoggerControllerItf _loggerc = (LoggerControllerItf) MFractalHelper.lookupFcController(getFcMembrane(),"logger-controller"); - return _loggerc.getLoggerNames(); - } - - // ----------------------------------------------------------- - // Introduction of the LoggerControllerRegister interface - // ----------------------------------------------------------- - - public void LoggerType.register(String loggerName, Loggable loggable) { - LoggerControllerItf _loggerc = (LoggerControllerItf) MFractalHelper.lookupFcController(getFcMembrane(),"logger-controller"); - _loggerc.register(loggerName,loggable); - } - - public void LoggerType.unregiser(String loggerName, Loggable loggable) { - LoggerControllerItf _loggerc = (LoggerControllerItf) MFractalHelper.lookupFcController(getFcMembrane(),"logger-controller"); - _loggerc.unregiser(loggerName,loggable); - } - -} diff --git a/aokell/doc/javadoc/examples/BasicLoggerControllerImpl.java b/aokell/doc/javadoc/examples/BasicLoggerControllerImpl.java deleted file mode 100644 index f0e04e08778585c5de557fa1e2feb4204d6b7490..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/BasicLoggerControllerImpl.java +++ /dev/null @@ -1,298 +0,0 @@ -/** - * Dream - * Copyright (C) 2003-2004 INRIA Rhone-Alpes - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: dream@objectweb.org - * - * Initial developer(s): Matthieu Leclercq - * Contributor(s): Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.dream.lib.control.logger; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.objectweb.dream.control.logger.Loggable; -import org.objectweb.dream.control.logger.LoggerControllerRegister; -import org.objectweb.dream.control.logger.Util; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Type; -import org.objectweb.util.monolog.Monolog; -import org.objectweb.util.monolog.api.BasicLevel; -import org.objectweb.util.monolog.api.Logger; - -import org.objectweb.fractal.aokell.lib.control.CloneCtrlException; -import org.objectweb.fractal.aokell.lib.control.Controller; -import org.objectweb.fractal.aokell.lib.membrane.Membrane; - -/** - * Basic implementation of logger controller. A "monolog-conf-file" - * initialisation parameter can be set to specify the location of the monolog - * configuration file. - */ -public class BasicLoggerControllerImpl - implements LoggerControllerItf, Controller -{ - - String baseName; - - /** Map associating logger name and list of registred loggables */ - Map registrations; - /** Map associating logger name and logger instance */ - Map loggers; - Logger baseLogger; - - - public BasicLoggerControllerImpl() { - initFcController(); - } - - private void initFcController() { - - String monologConfFile = "etc/monolog.properties"; - if (Monolog.monologFactory == Monolog.getDefaultMonologFactory()) - { - Monolog.getMonologFactory(monologConfFile); - } - - baseName = Util.getNextUnnamedBaseName(); - registrations = new HashMap(); - loggers = new HashMap(); - } - - // ------------------------------------------------------------------------- - // Fields and methods added and overriden by the mixin class - // ------------------------------------------------------------------------- - - /** - * @see LoggerControllerItf#getBaseName() - */ - public String getBaseName() - { - return baseName; - } - - /** - * @see LoggerControllerItf#setBaseName(String) - */ - public void setBaseName(String name) - { - this.baseName = name; - baseNameChanged(); - } - - /** - * @see LoggerControllerItf#getLoggerLevel(String) - */ - public int getLoggerLevel(String loggerName) - { - Logger l = (Logger) loggers.get(loggerName); - if (l == null) - { - if (loggerName == null) - { - if (baseLogger == null) - { - baseLogger = Monolog.monologFactory.getLogger(baseName); - } - l = baseLogger; - } - else - { - return INHERIT; - } - } - int i = l.getCurrentIntLevel(); - if (i == BasicLevel.DEBUG) - return DEBUG; - if (i == BasicLevel.INFO) - return INFO; - if (i == BasicLevel.WARN) - return WARN; - if (i == BasicLevel.ERROR) - return ERROR; - if (i == BasicLevel.FATAL) - return FATAL; - if (i == BasicLevel.INHERIT) - return INHERIT; - throw new IllegalStateException("Unknown logger level : " + i); - } - - /** - * @see LoggerControllerItf#setLoggerLevel(String, int) - */ - public void setLoggerLevel(String loggerName, int level) - { - Logger l = (Logger) loggers.get(loggerName); - if (l == null) - { - if (loggerName == null) - { - if (baseLogger == null) - { - baseLogger = Monolog.monologFactory.getLogger(baseName); - } - l = baseLogger; - } - else - { - return; - } - } - switch (level) - { - case DEBUG : - l.setLevel(BasicLevel.LEVEL_DEBUG); - break; - case INFO : - l.setLevel(BasicLevel.LEVEL_INFO); - break; - case WARN : - l.setLevel(BasicLevel.LEVEL_WARN); - break; - case ERROR : - l.setLevel(BasicLevel.LEVEL_ERROR); - break; - case FATAL : - l.setLevel(BasicLevel.LEVEL_FATAL); - break; - case INHERIT : - l.setLevel(BasicLevel.LEVEL_INHERIT); - break; - default : - throw new IllegalArgumentException("Unknown level " + level); - } - } - - /** - * @see LoggerControllerItf#getLoggerNames() - */ - public String[] getLoggerNames() - { - return (String[]) loggers.keySet().toArray(new String[loggers.size()]); - } - - /** - * @see LoggerControllerRegister#register(String, Loggable) - */ - public void register(String loggerName, Loggable loggable) - { - Set s = (Set) registrations.get(loggerName); - if (s == null) - { - s = new HashSet(); - registrations.put(loggerName, s); - } - s.add(loggable); - giveLogger(loggerName, loggable); - } - - /** - * @see LoggerControllerRegister#unregiser(String, Loggable) - */ - public void unregiser(String loggerName, Loggable loggable) - { - Set s = (Set) registrations.get(loggerName); - if (s == null) - { - return; - } - s.remove(loggable); - if (s.isEmpty()) - { - // no more registration for this logger, remove reference to it, for - // garbage collector - registrations.remove(loggerName); - loggers.remove(loggerName); - } - } - - // --------------------------------------------------------------------------- - // Utility methods - // --------------------------------------------------------------------------- - - void baseNameChanged() - { - loggers.clear(); - Iterator iter = registrations.entrySet().iterator(); - while (iter.hasNext()) - { - Map.Entry entry = (Map.Entry) iter.next(); - String loggerName = (String) entry.getKey(); - Set loggables = (Set) entry.getValue(); - Iterator iter2 = loggables.iterator(); - while (iter2.hasNext()) - { - Loggable loggable = (Loggable) iter2.next(); - giveLogger(loggerName, loggable); - } - } - } - - void giveLogger(String loggerName, Loggable loggable) - { - Logger logger = (Logger) loggers.get(loggerName); - if (logger == null) - { - String name; - if (loggerName == null) - { - name = baseName; - } - else - { - name = baseName + "." + loggerName; - } - logger = Monolog.monologFactory.getLogger(name); - loggers.put(loggerName, logger); - } - loggable.setLogger(loggerName, logger); - } - - // -------------------------------------------------------------- - // Controller interface - // -------------------------------------------------------------- - - /** - * Initialize the controller. - * - * @param membrane the membrane which contains the controller - */ - public void initFcCtrl( Membrane membrane ) { - // Indeed nothing - } - - /** - * Clone the controller state from the current component to another one. - * This method may receive some hints on how to do this, or provide some - * hints on how this has been done. For instance, the hints may be a map - * that is read and/or written by the controller. The raison d'être of - * these hints is that when its state is cloned, a controller may produce - * results that are needed by other controllers. - * - * @param dst the destination component - * @param hints hints for performing the operation - */ - public void cloneFcCtrl( Component dst, Object hints ) - throws CloneCtrlException { - // Indeed nothing for the component controller - } -} diff --git a/aokell/doc/javadoc/examples/Controller.java b/aokell/doc/javadoc/examples/Controller.java deleted file mode 100644 index 39d513c8e7622b5cb1acf911647bdfc656af8939..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/Controller.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control; - -import org.objectweb.fractal.api.Component; - -/** - * Interface for defining a controller. - * - * @author Lionel Seinturier - */ -public interface Controller { - - /** - * Set the reference towards the component controller associated to this - * controller. - */ - public void setFcCompCtrl( Component compctrl ); - - /** - * Initialize the controller. - */ - public void initFcCtrl(); - - /** - * Clone the controller state from the current component to another one. - * This method may receive some hints on how to do this, or provide some - * hints on how this has been done. For instance, the hints may be a map - * that is read and/or written by the controller. The raison d'etre of - * these hints is that when its state is cloned, a controller may produce - * results that are needed by other controllers. - * - * @param dst the destination component - * @param hints hints for performing the operation - */ - public void cloneFcCtrl( Component dst, Object hints ) - throws CloneCtrlException; - -} diff --git a/aokell/doc/javadoc/examples/DreamLogType.java b/aokell/doc/javadoc/examples/DreamLogType.java deleted file mode 100644 index b0897d2e1a5a7f40765bf14f18ba84eaec86c60a..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/DreamLogType.java +++ /dev/null @@ -1,39 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.dream.lib.control.logger; - -import org.objectweb.fractal.aokell.lib.membrane.BaseType; - -/** - * Marker type for components with a Logger controller. - * - * @author Lionel Seinturier - */ -public interface DreamLogType - extends - BaseType, - LoggerType -{ - -} diff --git a/aokell/doc/javadoc/examples/LoggerController.fractal b/aokell/doc/javadoc/examples/LoggerController.fractal deleted file mode 100644 index 684397f0a77ebacf66dbe327db8e09d9b750120f..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/LoggerController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/doc/javadoc/examples/LoggerControllerItf.java b/aokell/doc/javadoc/examples/LoggerControllerItf.java deleted file mode 100644 index 3cd9c258f491a0bd3563659a6e80ab468e8e0b10..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/LoggerControllerItf.java +++ /dev/null @@ -1,50 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.dream.lib.control.logger; - -import org.objectweb.dream.control.logger.LoggerController; -import org.objectweb.dream.control.logger.LoggerControllerRegister; -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -import org.objectweb.fractal.api.type.InterfaceType; - -/** - * Unified interface for LoggerControllerRegister and LoggerController. - * Both interfaces are implemented by BasicLoggerControllerImpl. - * - * @author Lionel Seinturier - */ -public interface LoggerControllerItf - extends - LoggerController, - LoggerControllerRegister { - - final public static String NAME = "logger-controller"; - - final public static InterfaceType TYPE = - new InterfaceTypeImpl( - NAME, - LoggerControllerItf.class.getName(), - false, false, false); - -} diff --git a/aokell/doc/javadoc/examples/LoggerControllerProcessor.java b/aokell/doc/javadoc/examples/LoggerControllerProcessor.java deleted file mode 100644 index 57b83acadcd38afcb6be2803f2ff00604b218762..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/LoggerControllerProcessor.java +++ /dev/null @@ -1,53 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - - -import org.objectweb.fractal.aokell.lib.membrane.marker.NameType; - -import spoon.processing.AbstractProcessor; -import spoon.reflect.declaration.CtClass; -import spoon.template.Substitution; -import spoon.template.Template; - -/** - * This processor introduces the features provided by the name controller. - * These features are introduced for all classes that implement the NameType - * marker interface. - * - * @author Lionel Seinturier - */ -public class LoggerControllerProcessor extends AbstractProcessor { - - public boolean isToBeProcessed(CtClass ct) { - return SpoonHelper.impls(ct,DreamLogType.class); - } - - public void process(CtClass ct) { - Template t = new LoggerControllerTemplate(); - Substitution.insertAll(ct,t); - } - -} - diff --git a/aokell/doc/javadoc/examples/LoggerControllerTemplate.java b/aokell/doc/javadoc/examples/LoggerControllerTemplate.java deleted file mode 100644 index f24643987912134370581e8d00f96d348e2936cd..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/LoggerControllerTemplate.java +++ /dev/null @@ -1,99 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.api.Component; -import aokell.dream.lib.control.logger.LoggerControllerItf; - -import spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by LoggerControllerProcessor. - * - * @author Lionel Seinturier - */ -public class LoggerControllerTemplate implements Template, LoggerControllerItf { - - @Local - public LoggerControllerTemplate() {} - - @Local - private Component getFcComponent() { - return null; - } - - // ----------------------------------------------------------- - // LoggerController interface implementation - // ----------------------------------------------------------- - - public void setBaseName(String name) { - LoggerControllerItf _loggerc = (LoggerControllerItf) - FractalHelper.getFcInterface(getFcComponent(),"logger-controller"); - _loggerc.setBaseName(name); - } - - public String getBaseName() { - LoggerControllerItf _loggerc = (LoggerControllerItf) - FractalHelper.getFcInterface(getFcComponent(),"logger-controller"); - return _loggerc.getBaseName(); - } - - public int getLoggerLevel(String loggerName) { - LoggerControllerItf _loggerc = (LoggerControllerItf) - FractalHelper.getFcInterface(getFcComponent(),"logger-controller"); - return _loggerc.getLoggerLevel(loggerName); - } - - public void setLoggerLevel(String loggerName, int level) { - LoggerControllerItf _loggerc = (LoggerControllerItf) - FractalHelper.getFcInterface(getFcComponent(),"logger-controller"); - _loggerc.setLoggerLevel(loggerName,level); - } - - public String[] getLoggerNames() { - LoggerControllerItf _loggerc = (LoggerControllerItf) - FractalHelper.getFcInterface(getFcComponent(),"logger-controller"); - return _loggerc.getLoggerNames(); - } - - // ----------------------------------------------------------- - // LoggerControllerRegister interface implementation - // ----------------------------------------------------------- - - public void register(String loggerName, Loggable loggable) { - LoggerControllerItf _loggerc = (LoggerControllerItf) - FractalHelper.getFcInterface(getFcComponent(),"logger-controller"); - _loggerc.register(loggerName,loggable); - } - - public void unregiser(String loggerName, Loggable loggable) { - LoggerControllerItf _loggerc = (LoggerControllerItf) - FractalHelper.getFcInterface(getFcComponent(),"logger-controller"); - _loggerc.unregiser(loggerName,loggable); - } - -} diff --git a/aokell/doc/javadoc/examples/LoggerControllerType.fractal b/aokell/doc/javadoc/examples/LoggerControllerType.fractal deleted file mode 100644 index c189b137b9b7d81276108b79076bbad39c783474..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/LoggerControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/doc/javadoc/examples/Primitive.fractal b/aokell/doc/javadoc/examples/Primitive.fractal deleted file mode 100644 index 794eb4ef6cf2a0e4ef7749d677e73fb92c4c19d7..0000000000000000000000000000000000000000 --- a/aokell/doc/javadoc/examples/Primitive.fractal +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/doc/javadoc/examples/tutorial.zip b/aokell/doc/javadoc/examples/tutorial.zip deleted file mode 100644 index 99c449dada75c56d63dafbaede18bbc8f39a870b..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/examples/tutorial.zip and /dev/null differ diff --git a/aokell/doc/javadoc/figures/bootstrapComponent.jpg b/aokell/doc/javadoc/figures/bootstrapComponent.jpg deleted file mode 100644 index 6aa43cb819df09e64582df6720dc73cb482e543c..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/bootstrapComponent.jpg and /dev/null differ diff --git a/aokell/doc/javadoc/figures/componentStructure.jpg b/aokell/doc/javadoc/figures/componentStructure.jpg deleted file mode 100644 index d0dc7be89ee6a823dd6ae9095298d8b177328071..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/componentStructure.jpg and /dev/null differ diff --git a/aokell/doc/javadoc/figures/componentizedMembranes.jpg b/aokell/doc/javadoc/figures/componentizedMembranes.jpg deleted file mode 100644 index 4e6be46e6c7dc13b1a4fe1a1ef2ed3bbda0dfa80..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/componentizedMembranes.jpg and /dev/null differ diff --git a/aokell/doc/javadoc/figures/controlLayers.jpg b/aokell/doc/javadoc/figures/controlLayers.jpg deleted file mode 100644 index 3e47e567237c1c8e84d3dcfea8137486e155f399..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/controlLayers.jpg and /dev/null differ diff --git a/aokell/doc/javadoc/figures/flatMembrane.jpg b/aokell/doc/javadoc/figures/flatMembrane.jpg deleted file mode 100644 index 363ea78b85aea146403b1a6850fe8d9774618ef8..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/flatMembrane.jpg and /dev/null differ diff --git a/aokell/doc/javadoc/figures/markerTypeSystem.jpg b/aokell/doc/javadoc/figures/markerTypeSystem.jpg deleted file mode 100644 index 273cf0f8033c314f4dc92a3aba97f4587e88eb29..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/markerTypeSystem.jpg and /dev/null differ diff --git a/aokell/doc/javadoc/figures/packages.jpg b/aokell/doc/javadoc/figures/packages.jpg deleted file mode 100644 index baa2654fe3750580ef16748db8e44c0246ac287a..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/packages.jpg and /dev/null differ diff --git a/aokell/doc/javadoc/figures/twoLevels.jpg b/aokell/doc/javadoc/figures/twoLevels.jpg deleted file mode 100644 index 177f07d1921ea3ecee69476581faccbf740db06a..0000000000000000000000000000000000000000 Binary files a/aokell/doc/javadoc/figures/twoLevels.jpg and /dev/null differ diff --git a/aokell/examples-j2me-cldc/common/build.xml b/aokell/examples-j2me-cldc/common/build.xml deleted file mode 100644 index d100ead1722df8979a9fc34aa4e2fefb09231bf3..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/common/build.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/examples-j2me-cldc/helloworld/README.txt b/aokell/examples-j2me-cldc/helloworld/README.txt deleted file mode 100644 index 6d560545ff5cc09b0d30322985696f24da0f9d87..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/README.txt +++ /dev/null @@ -1,40 +0,0 @@ -This example shows how to program a simple Fractal application -with AOKell for the J2ME CLDC configuration. - -This example requires the KVM which can be downloaded on the Sun -site at: http://java.sun.com/javame/downloads/index.html - -To execute the example type: - ant compile - preverify.sh (.bat on Windows) - kvm.sh (.bat on Windows) - -The available Ant targets are: - compile: compile the example - help: display this help message - clean: clean the generated files - -When run, the example creates the following architecture: -- 1 root composite component -- 2 primitive components included in the root composite - - |--------------------------------------| - | | - | |--------| |--------| | -|-|-|--->|-| Client |-|--->|-| Server | | - | |--------| |--------| | - | | - |--------------------------------------| - -The server owns an interface with a method for displaying a message -and an attribute controller exporting two attributes: -- header: text to be printed before the message -- count: how many time the message must be printed - -When run, the program displays the following messages: - -CLIENT created -SERVER created -Server: begin printing... -->hello world -Server: print done. diff --git a/aokell/examples-j2me-cldc/helloworld/etc/execute.properties b/aokell/examples-j2me-cldc/helloworld/etc/execute.properties deleted file mode 100644 index 7b42a943357b4b106b4cf4619ceba034318b59aa..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/etc/execute.properties +++ /dev/null @@ -1,13 +0,0 @@ -# JVM arguments -run.jvm.parameters -Dfractal.provider=org.objectweb.fractal.aokell.AOKell - -# Java class to be launched -run.classname hw.kvm.Main - -# Application arguments -run.parameters - -# Java interfaces used as Fractal interfaces -# This property is only needed when compile-time generation of Fractal -# interfaces is used (fcinterface set to ct) -fcinterface.ct.parameters java.lang.Runnable hw.kvm.ServiceAttributes hw.kvm.Service diff --git a/aokell/examples-j2me-cldc/helloworld/files.lst b/aokell/examples-j2me-cldc/helloworld/files.lst deleted file mode 100644 index feba749b84d15a298068ce15448d4274431136ef..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/files.lst +++ /dev/null @@ -1 +0,0 @@ -hw.kvm.ClientImpl hw.kvm.Main hw.kvm.ServerImpl hw.kvm.Service hw.kvm.ServiceAttributes aokell.generated.hw.kvm.ServiceAttributesBoundableInterface aokell.generated.hw.kvm.ServiceAttributesImplementedInterface aokell.generated.hw.kvm.ServiceBoundableInterface aokell.generated.hw.kvm.ServiceImplementedInterface aokell.generated.java.lang.RunnableBoundableInterface aokell.generated.java.lang.RunnableImplementedInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerItfBoundableInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerItfImplementedInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.component.ComponentItfBoundableInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.component.ComponentItfImplementedInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.content.ContentControllerItfBoundableInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.content.ContentControllerItfImplementedInterface aokell.generated.org.objectweb.fractal.api.factory.FactoryBoundableInterface aokell.generated.org.objectweb.fractal.api.factory.FactoryImplementedInterface aokell.generated.org.objectweb.fractal.julia.factory.TemplateBoundableInterface aokell.generated.org.objectweb.fractal.julia.factory.TemplateImplementedInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleCoordinatorItfBoundableInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleCoordinatorItfImplementedInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.name.NameControllerItfBoundableInterface aokell.generated.org.objectweb.fractal.aokell.lib.control.name.NameControllerItfImplementedInterface aokell.generated.org.objectweb.fractal.julia.control.content.SuperControllerNotifierBoundableInterface aokell.generated.org.objectweb.fractal.julia.control.content.SuperControllerNotifierImplementedInterface aokell.generated.org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinatorBoundableInterface aokell.generated.org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinatorImplementedInterface aokell.generated.org.objectweb.fractal.api.control.BindingControllerBoundableInterface aokell.generated.org.objectweb.fractal.api.control.BindingControllerImplementedInterface aokell.generated.org.objectweb.fractal.api.factory.GenericFactoryBoundableInterface aokell.generated.org.objectweb.fractal.api.factory.GenericFactoryImplementedInterface aokell.generated.org.objectweb.fractal.api.type.TypeFactoryBoundableInterface aokell.generated.org.objectweb.fractal.api.type.TypeFactoryImplementedInterface org.objectweb.fractal.aokell.AOKell org.objectweb.fractal.aokell.AOKellMembranes org.objectweb.fractal.aokell.BasicMembranes org.objectweb.fractal.aokell.component.BootstrapComponentImpl org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerCloneableItf org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerImpl org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerItf$1 org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerItf org.objectweb.fractal.aokell.lib.control.binding.AbstractBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.BindingControllerDef$1 org.objectweb.fractal.aokell.lib.control.binding.BindingControllerDef org.objectweb.fractal.aokell.lib.control.binding.CompositeAutoBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.CompositeBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.CompositeTemplateBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.FlatBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.FlatTemplateBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.PrimitiveAutoBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.PrimitiveBindingControllerImpl org.objectweb.fractal.aokell.lib.control.binding.PrimitiveTemplateBindingControllerImpl org.objectweb.fractal.aokell.lib.control.CloneCtrlException org.objectweb.fractal.aokell.lib.control.component.ComponentDescItf org.objectweb.fractal.aokell.lib.control.component.ComponentImpl org.objectweb.fractal.aokell.lib.control.component.ComponentItf$1 org.objectweb.fractal.aokell.lib.control.component.ComponentItf org.objectweb.fractal.aokell.lib.control.component.ComponentSetterItf org.objectweb.fractal.aokell.lib.control.component.CompositeComponentImpl org.objectweb.fractal.aokell.lib.control.content.ContentControllerImpl org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf$1 org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf org.objectweb.fractal.aokell.lib.control.content.TemplateContentControllerImpl org.objectweb.fractal.aokell.lib.control.Controller org.objectweb.fractal.api.factory.Factory org.objectweb.fractal.julia.factory.Template org.objectweb.fractal.aokell.lib.control.factory.FactoryControllerImpl org.objectweb.fractal.aokell.lib.control.factory.FactoryDef$1 org.objectweb.fractal.aokell.lib.control.factory.FactoryDef org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator org.objectweb.fractal.aokell.lib.control.lifecycle.CompositeLifeCycleControllerImpl org.objectweb.fractal.aokell.lib.control.lifecycle.InvocationCounter org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleControllerDef org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleControllerDef$1 org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleCoordinatorItf org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleInterceptorItf org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleControllerImpl org.objectweb.fractal.aokell.lib.control.name.NameControllerImpl org.objectweb.fractal.aokell.lib.control.name.NameControllerItf$1 org.objectweb.fractal.aokell.lib.control.name.NameControllerItf org.objectweb.fractal.julia.control.content.SuperControllerNotifier org.objectweb.fractal.aokell.lib.control.superc.SuperControllerImpl org.objectweb.fractal.aokell.lib.control.superc.SuperControllerDef$1 org.objectweb.fractal.aokell.lib.control.superc.SuperControllerDef org.objectweb.fractal.aokell.lib.factory.GenericFactoryImpl org.objectweb.fractal.aokell.lib.factory.MembraneFactoryImpl org.objectweb.fractal.aokell.lib.factory.MembraneFactoryItf org.objectweb.fractal.aokell.lib.factory.TypeFactoryImpl org.objectweb.fractal.aokell.lib.interf.AOKellGeneratedItf org.objectweb.fractal.aokell.lib.interf.ClassDefinition org.objectweb.fractal.aokell.lib.interf.CompositeExtItfManager org.objectweb.fractal.aokell.lib.interf.CompositeIntItfManager org.objectweb.fractal.aokell.lib.interf.Delegator org.objectweb.fractal.aokell.lib.interf.FcItfImplHelper org.objectweb.fractal.aokell.lib.interf.InterfaceManager org.objectweb.fractal.aokell.lib.interf.PrimitiveExtItfManager org.objectweb.fractal.julia.ComponentInterface org.objectweb.fractal.aokell.lib.ComponentInterfaceImpl org.objectweb.fractal.aokell.lib.InterfaceImpl org.objectweb.fractal.aokell.lib.membrane.composite.CompositeTemplateType org.objectweb.fractal.aokell.lib.membrane.composite.CompositeType org.objectweb.fractal.aokell.lib.membrane.composite.ParametricCompositeTemplateType org.objectweb.fractal.aokell.lib.membrane.composite.ParametricCompositeType org.objectweb.fractal.aokell.lib.membrane.ControllerDef org.objectweb.fractal.aokell.lib.membrane.flat.FlatTemplateType org.objectweb.fractal.aokell.lib.membrane.flat.FlatType org.objectweb.fractal.aokell.lib.membrane.flat.ParametricFlatTemplateType org.objectweb.fractal.aokell.lib.membrane.flat.ParametricFlatType org.objectweb.fractal.aokell.lib.membrane.marker.BaseType org.objectweb.fractal.aokell.lib.membrane.marker.BindingType org.objectweb.fractal.aokell.lib.membrane.marker.ContentType org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleType org.objectweb.fractal.aokell.lib.membrane.marker.NameType org.objectweb.fractal.aokell.lib.membrane.marker.ParametricType org.objectweb.fractal.aokell.lib.membrane.marker.SuperType org.objectweb.fractal.aokell.lib.membrane.marker.TemplateType org.objectweb.fractal.aokell.lib.membrane.MembraneDef org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveTemplateType org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveType org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveTemplateType org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType org.objectweb.fractal.aokell.lib.type.ComponentTypeImpl org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl org.objectweb.fractal.aokell.lib.util.FractalHelper org.objectweb.fractal.aokell.lib.util.LoggableHelper org.objectweb.fractal.aokell.lib.util.MembraneHelper org.objectweb.fractal.aokell.lib.util.PlatformHelper org.objectweb.fractal.aokell.Membranes org.objectweb.fractal.api.Component org.objectweb.fractal.api.control.AttributeController org.objectweb.fractal.api.control.BindingController org.objectweb.fractal.api.control.ContentController org.objectweb.fractal.api.control.IllegalBindingException org.objectweb.fractal.api.control.IllegalContentException org.objectweb.fractal.api.control.IllegalLifeCycleException org.objectweb.fractal.api.control.LifeCycleController org.objectweb.fractal.api.control.NameController org.objectweb.fractal.api.control.SuperController org.objectweb.fractal.api.factory.Factory org.objectweb.fractal.api.factory.GenericFactory org.objectweb.fractal.api.factory.InstantiationException org.objectweb.fractal.api.Fractal org.objectweb.fractal.api.Interface org.objectweb.fractal.api.NoSuchInterfaceException org.objectweb.fractal.api.type.ComponentType org.objectweb.fractal.api.type.InterfaceType org.objectweb.fractal.api.type.TypeFactory org.objectweb.fractal.api.Type org.objectweb.fractal.util.BindingControllerHelper org.objectweb.fractal.util.ComponentHelper org.objectweb.fractal.util.ContentControllerHelper org.objectweb.fractal.util.Fractal spoon.jdiet.java14.cldc.rt.Helper spoon.jdiet.java14.cldc.rt.MapEntryImpl \ No newline at end of file diff --git a/aokell/examples-j2me-cldc/helloworld/kvm.bat b/aokell/examples-j2me-cldc/helloworld/kvm.bat deleted file mode 100644 index e3e9d04d0e2b13d1e6ef5b92ef57bc14257811f6..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/kvm.bat +++ /dev/null @@ -1 +0,0 @@ -kvm.exe -classpath build4kvm hw.kvm.Main \ No newline at end of file diff --git a/aokell/examples-j2me-cldc/helloworld/kvm.sh b/aokell/examples-j2me-cldc/helloworld/kvm.sh deleted file mode 100644 index 6322c6399ea08e8ba2bd17fa933c8af957e8f345..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/kvm.sh +++ /dev/null @@ -1 +0,0 @@ -kvm -classpath build4kvm hw.kvm.Main \ No newline at end of file diff --git a/aokell/examples-j2me-cldc/helloworld/preverify.bat b/aokell/examples-j2me-cldc/helloworld/preverify.bat deleted file mode 100644 index bd9d0420c0301a36caaf573bd92d99265029d1c2..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/preverify.bat +++ /dev/null @@ -1 +0,0 @@ -preverify.exe -d build4kvm -classpath build;..\..\externals\cldc-1.1.jar;..\..\externals\fractal.jar;..\..\externals\jdiet-rt-20060719.jar;..\..\lib\aokell-lib-2.0.jar;..\..\lib\aokell-component-2.0.jar;..\..\lib\julia-api.jar;..\..\externals\fractal-util-j2me.jar @files.lst \ No newline at end of file diff --git a/aokell/examples-j2me-cldc/helloworld/preverify.sh b/aokell/examples-j2me-cldc/helloworld/preverify.sh deleted file mode 100644 index a81356053f47b86915ccc9829f6dabdef7e96fa3..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/preverify.sh +++ /dev/null @@ -1 +0,0 @@ -preverify -d build4kvm -classpath build:../../externals/cldc-1.1.jar:../../externals/fractal.jar:../../externals/jdiet-rt-20060719.jar:../../lib/aokell-lib-2.0.jar:../../lib/aokell-component-2.0.jar:../../lib/julia-api.jar:../../lib/fractal-util.jar @files.lst \ No newline at end of file diff --git a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ClientImpl.java b/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ClientImpl.java deleted file mode 100644 index 9661342032094855e4d44bdf6bf707e0694b072b..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ClientImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package hw.kvm; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - - -public class ClientImpl implements Runnable { - - public ClientImpl () { - System.err.println("CLIENT created"); - } - - public void run () { - Service service = null; - try { - service = (Service) ((BindingController)this).lookupFc("s"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - service.print("hello world"); - } - -} diff --git a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/Main.java b/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/Main.java deleted file mode 100644 index 32f3fcbc1f085fcea35a01fc4aa773e8cc621cf1..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/Main.java +++ /dev/null @@ -1,138 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package hw.kvm; - -import org.objectweb.fractal.aokell.AOKell; -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 Main { - - public static void main(String[] args) { - - /* - * Contrary to the jvm, the kvm does not by default displays the stack - * trace when the main method throws an exception. - */ - try - { - mmain(args); - } - catch (Throwable t) - { - t.printStackTrace(); - } - } - - public static void mmain(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Get the bootstrap component and factories - // ---------------------------------------------------------- -// Component boot = Fractal.getBootstrapComponent(); - Component boot = new AOKell().newFcInstance(); - TypeFactory tf = Fractal.getTypeFactory(boot); - GenericFactory cf = Fractal.getGenericFactory(boot); - - // ---------------------------------------------------------- - // Create the component types - // ---------------------------------------------------------- - ComponentType rType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType( - "m", - "java.lang.Runnable", - false, // server interface - false, // mandatory - false) // singleton - }); - - ComponentType cType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "java.lang.Runnable", false, false, false), - tf.createFcItfType("s", Service.class.getName(), true, false, false) - }); - ComponentType sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", Service.class.getName(), false, false, false), - tf.createFcItfType( - "attribute-controller", - ServiceAttributes.class.getName(), - false, - false, - false) - }); - - // ---------------------------------------------------------- - // Instantiate and initialize the components - // ---------------------------------------------------------- - Component rComp = cf.newFcInstance( - rType, - "composite", - null); - - Component cComp = cf.newFcInstance(cType, "primitive", ClientImpl.class.getName()); - Component sComp = cf.newFcInstance(sType, "parametricPrimitive", ServerImpl.class.getName()); - - - ServiceAttributes sa = (ServiceAttributes) - Fractal.getAttributeController(sComp); - sa.setHeader("->"); - sa.setCount(1); - - // ---------------------------------------------------------- - // Set component names - // ---------------------------------------------------------- - Fractal.getNameController(rComp).setFcName("root"); - Fractal.getNameController(cComp).setFcName("client"); - Fractal.getNameController(sComp).setFcName("server"); - - // ---------------------------------------------------------- - // Add the Client and Server components in the Root composite - // ---------------------------------------------------------- - Fractal.getContentController(rComp).addFcSubComponent(cComp); - Fractal.getContentController(rComp).addFcSubComponent(sComp); - - // ---------------------------------------------------------- - // Create bindings - // ---------------------------------------------------------- - Fractal.getBindingController(rComp).bindFc("m", cComp.getFcInterface("m")); - Fractal.getBindingController(cComp).bindFc("s", sComp.getFcInterface("s")); - - // ---------------------------------------------------------- - // Start the Root component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(rComp).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - Runnable mainItf = (Runnable)rComp.getFcInterface("m"); - mainItf.run(); - } -} diff --git a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ServerImpl.java b/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ServerImpl.java deleted file mode 100644 index de84b7a9e52513312f6b811f85c5a66c24aeb162..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ServerImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ -package hw.kvm; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header; - - private int count; - - public ServerImpl () { - System.err.println("SERVER created"); - } - - public void print (final String msg) { - 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/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/Service.java b/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/Service.java deleted file mode 100644 index 94f1c34c20f2dc43fd63e5508c315d6750e4c024..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package hw.kvm; - -public interface Service { - void print (String msg); -} diff --git a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ServiceAttributes.java b/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ServiceAttributes.java deleted file mode 100644 index d4331568876440c99300783bca90237aa3740ef4..0000000000000000000000000000000000000000 --- a/aokell/examples-j2me-cldc/helloworld/src/hw/kvm/ServiceAttributes.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package hw.kvm; - -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/aokell/examples/bench/README.txt b/aokell/examples/bench/README.txt deleted file mode 100644 index 4aac175f9ef1d8de61374430d6be772c17503b2a..0000000000000000000000000000000000000000 --- a/aokell/examples/bench/README.txt +++ /dev/null @@ -1,40 +0,0 @@ -This example implements a benchmark suite to measure the cost of -programming components with AOKell. - -To execute the example type: - ant execute - -The available Ant targets are: - compile: compile the example - execute: execute the example - help: display this help message - clean: clean the generated files - -When run, the example creates the following components -architecture: -- 1 root composite component -- 2 primitive components included in the root composite - - |--------------------------------------| - | | - | |--------| |--------| | -|-|-|--->|-| Client |-|--->|-| Server | | - | |--------| |--------| | - | | - |--------------------------------------| - -The server component exports an interface with 8 different methods, -each of them being trivial but non empty to bypass VM -optimizations. - -The bench consists in calling the 8 methods of the server 1,000,000 -times. The bench is performed 4 times in a warmup phase, and then -measures are taken on 5 different executions of the bench. The -result is the average (in milliseconds) of these last 5 executions. - -A typical run of the program should return something like: - -BENCH CREATED -Warming up .... -Starting bench -0: 741ms; 1: 751ms; 2: 751ms; 3: 751ms; 4: 742ms; average=747ms diff --git a/aokell/examples/bench/etc/execute.properties b/aokell/examples/bench/etc/execute.properties deleted file mode 100644 index 54f2f7b8920343faf8d266134b8c5a1b709cdc38..0000000000000000000000000000000000000000 --- a/aokell/examples/bench/etc/execute.properties +++ /dev/null @@ -1,14 +0,0 @@ -# JVM arguments -run.jvm.parameters -Dfractal.provider=org.objectweb.fractal.aokell.AOKell - -# Java class to be launched -run.classname benchmain.Main - -# Application arguments -run.parameters - -# Java interfaces used as Fractal interfaces -# This property is only needed when compile-time generation of Fractal -# interfaces is used (fcinterface set to ct) - -fcinterface.ct.parameters java.lang.Runnable bench.BenchInterface diff --git a/aokell/examples/bench/src/bench/Bench.fractal b/aokell/examples/bench/src/bench/Bench.fractal deleted file mode 100644 index d1de71097cb5d7db9c942735fe4b0e37c1419e51..0000000000000000000000000000000000000000 --- a/aokell/examples/bench/src/bench/Bench.fractal +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/examples/bench/src/bench/Bench.java b/aokell/examples/bench/src/bench/Bench.java deleted file mode 100644 index bf497b59e7bb482a45d0d8f9418141934b596a53..0000000000000000000000000000000000000000 --- a/aokell/examples/bench/src/bench/Bench.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * JACBenchmark - * Copyright (C) 2002 AOPSYS - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: laurent@aopsys.com - * Contact: Nicolas.Pessemier@lifl.fr - * - * Author: Laurent Martelli - * Author: Nicolas Pessemier - */ - -package bench; - -public class Bench implements BenchInterface { - - public Bench() { - System.out.println("BENCH CREATED"); - } - - public void m1() { -// System.out.println("m1"); - int i = 0; - } - - public void m2(Integer a) { - int i = 0; - } - - public void m3(Integer a, Integer b) { - int i = 0; - } - - public Integer m4() { - return new Integer(0); - } - - public Integer m5(Integer a) { - return new Integer(0); - } - - public Integer m6(Integer a, Integer b) { - return new Integer(0); - } - - public void m7(Object a) { - return; - } - - public void m8(Object a, Object b) { - return; - } -} \ No newline at end of file diff --git a/aokell/examples/bench/src/bench/BenchInterface.java b/aokell/examples/bench/src/bench/BenchInterface.java deleted file mode 100644 index f9362fdac05d30994e931224d1ec9a95eb032d10..0000000000000000000000000000000000000000 --- a/aokell/examples/bench/src/bench/BenchInterface.java +++ /dev/null @@ -1,48 +0,0 @@ -/*** - * JACBenchmark - * Copyright (C) 2002 AOPSYS - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: laurent@aopsys.com - * Contact: Nicolas.Pessemier@lifl.fr - * - * Author: Laurent Martelli - * Author: Nicolas Pessemier - */ - -package bench; - -/** - * @author Nicolas Pessemier - */ -public interface BenchInterface { - - public void m1(); - - public void m2(Integer a); - - public void m3(Integer a, Integer b); - - public Integer m4(); - - public Integer m5(Integer a); - - public Integer m6(Integer a, Integer b); - - public void m7(Object a); - - public void m8(Object a, Object b); -} \ No newline at end of file diff --git a/aokell/examples/bench/src/bench/ClientImpl.java b/aokell/examples/bench/src/bench/ClientImpl.java deleted file mode 100644 index 8a8c5559f1538a8f35622a9b68752aa1144582ba..0000000000000000000000000000000000000000 --- a/aokell/examples/bench/src/bench/ClientImpl.java +++ /dev/null @@ -1,147 +0,0 @@ -/*** - * JACBenchmark - * Copyright (C) 2002 AOPSYS - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: laurent@aopsys.com - * Contact: Nicolas.Pessemier@lifl.fr - * - * Author: Laurent Martelli - * Author: Nicolas Pessemier - */ - -package bench; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - -/** - * @author Nicolas Pessemier - */ -public class ClientImpl implements Runnable { - - private BenchInterface b; - - boolean rCalls; - - - - private int n; - String s; - - // from Main interface - - public void run() { - - - this.n = 1000000; - this.rCalls=false; - - try { - b = (BenchInterface) ((BindingController) this).lookupFc("bench"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - // Let the VM optimize - System.out.print("Warming up "); - doBench(); System.out.print("."); - doBench(); System.out.print("."); - doBench(); System.out.print("."); - doBench(); System.out.println("."); - //Thread.currentThread().sleep(5000); - - System.out.println("Starting bench"); - long total = 0; - int num_runs = 5; - for (int i=0; i - */ -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Load the ADL definition - // ---------------------------------------------------------- - Factory factory = - FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component root = (Component) - factory.newComponent("bench.Bench",new HashMap()); - - // ---------------------------------------------------------- - // Start the Root component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(root).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - ((Runnable)root.getFcInterface("r")).run(); - - } -} diff --git a/aokell/examples/benchsep/README.txt b/aokell/examples/benchsep/README.txt deleted file mode 100644 index 2e5a1cb827c73dcc15ea38b5f897bb59c0a90586..0000000000000000000000000000000000000000 --- a/aokell/examples/benchsep/README.txt +++ /dev/null @@ -1,46 +0,0 @@ -This example implements a benchmark suite to measure the cost of -programming components with AOKell. - -This example is the same as the one contained in the bench/ -directory, but differs in the way components are implemented. This -example uses a Julia-like (JL) based development style for -implementing components, whereas bench/ uses an aspect-oriented (AO) -based development style. - -To execute the example type: - ant execute - -The available Ant targets are: - compile: compile the example - execute: execute the example - help: display this help message - clean: clean the generated files - -When run, the example creates the following components -architecture: -- 1 root composite component -- 2 primitive components included in the root composite - - |--------------------------------------| - | | - | |--------| |--------| | -|-|-|--->|-| Client |-|--->|-| Server | | - | |--------| |--------| | - | | - |--------------------------------------| - -The server component exports an interface with 8 different methods, -each of them being trivial but non empty to bypass VM -optimizations. - -The bench consists in calling the 8 methods of the server 1,000,000 -times. The bench is performed 4 times in a warmup phase, and then -measures are taken on 5 different executions of the bench. The -result is the average (in milliseconds) of these last 5 executions. - -A typical run of the program should return something like: - -BENCH CREATED -Warming up .... -Starting bench -0: 741ms; 1: 751ms; 2: 751ms; 3: 751ms; 4: 742ms; average=747ms diff --git a/aokell/examples/benchsep/etc/execute.properties b/aokell/examples/benchsep/etc/execute.properties deleted file mode 100644 index 68b3bf13beacbddeb00900c2d01c37f0402f1d29..0000000000000000000000000000000000000000 --- a/aokell/examples/benchsep/etc/execute.properties +++ /dev/null @@ -1,14 +0,0 @@ -# JVM arguments -run.jvm.parameters -Dfractal.provider=org.objectweb.fractal.aokell.AOKell - -# Java class to be launched -run.classname benchsepmain.Main - -# Application arguments -run.parameters - -# Java interfaces used as Fractal interfaces -# This property is only needed when compile-time generation of Fractal -# interfaces is used (fcinterface set to ct) - -fcinterface.ct.parameters java.lang.Runnable benchsep.BenchInterface diff --git a/aokell/examples/benchsep/src/benchsep/Bench.fractal b/aokell/examples/benchsep/src/benchsep/Bench.fractal deleted file mode 100644 index f8c3b2ccac30f041eb1a353e27b6411c171100c4..0000000000000000000000000000000000000000 --- a/aokell/examples/benchsep/src/benchsep/Bench.fractal +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/examples/benchsep/src/benchsep/Bench.java b/aokell/examples/benchsep/src/benchsep/Bench.java deleted file mode 100644 index b65dbba0bcefa53d1cb34ecd6077c272480fa71d..0000000000000000000000000000000000000000 --- a/aokell/examples/benchsep/src/benchsep/Bench.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * JACBenchmark - * Copyright (C) 2002 AOPSYS - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: laurent@aopsys.com - * Contact: Nicolas.Pessemier@lifl.fr - * - * Author: Laurent Martelli - * Author: Nicolas Pessemier - */ - -package benchsep; - -public class Bench implements BenchInterface { - - public Bench() { - System.out.println("BENCH CREATED"); - } - - public void m1() { -// System.out.println("m1"); - int i = 0; - } - - public void m2(Integer a) { - int i = 0; - } - - public void m3(Integer a, Integer b) { - int i = 0; - } - - public Integer m4() { - return new Integer(0); - } - - public Integer m5(Integer a) { - return new Integer(0); - } - - public Integer m6(Integer a, Integer b) { - return new Integer(0); - } - - public void m7(Object a) { - return; - } - - public void m8(Object a, Object b) { - return; - } -} \ No newline at end of file diff --git a/aokell/examples/benchsep/src/benchsep/BenchInterface.java b/aokell/examples/benchsep/src/benchsep/BenchInterface.java deleted file mode 100644 index 012b8c1904e9215edc7e0430fb9499e6ca950ad0..0000000000000000000000000000000000000000 --- a/aokell/examples/benchsep/src/benchsep/BenchInterface.java +++ /dev/null @@ -1,48 +0,0 @@ -/*** - * JACBenchmark - * Copyright (C) 2002 AOPSYS - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: laurent@aopsys.com - * Contact: Nicolas.Pessemier@lifl.fr - * - * Author: Laurent Martelli - * Author: Nicolas Pessemier - */ - -package benchsep; - -/** - * @author Nicolas Pessemier - */ -public interface BenchInterface { - - public void m1(); - - public void m2(Integer a); - - public void m3(Integer a, Integer b); - - public Integer m4(); - - public Integer m5(Integer a); - - public Integer m6(Integer a, Integer b); - - public void m7(Object a); - - public void m8(Object a, Object b); -} \ No newline at end of file diff --git a/aokell/examples/benchsep/src/benchsep/ClientImpl.java b/aokell/examples/benchsep/src/benchsep/ClientImpl.java deleted file mode 100644 index 806d1642b131811bf4066e19346f4f42a00b0c7c..0000000000000000000000000000000000000000 --- a/aokell/examples/benchsep/src/benchsep/ClientImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -/*** - * JACBenchmark - * Copyright (C) 2002 AOPSYS - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: laurent@aopsys.com - * Contact: Nicolas.Pessemier@lifl.fr - * - * Author: Laurent Martelli - * Author: Nicolas Pessemier - */ - -package benchsep; - -import org.objectweb.fractal.api.control.BindingController; - -/** - * @author Nicolas Pessemier - */ -public class ClientImpl implements Runnable, BindingController { - - private BenchInterface b; - - boolean rCalls; - - - - private int n; - String s; - - // from Main interface - - public void run() { - - - this.n = 1000000; - this.rCalls=false; - - // Let the VM optimize - System.out.print("Warming up "); - doBench(); System.out.print("."); - doBench(); System.out.print("."); - doBench(); System.out.print("."); - doBench(); System.out.println("."); - //Thread.currentThread().sleep(5000); - - System.out.println("Starting bench"); - long total = 0; - int num_runs = 5; - for (int i=0; i - */ -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Load the ADL definition - // ---------------------------------------------------------- - Factory factory = - FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component root = (Component) - factory.newComponent("benchsep.Bench",new HashMap()); - - // ---------------------------------------------------------- - // Start the Root component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(root).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - ((Runnable)root.getFcInterface("r")).run(); - - } -} diff --git a/aokell/examples/collection/README.txt b/aokell/examples/collection/README.txt deleted file mode 100644 index bf0c9e56e1c3bd6a9ecaffe97281c60b33d7e54c..0000000000000000000000000000000000000000 --- a/aokell/examples/collection/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -Example taken from the Julia distribution to illustrate the usage of collection -interfaces and auto-bindings. \ No newline at end of file diff --git a/aokell/examples/collection/etc/execute.properties b/aokell/examples/collection/etc/execute.properties deleted file mode 100644 index 200a5253d2bcd9729703aae7f2ec42485ba58995..0000000000000000000000000000000000000000 --- a/aokell/examples/collection/etc/execute.properties +++ /dev/null @@ -1,14 +0,0 @@ -# JVM arguments -run.jvm.parameters -Dfractal.provider=org.objectweb.fractal.aokell.AOKell - -# Java class to be launched -run.classname collection.Collection - -# Application arguments -run.parameters - -# Java interfaces used as Fractal interfaces -# This property is only needed when compile-time generation of Fractal -# interfaces is used (fcinterface set to ct) - -fcinterface.ct.parameters collection.I diff --git a/aokell/examples/collection/src/collection/CImpl.java b/aokell/examples/collection/src/collection/CImpl.java deleted file mode 100644 index 080dacfc1bcc05d65abcb1f93c7ec07f8001e2b6..0000000000000000000000000000000000000000 --- a/aokell/examples/collection/src/collection/CImpl.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 collection; -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.api.control.BindingController; - -public class CImpl implements BindingController { - - private Map bindings = new HashMap(); - - public String[] listFc () { - return (String[])bindings.keySet().toArray(new String[bindings.size()]); - } - - public Object lookupFc (String itf) { - return bindings.get(itf); - } - - public void bindFc (String itf, Object value) { - if (!itf.equals("component")) { - bindings.put(itf, value); - } - } - - public void unbindFc (String itf) { - bindings.remove(itf); - } -} diff --git a/aokell/examples/collection/src/collection/Collection.java b/aokell/examples/collection/src/collection/Collection.java deleted file mode 100644 index 996ff080501a67e15a2e22710ac0d888376c9c9f..0000000000000000000000000000000000000000 --- a/aokell/examples/collection/src/collection/Collection.java +++ /dev/null @@ -1,100 +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 collection; - -import java.util.Arrays; - -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 Collection { - - public static void main (String[] args) throws Exception { - - Component boot = Fractal.getBootstrapComponent(); - - TypeFactory tf = Fractal.getTypeFactory(boot); - ComponentType aType = tf.createFcType(new InterfaceType[0]); - ComponentType bType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("client", I.class.getName(), true, true, true) - }); - ComponentType sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("server", I.class.getName(), false, false, false) - }); - - GenericFactory cf = Fractal.getGenericFactory(boot); - - Component aComp = cf.newFcInstance(aType, "composite", null); - Component bComp = cf.newFcInstance(bType, "autoBindingComposite", null); - Component cComp = cf.newFcInstance(bType, "autoBindingPrimitive", CImpl.class.getName()); - Component s1Comp = cf.newFcInstance(sType, "primitive", SImpl.class.getName()); - Component s2Comp = cf.newFcInstance(sType, "primitive", SImpl.class.getName()); - Component s3Comp = cf.newFcInstance(sType, "primitive", SImpl.class.getName()); - - Fractal.getContentController(aComp).addFcSubComponent(bComp); - Fractal.getContentController(aComp).addFcSubComponent(s1Comp); - Fractal.getContentController(aComp).addFcSubComponent(s2Comp); - Fractal.getContentController(aComp).addFcSubComponent(s3Comp); - Fractal.getContentController(bComp).addFcSubComponent(cComp); - - // creates a binding between b and s1 - Fractal.getBindingController(bComp).bindFc( - "client-I", s1Comp.getFcInterface("server")); - - // creates a "model" binding between c and b - // this automatically creates similar bindings bewteen c and b, - // for each interface in the collection in b - Fractal.getBindingController(cComp).bindFc( - "client", - Fractal.getContentController(bComp).getFcInternalInterface("client")); - - // we can check this with the following code: - String[] itfs = Fractal.getBindingController(cComp).listFc(); - System.out.println(Arrays.asList(itfs)); - - // during the following bindings between b and si, - // similar bindings are created between c and b (following the model binding) - Fractal.getBindingController(bComp).bindFc( - "client-II", s2Comp.getFcInterface("server")); - Fractal.getBindingController(bComp).bindFc( - "client-III", s3Comp.getFcInterface("server")); - - // we can check this with the following code: - itfs = Fractal.getBindingController(cComp).listFc(); - System.out.println(Arrays.asList(itfs)); - - // removing bindings between b and si also removes bindings between c and b - Fractal.getBindingController(bComp).unbindFc("client-I"); - Fractal.getBindingController(bComp).unbindFc("client-II"); - Fractal.getBindingController(bComp).unbindFc("client-III"); - - itfs = Fractal.getBindingController(cComp).listFc(); - System.out.println(Arrays.asList(itfs)); - } -} diff --git a/aokell/examples/collection/src/collection/I.java b/aokell/examples/collection/src/collection/I.java deleted file mode 100644 index f0e773a37c635675eab71cabe33bc0390d1827da..0000000000000000000000000000000000000000 --- a/aokell/examples/collection/src/collection/I.java +++ /dev/null @@ -1,27 +0,0 @@ -package collection; -/*** - * 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 (); -} diff --git a/aokell/examples/collection/src/collection/SImpl.java b/aokell/examples/collection/src/collection/SImpl.java deleted file mode 100644 index 00606bc1a98a1a14d5875b10a2abe7bfcdacb50b..0000000000000000000000000000000000000000 --- a/aokell/examples/collection/src/collection/SImpl.java +++ /dev/null @@ -1,29 +0,0 @@ -package collection; -/*** - * 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 SImpl implements I { - - public void m () { - } -} diff --git a/aokell/examples/comanche/README.txt b/aokell/examples/comanche/README.txt deleted file mode 100644 index 781d565430ad00744c31c87989ca30f3a1325dd9..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/README.txt +++ /dev/null @@ -1,27 +0,0 @@ -This is the comanche web server. This program was implemented with -Julia and runs, unmodified, with AOKell. - -To execute the example type: - ant execute - -The available Ant targets are: - compile: compile the example - execute: execute the example - help: display this help message - clean: clean the generated files - -See "Developing with Fractal" in the Documentation section of the -Fractal web site for a description -of the comanche architecture. - -When run, comanche waits for HTTP request on port 8080. A typical -run of the program should return something like: - -Comanche HTTP Server ready on port 8080. - -Open the URL in your favorite -web browser. A well-known head should appear! To stop the server, -type Ctrl-C in the launching shell. - -You can add any file you like in the comanche/ directory to have -them served by comanche. diff --git a/aokell/examples/comanche/etc/execute.properties b/aokell/examples/comanche/etc/execute.properties deleted file mode 100644 index e0e9e0d6c6600077bd79c106d5d2e28e4791ba5a..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/etc/execute.properties +++ /dev/null @@ -1,14 +0,0 @@ -# JVM arguments -run.jvm.parameters -Dfractal.provider=org.objectweb.fractal.aokell.AOKell - -# Java class to be launched -run.classname comanchemain.Main - -# Application arguments -run.parameters - -# Java interfaces used as Fractal interfaces -# This property is only needed when compile-time generation of Fractal -# interfaces is used (fcinterface set to ct) - -fcinterface.ct.parameters java.lang.Runnable comanche.Logger comanche.RequestHandler comanche.Scheduler diff --git a/aokell/examples/comanche/src/comanche/Analyzer.fractal b/aokell/examples/comanche/src/comanche/Analyzer.fractal deleted file mode 100644 index cdf21833a7e529e88aafa48932c74177962d8a14..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Analyzer.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/AnalyzerType.fractal b/aokell/examples/comanche/src/comanche/AnalyzerType.fractal deleted file mode 100644 index 9300370cc74a14e62880f517531c1d805f88eb09..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/AnalyzerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/Backend.fractal b/aokell/examples/comanche/src/comanche/Backend.fractal deleted file mode 100644 index 60217a008a4ec69d2f55454334a7254ec3605ee7..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Backend.fractal +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/BackendType.fractal b/aokell/examples/comanche/src/comanche/BackendType.fractal deleted file mode 100644 index bcb8a08eb133586140b101997e0668c0f5b5cce4..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/BackendType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/BasicLogger.java b/aokell/examples/comanche/src/comanche/BasicLogger.java deleted file mode 100644 index 7a9fa1a6e44cd571ce025575cbf8153f244f1046..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/BasicLogger.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -public class BasicLogger implements Logger { - public void log (String msg) { System.out.println(msg); } -} diff --git a/aokell/examples/comanche/src/comanche/Comanche.fractal b/aokell/examples/comanche/src/comanche/Comanche.fractal deleted file mode 100644 index f13199d3261bc9172d65307efaca82e44705acbf..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Comanche.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/ComancheType.fractal b/aokell/examples/comanche/src/comanche/ComancheType.fractal deleted file mode 100644 index 432d4e38981db5901362ee39f478a3830d0e7ffc..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/ComancheType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/Dispatcher.fractal b/aokell/examples/comanche/src/comanche/Dispatcher.fractal deleted file mode 100644 index 4f55a25cabd87ef25a920b246bf2723988cde8f3..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Dispatcher.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/DispatcherType.fractal b/aokell/examples/comanche/src/comanche/DispatcherType.fractal deleted file mode 100644 index 0dc3612447baa15258abf686268ebab28bb172f7..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/DispatcherType.fractal +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/ErrorHandler.fractal b/aokell/examples/comanche/src/comanche/ErrorHandler.fractal deleted file mode 100644 index cb888d62782bf4620e38665a7a78501e335d808b..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/ErrorHandler.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/ErrorRequestHandler.java b/aokell/examples/comanche/src/comanche/ErrorRequestHandler.java deleted file mode 100644 index ab33261b0f5f49cd6d332fd820cf62e16a809ff0..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/ErrorRequestHandler.java +++ /dev/null @@ -1,36 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -import java.io.IOException; - - -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/aokell/examples/comanche/src/comanche/FileHandler.fractal b/aokell/examples/comanche/src/comanche/FileHandler.fractal deleted file mode 100644 index 5215e29e9a3ca3ae1284abe4f2af66e928937d50..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/FileHandler.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/FileRequestHandler.java b/aokell/examples/comanche/src/comanche/FileRequestHandler.java deleted file mode 100644 index e4aa67fc6e868d8fb4b1c95d2a1cfbb809ac90f8..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/FileRequestHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -import java.io.IOException; -import java.io.InputStream; - - -/** - * Handle HTTP request for files. - * - * @author Eric Bruneton - * @author Lionel Seinturier - */ -public class FileRequestHandler implements RequestHandler { - - public void handleRequest (Request r) throws IOException { - - if( r.url.length() == 0 ) { - // Default to index.html - r.url = "index.html"; - } - - InputStream is = ClassLoader.getSystemResourceAsStream(r.url); - if( is != null ) { - 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); - return; - } - - throw new IOException("File not found"); - } -} diff --git a/aokell/examples/comanche/src/comanche/Frontend.fractal b/aokell/examples/comanche/src/comanche/Frontend.fractal deleted file mode 100644 index b753796e0c17ab571ad5ae5ee8edebdaa1ad7d97..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Frontend.fractal +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/FrontendType.fractal b/aokell/examples/comanche/src/comanche/FrontendType.fractal deleted file mode 100644 index 20da09ff1e13b7229ec8ce07f3a21eded6a77aea..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/FrontendType.fractal +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/Handler.fractal b/aokell/examples/comanche/src/comanche/Handler.fractal deleted file mode 100644 index aebedca945807b8c5f65a83b894f150807dffb5e..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Handler.fractal +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/Logger.fractal b/aokell/examples/comanche/src/comanche/Logger.fractal deleted file mode 100644 index d4576b1868cf3de4925fdbefb126e9708edf76d8..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Logger.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/Logger.java b/aokell/examples/comanche/src/comanche/Logger.java deleted file mode 100644 index 049a35be60f4bdc43869390a4ebfbdb3961ce1a2..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Logger.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -public interface Logger { - void log (String msg); -} diff --git a/aokell/examples/comanche/src/comanche/LoggerType.fractal b/aokell/examples/comanche/src/comanche/LoggerType.fractal deleted file mode 100644 index ea3cdd37a053a2357ae4813427780ef126686fd7..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/LoggerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/MultiThreadScheduler.fractal b/aokell/examples/comanche/src/comanche/MultiThreadScheduler.fractal deleted file mode 100644 index cfd9fb2d3b9b851d3a1def3e8891d4650010c62f..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/MultiThreadScheduler.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/MultiThreadScheduler.java b/aokell/examples/comanche/src/comanche/MultiThreadScheduler.java deleted file mode 100644 index 762e6cfd16e2ae3fd23f86f113097fc982f22fa8..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/MultiThreadScheduler.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -public class MultiThreadScheduler implements Scheduler { - public void schedule (Runnable task) { new Thread(task).start(); } -} diff --git a/aokell/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal b/aokell/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal deleted file mode 100644 index 271091cffe5237ad992fb21db0d625d9c3e7e258..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/MultiThreadSchedulerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/Receiver.fractal b/aokell/examples/comanche/src/comanche/Receiver.fractal deleted file mode 100644 index f4dfa780fa13e1bee600e00eecfb85a947bb99d8..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Receiver.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/ReceiverType.fractal b/aokell/examples/comanche/src/comanche/ReceiverType.fractal deleted file mode 100644 index b02aa9062d1d8c08cc6b9bf9d7a6d8345445533b..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/ReceiverType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - diff --git a/aokell/examples/comanche/src/comanche/Request.java b/aokell/examples/comanche/src/comanche/Request.java deleted file mode 100644 index 8a55a713c2ff552129c5e85039d1142fa8e074dd..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Request.java +++ /dev/null @@ -1,39 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -import java.io.PrintStream; -import java.io.Reader; -import java.net.Socket; - - -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/aokell/examples/comanche/src/comanche/RequestAnalyzer.java b/aokell/examples/comanche/src/comanche/RequestAnalyzer.java deleted file mode 100644 index 83407c8d03d5ff422ef65733e036bd03896af714..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/RequestAnalyzer.java +++ /dev/null @@ -1,79 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.LineNumberReader; -import java.io.PrintStream; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -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(); - - try { - rh = (RequestHandler) ((BindingController)this).lookupFc("rh"); - l = (Logger) ((BindingController)this).lookupFc("l"); - } - catch(NoSuchInterfaceException nsie) { - throw new RuntimeException(nsie.getMessage()); - } - - 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/aokell/examples/comanche/src/comanche/RequestDispatcher.java b/aokell/examples/comanche/src/comanche/RequestDispatcher.java deleted file mode 100644 index 23a573fc9b3abb02b77a41eff4f4f27be031e54b..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/RequestDispatcher.java +++ /dev/null @@ -1,75 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -import java.io.IOException; -import java.util.Iterator; -import java.util.List; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -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(); - - List handlers = null; - try { - handlers = (List) ((BindingController)this).lookupFc("h"); - } - catch(NoSuchInterfaceException nsie) { - throw new RuntimeException(nsie.getMessage()); - } - - Iterator i = handlers.iterator(); - - while (i.hasNext()) { - try { - RequestHandler rh = (RequestHandler) i.next(); - rh.handleRequest(r); - return; - } catch (IOException _) { } - } - } -} diff --git a/aokell/examples/comanche/src/comanche/RequestHandler.java b/aokell/examples/comanche/src/comanche/RequestHandler.java deleted file mode 100644 index 12cca823907534438661466debd7a755ad777e9c..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/RequestHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -public interface RequestHandler { - void handleRequest (Request r) throws java.io.IOException; -} diff --git a/aokell/examples/comanche/src/comanche/RequestReceiver.java b/aokell/examples/comanche/src/comanche/RequestReceiver.java deleted file mode 100644 index 8696ffc243a5cae844a43c90e3d263a4c3b338f7..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/RequestReceiver.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -import java.io.IOException; -import java.net.ServerSocket; -import java.net.Socket; - -import org.objectweb.fractal.api.control.BindingController; - -public class RequestReceiver implements Runnable /*, BindingController*/ { - - public void run () { - try { - ServerSocket ss = new ServerSocket(8080); - System.out.println("Comanche HTTP Server ready on port 8080."); - System.out.println("Load http://localhost:8080/gnu.jpg"); - while (true) { - final Socket socket = ss.accept(); - - final Scheduler s = (Scheduler) ((BindingController)this).lookupFc("s"); - final RequestHandler rh = (RequestHandler) ((BindingController)this).lookupFc("rh"); - - s.schedule(new Runnable () { - public void run () { - try { - rh.handleRequest(new Request(socket)); - } catch (IOException _) { } - } - }); - } - } catch (Exception e) { e.printStackTrace(); } - } -} diff --git a/aokell/examples/comanche/src/comanche/Scheduler.java b/aokell/examples/comanche/src/comanche/Scheduler.java deleted file mode 100644 index 70985d1b5447b43f46007807b32e40b23f439a18..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/Scheduler.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -public interface Scheduler { - void schedule (Runnable task); -} diff --git a/aokell/examples/comanche/src/comanche/SequentialScheduler.java b/aokell/examples/comanche/src/comanche/SequentialScheduler.java deleted file mode 100644 index 9a15ecf70d4f7094bd86c62cc0b47725562f0842..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanche/SequentialScheduler.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanche; - -public class SequentialScheduler implements Scheduler { - public void schedule (Runnable task) { task.run(); } -} diff --git a/aokell/examples/comanche/src/comanchemain/Main.java b/aokell/examples/comanche/src/comanchemain/Main.java deleted file mode 100644 index b126d587ee22d77c2da22ed1ccd4c40bd81ffb91..0000000000000000000000000000000000000000 --- a/aokell/examples/comanche/src/comanchemain/Main.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * Comanche web server - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package comanchemain; - -import java.util.HashMap; - -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.util.Fractal; - - -/** - * Main class for the comanche web server. - * - * @author Lionel Seinturier - */ -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Load the ADL definition - // ---------------------------------------------------------- - Factory factory = - FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component root = (Component) - factory.newComponent("comanche.Comanche",new HashMap()); - - // ---------------------------------------------------------- - // Start the Root component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(root).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - ((Runnable)root.getFcInterface("r")).run(); - } -} diff --git a/aokell/examples/comanche/src/gnu.jpg b/aokell/examples/comanche/src/gnu.jpg deleted file mode 100644 index 49502c771ff95ff97514eaf4c21f7a3f262b5310..0000000000000000000000000000000000000000 Binary files a/aokell/examples/comanche/src/gnu.jpg and /dev/null differ diff --git a/aokell/examples/common/build.xml b/aokell/examples/common/build.xml deleted file mode 100644 index cc3a053bb46d576b627fc55e69612ed7abde85dc..0000000000000000000000000000000000000000 --- a/aokell/examples/common/build.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/examples/estore/README.txt b/aokell/examples/estore/README.txt deleted file mode 100644 index 033db907ba10f2a0a35239b3ce9a5e46a17a61ba..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/README.txt +++ /dev/null @@ -1,67 +0,0 @@ -This example implements an electronic store selling CDs and DVDs. This -example demonstrates the use of collection interfaces. - -To execute the example type: - ant execute - -The available Ant targets are: - compile: compile the example - execute: execute the example - help: display this help message - clean: clean the generated files - -When run, the example creates the following components -architecture: -- 1 root composite component -- 4 components included in the root composite - - |------------------------------------------------------| - | | - | |--------| |-------| |------| | -|-|-|-->|-| Client |-|-->|-| |-|-->|-| Bank | | - | |--------| | | |------| | - | | Store | | - | | | |----------| | - | | |-|-->|-| Provider | | - | |-------| |----------| | - | | - |------------------------------------------------------| - -Client, Store and Provider are primitive components. Bank is a -composite with a Desk primitive sub-component, and some Account -primitive sub-components. The account components (3 in our case, 1 -for the store, and 2 for customers Anne and Bob) are bound to a -collection client interfaces provided by the Desk component. - - |------------------------------------| - | Bank | - | |---------| | - | |------| |-->| E-Store | | -|-|-|-->|-| Desk |-|--| |---------| | - | |------| | | - | | |------| | - | |-->| Anne | | - | | |------| | - | | | - | | |-----| | - | |-->| Bob | | - | |-----| | - | | - |------------------------------------| - - -The program performs two selling scenario. In the first one, both -Bob and Anne place an order for CDs. In the second one, Bob places -an order for DVDs and CDs. The following messages are displayed: - -Scenario 1 -Ordering 2 CD for Bob... -Order #0 amount: 30.0 delay: 71h issued on: Tue Jul 26 02:23:24 CEST 2005 -Ordering 1 CD for Anne... -Order #1 amount: 15.0 delay: 2h issued on: Tue Jul 26 02:23:24 CEST 2005 - -Scenario 2 -Ordering for Bob... -Item: DVD, quantity: 2 -Item: CD, quantity: 1 -Order #2 amount: 55.0 delay: 62h issued on: Tue Jul 26 02:23:24 CEST 2005 diff --git a/aokell/examples/estore/etc/execute.properties b/aokell/examples/estore/etc/execute.properties deleted file mode 100644 index 9fbca9b38a091d50a66319f2a0782195a0b6f535..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/etc/execute.properties +++ /dev/null @@ -1,14 +0,0 @@ -# JVM arguments -run.jvm.parameters -Dfractal.provider=org.objectweb.fractal.aokell.AOKell - -# Java class to be launched -run.classname estore.Main - -# Application arguments -run.parameters - -# Java interfaces used as Fractal interfaces -# This property is only needed when compile-time generation of Fractal -# interfaces is used (fcinterface set to ct) - -fcinterface.ct.parameters java.lang.Runnable estore.client.IClient estore.store.IFastLane estore.store.ILane estore.store.IJustHaveALook estore.bank.IBank estore.provider.IProvider estore.bank.account.IAccount estore.bank.account.IAccountProperties diff --git a/aokell/examples/estore/src/estore/Main.java b/aokell/examples/estore/src/estore/Main.java deleted file mode 100644 index 8014208cd5517f1b8fc5052b2fc1d25302122687..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/Main.java +++ /dev/null @@ -1,116 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; -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.LifeCycleController; -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.util.Fractal; - -import estore.bank.desk.DeskHelper; - - -/** - * @author Lionel Seinturier - */ -public class Main { - - public static void main(String[] args) throws Exception { - - // Create the Root component - Factory f = getFactory(); - root = (Component) f.newComponent("estore.Root",null); - - // Start the Root component - LifeCycleController lc = Fractal.getLifeCycleController(root); - lc.startFc(); - - Component desk = DeskHelper.getDeskComponent(); - Runnable idc = (Runnable) - desk.getFcInterface("IDeskConfiguration");; - idc.run(); - - // Call the run() method of the IRun interface of the Root component - Runnable r = (Runnable) root.getFcInterface("IRun"); - r.run(); - } - - - private static Factory factory; - - /** - * Return the singleton instance of a FRACTAL_BACKEND factory. - * FactoryFactory.getFactory always return a new instance. - * For dynamic creation of component instances, - * we need to access the same factory, and thus retain its reference. - * - * @return the singleton instance of a FRACTAL_BACKEND factory - */ - public static Factory getFactory() { - if ( factory == null ) { - try { - factory = - FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - } catch (ADLException e) { - e.printStackTrace(); - } - } - return factory; - } - - /** - * Get a named direct sub-component contained inside a composite. - * This is not a recursive search. - * - * @param c the composite - * @param name the name of the sub-component - * @return the sub-component or null - */ - public static Component getSubComponent( Component c, String name ) - throws NoSuchInterfaceException { - - ContentController cc = Fractal.getContentController(c); - Component[] comps = cc.getFcSubComponents(); - for (int i = 0; i < comps.length; i++) { - NameController nc = Fractal.getNameController(comps[i]); - if( nc.getFcName().equals(name) ) - return comps[i]; - } - - return null; - - } - - /** The root component of this application. */ - protected static Component root; - public static Component getRootComponent() { - return root; - } - -} diff --git a/aokell/examples/estore/src/estore/Root.fractal b/aokell/examples/estore/src/estore/Root.fractal deleted file mode 100644 index c3b9ce2192af7431fb888a189399b649931b1de5..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/Root.fractal +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/examples/estore/src/estore/RootType.fractal b/aokell/examples/estore/src/estore/RootType.fractal deleted file mode 100644 index 1a70313419fde77b71f1ca77a97dce2682695964..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/RootType.fractal +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/estore/src/estore/bank/Bank.fractal b/aokell/examples/estore/src/estore/bank/Bank.fractal deleted file mode 100644 index 1404bce92071a680e2382931a0d145d21d56800e..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/Bank.fractal +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - diff --git a/aokell/examples/estore/src/estore/bank/BankHelper.java b/aokell/examples/estore/src/estore/bank/BankHelper.java deleted file mode 100644 index 777c37e75e703396486bb0da1cdc403682731d4a..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/BankHelper.java +++ /dev/null @@ -1,61 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; - -import estore.Main; - -/** - * Helper class for retrieving the Bank component. - * - * @author Lionel Seinturier - */ -public class BankHelper { - - /** The name of the Bank component defined in Root.fractal. */ - final private static String BANK_NAME = "Bank"; - - private static Component bank; - - /** - * Return the Bank component. - */ - public static Component getBankComponent() { - - if( bank == null ) { - try { - Component root = Main.getRootComponent(); - bank = Main.getSubComponent(root,BANK_NAME); - } - catch (NoSuchInterfaceException e) { - e.printStackTrace(); - } - - } - return bank; - } - -} diff --git a/aokell/examples/estore/src/estore/bank/BankType.fractal b/aokell/examples/estore/src/estore/bank/BankType.fractal deleted file mode 100644 index 49c998526769c41d4d5552411c192a233070407d..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/BankType.fractal +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/estore/src/estore/bank/IBank.java b/aokell/examples/estore/src/estore/bank/IBank.java deleted file mode 100644 index 1d652bdf4b328d87bc02e898904ec68106036609..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/IBank.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank; - - -/** - * @author Lionel Seinturier - */ -public interface IBank { - - void transfert( Object from, Object to, double amount ) - throws InsufficientBalanceException, UnknownAccountException; - -} diff --git a/aokell/examples/estore/src/estore/bank/InsufficientBalanceException.java b/aokell/examples/estore/src/estore/bank/InsufficientBalanceException.java deleted file mode 100644 index 236272188be6e293573b6e88ac1a565b3fdb1e62..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/InsufficientBalanceException.java +++ /dev/null @@ -1,42 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank; - -/** - * @author Lionel Seinturier - */ -public class InsufficientBalanceException extends Exception { - - private static final long serialVersionUID = 1365771904467860173L; - private String account; - - public InsufficientBalanceException( String account ) { - super(); - this.account = account; - } - - public String getMessage() { - return "The account "+account+" is not sufficiently balanced."; - } -} diff --git a/aokell/examples/estore/src/estore/bank/UnknownAccountException.java b/aokell/examples/estore/src/estore/bank/UnknownAccountException.java deleted file mode 100644 index 84a5f077b23e34d8877b8a0d7d4779da83f37388..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/UnknownAccountException.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank; - -/** - * @author Lionel Seinturier - */ -public class UnknownAccountException extends Exception { - - private static final long serialVersionUID = 8340333926671329022L; - private String account; - - public UnknownAccountException( String account ) { - super(); - this.account = account; - } - - public String getMessage() { - return "The account "+account+" is unknown."; - } - -} diff --git a/aokell/examples/estore/src/estore/bank/account/Account.fractal b/aokell/examples/estore/src/estore/bank/account/Account.fractal deleted file mode 100644 index b573ce03a689823b38d16fceddcecaa3d0923998..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/account/Account.fractal +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/aokell/examples/estore/src/estore/bank/account/AccountImpl.java b/aokell/examples/estore/src/estore/bank/account/AccountImpl.java deleted file mode 100644 index b92ff73e8c9aa6b1cf36edb55b6849e1075e3148..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/account/AccountImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank.account; - -import estore.bank.InsufficientBalanceException; - -public class AccountImpl implements IAccount, IAccountProperties { - - /** - * Constructs a new AccountImpl - */ - public AccountImpl() { - } - - // ----------------------------------------------------- - // Implementation of the IAccountProperties interface - // ----------------------------------------------------- - - private double amount; - private String owner; - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public double getAmount() { - return amount; - } - - public void setAmount(double amount) { - this.amount = amount; - } - - // ----------------------------------------------------- - // Implementation of the IAccount interface - // ----------------------------------------------------- - - public void credit(double amount) { - this.amount += amount; - } - - public void withdraw(double amount) throws InsufficientBalanceException { - if ( this.amount < amount ) - throw new InsufficientBalanceException(owner); - this.amount -= amount; - } - - // ----------------------------------------------------- - // Implementation of the Object interface - // ----------------------------------------------------- - - /** - * Two AccountImpl instances are considered equals - * if they share the same owner. - * Of course, in a more realistic implementation, - * we should have a account number. - */ - public boolean equals( Object other ) { - if( ! (other instanceof AccountImpl) ) - return false; - AccountImpl otherAccount = (AccountImpl) other; - return ( otherAccount.owner == owner); - } - - public int hashCode() { - return owner.hashCode(); - } - -} diff --git a/aokell/examples/estore/src/estore/bank/account/AccountType.fractal b/aokell/examples/estore/src/estore/bank/account/AccountType.fractal deleted file mode 100644 index f22a4c5b9c2ea97aa99d7b49b901bb6e3d1eb7f2..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/account/AccountType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/estore/src/estore/bank/account/IAccount.java b/aokell/examples/estore/src/estore/bank/account/IAccount.java deleted file mode 100644 index 807236929b5392e0d7f99d6e9aaf53da12782789..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/account/IAccount.java +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank.account; - -import estore.bank.InsufficientBalanceException; - -/** - * @author Lionel Seinturier - */ -public interface IAccount { - void credit( double amount ); - void withdraw( double amount ) throws InsufficientBalanceException; -} diff --git a/aokell/examples/estore/src/estore/bank/account/IAccountProperties.java b/aokell/examples/estore/src/estore/bank/account/IAccountProperties.java deleted file mode 100644 index 3087a746806989e461cb2edc1e6624abece6240d..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/account/IAccountProperties.java +++ /dev/null @@ -1,38 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank.account; - -import org.objectweb.fractal.api.control.AttributeController; - -/** - * @author Lionel Seinturier - */ -public interface IAccountProperties extends AttributeController { - - String getOwner(); - void setOwner( String name ); - - double getAmount(); - void setAmount( double amount ); -} diff --git a/aokell/examples/estore/src/estore/bank/desk/Desk.fractal b/aokell/examples/estore/src/estore/bank/desk/Desk.fractal deleted file mode 100644 index 1dfca633c639e55af391fabd148f4cfba83d7898..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/desk/Desk.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - diff --git a/aokell/examples/estore/src/estore/bank/desk/DeskHelper.java b/aokell/examples/estore/src/estore/bank/desk/DeskHelper.java deleted file mode 100644 index 52cae1e0fe4f93712ce860c34da76a32da2a24dd..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/desk/DeskHelper.java +++ /dev/null @@ -1,62 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank.desk; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; - -import estore.Main; -import estore.bank.BankHelper; - -/** - * Helper class for retrieving the Desk component. - * - * @author Lionel Seinturier - */ -public class DeskHelper { - - /** The name of the Desk component defined in Bank.fractal. */ - final private static String DESK_NAME = "Desk"; - - private static Component desk; - - /** - * Return the Desk component. - */ - public static Component getDeskComponent() { - - if ( desk == null ) { - try { - Component bank = BankHelper.getBankComponent(); - desk = Main.getSubComponent(bank,DESK_NAME); - } - catch (NoSuchInterfaceException e) { - e.printStackTrace(); - } - } - - return desk; - } - -} diff --git a/aokell/examples/estore/src/estore/bank/desk/DeskImpl.java b/aokell/examples/estore/src/estore/bank/desk/DeskImpl.java deleted file mode 100644 index a286167c415363ef54c7d07fbaed4901aac3b501..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/desk/DeskImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.bank.desk; - - -import org.objectweb.fractal.adl.Factory; -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.LifeCycleController; -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.util.Fractal; - -import estore.Main; -import estore.bank.IBank; -import estore.bank.InsufficientBalanceException; -import estore.bank.UnknownAccountException; -import estore.bank.account.IAccountProperties; - -public class DeskImpl implements IBank, Runnable { - - // ----------------------------------------------------- - // Implementation of the IBank interface - // ----------------------------------------------------- - - public void transfert(Object from, Object to, double amount) - throws InsufficientBalanceException, UnknownAccountException { - - try { - // Get the Account components - String fromAccountItfName = IACCOUNT_BINDING+from; - - Interface fromAccountItf = (Interface) ((BindingController)this).lookupFc(fromAccountItfName); - Component fromAccount = fromAccountItf.getFcItfOwner(); - - String toAccountItfName = IACCOUNT_BINDING+to; - Interface toAccountItf = (Interface) ((BindingController)this).lookupFc(toAccountItfName); - Component toAccount = toAccountItf.getFcItfOwner(); - - // Get the balance of the account to widthdraw - IAccountProperties acFrom = (IAccountProperties) - Fractal.getAttributeController(fromAccount); - double fromBalance = acFrom.getAmount(); - - // Check whether the account is sufficiently balanced - if ( fromBalance < amount ) - throw new InsufficientBalanceException(from.toString()); - - // Get the balance of the account to credit - IAccountProperties acTo = (IAccountProperties) - Fractal.getAttributeController(toAccount); - double toBalance = acTo.getAmount(); - - // Perform the transfert - acFrom.setAmount( fromBalance - amount ); - acTo.setAmount( toBalance + amount ); - } - catch (NoSuchInterfaceException e) { - // We do not want this exception to appear in the business - // interface, so we wrap it in a runtime exception - e.printStackTrace(); - throw new RuntimeException(e); - } - } - - // ----------------------------------------------------- - // Implementation of the Runnable interface - // ----------------------------------------------------- - - public void run() { - Component desk = DeskHelper.getDeskComponent(); - createAndBindAccount(desk,"Bob",100); - createAndBindAccount(desk,"Anne",30); - createAndBindAccount(desk,"E-Store",0); - } - - /** - * Create a Account component with the given initial values, - * insert it in the Bank component that contains the given Desk component, - * bind it to the current Desk component, and - * start it. - * - * @param desk the Desk component that perform the creation - * @param owner the owner of the account - * @param amount the initial balance of the account - */ - private void createAndBindAccount( - Component desk, - String owner, - double amount ) { - - Factory f = Main.getFactory(); - - try { - // Create a new Account component - Component c = (Component) - f.newComponent("estore.bank.account.Account",null); - - // Give a name (owner) to the Account component - NameController nc = Fractal.getNameController(c); - nc.setFcName(owner); - - // Initialize the Account component properties - IAccountProperties props = - (IAccountProperties) Fractal.getAttributeController(c); - props.setOwner(owner); - props.setAmount(amount); - - // Get the Bank composite that contains the Desk component - // Nota: we "know" that Desk in not shared and that supers[0] - // is the only composite containing Desk, and is Bank - SuperController sc = Fractal.getSuperController(desk); - Component[] supers = sc.getFcSuperComponents(); - Component bank = supers[0]; - - // Add the Account component to the Bank composite - ContentController cc = Fractal.getContentController(bank); - cc.addFcSubComponent(c); - - // Bind the Account component to the current Desk component - // bindFc(IACCOUNT_BINDING,c); - BindingController bc = Fractal.getBindingController(desk); - String clientItfName = IACCOUNT_BINDING+owner; - Object itf = c.getFcInterface("IAccount"); - bc.bindFc(clientItfName,itf); - - // Start the Account component - LifeCycleController lc = Fractal.getLifeCycleController(c); - lc.startFc(); - } - catch (Exception e) { - throw new RuntimeException( - "Failed to create account for "+owner, e ); - } - - } - - public final static String IACCOUNT_BINDING = "IAccount"; - -} diff --git a/aokell/examples/estore/src/estore/bank/desk/DeskType.fractal b/aokell/examples/estore/src/estore/bank/desk/DeskType.fractal deleted file mode 100644 index 44d0a0b0b5695ad79c14df5bf9ee848cf5a202ef..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/bank/desk/DeskType.fractal +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - diff --git a/aokell/examples/estore/src/estore/client/Client.fractal b/aokell/examples/estore/src/estore/client/Client.fractal deleted file mode 100644 index 9aaa0e4945f28d6c524194c899ca2ecb9a5e1e36..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/client/Client.fractal +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/estore/src/estore/client/ClientImpl.java b/aokell/examples/estore/src/estore/client/ClientImpl.java deleted file mode 100644 index f58fcb2e7692031ada6965b3801e8dda5d465e02..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/client/ClientImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.client; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - -import estore.bank.InsufficientBalanceException; -import estore.bank.UnknownAccountException; -import estore.provider.UnknownItemException; -import estore.store.Cart; -import estore.store.IFastLane; -import estore.store.ILane; -import estore.store.InvalidCartException; -import estore.store.Order; - -public class ClientImpl implements Runnable, IClient { - - private ILane iLane; - private IFastLane iFastLane; - - // ----------------------------------------------------- - // Implementation of the Runnable interface - // ----------------------------------------------------- - - public void run() { - - // Scenario 1 - // Direct ordering of an item - // The scenario is run twice - System.out.println("Scenario 1"); - scenario1("CD",2,"Lille","Bob"); - scenario1("CD",1,"Lille","Anne"); - System.out.println(); - - // Scenario 2 - // Ordering of several items by using a cart - System.out.println("Scenario 2"); - scenario2(new String[]{"DVD","CD"},new int[]{2,1},"Lille","Bob"); - System.out.println(); - } - - private void scenario1( - String item, int qty, String address, String account ) { - - try { - _scenario1(item,qty,address,account); - } - catch (Exception e) { - System.err.println("Exception: "+e.getMessage()); - e.printStackTrace(); - } - } - - private void _scenario1( - String item, int qty, String address, String account ) - throws - UnknownItemException, - InsufficientBalanceException, UnknownAccountException, - NoSuchInterfaceException { - - iFastLane = (IFastLane) ((BindingController)this).lookupFc("IFastLane"); - - System.out.println("Ordering "+qty+" "+item+" for "+account+"..."); - Order order = iFastLane.oneShotOrder(this,item,qty,address,account); - System.out.println(order); - } - - private void scenario2( - String[] items, int[] qties, String address, String account ) { - - try { - _scenario2(items,qties,address,account); - } - catch (Exception e) { - System.err.println("Exception: "+e.getMessage()); - e.printStackTrace(); - } - } - - private void _scenario2( - String[] items, int[] qties, String address, String account ) - throws - InsufficientBalanceException, UnknownAccountException, - UnknownItemException, InvalidCartException, - NoSuchInterfaceException { - - iLane = (ILane) ((BindingController)this).lookupFc("ILane"); - - System.out.println("Ordering for "+account+"..."); - Cart cart = null; - for (int i = 0; i < items.length; i++) { - System.out.println("Item: "+items[i]+", quantity: "+qties[i]); - cart = iLane.addItemToCart(cart,this,items[i],qties[i]); - } - Order order = iLane.pay(cart,address,account); - System.out.println(order); - } - - // ----------------------------------------------------- - // Implementation of the IClient interface - // ----------------------------------------------------- - -} \ No newline at end of file diff --git a/aokell/examples/estore/src/estore/client/ClientType.fractal b/aokell/examples/estore/src/estore/client/ClientType.fractal deleted file mode 100644 index 08d91e450c5e95ce914b201bd84f379405a8844f..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/client/ClientType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - diff --git a/aokell/examples/estore/src/estore/client/IClient.java b/aokell/examples/estore/src/estore/client/IClient.java deleted file mode 100644 index 166dd218cc4227c9c7a15a86c5849103f688c0be..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/client/IClient.java +++ /dev/null @@ -1,31 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.client; - -/** - * @author Lionel Seinturier - */ -public interface IClient { - -} diff --git a/aokell/examples/estore/src/estore/provider/IProvider.java b/aokell/examples/estore/src/estore/provider/IProvider.java deleted file mode 100644 index 3ebcf01acecfd09ebcebe29eee193498ab51a89b..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/provider/IProvider.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.provider; - -import estore.store.IStore; - -/** - * @author Lionel Seinturier - */ -public interface IProvider { - - /** - * Get the price of an item provided by this provider. - * - * @param item - * @return - */ - double getPrice( Object item ) throws UnknownItemException; - - /** - * Emit an order for items. - * The provider returns the delay for delivering the items. - * - * @param store the store that emits the order - * @param item the item ordered - * @param qty the quantity ordered - * @return the delay (in hours) - */ - int order( IStore store, Object item, int qty ) throws UnknownItemException; - -} diff --git a/aokell/examples/estore/src/estore/provider/Provider.fractal b/aokell/examples/estore/src/estore/provider/Provider.fractal deleted file mode 100644 index 3e26e9cd0a3603deff78992186540d222a33b1f0..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/provider/Provider.fractal +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/estore/src/estore/provider/ProviderImpl.java b/aokell/examples/estore/src/estore/provider/ProviderImpl.java deleted file mode 100644 index 8188d4d3843c1745d9c8806761e83c686299286f..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/provider/ProviderImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.provider; - -import java.util.HashMap; -import java.util.Map; - -import estore.store.IStore; - -public class ProviderImpl implements IProvider { - - private Map itemPrices = new HashMap(); - - /** - * Constructs a new ProviderImpl - */ - public ProviderImpl() { - itemPrices.put("CD",new Double(15)); - itemPrices.put("DVD",new Double(20)); - } - - // ----------------------------------------------------- - // Implementation of the IProvider interface - // ----------------------------------------------------- - - /** - * Get the price of an item provided by this provider. - * - * @param item - * @return - */ - public double getPrice( Object item ) throws UnknownItemException { - - if ( ! itemPrices.containsKey(item) ) - throw new UnknownItemException( - "Item "+item+ - " is not an item delivered by this provider."); - - Double price = (Double) itemPrices.get(item); - return price.doubleValue(); - } - - /** - * Emit an order for items. - * The provider returns the delay for delivering the items. - * - * @param store the store that emits the order - * @param item the item ordered - * @param qty the quantity ordered - * @return the delay (in hours) - */ - public int order( IStore store, Object item, int qty ) - throws UnknownItemException { - - if ( ! itemPrices.containsKey(item) ) - throw new UnknownItemException( - "Item "+item+ - " is not an item delivered by this provider."); - - // Actually the production process is quite chaotic - // We only know that the production a random number of hours!! - double r = Math.random() * 10 * qty; - return (int)r; - } - -} \ No newline at end of file diff --git a/aokell/examples/estore/src/estore/provider/ProviderType.fractal b/aokell/examples/estore/src/estore/provider/ProviderType.fractal deleted file mode 100644 index 06a4bf848632fd21d2040530b09f4cdc31dbba8d..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/provider/ProviderType.fractal +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/estore/src/estore/provider/UnknownItemException.java b/aokell/examples/estore/src/estore/provider/UnknownItemException.java deleted file mode 100644 index 99bb1b115b7a19cd7a1c6b1028f585e8a419c205..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/provider/UnknownItemException.java +++ /dev/null @@ -1,42 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.provider; - -/** - * @author Lionel Seinturier - */ -public class UnknownItemException extends Exception { - - private static final long serialVersionUID = -1585427033037517192L; - - private Object item; - - public UnknownItemException( String msg ) { - super(msg); - } - - public String getMessage() { - return "Item "+item+" is not an item delivered by this provider."; - } -} diff --git a/aokell/examples/estore/src/estore/store/Cart.java b/aokell/examples/estore/src/estore/store/Cart.java deleted file mode 100644 index 67c6312831e82620959c94f0d696b3391f9e7ef3..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/Cart.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -import java.util.HashMap; -import java.util.Map; - -import estore.client.IClient; - -/** - * @author Lionel Seinturier - */ -public class Cart { - - /** The client owning the cart. */ - public IClient client; - - /** The items currently added to the cart. key=item, value=quantity. */ - private Map items = new HashMap(); - - - public Cart(IClient client) { - this.client = client; - } - - public void addItem( Object item, int qty ) { - int oldQty = 0; - if ( items.containsKey(item) ) { - // The item has already been put in the cart - // Increase the number - oldQty = ((Integer) items.get(item)).intValue(); - } - items.put( item, new Integer(qty+oldQty) ); - } - - public Map getItems() { - return items; - } -} diff --git a/aokell/examples/estore/src/estore/store/IFastLane.java b/aokell/examples/estore/src/estore/store/IFastLane.java deleted file mode 100644 index fb263ac4ab8136d2f179e6b97d9d9f673ef9f6ca..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/IFastLane.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -import estore.bank.InsufficientBalanceException; -import estore.bank.UnknownAccountException; -import estore.client.IClient; -import estore.provider.UnknownItemException; - -/** - * @author Lionel Seinturier - */ -public interface IFastLane extends IStore { - - /** - * Used by a client to order an item. - * The whole process of ordering is encapsulated by this method. - * If several items need to be ordered, this method needs to be - * called several times, but the items will appear in separate orders. - * - * @param client - * @param item - * @param quantity - * @param address - * @param bankAccount - * @return the order - */ - Order oneShotOrder( - IClient client, - Object item, - int quantity, - Object address, - Object bankAccount - ) - throws - UnknownItemException, - InsufficientBalanceException, UnknownAccountException; - -} diff --git a/aokell/examples/estore/src/estore/store/IJustHaveALook.java b/aokell/examples/estore/src/estore/store/IJustHaveALook.java deleted file mode 100644 index 83dce85b9fc1381d1c3f30a6988b6968c54962ed..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/IJustHaveALook.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -import estore.provider.UnknownItemException; - -/** - * @author Lionel Seinturier - */ -public interface IJustHaveALook extends IStore { - - /** - * @param item a given item - * @return the price of a given item - * @throws UnknownItemException - */ - double getPrice( Object item ) throws UnknownItemException; - - /** - * @param item a given item - * @param qty a given quantity - * @return - * true if the given quantity of the given item is available - * directly from the store - * i.e. without having to re-order it from the provider - * @throws UnknownItemException - */ - boolean isAvailable( Object item, int qty ) throws UnknownItemException; - -} diff --git a/aokell/examples/estore/src/estore/store/ILane.java b/aokell/examples/estore/src/estore/store/ILane.java deleted file mode 100644 index 3e6fb268b400b4793633b3a7edd9cdece9d2c0d5..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/ILane.java +++ /dev/null @@ -1,74 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -import estore.bank.InsufficientBalanceException; -import estore.bank.UnknownAccountException; -import estore.client.IClient; -import estore.provider.UnknownItemException; - -/** - * @author Lionel Seinturier - */ -public interface ILane extends IStore { - - /** - * Add an item to a cart. - * If the cart does not exist yet, create a new one. - * This method is called for each item one wants to add to the cart. - * - * @param cart a previously created cart or null - * @param client - * @param item - * @param qty - * @return - * Implementation dependant. - * Either a new cart at each call or the same cart updated. - * - * @throws UnknownItemException - * @throws InvalidCartException - * if the given client does not own the given cart - */ - Cart addItemToCart( - Cart cart, - IClient client, - Object item, - int qty ) - throws UnknownItemException, InvalidCartException; - - /** - * Once all the items have been added to the cart, - * this method finish make the payment. - * - * @param cart - * @param address - * @param bankAccount - * @return the order - */ - Order pay( Cart cart, Object address, Object bankAccount ) - throws - InvalidCartException, UnknownItemException, - InsufficientBalanceException, UnknownAccountException; - -} diff --git a/aokell/examples/estore/src/estore/store/IStore.java b/aokell/examples/estore/src/estore/store/IStore.java deleted file mode 100644 index 894b9ab5c6c1553c072398695ce5f02b8732a059..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/IStore.java +++ /dev/null @@ -1,31 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -/** - * @author Lionel Seinturier - */ -public interface IStore { - -} diff --git a/aokell/examples/estore/src/estore/store/InvalidCartException.java b/aokell/examples/estore/src/estore/store/InvalidCartException.java deleted file mode 100644 index a56e5affa03f88ab36c860b985130a572c69d9d6..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/InvalidCartException.java +++ /dev/null @@ -1,37 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -/** - * @author Lionel Seinturier - */ -public class InvalidCartException extends Exception { - - private static final long serialVersionUID = -6561524790558683191L; - - public InvalidCartException(String msg) { - super(msg); - } - -} diff --git a/aokell/examples/estore/src/estore/store/ItemInStock.java b/aokell/examples/estore/src/estore/store/ItemInStock.java deleted file mode 100644 index b7b68e6f67ba130c3ffc08d25c2639e85e0bd285..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/ItemInStock.java +++ /dev/null @@ -1,61 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -import estore.provider.IProvider; - -/** - * @author Lionel Seinturier - */ -public class ItemInStock { - - /** The total number of ItemInStock instances created. */ - private static int numItems; - - /** The index of this item. */ - private int num; - - public Object item; - public int quantity; - public double price; - public IProvider provider; - - private ItemInStock() { - num = numItems++; - } - - public ItemInStock(Object item, int quantity, double price, - IProvider provider) { - this(); - this.item = item; - this.quantity = quantity; - this.price = price; - this.provider = provider; - } - - public String toString() { - return "Item #"+num; - } - -} diff --git a/aokell/examples/estore/src/estore/store/Order.java b/aokell/examples/estore/src/estore/store/Order.java deleted file mode 100644 index 76731d1eb3f1ffa4c0d269aac77900d132adbb9b..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/Order.java +++ /dev/null @@ -1,155 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import estore.client.IClient; -import estore.provider.UnknownItemException; - -/** - * @author Lionel Seinturier - */ -public class Order { - - /** The total number of orders emitted so far. */ - private static int numOrders; - - /** The index of this order. */ - private int num; - - public IClient client; - public Object item; - public Object address; - public Object bankAccount; - - /** The date at which the ordered is issued. */ - public Date date; - - /** The delay for delivering the items in the order. */ - private int delay; - - /** The items currently in the order. */ - private Set items = new HashSet(); - - /** The quantities of each item ordered. key=item, value=quantity. */ - private Map itemQuantities = new HashMap(); - - /** The individual prices of each item ordered. key=item, value=price. */ - private Map itemPrices = new HashMap(); - - - private Order() { - num = numOrders++; - date = new Date(); - } - - public Order(IClient client, Object address, Object bankAccount) { - this(); - this.client = client; - this.address = address; - this.bankAccount = bankAccount; - } - - /** - * Add an item to the order. - * - * @param item - * @param qty - * @param price - * @throws UnknownItemException - */ - public void addItem( Object item, int qty, double price ) - throws UnknownItemException { - - if ( itemPrices.containsKey(item) ) { - double oldPrice = ((Double) itemPrices.get(item)).doubleValue(); - if ( oldPrice != price ) - throw new UnknownItemException( - "Item "+item+" price ("+price+ - ") added to cart is different from the price ("+ - oldPrice+") of the same item already in the cart" ); - } - - items.add(item); - itemPrices.put( item, new Double(price) ); - - int newQty = qty; - if ( itemQuantities.containsKey(item) ) { - newQty += ((Integer) itemQuantities.get(item)).intValue(); - } - itemQuantities.put( item, new Integer(newQty) ); - } - - /** - * Compute the total amount of the order - */ - public double computeAmount() { - - double amount = 0; - - for (Iterator iter = items.iterator(); iter.hasNext();) { - Object item = iter.next(); - int qty = ((Integer)itemQuantities.get(item)).intValue(); - double price = ((Double)itemPrices.get(item)).doubleValue(); - - amount += qty*price; - } - - return amount; - } - - /** - * @return Returns the delay for delivering this order. - */ - public int getDelay() { - return delay; - } - - /** - * Set the delay for this order. - * The delay is the highest delay for delivering all the items of an order. - */ - public void setDelay(int delay) { - if ( delay > this.delay ) - this.delay = delay; - } - - public int getKey() { - return num; - } - - public String toString() { - String msg = "Order #"+num+" "; - msg += "amount: "+computeAmount()+" "; - msg += "delay: "+getDelay()+"h "; - msg += "issued on: "+date; - return msg; - } -} diff --git a/aokell/examples/estore/src/estore/store/Store.fractal b/aokell/examples/estore/src/estore/store/Store.fractal deleted file mode 100644 index b94d5cb5a1158f34dcfe0ae4cca50955e03a1009..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/Store.fractal +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/estore/src/estore/store/StoreImpl.java b/aokell/examples/estore/src/estore/store/StoreImpl.java deleted file mode 100644 index a5fb05a4cb0b4e6cb7cb91f1d6a483584fb3434d..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/StoreImpl.java +++ /dev/null @@ -1,328 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore.store; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - -import estore.bank.IBank; -import estore.bank.InsufficientBalanceException; -import estore.bank.UnknownAccountException; -import estore.client.IClient; -import estore.provider.IProvider; -import estore.provider.UnknownItemException; - -public class StoreImpl - implements IStore, IFastLane, ILane, IJustHaveALook { - - public final static String IPROVIDER_BINDING = "IProvider"; - public final static String IBANK_BINDING = "IBank"; - private IProvider iProvider; - private IBank iBank; - - /** - * Constructs a new StoreImpl - */ - public StoreImpl() { - // ... - } - - // ----------------------------------------------------- - // Implementation of the IJustHaveALook interface - // ----------------------------------------------------- - - /** - * @param item a given item - * @return the price of a given item - * @throws UnknownItemException - */ - public double getPrice( Object item ) throws UnknownItemException { - return iProvider.getPrice(item); - } - - /** - * @param item a given item - * @param qty a given quantity - * @return - * true if the given quantity of the given item is available - * directly from the store - * i.e. without having to re-order it from the provider - */ - public boolean isAvailable( Object item, int qty ) - throws UnknownItemException { - - if ( ! itemsInStock.containsKey(item) ) - throw new UnknownItemException( - "Item "+item+ - " does not correspond to any known reference"); - - ItemInStock iis = (ItemInStock) itemsInStock.get(item); - boolean isAvailable = (iis.quantity >= qty); - - return isAvailable; - } - - // ----------------------------------------------------- - // Implementation of the IStore interface - // ----------------------------------------------------- - - // ----------------------------------------------------- - // Implementation of the ILane interface - // ----------------------------------------------------- - /** - * Add an item to a cart. - * If the cart does not exist yet, create a new one. - * This method is called for each item one wants to add to the cart. - * - * @param cart a previously created cart or null - * @param client - * @param item - * @param qty - * @return - * Implementation dependant. - * Either a new cart at each call or the same cart updated. - * - * @throws UnknownItemException - * @throws MismatchClientCartException - * if the given client does not own the given cart - */ - public Cart addItemToCart( - Cart cart, - IClient client, - Object item, - int qty ) - throws UnknownItemException, InvalidCartException { - - if ( cart == null ) { - // If no cart is provided, create a new one - cart = new Cart(client); - } - else { - if ( client != cart.client ) - throw new InvalidCartException( - "Cart "+cart+" does not belong to "+client); - } - - cart.addItem(item,qty); - - return cart; - } - - /** - * Once all the items have been added to the cart, - * this method finish make the payment - * - * @param cart - * @param address - * @param bankAccount - * @return the order - * - * @throws UnknownItemException - */ - public Order pay( Cart cart, Object address, Object bankAccount ) - throws - InvalidCartException, UnknownItemException, - InsufficientBalanceException, UnknownAccountException { - - if ( cart == null ) - throw new InvalidCartException("Cart shouldn't be null"); - - // Create a new order - Order order = new Order( cart.client, address, bankAccount ); - orders.put( new Integer(order.getKey()), order ); - - // Order all the items of the cart - Set entries = cart.getItems().entrySet(); - for (Iterator iter = entries.iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry) iter.next(); - Object item = entry.getKey(); - int qty = ((Integer) entry.getValue()).intValue(); - - treatOrder(order,item,qty); - } - double amount = order.computeAmount(); - - try { - iBank = (IBank) ((BindingController)this).lookupFc("IBank"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - // Make the payment - // Throws InsuffisiantBalanceException if the client account is - // not sufficiently balanced - iBank.transfert(bankAccount,toString(),amount); - - return order; - } - - // ----------------------------------------------------- - // Implementation of the IFastLane interface - // ----------------------------------------------------- - - /** - * A map of emitted orders. - * keys = order keys as Integers - * values = Order instances - */ - private Map orders = new HashMap(); - - /** - * A map of items available in the stock of the store. - * keys = the references of the items as Objects - * values = ItemInStock instances - */ - private Map itemsInStock = new HashMap(); - - /** - * Used by a client to order an item. - * The whole process of ordering is encapsulated by this method. - * If several items need to be ordered, this method needs to be - * called several times, but the items will appear in separate orders. - * - * @param client - * @param item - * @param qty - * @param address - * @param bankAccount - * @return the order - * - * @throws UnknownItemException - * @throws InsufficientBalanceException - * @throws UnknownAccountException - */ - public Order oneShotOrder( - IClient client, - Object item, - int qty, - Object address, - Object bankAccount - ) - throws - UnknownItemException, - InsufficientBalanceException, UnknownAccountException { - - // Create a new order - Order order = new Order( client, address, bankAccount ); - orders.put( new Integer(order.getKey()), order ); - - // Treat the item ordered - treatOrder(order,item,qty); - double amount = order.computeAmount(); - - try { - iBank = (IBank) ((BindingController)this).lookupFc("IBank"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - // Make the payment - // Throws InsuffisiantBalanceException if the client account is - // not sufficiently balanced - iBank.transfert(bankAccount,toString(),amount); - - return order; - } - - /** - * Treat an item ordered by a client and update the corresponding order. - * - * @param order - * @param item - * @param qty - * @return - * - * @throws UnknownItemException - * @throws InsufficientBalanceException - * @throws UnknownAccountException - */ - private void treatOrder( Order order, Object item, int qty ) - throws UnknownItemException { - - // The number of additional item to order - // in case we need to place an order to the provider - final int more = 10; - - try { - iProvider = (IProvider) ((BindingController)this).lookupFc("IProvider"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - // The price of the ordered item - // Throws UnknownItemException if the item does not exist - final double price = iProvider.getPrice(item); - - final double totalAmount = price*qty; - - // The delay (in hours) for delivering the order - // By default, it takes 2 hours to ship items from the stock - // This delay increases if an order is to be placed to the provider - int delay = 2; - - // Check whether the item is available in the stock - // If not, place an order for it to the provider - ItemInStock iis = (ItemInStock) itemsInStock.get(item); - if ( iis == null ) { - int quantity = qty + more; - delay += iProvider.order(this,item,quantity); - ItemInStock newItem = new ItemInStock(item,more,price,iProvider); - itemsInStock.put(item,newItem); - } - else { - // The item is in the stock - // Check whether there is a sufficient number of them - // to match the order - if ( iis.quantity >= qty ) { - iis.quantity -= qty; - } - else { - // An order to the provider needs to be issued - int quantity = qty + more; - delay += iProvider.order(this,item,quantity); - iis.quantity += more; - } - } - - // Update the order - order.addItem(item,qty,price); - order.setDelay(delay); - } - - // ----------------------------------------------------- - // Other methods - // ----------------------------------------------------- - - public String toString() { - return "E-Store"; - } -} \ No newline at end of file diff --git a/aokell/examples/estore/src/estore/store/StoreType.fractal b/aokell/examples/estore/src/estore/store/StoreType.fractal deleted file mode 100644 index 51754680ad45dea3e27ba6afeb3b3a2eb5b88b6e..0000000000000000000000000000000000000000 --- a/aokell/examples/estore/src/estore/store/StoreType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - diff --git a/aokell/examples/helloworld/README.txt b/aokell/examples/helloworld/README.txt deleted file mode 100644 index 6d10a35f637034cc96c1838bff5a137ae5a76375..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/README.txt +++ /dev/null @@ -1,158 +0,0 @@ -This example shows how to program a simple Fractal application with AOKell. -This is the Hello World of Fractal. - -To execute the example type: - ant execute - -The available Ant targets are: - compile: compile the example - execute: execute the example - help: display this help message - clean: clean the generated files - -When run, the example creates the following components -architecture: -- 1 root composite component -- 2 primitive components included in the root composite - - |--------------------------------------| - | | - | |--------| |--------| | -|-|-|--->|-| Client |-|--->|-| Server | | - | |--------| |--------| | - | | - |--------------------------------------| - -The server owns an interface with a method for displaying a message -and an attribute controller exporting two attributes: -- header: text to be printed before the message -- count: how many time the message must be printed - -In addition to printing the message, the server throws an exception -and print the stack trace to show which are the method visited by -the program. - -This program is run 5 times with 5 different configurations: -- the component assembly is defined with the API -- the component assembly is defined with Fractal ADL -- the component assembly is defined with the API and component implementations - follow the JL style (see below the section on the JL vs AO style) -- the component assembly is defined with template components and the API -- the component assembly is defined with template components and Fractal ADL - -A typical run of the program should return something like: - -=================================================== -==== Hello World with the API ==== -=================================================== -CLIENT created -SERVER created -Server: print method called - at cs.impl.ServerImpl.print(ServerImpl.java:38) - at aokell.generated.cs.impl.ServiceImplementedInterface.print(Unknown Source) - at cs.impl.ClientImpl.run(ClientImpl.java:46) - at aokell.generated.java.lang.RunnableImplementedInterface.run(Unknown Source) - at aokell.generated.java.lang.RunnableBoundableInterface.run(Unknown Source) - at cs.Main.main(Main.java:124) - at hw.Main.main(Main.java:39) -Server: begin printing... -->hello world -Server: print done. - -=================================================== -==== Hello World with the ADL ==== -=================================================== -CLIENT created -SERVER created -Server: print method called - at csadl.impl.ServerImpl.print(ServerImpl.java:39) - at aokell.generated.csadl.impl.ServiceImplementedInterface.print(Unknown Source) - at csadl.impl.ClientImpl.run(ClientImpl.java:48) - at aokell.generated.java.lang.RunnableImplementedInterface.run(Unknown Source) - at aokell.generated.java.lang.RunnableBoundableInterface.run(Unknown Source) - at csadl.Main.main(Main.java:61) - at hw.Main.main(Main.java:45) -Server: begin printing... -->hello world -Server: print done. - -=================================================== -==== Hello World with the API and the JL style ==== -=================================================== -CLIENT created -SERVER created -Server: print method called - at cssep.impl.ServerImpl.print(ServerImpl.java:39) - at aokell.generated.cssep.impl.ServiceImplementedInterface.print(Unknown Source) - at cssep.impl.ClientImpl.run(ClientImpl.java:39) - at aokell.generated.java.lang.RunnableImplementedInterface.run(Unknown Source) - at aokell.generated.java.lang.RunnableBoundableInterface.run(Unknown Source) - at cssep.Main.main(Main.java:124) - at hw.Main.main(Main.java:51) -Server: begin printing... -->hello world -Server: print done. - -=================================================== -==== Hello World with the API and templates ==== -=================================================== -CLIENT created -SERVER created -CLIENT created -SERVER created -Server: print method called - at cstemplate.impl.ServerImpl.print(ServerImpl.java:39) - at aokell.generated.cstemplate.impl.ServiceImplementedInterface.print(Unknown Source) - at cstemplate.impl.ClientImpl.run(ClientImpl.java:47) - at aokell.generated.java.lang.RunnableImplementedInterface.run(Unknown Source) - at aokell.generated.java.lang.RunnableBoundableInterface.run(Unknown Source) - at cstemplate.Main.main(Main.java:126) - at hw.Main.main(Main.java:57) -Server: begin printing... -->hello world -->hello world -->hello world -->hello world -Server: print done. - -=================================================== -==== Hello World with the ADL and templates ==== -=================================================== -CLIENT created -SERVER created -CLIENT created -SERVER created -Server: print method called - at cstemplateadl.impl.ServerImpl.print(ServerImpl.java:39) - at aokell.generated.cstemplateadl.impl.ServiceImplementedInterface.print(Unknown Source) - at cstemplateadl.impl.ClientImpl.run(ClientImpl.java:48) - at aokell.generated.java.lang.RunnableImplementedInterface.run(Unknown Source) - at aokell.generated.java.lang.RunnableBoundableInterface.run(Unknown Source) - at cstemplateadl.Main.main(Main.java:65) - at hw.Main.main(Main.java:63) -Server: begin printing... -->hello world -->hello world -->hello world -Server: print done. - - -AO style vs JL style for implementing components ------------------------------------------------- - -With the AO style, component content classes implement one of the -AOKell provided marker interfaces (for instance, -aokell.lib.membrane.primitive.PrimitiveType for primitive -components.) Based on these markers, AOKell aspects extend the -component content classes with the control logic. The control -interfaces are then directly available to the component programmer. -For instance, s/he can call this.bindFc even though the method has -not been implemented (the method is injected by the binding -controller aspect.) - -With the JL style, component content classes are just like what -they use to be with Julia. Content classes may implement control -interfaces, and if so, the membrane notifies the content whenever a -call to a control interfaces is issued. With the JL style, -programmers can then seamlessly run Fractal applications written for -Julia with AOKell. diff --git a/aokell/examples/helloworld/etc/execute.properties b/aokell/examples/helloworld/etc/execute.properties deleted file mode 100644 index dd07f278b85b023192b400ddf93b1ef1039ca68a..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/etc/execute.properties +++ /dev/null @@ -1,14 +0,0 @@ -# JVM arguments -run.jvm.parameters -Dfractal.provider=org.objectweb.fractal.aokell.AOKell - -# Java class to be launched -run.classname hw.Main - -# Application arguments -run.parameters - -# Java interfaces used as Fractal interfaces -# This property is only needed when compile-time generation of Fractal -# interfaces is used (fcinterface set to ct) - -fcinterface.ct.parameters java.lang.Runnable cs.impl.ServiceAttributes cs.impl.Service csadl.impl.ServiceAttributes csadl.impl.Service cssep.impl.ServiceAttributes cssep.impl.Service cstemplate.impl.ServiceAttributes cstemplate.impl.Service cstemplateadl.impl.ServiceAttributes cstemplateadl.impl.Service diff --git a/aokell/examples/helloworld/src/cs/Main.java b/aokell/examples/helloworld/src/cs/Main.java deleted file mode 100644 index bd595fee1c93e1ff64fbd95a9c2db26265fa6cd4..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cs/Main.java +++ /dev/null @@ -1,124 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cs; - -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; - -import cs.impl.ClientImpl; -import cs.impl.ServerImpl; -import cs.impl.Service; -import cs.impl.ServiceAttributes; - -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Get the bootstrap component and factories - // ---------------------------------------------------------- - Component boot = Fractal.getBootstrapComponent(); - TypeFactory tf = Fractal.getTypeFactory(boot); - GenericFactory cf = Fractal.getGenericFactory(boot); - - // ---------------------------------------------------------- - // Create the component types - // ---------------------------------------------------------- - ComponentType rType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType( - "m", - "java.lang.Runnable", - false, // server interface - false, // mandatory - false) // singleton - }); - - ComponentType cType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "java.lang.Runnable", false, false, false), - tf.createFcItfType("s", Service.class.getName(), true, false, false) - }); - ComponentType sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", Service.class.getName(), false, false, false), - tf.createFcItfType( - "attribute-controller", - ServiceAttributes.class.getName(), - false, - false, - false) - }); - - // ---------------------------------------------------------- - // Instantiate and initialize the components - // ---------------------------------------------------------- - Component rComp = cf.newFcInstance( - rType, - "composite", - null); - - Component cComp = cf.newFcInstance(cType, "primitive", ClientImpl.class.getName()); - Component sComp = cf.newFcInstance(sType, "parametricPrimitive", ServerImpl.class.getName()); - - - ServiceAttributes sa = (ServiceAttributes) - Fractal.getAttributeController(sComp); - sa.setHeader("->"); - sa.setCount(1); - - // ---------------------------------------------------------- - // Set component names - // ---------------------------------------------------------- - Fractal.getNameController(rComp).setFcName("root"); - Fractal.getNameController(cComp).setFcName("client"); - Fractal.getNameController(sComp).setFcName("server"); - - // ---------------------------------------------------------- - // Add the Client and Server components in the Root composite - // ---------------------------------------------------------- - Fractal.getContentController(rComp).addFcSubComponent(cComp); - Fractal.getContentController(rComp).addFcSubComponent(sComp); - - // ---------------------------------------------------------- - // Create bindings - // ---------------------------------------------------------- - Fractal.getBindingController(rComp).bindFc("m", cComp.getFcInterface("m")); - Fractal.getBindingController(cComp).bindFc("s", sComp.getFcInterface("s")); - - // ---------------------------------------------------------- - // Start the Root component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(rComp).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - Runnable mainItf = (Runnable)rComp.getFcInterface("m"); - mainItf.run(); - } -} diff --git a/aokell/examples/helloworld/src/cs/impl/ClientImpl.java b/aokell/examples/helloworld/src/cs/impl/ClientImpl.java deleted file mode 100644 index 80c5369855447303fbb8deb2f080782823409095..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cs/impl/ClientImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cs.impl; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - - -public class ClientImpl implements Runnable { - - public ClientImpl () { - System.err.println("CLIENT created"); - } - - public void run () { - Service service = null; - try { - service = (Service) ((BindingController)this).lookupFc("s"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - service.print("hello world"); - } - -} diff --git a/aokell/examples/helloworld/src/cs/impl/ServerImpl.java b/aokell/examples/helloworld/src/cs/impl/ServerImpl.java deleted file mode 100644 index 655975f337464eec9181f47b00227871f909ddee..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cs/impl/ServerImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ -package cs.impl; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header; - - private int count; - - public ServerImpl () { - System.err.println("SERVER created"); - } - - public void print (final String msg) { - new Exception() { - private static final long serialVersionUID = 2182742162070453637L; - 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/aokell/examples/helloworld/src/cs/impl/Service.java b/aokell/examples/helloworld/src/cs/impl/Service.java deleted file mode 100644 index 6605d3751a00683d2c45f988ad86af79e6fbf9f1..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cs/impl/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cs.impl; - -public interface Service { - void print (String msg); -} diff --git a/aokell/examples/helloworld/src/cs/impl/ServiceAttributes.java b/aokell/examples/helloworld/src/cs/impl/ServiceAttributes.java deleted file mode 100644 index 4b3694c3f839fe5d9033ce2d37132391e7f908dd..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cs/impl/ServiceAttributes.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cs.impl; - -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/aokell/examples/helloworld/src/csadl/Main.java b/aokell/examples/helloworld/src/csadl/Main.java deleted file mode 100644 index 6503d83eb3acd3ae62bb072ad41f0fcc5fe7f501..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/Main.java +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package csadl; - -import java.util.HashMap; - -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.util.Fractal; - - -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Load the ADL definition - // ---------------------------------------------------------- - Factory factory = - FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component root = (Component) - factory.newComponent("csadl.impl.ClientServerImpl",new HashMap()); - - // ---------------------------------------------------------- - // Start the Root component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(root).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - ((Runnable)root.getFcInterface("m")).run(); - - } -} diff --git a/aokell/examples/helloworld/src/csadl/impl/AbstractClientServer.fractal b/aokell/examples/helloworld/src/csadl/impl/AbstractClientServer.fractal deleted file mode 100644 index 011c4efb4fa1f6fdb56d8e13de111da36d7d372e..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/AbstractClientServer.fractal +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/csadl/impl/ClientImpl.fractal b/aokell/examples/helloworld/src/csadl/impl/ClientImpl.fractal deleted file mode 100644 index 8ac3c7bda83a1e7bd2b78db7e8e2d600fc7cd324..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ClientImpl.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/helloworld/src/csadl/impl/ClientImpl.java b/aokell/examples/helloworld/src/csadl/impl/ClientImpl.java deleted file mode 100644 index 37c020b2e4715d99e62f26f717fdacf0c6d58a05..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ClientImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package csadl.impl; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - - -public class ClientImpl implements Runnable { - - public ClientImpl () { - System.err.println("CLIENT created"); - } - - private Service service; - - public void run () { - - try { - service = (Service) ((BindingController)this).lookupFc("s"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - service.print("hello world"); - } - -} diff --git a/aokell/examples/helloworld/src/csadl/impl/ClientServerImpl.fractal b/aokell/examples/helloworld/src/csadl/impl/ClientServerImpl.fractal deleted file mode 100644 index 004da971bb9647c56265cce2a5251b01997fdbf3..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ClientServerImpl.fractal +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/csadl/impl/ClientType.fractal b/aokell/examples/helloworld/src/csadl/impl/ClientType.fractal deleted file mode 100644 index ab1797eb7efcff2969623a9e9a62d5952864c1d4..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ClientType.fractal +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/csadl/impl/RootType.fractal b/aokell/examples/helloworld/src/csadl/impl/RootType.fractal deleted file mode 100644 index a9defbc0747f3501eb123480c86c4ed9a72eed5f..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/RootType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/helloworld/src/csadl/impl/ServerImpl.fractal b/aokell/examples/helloworld/src/csadl/impl/ServerImpl.fractal deleted file mode 100644 index 86b96b83ee7e767a60ae225dd732654635522ab7..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ServerImpl.fractal +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/csadl/impl/ServerImpl.java b/aokell/examples/helloworld/src/csadl/impl/ServerImpl.java deleted file mode 100644 index 1caff6b5c103e45af223feeb182c563b7a24c0ef..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ServerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package csadl.impl; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header; - - private int count; - - public ServerImpl () { - System.err.println("SERVER created"); - } - - public void print (final String msg) { - new Exception() { - private static final long serialVersionUID = 3881199107085394940L; - 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/aokell/examples/helloworld/src/csadl/impl/ServerType.fractal b/aokell/examples/helloworld/src/csadl/impl/ServerType.fractal deleted file mode 100644 index 5e87d3444f01b34aa872ce7679cc2d80b92d0732..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ServerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/helloworld/src/csadl/impl/Service.java b/aokell/examples/helloworld/src/csadl/impl/Service.java deleted file mode 100644 index 52d3d692609dd5ca295fb31a20849b0a98a2a58e..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package csadl.impl; - -public interface Service { - void print (String msg); -} diff --git a/aokell/examples/helloworld/src/csadl/impl/ServiceAttributes.java b/aokell/examples/helloworld/src/csadl/impl/ServiceAttributes.java deleted file mode 100644 index 6207a10685955f0d731c7869f1e96fd922eca2b1..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/csadl/impl/ServiceAttributes.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package csadl.impl; - -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/aokell/examples/helloworld/src/cssep/Main.java b/aokell/examples/helloworld/src/cssep/Main.java deleted file mode 100644 index 4574bb243b740c1bea2c129f928efba80316a5c8..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cssep/Main.java +++ /dev/null @@ -1,124 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cssep; - -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; - -import cssep.impl.ClientImpl; -import cssep.impl.ServerImpl; -import cssep.impl.Service; -import cssep.impl.ServiceAttributes; - -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Get the bootstrap component and factories - // ---------------------------------------------------------- - Component boot = Fractal.getBootstrapComponent(); - TypeFactory tf = Fractal.getTypeFactory(boot); - GenericFactory cf = Fractal.getGenericFactory(boot); - - // ---------------------------------------------------------- - // Create the component types - // ---------------------------------------------------------- - ComponentType rType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType( - "m", - "java.lang.Runnable", - false, // server interface - false, // mandatory - false) // singleton - }); - - ComponentType cType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "java.lang.Runnable", false, false, false), - tf.createFcItfType("s", Service.class.getName(), true, false, false) - }); - ComponentType sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", Service.class.getName(), false, false, false), - tf.createFcItfType( - "attribute-controller", - ServiceAttributes.class.getName(), - false, - false, - false) - }); - - // ---------------------------------------------------------- - // Instantiate and initialize the components - // ---------------------------------------------------------- - Component rComp = cf.newFcInstance( - rType, - "composite", - null); - - Component cComp = cf.newFcInstance(cType, "primitive", ClientImpl.class.getName()); - Component sComp = cf.newFcInstance(sType, "primitive", ServerImpl.class.getName()); - - - ServiceAttributes sa = (ServiceAttributes) - Fractal.getAttributeController(sComp); - sa.setHeader("->"); - sa.setCount(1); - - // ---------------------------------------------------------- - // Set component names - // ---------------------------------------------------------- - Fractal.getNameController(rComp).setFcName("root"); - Fractal.getNameController(cComp).setFcName("client"); - Fractal.getNameController(sComp).setFcName("server"); - - // ---------------------------------------------------------- - // Add the Client and Server components in the Root composite - // ---------------------------------------------------------- - Fractal.getContentController(rComp).addFcSubComponent(cComp); - Fractal.getContentController(rComp).addFcSubComponent(sComp); - - // ---------------------------------------------------------- - // Create bindings - // ---------------------------------------------------------- - Fractal.getBindingController(rComp).bindFc("m", cComp.getFcInterface("m")); - Fractal.getBindingController(cComp).bindFc("s", sComp.getFcInterface("s")); - - // ---------------------------------------------------------- - // Start the Root component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(rComp).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - Runnable mainItf = (Runnable)rComp.getFcInterface("m"); - mainItf.run(); - } -} diff --git a/aokell/examples/helloworld/src/cssep/impl/ClientImpl.java b/aokell/examples/helloworld/src/cssep/impl/ClientImpl.java deleted file mode 100644 index 55337fb26e8412d4f180ba56c141931eb26ca59d..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cssep/impl/ClientImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cssep.impl; - -import org.objectweb.fractal.api.control.BindingController; - - -public class ClientImpl implements Runnable, BindingController { - - public ClientImpl () { - System.err.println("CLIENT created"); - } - - public void run () { - service.print("hello world"); - } - - private Service service; - - 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/aokell/examples/helloworld/src/cssep/impl/ServerImpl.java b/aokell/examples/helloworld/src/cssep/impl/ServerImpl.java deleted file mode 100644 index c26684890aece00c4f5c5495760de60d5758166e..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cssep/impl/ServerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cssep.impl; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header; - - private int count; - - public ServerImpl () { - System.err.println("SERVER created"); - } - - public void print (final String msg) { - new Exception() { - private static final long serialVersionUID = -6030032395568684566L; - 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/aokell/examples/helloworld/src/cssep/impl/Service.java b/aokell/examples/helloworld/src/cssep/impl/Service.java deleted file mode 100644 index 58bd33d32a7118f0efe1068bc14815e7dfec34c7..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cssep/impl/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cssep.impl; - -public interface Service { - void print (String msg); -} diff --git a/aokell/examples/helloworld/src/cssep/impl/ServiceAttributes.java b/aokell/examples/helloworld/src/cssep/impl/ServiceAttributes.java deleted file mode 100644 index 3034a9aa5b9f96703e9e1faa1c6fca9acdd8c5ba..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cssep/impl/ServiceAttributes.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cssep.impl; - -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/aokell/examples/helloworld/src/cstemplate/Main.java b/aokell/examples/helloworld/src/cstemplate/Main.java deleted file mode 100644 index 6774dd4be74bc1d7e3034a9d626f9f26a5bfa922..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplate/Main.java +++ /dev/null @@ -1,127 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplate; - -import org.objectweb.fractal.api.Component; -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.util.Fractal; - -import cstemplate.impl.ClientImpl; -import cstemplate.impl.ServerImpl; -import cstemplate.impl.Service; -import cstemplate.impl.ServiceAttributes; - - -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Get the bootstrap component and factories - // ---------------------------------------------------------- - Component boot = Fractal.getBootstrapComponent(); - TypeFactory tf = Fractal.getTypeFactory(boot); - GenericFactory cf = Fractal.getGenericFactory(boot); - - // ---------------------------------------------------------- - // Create the component types - // ---------------------------------------------------------- - ComponentType rType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType( - "m", - "java.lang.Runnable", - false, // server interface - false, // mandatory - false) // singleton - }); - - ComponentType cType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("m", "java.lang.Runnable", false, false, false), - tf.createFcItfType("s", Service.class.getName(), true, false, false) - }); - ComponentType sType = tf.createFcType(new InterfaceType[] { - tf.createFcItfType("s", Service.class.getName(), false, false, false), - tf.createFcItfType( - "attribute-controller", - ServiceAttributes.class.getName(), - false, - false, - false) - }); - - // ---------------------------------------------------------- - // Instantiate and initialize the components - // ---------------------------------------------------------- - Component rTemplate = cf.newFcInstance( - rType,"compositeTemplate",new Object[]{"composite",null}); - - Component cTemplate = cf.newFcInstance( - cType,"primitiveTemplate", - new Object[]{"primitive",ClientImpl.class.getName()} ); - - Component sTemplate = cf.newFcInstance( - sType,"parametricPrimitiveTemplate", - new Object[]{"parametricPrimitive",ServerImpl.class.getName()} ); - - ServiceAttributes sa = (ServiceAttributes) - Fractal.getAttributeController(sTemplate); - sa.setHeader("->"); - sa.setCount(4); - - // ---------------------------------------------------------- - // Add the Client and Server components in the Root composite - // ---------------------------------------------------------- - Fractal.getContentController(rTemplate).addFcSubComponent(cTemplate); - Fractal.getContentController(rTemplate).addFcSubComponent(sTemplate); - - // ---------------------------------------------------------- - // Create bindings - // ---------------------------------------------------------- - Fractal.getBindingController(rTemplate).bindFc("m", cTemplate.getFcInterface("m")); - Fractal.getBindingController(cTemplate).bindFc("s", sTemplate.getFcInterface("s")); - - // ---------------------------------------------------------- - // Instantiate the template - // ---------------------------------------------------------- - Factory f = Fractal.getFactory(rTemplate); - Component rComp = f.newFcInstance(); - - // ---------------------------------------------------------- - // Start the component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(rComp).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - ((Runnable)rComp.getFcInterface("m")).run(); - - } -} diff --git a/aokell/examples/helloworld/src/cstemplate/impl/ClientImpl.java b/aokell/examples/helloworld/src/cstemplate/impl/ClientImpl.java deleted file mode 100644 index 470ffc82ce9bb94ca9e9668a70ec3f97e06a9357..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplate/impl/ClientImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplate.impl; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - - -public class ClientImpl implements Runnable { - - public ClientImpl () { - System.err.println("CLIENT created"); - } - - public void run () { - Service service = null; - try { - Object obj = ((BindingController)this).lookupFc("s"); - service = (Service) obj; - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - service.print("hello world"); - } - -} diff --git a/aokell/examples/helloworld/src/cstemplate/impl/ServerImpl.java b/aokell/examples/helloworld/src/cstemplate/impl/ServerImpl.java deleted file mode 100644 index 7e66aae5dae856b73dd0f7d1b3e450fc4ecde71b..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplate/impl/ServerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplate.impl; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header; - - private int count; - - public ServerImpl () { - System.err.println("SERVER created"); - } - - public void print (final String msg) { - new Exception() { - private static final long serialVersionUID = -1967878962345630137L; - 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/aokell/examples/helloworld/src/cstemplate/impl/Service.java b/aokell/examples/helloworld/src/cstemplate/impl/Service.java deleted file mode 100644 index 0421eaca9770d6af41122ae42467e0ab28229657..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplate/impl/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplate.impl; - -public interface Service { - void print (String msg); -} diff --git a/aokell/examples/helloworld/src/cstemplate/impl/ServiceAttributes.java b/aokell/examples/helloworld/src/cstemplate/impl/ServiceAttributes.java deleted file mode 100644 index 46147e40c88fe068aaca82ae91b0af563cf2b4c3..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplate/impl/ServiceAttributes.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplate.impl; - -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/aokell/examples/helloworld/src/cstemplateadl/Main.java b/aokell/examples/helloworld/src/cstemplateadl/Main.java deleted file mode 100644 index 833260c76a56ee300ac66d5cfeb7eb42674d0055..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/Main.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplateadl; - -import java.util.HashMap; - -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.util.Fractal; - - -public class Main { - - public static void main(String[] args) throws Exception { - - // ---------------------------------------------------------- - // Load the ADL definition - // ---------------------------------------------------------- - Factory factory = - FactoryFactory.getFactory(FactoryFactory.FRACTAL_BACKEND); - Component rootTemplate = (Component) factory.newComponent( - "cstemplateadl.impl.ClientServerImpl",new HashMap()); - - // ---------------------------------------------------------- - // Instantiate the template - // ---------------------------------------------------------- - Component root = Fractal.getFactory(rootTemplate).newFcInstance(); - - // ---------------------------------------------------------- - // Start the component - // ---------------------------------------------------------- - Fractal.getLifeCycleController(root).startFc(); - - // ---------------------------------------------------------- - // Call the entry point of the application - // ---------------------------------------------------------- - ((Runnable)root.getFcInterface("m")).run(); - } -} diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/AbstractClientServer.fractal b/aokell/examples/helloworld/src/cstemplateadl/impl/AbstractClientServer.fractal deleted file mode 100644 index e5622fc3eeb171cf2427619eba6dae9cb3d00a68..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/AbstractClientServer.fractal +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientImpl.fractal b/aokell/examples/helloworld/src/cstemplateadl/impl/ClientImpl.fractal deleted file mode 100644 index f7df3bcee0835512bdb21d5a32d2d685b5aaee0a..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientImpl.fractal +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientImpl.java b/aokell/examples/helloworld/src/cstemplateadl/impl/ClientImpl.java deleted file mode 100644 index 286273a6f8537dac5395e9dc61a13f57acf9d6d8..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplateadl.impl; - -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.control.BindingController; - - -public class ClientImpl implements Runnable { - - public ClientImpl () { - System.err.println("CLIENT created"); - } - - private Service service; - - public void run () { - - try { - service = (Service) ((BindingController)this).lookupFc("s"); - } - catch( NoSuchInterfaceException nsie ) { - throw new RuntimeException(nsie.getMessage()); - } - - service.print("hello world"); - } - -} diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientServerImpl.fractal b/aokell/examples/helloworld/src/cstemplateadl/impl/ClientServerImpl.fractal deleted file mode 100644 index 3a7110fb63f1e20972addf42f772012ed8f12e8f..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientServerImpl.fractal +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientType.fractal b/aokell/examples/helloworld/src/cstemplateadl/impl/ClientType.fractal deleted file mode 100644 index ddd3ef42a62b9586b82e60183b7b0f8e7865be4b..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ClientType.fractal +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/RootType.fractal b/aokell/examples/helloworld/src/cstemplateadl/impl/RootType.fractal deleted file mode 100644 index 19fb93a672d1c1f1744906626699a8f9bba0ebed..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/RootType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/ServerImpl.fractal b/aokell/examples/helloworld/src/cstemplateadl/impl/ServerImpl.fractal deleted file mode 100644 index 54f138b003536e1591d2e4e28e7002cfc9930aa2..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ServerImpl.fractal +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/ServerImpl.java b/aokell/examples/helloworld/src/cstemplateadl/impl/ServerImpl.java deleted file mode 100644 index eccba0f2236863837edb0e246cb473d86d9baca5..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ServerImpl.java +++ /dev/null @@ -1,67 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplateadl.impl; - -public class ServerImpl implements Service, ServiceAttributes { - - private String header; - - private int count; - - public ServerImpl () { - System.err.println("SERVER created"); - } - - public void print (final String msg) { - new Exception() { - private static final long serialVersionUID = 6443839428703328850L; - 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/aokell/examples/helloworld/src/cstemplateadl/impl/ServerType.fractal b/aokell/examples/helloworld/src/cstemplateadl/impl/ServerType.fractal deleted file mode 100644 index e02641e3819f9eca86964e5833845bf7867d58fa..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ServerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/Service.java b/aokell/examples/helloworld/src/cstemplateadl/impl/Service.java deleted file mode 100644 index ff4e1d1e91e47318038e65e62e543d66655a8255..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/Service.java +++ /dev/null @@ -1,30 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplateadl.impl; - -public interface Service { - void print (String msg); -} diff --git a/aokell/examples/helloworld/src/cstemplateadl/impl/ServiceAttributes.java b/aokell/examples/helloworld/src/cstemplateadl/impl/ServiceAttributes.java deleted file mode 100644 index 0a75c56a1188bd3213d5d034dea7ae67495cb70e..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/cstemplateadl/impl/ServiceAttributes.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * Fractal Hello World Example - * 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 - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Eric Bruneton - * Author: Lionel Seinturier - */ - -package cstemplateadl.impl; - -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/aokell/examples/helloworld/src/hw/Main.java b/aokell/examples/helloworld/src/hw/Main.java deleted file mode 100644 index 0e4c4cd9da58b19d02651a3dc5a5e463e539af09..0000000000000000000000000000000000000000 --- a/aokell/examples/helloworld/src/hw/Main.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package hw; - -/** - * This class launches the five different versions of the Fractal Hello World - * application. - * - * @author Lionel Seinturier - */ -public class Main { - - public static void main(String[] args) throws Exception { - - System.err.println("==================================================="); - System.err.println("==== Hello World with the API ===="); - System.err.println("==================================================="); - cs.Main.main(args); - - System.err.println(); - System.err.println("==================================================="); - System.err.println("==== Hello World with the ADL ===="); - System.err.println("==================================================="); - csadl.Main.main(args); - - System.err.println(); - System.err.println("==================================================="); - System.err.println("==== Hello World with the API and the JL style ===="); - System.err.println("==================================================="); - cssep.Main.main(args); - - System.err.println(); - System.err.println("==================================================="); - System.err.println("==== Hello World with the API and templates ===="); - System.err.println("==================================================="); - cstemplate.Main.main(args); - - System.err.println(); - System.err.println("==================================================="); - System.err.println("==== Hello World with the ADL and templates ===="); - System.err.println("==================================================="); - cstemplateadl.Main.main(args); - - } -} diff --git a/aokell/externals/README.txt b/aokell/externals/README.txt deleted file mode 100644 index 336e5a5f98d9fbe884814c08329ea286ea55a00a..0000000000000000000000000000000000000000 --- a/aokell/externals/README.txt +++ /dev/null @@ -1 +0,0 @@ -This directory contains the external libraries required for running the product. diff --git a/aokell/externals/asm-2.2.jar b/aokell/externals/asm-2.2.jar deleted file mode 100644 index d4de0eccac9b801d4312195f734b5b25a1264f23..0000000000000000000000000000000000000000 Binary files a/aokell/externals/asm-2.2.jar and /dev/null differ diff --git a/aokell/externals/dtdparser.jar b/aokell/externals/dtdparser.jar deleted file mode 100644 index ddb33dc33e512b1394953e10a83d1fdad438dffc..0000000000000000000000000000000000000000 Binary files a/aokell/externals/dtdparser.jar and /dev/null differ diff --git a/aokell/externals/fractal-adl.jar b/aokell/externals/fractal-adl.jar deleted file mode 100644 index 705103f5824ac2d06944a09cf19c16b5873ec24a..0000000000000000000000000000000000000000 Binary files a/aokell/externals/fractal-adl.jar and /dev/null differ diff --git a/aokell/externals/fractal-util.jar b/aokell/externals/fractal-util.jar deleted file mode 100644 index ddbfcd2561daa2ec61dc826fea8fa2bc531c8e37..0000000000000000000000000000000000000000 Binary files a/aokell/externals/fractal-util.jar and /dev/null differ diff --git a/aokell/externals/fractal.jar b/aokell/externals/fractal.jar deleted file mode 100644 index eeebfb0ccfe33a884de25d70e0e6bde4b4a8d138..0000000000000000000000000000000000000000 Binary files a/aokell/externals/fractal.jar and /dev/null differ diff --git a/aokell/externals/ow_deployment_scheduling.jar b/aokell/externals/ow_deployment_scheduling.jar deleted file mode 100644 index 0f20b080a8d0979254b548c52dd40437060386ea..0000000000000000000000000000000000000000 Binary files a/aokell/externals/ow_deployment_scheduling.jar and /dev/null differ diff --git a/aokell/features/README.txt b/aokell/features/README.txt deleted file mode 100644 index dc3639982b5991f517a4ba1b6e9d0b98e74c55a2..0000000000000000000000000000000000000000 --- a/aokell/features/README.txt +++ /dev/null @@ -1,15 +0,0 @@ -This directory contains the implementation of some additional features of -AOKell. The features contained in this directory differ from the ones found in -the core source tree (src/), because they are: -- either optional, -- or comes in several versions. - -Five features exist: -- fcinterface: deals with the way Fractal interfaces are implemented, -- glue: deals with the way the control and the content are glued together, -- loggable: deals with whether primitive components can be logged, -- membrane: deals with the way control membranes are implemented, -- platform: deals with the targeted Java platform (J2SE or J2ME). - -See the README.txt file in the corresponding directories for further -explanations on these features. diff --git a/aokell/features/fcinterface/README.txt b/aokell/features/fcinterface/README.txt deleted file mode 100644 index 826944981ed6e143a9d6fd85deb49c81c8300f87..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/README.txt +++ /dev/null @@ -1,8 +0,0 @@ -This directory contains the implementation of the fcinterface feature. This -feature deals with the way Fractal interfaces are implemented. - -Two versions exist: -- rt (default): Fractal interface implementations are generated at runtime with - ASM -- ct: Fractal interface implementations can be precompiled with the - org.objectweb.fractal.aokell.tools.interf tool. \ No newline at end of file diff --git a/aokell/features/fcinterface/ct/examples/common/fcinterface.xml b/aokell/features/fcinterface/ct/examples/common/fcinterface.xml deleted file mode 100644 index 361995c317471825fae28d286d471095d6c3fe06..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/ct/examples/common/fcinterface.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/fcinterface/ct/fcinterface.properties b/aokell/features/fcinterface/ct/fcinterface.properties deleted file mode 100644 index 0e7ea30fefc30d53205e0ad968d2ac412c40a15e..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/ct/fcinterface.properties +++ /dev/null @@ -1,54 +0,0 @@ -============================================================================ -AOKell -Copyright (C) 2005-2006 INRIA, France Telecom, USTL - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Contact: Lionel.Seinturier@lifl.fr - -Author: Lionel Seinturier -============================================================================ - -fcinterface.ct.aokell.interfaces.oo \ - org.objectweb.fractal.api.factory.GenericFactory \ - org.objectweb.fractal.api.type.TypeFactory \ - org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerItf \ - org.objectweb.fractal.api.control.BindingController \ - org.objectweb.fractal.aokell.lib.control.component.ComponentItf \ - org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf \ - org.objectweb.fractal.api.factory.Factory \ - org.objectweb.fractal.julia.factory.Template \ - org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleCoordinatorItf \ - org.objectweb.fractal.aokell.lib.control.name.NameControllerItf \ - org.objectweb.fractal.julia.control.content.SuperControllerNotifier \ - org.objectweb.fractal.julia.control.lifecycle.LifeCycleCoordinator - -fcinterface.ct.aokell.interfaces.comp \ - org.objectweb.fractal.api.factory.GenericFactory \ - org.objectweb.fractal.api.type.TypeFactory \ - org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerItf \ - org.objectweb.fractal.api.control.BindingController \ - org.objectweb.fractal.aokell.lib.control.component.ComponentItf \ - org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf \ - org.objectweb.fractal.api.factory.Factory \ - org.objectweb.fractal.julia.factory.Template \ - org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleControllerItf \ - org.objectweb.fractal.aokell.lib.control.name.NameControllerItf \ - org.objectweb.fractal.julia.control.content.SuperControllerNotifier \ - \ - org.objectweb.fractal.api.Component \ - org.objectweb.fractal.api.control.ContentController \ - org.objectweb.fractal.api.control.NameController \ - org.objectweb.fractal.aokell.lib.control.membrane.MembraneControllerItf diff --git a/aokell/features/fcinterface/ct/fcinterface.xml b/aokell/features/fcinterface/ct/fcinterface.xml deleted file mode 100644 index 080430d9e5f4c892ed663e8618245bba6a23ef79..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/ct/fcinterface.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/fcinterface/rt/examples/common/fcinterface.xml b/aokell/features/fcinterface/rt/examples/common/fcinterface.xml deleted file mode 100644 index c5f071c77cbfe91ba4516bf85dea09b88db3b96a..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/examples/common/fcinterface.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/fcinterface/rt/fcinterface.xml b/aokell/features/fcinterface/rt/fcinterface.xml deleted file mode 100644 index 315793f6b399880eff9ccdf291fe91e34dc72b5e..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/fcinterface.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorFactory.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorFactory.java deleted file mode 100644 index c01006ee4535725bc133d83b2f316ea42ad552a0..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.fractal.aokell.lib.interf.GeneratorFactoryItf; -import org.objectweb.fractal.aokell.lib.interf.GeneratorItf; - - -/** - * The factory of ASM generators. - * - * @author Lionel Seinturier - */ -public class ASMGeneratorFactory implements GeneratorFactoryItf { - - private GeneratorItf impl = new ASMGeneratorForImplementedInterface(); - private GeneratorItf bound = new ASMGeneratorForBoundableInterface(); - - public GeneratorItf getImplementedInterfaceGenerator() { - return impl; - } - - public GeneratorItf getBoundableInterfaceGenerator() { - return bound; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorForBoundableInterface.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorForBoundableInterface.java deleted file mode 100644 index 25878f34453715335853c921703ce3fed942efd7..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorForBoundableInterface.java +++ /dev/null @@ -1,309 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashSet; -import java.util.Set; - -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.fractal.aokell.lib.InterfaceImpl; -import org.objectweb.fractal.aokell.lib.interf.AOKellGeneratedItf; -import org.objectweb.fractal.aokell.lib.interf.ClassDefinition; -import org.objectweb.fractal.aokell.lib.interf.GeneratorItf; -import org.objectweb.fractal.aokell.lib.util.PlatformHelper; - - -/** - * This class generates {@link org.objectweb.fractal.api.Interface} - * implementations for interfaces which are bound to a target interface. - * - * This is typically the case of: - *
    - *
  • interfaces own by composite components,
  • - *
  • client interfaces associated to primitive components.
  • - *
- * - * @author Lionel Seinturier - */ -public class ASMGeneratorForBoundableInterface implements GeneratorItf { - - /** - * Generate an Interface implementation by extending - * {@link InterfaceImpl}. - * - * @param targetClassname the name of the generated class - * @param delegateClassname the name of the class where calls will be delegated - * @return the generated class definition (Class and bytecode) - */ - public ClassDefinition generate( - String targetClassname, String delegateClassname ) { - - final String targetSignature = targetClassname.replace('.','/'); - final String delegateSignature = delegateClassname.replace('.','/'); - - // Class definition - // Name: targetClassname - // Extends: InterfaceImpl - ClassWriter cw = new ClassWriter(false); - cw.visit( - Opcodes.V1_1, - Opcodes.ACC_PUBLIC, - targetSignature, - null, - getInterfaceImpl(), - new String[] { - delegateSignature, - AOKellGeneratedItf.class.getName().replace('.','/') }); - - // Empty constructor generation - MethodVisitor mv = cw.visitMethod( - Opcodes.ACC_PUBLIC, - "", "()V", - null, - null); - - // Call the super contructor inherited from InterfaceImpl - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn( - Opcodes.INVOKESPECIAL, - getInterfaceImpl(), - "", "()V" ); - - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(5, 5); - - // For each method of delegateClassname generate a delegator method - ClassVisitor clv = - new BoundableInterfaceGenerator(cw,targetSignature,delegateSignature); - ClassReader cr; - try { - InputStream is = - PlatformHelper.getResourceAsStream( - delegateClassname.replace('.','/')+".class" ); - cr = new ClassReader(is); - } - catch( IOException e ) { - throw new RuntimeException("IOException: "+ e.getMessage()); - } - cr.accept(clv,true); - - cw.visitEnd(); - - // Load the proxy class - byte[] bytecode = cw.toByteArray(); - Class cl = PlatformHelper.defineClass(targetClassname,bytecode); - return new ClassDefinition(cl,bytecode); - } - - /** - * Return the name of the Interface implementation to be used as - * super class for generated implementations. - */ - protected String getInterfaceImpl() { - return InterfaceImpl.class.getName().replace('.','/'); - } -} - -/** - * ASM class visitor for generating delegation methods. - * - * For each visited method (typically defined in a Java interface), this class - * generates a method containing delegation code. This code delegates the call - * to the instance bound to the current interface (retrieved by calling lookupFc - * on the current binding controller). - * - * @author Lionel Seinturier - */ -class BoundableInterfaceGenerator implements ClassVisitor { - - private ClassWriter cw; - private String targetClassname; - private String delegateSignature; - - /** The set of methods already generated. */ - private Set methods = new HashSet(); // Set - - - /** - * @param cw the class writer where generated code must be written - * @param targetClassname - * the name of the generated class that will hold the delegation - * methods - * @param delegateSignature - * the signature of Java interface for which delegation code is to be - * generated - */ - public BoundableInterfaceGenerator( - ClassWriter cw, String targetClassname, String delegateSignature ) { - this.cw = cw; - this.targetClassname = targetClassname; - this.delegateSignature = delegateSignature; - } - - public MethodVisitor visitMethod( - int access, String name, String desc, String arg3, - String[] exceptions ) { - - /* - * Exclude static methods. Interfaces with final static fields may - * contain a static block (which translates as a static method in the - * bytecode structure) to initialize these fields. - */ - if( (access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC ) { - return null; - } - - String key = name+desc; - if( methods.contains(key) ) { - /* - * The signature has already been encountered. - * The situation occurs when the interface for which we are - * generating a proxy redefines (needlessly ?) a method with the - * same signature and already defined in a super-interface. - */ - return null; - } - methods.add(key); - - MethodVisitor cv = - cw.visitMethod( - Opcodes.ACC_PUBLIC, name, desc, arg3, exceptions ); - - // Call the lookupFc() method inherited from InterfaceImpl - cv.visitVarInsn(Opcodes.ALOAD, 0); - cv.visitMethodInsn( - Opcodes.INVOKEVIRTUAL, - targetClassname, - "lookupFc", - "()Ljava/lang/Object;"); - - // Cast the return value to the business interface - cv.visitTypeInsn( - Opcodes.CHECKCAST, - delegateSignature); - - // Generate a LOAD opcode for each parameter - SignatureStringAnalyzer ssa; - try { - ssa = new SignatureStringAnalyzer(desc); - } - catch( InvalidSignatureException ise ) { - throw new RuntimeException( - "InvalidSignatureException: "+ise.getMessage()); - } - - ISignatureParameter[] params = ssa.getParameters(); - ISignatureParameter ret = ssa.getReturnType(); - - int maxStack = 1; - for (int i = 0; i < params.length; i++) { - ISignatureParameter parameter = params[i]; - int opcode = parameter.getLoadOpCode(); - cv.visitVarInsn(opcode,maxStack); - maxStack += parameter.stackSize(); - } - - // Invoke the delegation method - cv.visitMethodInsn( - Opcodes.INVOKEINTERFACE, delegateSignature, name, desc); - - // Generate the RETURN opcode - int opcode = ret.getReturnOpCode(); - cv.visitInsn(opcode); - maxStack += ret.stackSize() - 1; - - // Compute maxs - cv.visitMaxs(maxStack, maxStack); - - return cv; - } - - public void visit( - int arg0, int access, String name, String supername, String arg4, - String[] interfaces ) { - - /* - * Recursively visit implemented interfaces to generated delegation - * method for all methods, including inherited ones. When an interface - * extends another one, the super-interface appears in the implemented - * interfaces (array interfaces), and not in the supername field. - */ - for (int i = 0; i < interfaces.length; i++) { - String delegateClassname = interfaces[i].replace('/','.'); - ClassReader cr; - try { - cr = new ClassReader(delegateClassname); - } - catch( IOException e ) { - throw new RuntimeException("IOException: "+e.getMessage()); - } - cr.accept(this,true); - } - } - - public void visitInnerClass(String arg0, String arg1, String arg2, int arg3) { - } - - public void visitAttribute(Attribute arg0) { - } - - public void visitEnd() { - } - - public void visitSource(String arg0, String arg1) { - } - - public void visitOuterClass(String arg0, String arg1, String arg2) { - } - - public AnnotationVisitor visitAnnotation(String arg0, boolean arg1) { - /* - * Propagate annotations. Each generated method is associated to the - * same annotations as its corresponding source method. - */ - return cw.visitAnnotation(arg0,arg1); - } - - public FieldVisitor visitField(int arg0, String arg1, String arg2, String arg3, Object arg4) { - /* - * Skip fields, i.e. fields encountered in the visited source code are - * not inserted in the generated class. - * - * Note: in the case of AOKell, the visited source code is a Java - * interface. Java interfaces may contain constants. These constants are - * stored as public final fields. - */ - return null; - } - -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorForImplementedInterface.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorForImplementedInterface.java deleted file mode 100644 index b2ad864c10cce2214a89e6c0ef8066f313e56934..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ASMGeneratorForImplementedInterface.java +++ /dev/null @@ -1,445 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import java.io.IOException; -import java.io.InputStream; -import java.util.HashSet; -import java.util.Set; - -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Attribute; -import org.objectweb.asm.ClassReader; -import org.objectweb.asm.ClassVisitor; -import org.objectweb.asm.ClassWriter; -import org.objectweb.asm.FieldVisitor; -import org.objectweb.asm.MethodVisitor; -import org.objectweb.asm.Opcodes; -import org.objectweb.fractal.aokell.lib.ComponentInterfaceImpl; -import org.objectweb.fractal.aokell.lib.control.CloneCtrlException; -import org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerCloneableItf; -import org.objectweb.fractal.aokell.lib.interf.AOKellGeneratedItf; -import org.objectweb.fractal.aokell.lib.interf.ClassDefinition; -import org.objectweb.fractal.aokell.lib.interf.FcItfImplHelper; -import org.objectweb.fractal.aokell.lib.interf.GeneratorItf; -import org.objectweb.fractal.aokell.lib.util.PlatformHelper; -import org.objectweb.fractal.api.control.AttributeController; - - -/** - * This class generates with ASM a class implementing - * {@link org.objectweb.fractal.api.Interface}. This implementation corresponds - * to a Fractal server interface associated to a primitive component. Calls to - * the generated implementation are delegated to the component. - * - * @author Lionel Seinturier - */ -public class ASMGeneratorForImplementedInterface implements GeneratorItf { - - /** - * Generate an {@link org.objectweb.fractal.api.Interface} implementation by - * extending {@link ComponentInterfaceImpl}. The implementation delegates - * calls for a given Java interface. - * - * @param targetClassname the name of the class to generate - * @param delegateJavaItfname - * the Java interface name for which delegation code must be - * generated - * @return the definition (class and bytecode) of the generated class - */ - public ClassDefinition generate( - String targetClassname, String delegateJavaItfname ) { - - final String targetSignature = targetClassname.replace('.','/'); - final String delegateSignature = delegateJavaItfname.replace('.','/'); - - /* - * Check whether the source Java interface is an attribute control - * interface. - */ - Class delegateJavaItf; - try { - delegateJavaItf = PlatformHelper.loadClass(delegateJavaItfname); - } - catch( ClassNotFoundException cnfe ) { - final String msg = "Class not found exception: "+delegateJavaItfname; - throw new RuntimeException(msg); - } - boolean isAttrCtrlItf = - AttributeController.class.isAssignableFrom(delegateJavaItf); - - // Interfaces implemented by the generated class - String[] impls = - (isAttrCtrlItf) ? - new String[] { - delegateSignature, - AttributeControllerCloneableItf.class.getName().replace('.','/'), - AOKellGeneratedItf.class.getName().replace('.','/') } : - new String[] { - delegateSignature, - AOKellGeneratedItf.class.getName().replace('.','/') }; - - - // Class definition - // Name: targetClassname - // Extends: ComponentInterfaceImpl - ClassWriter cw = new ClassWriter(true); - cw.visit( - Opcodes.V1_1, - Opcodes.ACC_PUBLIC, - targetSignature, - null, - ComponentInterfaceImpl.class.getName().replace('.','/'), - impls ); - - // Generate field: private delegateClassname _delegate - cw.visitField( - Opcodes.ACC_PRIVATE, - "_delegate", "L"+delegateSignature+";", - null, - null); - - // Method visitor for generating the cloneFcCtrl method (if needed) - MethodVisitor cloneFcCtrlMV = null; - if( isAttrCtrlItf ) { - cloneFcCtrlMV = cw.visitMethod( - Opcodes.ACC_PUBLIC, - "cloneFcCtrl", - "(L"+AttributeControllerCloneableItf.class.getName().replace('.','/')+";)V", - null, - new String[] { - CloneCtrlException.class.getName().replace('.','/') }); - } - - // Empty constructor generation - MethodVisitor mv = cw.visitMethod( - Opcodes.ACC_PUBLIC, - "", "()V", - null, - null); - - // Call the super contructor inherited from ComponentInterfaceImpl - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitMethodInsn( - Opcodes.INVOKESPECIAL, - ComponentInterfaceImpl.class.getName().replace('.','/'), - "", "()V" ); - - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(1, 1); - - // Generate method: public void setFcItfImpl(Object fcContent) - // This method overrides ComponentInterfaceImpl.setFcItfImpl(Object) - mv = cw.visitMethod( - Opcodes.ACC_PUBLIC, - "setFcItfImpl", "(Ljava/lang/Object;)V", - null, null ); - - // Generate this.fcContent = fcContent - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitFieldInsn( - Opcodes.PUTFIELD, - ComponentInterfaceImpl.class.getName().replace('.','/'), - "fcContent", "Ljava/lang/Object;" ); - - // Generate this._delegate = (delegateSignature) fcContent - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitVarInsn(Opcodes.ALOAD, 1); - mv.visitTypeInsn( Opcodes.CHECKCAST, delegateSignature ); - mv.visitFieldInsn( - Opcodes.PUTFIELD, - targetSignature, - "_delegate", "L"+delegateSignature+";" ); - - // Generate return - mv.visitInsn(Opcodes.RETURN); - mv.visitMaxs(2, 2); - - /* - * For each method of delegateSignature generate a delegation method. - */ - ImplementedInterfaceGenerator iig = - new ImplementedInterfaceGenerator( - cw, targetSignature, delegateSignature, - isAttrCtrlItf, cloneFcCtrlMV ); - ClassReader cr; - try { - InputStream is = - PlatformHelper.getResourceAsStream( delegateSignature+".class" ); - cr = new ClassReader(is); - } - catch( IOException e ) { - throw new RuntimeException(delegateJavaItfname+": "+e); - } - cr.accept(iig,true); - - cw.visitEnd(); - - /* - * Terminate the definition of the cloneFcCtrl method. - */ - if( isAttrCtrlItf ) { - cloneFcCtrlMV.visitInsn(Opcodes.RETURN); - cloneFcCtrlMV.visitMaxs(2,2); - cloneFcCtrlMV.visitEnd(); - } - - /* - * Load the proxy class. - */ - byte[] bytecode = cw.toByteArray(); - Class cl = PlatformHelper.defineClass(targetClassname,bytecode); - return new ClassDefinition(cl,bytecode); - } -} - -/** - * ASM class visitor for generating delegation methods. - * - * For each visited method (typically defined in a Java interface), this class - * generates a method containing delegation code. This code delegates the call - * for the current method to an instance referenced by the _delegate field. - * - * @author Lionel Seinturier - */ -class ImplementedInterfaceGenerator implements ClassVisitor { - - private ClassWriter cw; - private String targetClassname; - private String delegateSignature; - private boolean isAttrCtrlItf; - private MethodVisitor cloneFcCtrlMV; - - /** The set of methods already generated. */ - private Set methods = new HashSet(); // Set - - - /** - * @param cw the class writer where generated code must be written - * @param targetClassname - * the name of the generated class that will hold the delegation - * methods - * @param delegateSignature - * the signature of Java interface for which delegation code is to be - * generated - */ - public ImplementedInterfaceGenerator( - ClassWriter cw, String targetClassname, String delegateSignature, - boolean isAttrCtrlItf, MethodVisitor cloneFcCtrlMV ) { - - this.cw = cw; - this.targetClassname = targetClassname; - this.delegateSignature = delegateSignature; - this.isAttrCtrlItf = isAttrCtrlItf; - this.cloneFcCtrlMV = cloneFcCtrlMV; - } - - public MethodVisitor visitMethod( - int access, String name, String desc, String arg3, - String[] exceptions ) { - - /* - * Exclude static methods. Interfaces with final static fields may - * contain a static block (which translates as a static method in the - * bytecode structure) to initialize these fields. - */ - if( (access & Opcodes.ACC_STATIC) == Opcodes.ACC_STATIC ) { - return null; - } - - /* - * Check whether the signature has already been encountered. - * The situation occurs when the interface for which we are - * generating a proxy redefines (needlessly ?) a method with the - * same signature and already defined in a super-interface. - */ - String key = name+desc; - if( methods.contains(key) ) { - return null; - } - methods.add(key); - - /* - * Analyse the method parameters. - */ - SignatureStringAnalyzer ssa; - try { - ssa = new SignatureStringAnalyzer(desc); - } - catch( InvalidSignatureException ise ) { - final String msg = "InvalidSignatureException: "+ise.getMessage(); - throw new RuntimeException(msg); - } - ISignatureParameter[] params = ssa.getParameters(); - - /* - * Generate the method containing the delegation code. - */ - MethodVisitor mv = - cw.visitMethod( Opcodes.ACC_PUBLIC, name, desc, arg3, exceptions ); - - /* - * Handle attribute control interfaces. - */ - if( isAttrCtrlItf && name.startsWith("set") ) { - - // Get the attribute signature - if( params.length != 1 ) { - final String msg = - delegateSignature+"#"+name+ - " does not follow Java Bean conventions for a setter name"; - throw new IllegalArgumentException(msg); - } - String fieldName = FcItfImplHelper.getFieldNameFromSetter(name); - int p = desc.indexOf(')'); - if( p < 1 ) { - final String msg = desc+" should contain a closing parenthesis"; - throw new RuntimeException(msg); - } - String fieldSignature = desc.substring(1,p); - - // Generate this.field = name - mv.visitVarInsn(Opcodes.ALOAD, 0); - ISignatureParameter parameter = params[0]; - int opcode = parameter.getLoadOpCode(); - mv.visitVarInsn(opcode,1); - mv.visitFieldInsn( - Opcodes.PUTFIELD, - targetClassname, - fieldName, fieldSignature ); - - // Generate the declaration of the field - cw.visitField( - Opcodes.ACC_PRIVATE, - fieldName, fieldSignature, - null, null ); - - // Generate an instruction in cloneFcCtrl(dst) to clone the attribute - // 1. Load and cast the first and unique parameter (dst) - // 2. Load the attribute - // 3. Call dst.setAttrName(value) - cloneFcCtrlMV.visitVarInsn(Opcodes.ALOAD, 1); - cloneFcCtrlMV.visitTypeInsn(Opcodes.CHECKCAST, delegateSignature); - cloneFcCtrlMV.visitVarInsn(Opcodes.ALOAD, 0); - cloneFcCtrlMV.visitFieldInsn( - Opcodes.GETFIELD, - targetClassname, - fieldName, fieldSignature ); - cloneFcCtrlMV.visitMethodInsn( - Opcodes.INVOKEINTERFACE, - delegateSignature, - name, desc); - } - - // Get the _delegate field - mv.visitVarInsn(Opcodes.ALOAD, 0); - mv.visitFieldInsn( - Opcodes.GETFIELD, - targetClassname, - "_delegate", "L"+delegateSignature+";" ); - - // Generate a LOAD opcode for each parameter - int maxStack = 1; - for (int i = 0; i < params.length; i++) { - ISignatureParameter parameter = params[i]; - int opcode = parameter.getLoadOpCode(); - mv.visitVarInsn(opcode,maxStack); - maxStack += parameter.stackSize(); - } - - // Generate the invocation of the method - mv.visitMethodInsn( - Opcodes.INVOKEINTERFACE, delegateSignature, name, desc); - - // Generate the RETURN opcode - ISignatureParameter ret = ssa.getReturnType(); - int opcode = ret.getReturnOpCode(); - mv.visitInsn(opcode); - maxStack += ret.stackSize() - 1; - - // Compute maxs - mv.visitMaxs(maxStack, maxStack); - - return mv; - } - - public void visit( - int arg0, int access, String name, String supername, String arg4, - String[] interfaces ) { - - /* - * Recursively visit implemented interfaces to generate delegation - * method for all methods, including inherited ones. When an interface - * extends another one, the super-interface appears in the implemented - * interfaces (array interfaces), and not in the supername field. - */ - for (int i = 0; i < interfaces.length; i++) { - String delegateClassname = interfaces[i].replace('/','.'); - ClassReader cr; - try { - cr = new ClassReader(delegateClassname); - } - catch( IOException e ) { - throw new RuntimeException("IOException: "+ e.getMessage()); - } - cr.accept(this,true); - } - } - - public void visitInnerClass(String arg0, String arg1, String arg2, int arg3) { - } - - public void visitAttribute(Attribute arg0) { - } - - public void visitEnd() { - } - - public void visitSource(String arg0, String arg1) { - } - - public void visitOuterClass(String arg0, String arg1, String arg2) { - } - - public AnnotationVisitor visitAnnotation(String arg0, boolean arg1) { - /* - * Propagate annotations. Each generated method is associated to the - * same annotations as its corresponding source method. - */ - return cw.visitAnnotation(arg0,arg1); - } - - public FieldVisitor visitField(int arg0, String arg1, String arg2, String arg3, Object arg4) { - /* - * Skip fields, i.e. fields encountered in the visited source code are - * not inserted in the generated class. - * - * Note: in the case of AOKell, the visited source code is a Java - * interface. Java interfaces may contain constants. These constants are - * stored as public final fields. - */ - return null; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ISignatureParameter.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ISignatureParameter.java deleted file mode 100644 index b21326b522bac476f93611764662ab8a6e15c47f..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/ISignatureParameter.java +++ /dev/null @@ -1,43 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -/** - * This interface is implemented by all the types of parameters that can be - * found in a signature string. - * - * @author Lionel Seinturier - */ -public interface ISignatureParameter { - - /** Return the LOAD opcode that corresponds to this type. */ - int getLoadOpCode(); - - /** Return the RETURN opcode that corresponds to this type. */ - int getReturnOpCode(); - - /** Return the size occupied by this opcode on the stack. */ - int stackSize(); - -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/InvalidSignatureException.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/InvalidSignatureException.java deleted file mode 100644 index 712df799d0ae8c72b1e318f7257d2ad989d031aa..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/InvalidSignatureException.java +++ /dev/null @@ -1,52 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -/** - * This exception is thrown whenever an unexpected character is encountered in - * a signature strng. - * - * @author Lionel Seinturier - */ -public class InvalidSignatureException extends Exception { - - private static final long serialVersionUID = 2034410055905927870L; - - private String desc; - private String unexpected; - private int idx; - - public InvalidSignatureException(String desc, String unexpected, int idx) { - super(); - this.desc = desc; - this.unexpected = unexpected; - this.idx = idx; - } - - public String getMessage() { - return - "In \""+desc+"\" unexepected character \""+unexpected+ - "\" at position "+idx; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPDouble.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPDouble.java deleted file mode 100644 index 3e3da00d0dc3bb7c862a60dccd3adf0b9ea2fef1..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPDouble.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.asm.Opcodes; - - -/** - * This class represents a double type in a signature string. - * All instances of this class are equivalent. Hence this class can not be - * instantiated and provides only a singleton instance of itself. - * - * @author Lionel Seinturier - */ -public class SPDouble implements ISignatureParameter { - - final public static SPDouble singleton = new SPDouble(); - - private SPDouble() {} - - public int getLoadOpCode() { - return Opcodes.DLOAD; - } - - public int getReturnOpCode() { - return Opcodes.DRETURN; - } - - public int stackSize() { - return 2; - } - - public String toString() { - return "double"; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPFloat.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPFloat.java deleted file mode 100644 index 786c6be8ade9f60db52ec3a8bc8acdc70662323b..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPFloat.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.asm.Opcodes; - - -/** - * This class represents a float type in a signature string. - * All instances of this class are equivalent. Hence this class can not be - * instantiated and provides only a singleton instance of itself. - * - * @author Lionel Seinturier - */ -public class SPFloat implements ISignatureParameter { - - final public static SPFloat singleton = new SPFloat(); - - private SPFloat() {} - - public int getLoadOpCode() { - return Opcodes.FLOAD; - } - - public int getReturnOpCode() { - return Opcodes.FRETURN; - } - - public int stackSize() { - return 1; - } - - public String toString() { - return "float"; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPInt.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPInt.java deleted file mode 100644 index 0eedfc98bafdaf8dff1c4f052f1c6da4945d79d6..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPInt.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.asm.Opcodes; - - -/** - * This class represents a int type in a signature string. - * All instances of this class are equivalent. Hence this class can not be - * instantiated and provides only a singleton instance of itself. - * - * @author Lionel Seinturier - */ -public class SPInt implements ISignatureParameter { - - final public static SPInt singleton = new SPInt(); - - private SPInt() {} - - public int getLoadOpCode() { - return Opcodes.ILOAD; - } - - public int getReturnOpCode() { - return Opcodes.IRETURN; - } - - public int stackSize() { - return 1; - } - - public String toString() { - return "int"; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPLong.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPLong.java deleted file mode 100644 index 7dff10eefac6f3c84eb2d9bde48cf17a66feb065..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPLong.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.asm.Opcodes; - - -/** - * This class represents a long type in a signature string. - * All instances of this class are equivalent. Hence this class can not be - * instantiated and provides only a singleton instance of itself. - * - * @author Lionel Seinturier - */ -public class SPLong implements ISignatureParameter { - - final public static SPLong singleton = new SPLong(); - - private SPLong() {} - - public int getLoadOpCode() { - return Opcodes.LLOAD; - } - - public int getReturnOpCode() { - return Opcodes.LRETURN; - } - - public int stackSize() { - return 2; - } - - public String toString() { - return "long"; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPObject.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPObject.java deleted file mode 100644 index e2c2aa9bc28ef4486df68905e80caef964babb4b..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPObject.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.asm.Opcodes; - - -/** - * This class represents a Object type in a signature string. - * All instances of this class are equivalent. Hence this class can not be - * instantiated and provides only a singleton instance of itself. - * - * @author Lionel Seinturier - */ -public class SPObject implements ISignatureParameter { - - final public static SPObject singleton = new SPObject(); - - private SPObject() {} - - public int getLoadOpCode() { - return Opcodes.ALOAD; - } - - public int getReturnOpCode() { - return Opcodes.ARETURN; - } - - public int stackSize() { - return 1; - } - - public String toString() { - return "object"; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPVoid.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPVoid.java deleted file mode 100644 index 4208f97db10d1868299b35794de82b198b76d541..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SPVoid.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.asm.Opcodes; - - -/** - * This class represents a void type in a signature string. - * All instances of this class are equivalent. Hence this class can not be - * instantiated and provides only a singleton instance of itself. - * - * @author Lionel Seinturier - */ -public class SPVoid implements ISignatureParameter { - - final public static SPVoid singleton = new SPVoid(); - - private SPVoid() {} - - public int getLoadOpCode() { - return Opcodes.NOP; - } - - public int getReturnOpCode() { - return Opcodes.RETURN; - } - - public int stackSize() { - return 1; - } - - public String toString() { - return "void"; - } -} diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SignatureStringAnalyzer.java b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SignatureStringAnalyzer.java deleted file mode 100644 index 04c3f81aa30d15a4ace97208ad74de26b29ff3db..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/SignatureStringAnalyzer.java +++ /dev/null @@ -1,131 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import java.util.ArrayList; -import java.util.List; - -/** - * This class analyzes a signature string (e.g. a string such as - * "(DI[Ljava/lang/String;[F[Z[C[LItf;[Ljava/lang/Object;)Ljava/lang/Object;") - * and extract its parameters. - * - * @author Lionel Seinturier - */ -public class SignatureStringAnalyzer { - - private String desc; - - /** Indice giving the current position in the analyze of the string. */ - private int idx = 0; - - private ISignatureParameter[] parameters; - private ISignatureParameter returnType; - - public SignatureStringAnalyzer(String desc) - throws InvalidSignatureException { - - this.desc = desc; - analyze(); - } - - public ISignatureParameter[] getParameters() { - return parameters; - } - - public ISignatureParameter getReturnType() { - return returnType; - } - - /** - * Analyze the signature string. - * - * @throws InvalidSignatureException - * if an unexpected character is encountered - */ - private void analyze() throws InvalidSignatureException { - - List params = new ArrayList(); - - // Description strings start with a parenthesis - if( desc.charAt(0) != '(' ) - throw new InvalidSignatureException(desc,desc.substring(0,1),0); - - // Skip the parenthesis - idx = 1; - - for( ; idx= desc.length() ) - throw new InvalidSignatureException(desc,"EOF",idx); - - // The return type - returnType = analyzeParameter(); - - // The parameters - parameters = (ISignatureParameter[]) - params.toArray( new ISignatureParameter[params.size()] ); - } - - /** - * Analyze the current parameter in the string. - * - * @return the current parameter - */ - private ISignatureParameter analyzeParameter() - throws InvalidSignatureException { - - switch( desc.charAt(idx) ) { - case 'B' : return SPInt.singleton; // byte - case 'C' : return SPInt.singleton; // char - case 'D' : return SPDouble.singleton; // double - case 'F' : return SPFloat.singleton; // float - case 'I' : return SPInt.singleton; // int - case 'J' : return SPLong.singleton; // long - case 'S' : return SPInt.singleton; // short - case 'V' : return SPVoid.singleton; // void - case 'Z' : return SPInt.singleton; // boolean - - case '[' : // array - // The type of the array elements follows. Skip it. - idx++; - analyzeParameter(); - return SPObject.singleton; - - case 'L' : // object - int end = desc.indexOf(';',idx); - if( end == idx ) - // The object type is missing - throw new InvalidSignatureException(desc,";",idx); - idx = end; - return SPObject.singleton; - } - - throw new InvalidSignatureException(desc,desc.substring(idx,idx+1),idx); - } -} \ No newline at end of file diff --git a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/package.html b/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/package.html deleted file mode 100644 index 5d62bbd49b804050d618d27029e95d002168caf8..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/src/org/objectweb/fractal/aokell/lib/asm/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -

-This package contains the classes which generates the component interface -classes. The generation uses the ASM -bytecode engineering library. -

- - - diff --git a/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestDelegator.java b/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestDelegator.java deleted file mode 100644 index c93bfa099babb8017d67016768b25e7ec9371704..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestDelegator.java +++ /dev/null @@ -1,46 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import junit.framework.TestCase; - -/** - * @author Lionel Seinturier - */ -public class TestDelegator extends TestCase { - - public void testRepetitiveMethods() { - System.out.println("======= TestDelegator.testRepetitiveMethods() ======="); - - String iClassName = TestForDelegatorI.class.getName(); - String packageName = TestForDelegatorI.class.getPackage().getName(); - - String targetClassName = packageName+".foo"; - String delegateClassName = iClassName; - - new ASMGeneratorForImplementedInterface().generate( - targetClassName, delegateClassName ); - } - -} diff --git a/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestForDelegatorI.java b/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestForDelegatorI.java deleted file mode 100644 index 2bd231facea7e0c5a0b43172587573069fae1848..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestForDelegatorI.java +++ /dev/null @@ -1,35 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -/** - * @author Lionel Seinturier - */ -public interface TestForDelegatorI extends TestForDelegatorI2 { - void foo(); -} - -interface TestForDelegatorI2 { - void foo(); -} \ No newline at end of file diff --git a/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestSignatureStringAnalyzer.java b/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestSignatureStringAnalyzer.java deleted file mode 100644 index 6fda26e5dc050994bd4ca9ff098e0ed3eaed2a25..0000000000000000000000000000000000000000 --- a/aokell/features/fcinterface/rt/test/conform/org/objectweb/fractal/aokell/lib/asm/TestSignatureStringAnalyzer.java +++ /dev/null @@ -1,143 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.asm; - -import org.objectweb.fractal.aokell.lib.asm.ISignatureParameter; -import org.objectweb.fractal.aokell.lib.asm.InvalidSignatureException; -import org.objectweb.fractal.aokell.lib.asm.SPInt; -import org.objectweb.fractal.aokell.lib.asm.SPObject; -import org.objectweb.fractal.aokell.lib.asm.SPVoid; -import org.objectweb.fractal.aokell.lib.asm.SignatureStringAnalyzer; - -import junit.framework.TestCase; - -/** - * @author Lionel Seinturier - */ -public class TestSignatureStringAnalyzer extends TestCase { - - private SignatureStringAnalyzer analyze( String desc ) { - - System.out.println("Desc: "+desc); - - SignatureStringAnalyzer ssa; - try { - ssa = new SignatureStringAnalyzer(desc); - } - catch(InvalidSignatureException ise) { - throw new RuntimeException(ise); - } - - ISignatureParameter[] params = ssa.getParameters(); - ISignatureParameter ret = ssa.getReturnType(); - - System.out.print("Params : "); - for (int i = 0; i < params.length; i++) { - System.out.print(params[i]+" "); - } - System.out.println(); - System.out.println("Return : "+ret); - - return ssa; - } - - public void test1() { - System.out.println("=============== test 1 ==============="); - - SignatureStringAnalyzer ssa = analyze("()V"); - - ISignatureParameter[] params = ssa.getParameters(); - ISignatureParameter ret = ssa.getReturnType(); - - if( params.length != 0 ) - throw new RuntimeException("There shouldn't have any parameter"); - if( !(ret instanceof SPVoid) ) - throw new RuntimeException("Return type should be void"); - } - - public void test2() { - System.out.println("=============== test 2 ==============="); - - SignatureStringAnalyzer ssa = analyze("()I"); - - ISignatureParameter[] params = ssa.getParameters(); - ISignatureParameter ret = ssa.getReturnType(); - - if( params.length != 0 ) - throw new RuntimeException("There shouldn't have any parameter"); - if( !(ret instanceof SPInt) ) - throw new RuntimeException("Return type should be int"); - } - - public void test3() { - System.out.println("=============== test 3 ==============="); - - SignatureStringAnalyzer ssa = - analyze("(DILjava/lang/String;FZCSLItf;Ljava/lang/Object;)Ljava/lang/Object;"); - - ISignatureParameter[] params = ssa.getParameters(); - ISignatureParameter ret = ssa.getReturnType(); - - final String expected = - "double int object float int int int object object "; - - String result = ""; - for (int i = 0; i < params.length; i++) { - result += params[i]+" "; - } - - if( ! result.equals(expected) ) { - System.out.println("Expected: "+expected); - throw new RuntimeException("Unexpected parameters"); - } - if( !(ret instanceof SPObject) ) - throw new RuntimeException("Return type should be object"); - } - - public void test4() { - System.out.println("=============== test 4 ==============="); - - SignatureStringAnalyzer ssa = - analyze("([D[I[Ljava/lang/String;[F[Z[C[LItf;[Ljava/lang/Object;)[Ljava/lang/Object;"); - - ISignatureParameter[] params = ssa.getParameters(); - ISignatureParameter ret = ssa.getReturnType(); - - final String expected = - "object object object object object object object object "; - - String result = ""; - for (int i = 0; i < params.length; i++) { - result += params[i]+" "; - } - - if( ! result.equals(expected) ) { - System.out.println("Expected: "+expected); - throw new RuntimeException("Unexpected parameters"); - } - if( !(ret instanceof SPObject) ) - throw new RuntimeException("Return type should be object"); - } - -} diff --git a/aokell/features/glue/README.txt b/aokell/features/glue/README.txt deleted file mode 100644 index 1dcf738de7cefdbafdab48137a4f543dafaaa23d..0000000000000000000000000000000000000000 --- a/aokell/features/glue/README.txt +++ /dev/null @@ -1,7 +0,0 @@ -This directory contains the implementation of the glue feature. This feature -deals with the way the control part and the content part of a component are -glued together. - -Two versions exist: -- spoon (default): the glue is implemented with Spoon processors -- aspectj: the glue is implemented with AspectJ aspects diff --git a/aokell/features/glue/aspectj/examples/bench/src/benchmain/Conf.aj b/aokell/features/glue/aspectj/examples/bench/src/benchmain/Conf.aj deleted file mode 100644 index e83b25027db40aa09cf5ee60f9f4d0575b5f7a6c..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/examples/bench/src/benchmain/Conf.aj +++ /dev/null @@ -1,67 +0,0 @@ -/*** - * AOKell JACBenchmark - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package benchmain; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentSetterItf; -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleInterceptorItf; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.NameController; - - -/** - * @author Lionel Seinturier - */ -public aspect Conf { - - declare parents: bench.ClientImpl implements PrimitiveType; - - /* - * Workaround for replacing: - * declare parents: BaseType+ implements Component; - * ... - * which would require to expose BaseType to the weaver. - */ - declare parents: bench.ClientImpl implements Component; - declare parents: bench.ClientImpl implements BindingController; - declare parents: bench.ClientImpl implements LifeCycleController; - declare parents: bench.ClientImpl implements NameController; - declare parents: bench.ClientImpl implements SuperControllerNotifier; - declare parents: bench.ClientImpl implements LifeCycleInterceptorItf; - declare parents: bench.ClientImpl implements ComponentSetterItf; - - declare parents: bench.Bench implements PrimitiveType; - - declare parents: bench.Bench implements Component; - declare parents: bench.Bench implements BindingController; - declare parents: bench.Bench implements LifeCycleController; - declare parents: bench.Bench implements NameController; - declare parents: bench.Bench implements SuperControllerNotifier; - declare parents: bench.Bench implements LifeCycleInterceptorItf; - declare parents: bench.Bench implements ComponentSetterItf; -} diff --git a/aokell/features/glue/aspectj/examples/benchsep/src/benchsep/ABench.aj b/aokell/features/glue/aspectj/examples/benchsep/src/benchsep/ABench.aj deleted file mode 100644 index 7e4e93fb8a87b92a5f95d7678e70a8cd551131fc..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/examples/benchsep/src/benchsep/ABench.aj +++ /dev/null @@ -1,36 +0,0 @@ -/*** - * AOKell JACBenchmark - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package benchsep; - -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleInterceptorItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType; - -public aspect ABench { - - declare parents: benchsep.ClientImpl implements LifeCycleInterceptorType; - declare parents: benchsep.ClientImpl implements LifeCycleInterceptorItf; - - declare parents: benchsep.Bench implements LifeCycleInterceptorType; - declare parents: benchsep.Bench implements LifeCycleInterceptorItf; -} diff --git a/aokell/features/glue/aspectj/examples/comanche/README.txt b/aokell/features/glue/aspectj/examples/comanche/README.txt deleted file mode 100644 index 781d565430ad00744c31c87989ca30f3a1325dd9..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/examples/comanche/README.txt +++ /dev/null @@ -1,27 +0,0 @@ -This is the comanche web server. This program was implemented with -Julia and runs, unmodified, with AOKell. - -To execute the example type: - ant execute - -The available Ant targets are: - compile: compile the example - execute: execute the example - help: display this help message - clean: clean the generated files - -See "Developing with Fractal" in the Documentation section of the -Fractal web site for a description -of the comanche architecture. - -When run, comanche waits for HTTP request on port 8080. A typical -run of the program should return something like: - -Comanche HTTP Server ready on port 8080. - -Open the URL in your favorite -web browser. A well-known head should appear! To stop the server, -type Ctrl-C in the launching shell. - -You can add any file you like in the comanche/ directory to have -them served by comanche. diff --git a/aokell/features/glue/aspectj/examples/comanche/src/comanchemain/Conf.aj b/aokell/features/glue/aspectj/examples/comanche/src/comanchemain/Conf.aj deleted file mode 100644 index 6a1a24c809fcbc18cc2b344bd07a4eba44bef2f4..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/examples/comanche/src/comanchemain/Conf.aj +++ /dev/null @@ -1,120 +0,0 @@ -/*** - * AOKell Comanche web server - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package comanchemain; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentSetterItf; -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleInterceptorItf; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.NameController; - -/** - * @author Lionel Seinturier - */ -public aspect Conf { - - // Not all classes in comanche.* are Fractal components - - declare parents: comanche.BasicLogger implements PrimitiveType; - /* - * Workaround for replacing: - * declare parents: BaseType+ implements Component; - * ... - * which would require to expose BaseType to the weaver. - */ - declare parents: comanche.BasicLogger implements Component; - declare parents: comanche.BasicLogger implements BindingController; - declare parents: comanche.BasicLogger implements LifeCycleController; - declare parents: comanche.BasicLogger implements NameController; - declare parents: comanche.BasicLogger implements SuperControllerNotifier; - declare parents: comanche.BasicLogger implements LifeCycleInterceptorItf; - declare parents: comanche.BasicLogger implements ComponentSetterItf; - - declare parents: comanche.ErrorRequestHandler implements PrimitiveType; - declare parents: comanche.ErrorRequestHandler implements Component; - declare parents: comanche.ErrorRequestHandler implements BindingController; - declare parents: comanche.ErrorRequestHandler implements LifeCycleController; - declare parents: comanche.ErrorRequestHandler implements NameController; - declare parents: comanche.ErrorRequestHandler implements SuperControllerNotifier; - declare parents: comanche.ErrorRequestHandler implements LifeCycleInterceptorItf; - declare parents: comanche.ErrorRequestHandler implements ComponentSetterItf; - - declare parents: comanche.FileRequestHandler implements PrimitiveType; - declare parents: comanche.FileRequestHandler implements Component; - declare parents: comanche.FileRequestHandler implements BindingController; - declare parents: comanche.FileRequestHandler implements LifeCycleController; - declare parents: comanche.FileRequestHandler implements NameController; - declare parents: comanche.FileRequestHandler implements SuperControllerNotifier; - declare parents: comanche.FileRequestHandler implements LifeCycleInterceptorItf; - declare parents: comanche.FileRequestHandler implements ComponentSetterItf; - - declare parents: comanche.MultiThreadScheduler implements PrimitiveType; - declare parents: comanche.MultiThreadScheduler implements Component; - declare parents: comanche.MultiThreadScheduler implements BindingController; - declare parents: comanche.MultiThreadScheduler implements LifeCycleController; - declare parents: comanche.MultiThreadScheduler implements NameController; - declare parents: comanche.MultiThreadScheduler implements SuperControllerNotifier; - declare parents: comanche.MultiThreadScheduler implements LifeCycleInterceptorItf; - declare parents: comanche.MultiThreadScheduler implements ComponentSetterItf; - - declare parents: comanche.RequestAnalyzer implements PrimitiveType; - declare parents: comanche.RequestAnalyzer implements Component; - declare parents: comanche.RequestAnalyzer implements BindingController; - declare parents: comanche.RequestAnalyzer implements LifeCycleController; - declare parents: comanche.RequestAnalyzer implements NameController; - declare parents: comanche.RequestAnalyzer implements SuperControllerNotifier; - declare parents: comanche.RequestAnalyzer implements LifeCycleInterceptorItf; - declare parents: comanche.RequestAnalyzer implements ComponentSetterItf; - - declare parents: comanche.RequestDispatcher implements PrimitiveType; - declare parents: comanche.RequestDispatcher implements Component; - declare parents: comanche.RequestDispatcher implements BindingController; - declare parents: comanche.RequestDispatcher implements LifeCycleController; - declare parents: comanche.RequestDispatcher implements NameController; - declare parents: comanche.RequestDispatcher implements SuperControllerNotifier; - declare parents: comanche.RequestDispatcher implements LifeCycleInterceptorItf; - declare parents: comanche.RequestDispatcher implements ComponentSetterItf; - - declare parents: comanche.RequestReceiver implements PrimitiveType; - declare parents: comanche.RequestReceiver implements Component; - declare parents: comanche.RequestReceiver implements BindingController; - declare parents: comanche.RequestReceiver implements LifeCycleController; - declare parents: comanche.RequestReceiver implements NameController; - declare parents: comanche.RequestReceiver implements SuperControllerNotifier; - declare parents: comanche.RequestReceiver implements LifeCycleInterceptorItf; - declare parents: comanche.RequestReceiver implements ComponentSetterItf; - - declare parents: comanche.SequentialScheduler implements PrimitiveType; - declare parents: comanche.SequentialScheduler implements Component; - declare parents: comanche.SequentialScheduler implements BindingController; - declare parents: comanche.SequentialScheduler implements LifeCycleController; - declare parents: comanche.SequentialScheduler implements NameController; - declare parents: comanche.SequentialScheduler implements SuperControllerNotifier; - declare parents: comanche.SequentialScheduler implements LifeCycleInterceptorItf; - declare parents: comanche.SequentialScheduler implements ComponentSetterItf; -} diff --git a/aokell/features/glue/aspectj/examples/common/glue.xml b/aokell/features/glue/aspectj/examples/common/glue.xml deleted file mode 100644 index 4ca0da9e30dba4f5d130c5c1c3c7ed3f6c76b506..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/examples/common/glue.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/glue/aspectj/examples/estore/src/estore/Conf.aj b/aokell/features/glue/aspectj/examples/estore/src/estore/Conf.aj deleted file mode 100644 index 787877b7910de4cd4ea9aea207b559f5125e862a..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/examples/estore/src/estore/Conf.aj +++ /dev/null @@ -1,85 +0,0 @@ -/*** - * AOKell E-Store application - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentSetterItf; -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleInterceptorItf; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.NameController; - -/** - * @author Lionel Seinturier - */ -public aspect Conf { - - declare parents: estore.bank.account.AccountImpl implements PrimitiveType; - declare parents: estore.bank.account.AccountImpl implements Component; - declare parents: estore.bank.account.AccountImpl implements BindingController; - declare parents: estore.bank.account.AccountImpl implements LifeCycleController; - declare parents: estore.bank.account.AccountImpl implements NameController; - declare parents: estore.bank.account.AccountImpl implements SuperControllerNotifier; - declare parents: estore.bank.account.AccountImpl implements LifeCycleInterceptorItf; - declare parents: estore.bank.account.AccountImpl implements ComponentSetterItf; - - declare parents: estore.bank.desk.DeskImpl implements PrimitiveType; - declare parents: estore.bank.desk.DeskImpl implements Component; - declare parents: estore.bank.desk.DeskImpl implements BindingController; - declare parents: estore.bank.desk.DeskImpl implements LifeCycleController; - declare parents: estore.bank.desk.DeskImpl implements NameController; - declare parents: estore.bank.desk.DeskImpl implements SuperControllerNotifier; - declare parents: estore.bank.desk.DeskImpl implements LifeCycleInterceptorItf; - declare parents: estore.bank.desk.DeskImpl implements ComponentSetterItf; - - declare parents: estore.client.ClientImpl implements PrimitiveType; - declare parents: estore.client.ClientImpl implements Component; - declare parents: estore.client.ClientImpl implements BindingController; - declare parents: estore.client.ClientImpl implements LifeCycleController; - declare parents: estore.client.ClientImpl implements NameController; - declare parents: estore.client.ClientImpl implements SuperControllerNotifier; - declare parents: estore.client.ClientImpl implements LifeCycleInterceptorItf; - declare parents: estore.client.ClientImpl implements ComponentSetterItf; - - declare parents: estore.provider.ProviderImpl implements PrimitiveType; - declare parents: estore.provider.ProviderImpl implements Component; - declare parents: estore.provider.ProviderImpl implements BindingController; - declare parents: estore.provider.ProviderImpl implements LifeCycleController; - declare parents: estore.provider.ProviderImpl implements NameController; - declare parents: estore.provider.ProviderImpl implements SuperControllerNotifier; - declare parents: estore.provider.ProviderImpl implements LifeCycleInterceptorItf; - declare parents: estore.provider.ProviderImpl implements ComponentSetterItf; - - declare parents: estore.store.StoreImpl implements PrimitiveType; - declare parents: estore.store.StoreImpl implements Component; - declare parents: estore.store.StoreImpl implements BindingController; - declare parents: estore.store.StoreImpl implements LifeCycleController; - declare parents: estore.store.StoreImpl implements NameController; - declare parents: estore.store.StoreImpl implements SuperControllerNotifier; - declare parents: estore.store.StoreImpl implements LifeCycleInterceptorItf; - declare parents: estore.store.StoreImpl implements ComponentSetterItf; -} diff --git a/aokell/features/glue/aspectj/examples/helloworld/src/hw/AConf.aj b/aokell/features/glue/aspectj/examples/helloworld/src/hw/AConf.aj deleted file mode 100644 index eccb618fb2c9b5eaec2d52928b8200bcba3ecbeb..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/examples/helloworld/src/hw/AConf.aj +++ /dev/null @@ -1,113 +0,0 @@ -/*** - * AOKell Fractal Hello World Example - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package hw; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentSetterItf; -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleInterceptorItf; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; -import org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.api.control.NameController; - -/** - * @author Lionel Seinturier - */ -public aspect AConf { - - declare parents: cs.impl.ClientImpl implements PrimitiveType; - declare parents: cs.impl.ClientImpl implements Component; - declare parents: cs.impl.ClientImpl implements BindingController; - declare parents: cs.impl.ClientImpl implements LifeCycleController; - declare parents: cs.impl.ClientImpl implements NameController; - declare parents: cs.impl.ClientImpl implements SuperControllerNotifier; - declare parents: cs.impl.ClientImpl implements LifeCycleInterceptorItf; - declare parents: cs.impl.ClientImpl implements ComponentSetterItf; - - declare parents: cs.impl.ServerImpl implements ParametricPrimitiveType; - declare parents: cs.impl.ServerImpl implements Component; - declare parents: cs.impl.ServerImpl implements BindingController; - declare parents: cs.impl.ServerImpl implements LifeCycleController; - declare parents: cs.impl.ServerImpl implements NameController; - declare parents: cs.impl.ServerImpl implements SuperControllerNotifier; - declare parents: cs.impl.ServerImpl implements LifeCycleInterceptorItf; - declare parents: cs.impl.ServerImpl implements ComponentSetterItf; - - declare parents: csadl.impl.ClientImpl implements PrimitiveType; - declare parents: csadl.impl.ClientImpl implements Component; - declare parents: csadl.impl.ClientImpl implements BindingController; - declare parents: csadl.impl.ClientImpl implements LifeCycleController; - declare parents: csadl.impl.ClientImpl implements NameController; - declare parents: csadl.impl.ClientImpl implements SuperControllerNotifier; - declare parents: csadl.impl.ClientImpl implements LifeCycleInterceptorItf; - declare parents: csadl.impl.ClientImpl implements ComponentSetterItf; - - declare parents: csadl.impl.ServerImpl implements ParametricPrimitiveType; - declare parents: csadl.impl.ServerImpl implements Component; - declare parents: csadl.impl.ServerImpl implements BindingController; - declare parents: csadl.impl.ServerImpl implements LifeCycleController; - declare parents: csadl.impl.ServerImpl implements NameController; - declare parents: csadl.impl.ServerImpl implements SuperControllerNotifier; - declare parents: csadl.impl.ServerImpl implements LifeCycleInterceptorItf; - declare parents: csadl.impl.ServerImpl implements ComponentSetterItf; - - declare parents: cstemplate.impl.ClientImpl implements PrimitiveType; - declare parents: cstemplate.impl.ClientImpl implements Component; - declare parents: cstemplate.impl.ClientImpl implements BindingController; - declare parents: cstemplate.impl.ClientImpl implements LifeCycleController; - declare parents: cstemplate.impl.ClientImpl implements NameController; - declare parents: cstemplate.impl.ClientImpl implements SuperControllerNotifier; - declare parents: cstemplate.impl.ClientImpl implements LifeCycleInterceptorItf; - declare parents: cstemplate.impl.ClientImpl implements ComponentSetterItf; - - declare parents: cstemplate.impl.ServerImpl implements ParametricPrimitiveType; - declare parents: cstemplate.impl.ServerImpl implements Component; - declare parents: cstemplate.impl.ServerImpl implements BindingController; - declare parents: cstemplate.impl.ServerImpl implements LifeCycleController; - declare parents: cstemplate.impl.ServerImpl implements NameController; - declare parents: cstemplate.impl.ServerImpl implements SuperControllerNotifier; - declare parents: cstemplate.impl.ServerImpl implements LifeCycleInterceptorItf; - declare parents: cstemplate.impl.ServerImpl implements ComponentSetterItf; - - declare parents: cstemplateadl.impl.ClientImpl implements PrimitiveType; - declare parents: cstemplateadl.impl.ClientImpl implements Component; - declare parents: cstemplateadl.impl.ClientImpl implements BindingController; - declare parents: cstemplateadl.impl.ClientImpl implements LifeCycleController; - declare parents: cstemplateadl.impl.ClientImpl implements NameController; - declare parents: cstemplateadl.impl.ClientImpl implements SuperControllerNotifier; - declare parents: cstemplateadl.impl.ClientImpl implements LifeCycleInterceptorItf; - declare parents: cstemplateadl.impl.ClientImpl implements ComponentSetterItf; - - declare parents: cstemplateadl.impl.ServerImpl implements ParametricPrimitiveType; - declare parents: cstemplateadl.impl.ServerImpl implements Component; - declare parents: cstemplateadl.impl.ServerImpl implements BindingController; - declare parents: cstemplateadl.impl.ServerImpl implements LifeCycleController; - declare parents: cstemplateadl.impl.ServerImpl implements NameController; - declare parents: cstemplateadl.impl.ServerImpl implements SuperControllerNotifier; - declare parents: cstemplateadl.impl.ServerImpl implements LifeCycleInterceptorItf; - declare parents: cstemplateadl.impl.ServerImpl implements ComponentSetterItf; -} diff --git a/aokell/features/glue/aspectj/glue.xml b/aokell/features/glue/aspectj/glue.xml deleted file mode 100644 index 87f5567e2e7e0ea15d7a2c22eb9feae16dacc28d..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/glue.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/glue/aspectj/lib/aspectjrt.jar b/aokell/features/glue/aspectj/lib/aspectjrt.jar deleted file mode 100644 index 9df05f1f85ce9d37a0518c52d908cb32f88669d0..0000000000000000000000000000000000000000 Binary files a/aokell/features/glue/aspectj/lib/aspectjrt.jar and /dev/null differ diff --git a/aokell/features/glue/aspectj/lib/aspectjtools.jar b/aokell/features/glue/aspectj/lib/aspectjtools.jar deleted file mode 100644 index 551b1b9a25b4f18c9f9c032327408763f9ca865b..0000000000000000000000000000000000000000 Binary files a/aokell/features/glue/aspectj/lib/aspectjtools.jar and /dev/null differ diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AAbstractLifeCycleController.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AAbstractLifeCycleController.aj deleted file mode 100644 index 90cb3e121723468d75b6a8912b1280aadfadd419..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AAbstractLifeCycleController.aj +++ /dev/null @@ -1,124 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.LifeCycleController; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleCoordinatorItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleType; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; - - -/** - * This aspect introduces the features provided by the lifecycle controller. - * These features are introduced for all classes that implement the - * LifeCycleType or the LifeCycleInterceptorType marker interfaces. - * - * This aspect is abstract because control methods usually need to be excluded - * from the lifecycle. By leaving the pointcut capturing these methods abstract, - * new control methods can be added by extending this aspect. - * - * @author Lionel Seinturier - */ -public abstract aspect AAbstractLifeCycleController { - - // ----------------------------------------------------------- - // Introduction of the LifeCyleController interface - // ----------------------------------------------------------- - - public String LifeCycleType.getFcState() { - LifeCycleController _lc = FractalHelper.getLifeCycleController(_fcComp); - return _lc.getFcState(); - } - - public void LifeCycleType.startFc() throws IllegalLifeCycleException { - LifeCycleController _lc = FractalHelper.getLifeCycleController(_fcComp); - _lc.startFc(); - } - - public void LifeCycleType.stopFc() throws IllegalLifeCycleException { - LifeCycleController _lc = FractalHelper.getLifeCycleController(_fcComp); - _lc.stopFc(); - } - - - // ----------------------------------------------------------- - // Introduction of the LifeCyleInterceptorItf interface - // ----------------------------------------------------------- - - /** - * Introduced field to store the state of the lifecycle controller. - * This field caches the state which is managed by the lifecycle controller. - * This field is used to provide a more performant test on the lifecycle - * controller state (saves a method call). - */ - private boolean LifeCycleInterceptorType.isFcStarted = false; - - public void LifeCycleInterceptorType.setFcState( boolean isFcStarted ) { - this.isFcStarted = isFcStarted; - } - - /** - * Advice all business methods of a component (i.e. any method that is not - * a controller method or a method of the java.lang.Object interface). - */ - pointcut contentMethodsUnderLifecycleControl( LifeCycleInterceptorType adviced ): - execution( * LifeCycleInterceptorType+.*(..) ) && - !controllerMethodsExecution() && !jlObjectMethodsExecution() && - target(adviced); - - before(LifeCycleInterceptorType adviced) : - contentMethodsUnderLifecycleControl(adviced) { - - if( ! adviced.isFcStarted ) { - throw new RuntimeException( - "Component "+adviced+ - " must be started before accepting method calls"); - } - } - - /** - * Pointcut for method executions of controllers. - * This pointcut is left abstract to allow extending the set of control - * methods. - */ - abstract pointcut controllerMethodsExecution(); - - /** Pointcut for method executions of the java.lang.Object interface. */ - pointcut jlObjectMethodsExecution() : - execution( Object *.clone() ) || - execution( boolean *.equals(Object) ) || - execution( void *.finalize() ) || - execution( Class *.getClass() ) || - execution( int *.hashCode() ) || - execution( void *.notify() ) || - execution( void *.notifyAll() ) || - execution( String *.toString() ) || - execution( void *.wait() ) || - execution( void *.wait(long) ) || - execution( void *.wait(long,int) ); -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ABindingController.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ABindingController.aj deleted file mode 100644 index a7ab45e6d002caac49cdc8891c2bcf272d8d9e1f..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ABindingController.aj +++ /dev/null @@ -1,76 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -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.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.BindingType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; - - -/** - * This aspect introduces the features provided by the binding controller. - * These features are introduced for all classes that implement the BindingType - * marker interface. - * - * @author Lionel Seinturier - */ -public aspect ABindingController { - - // ----------------------------------------------------------- - // Introduction of the BindingController interface - // ----------------------------------------------------------- - - declare parents: BindingType+ implements BindingController; - - public String[] BindingType.listFc() { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - return _bc.listFc(); - } - - public Object BindingType.lookupFc(final String cItf) - throws NoSuchInterfaceException { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - return _bc.lookupFc(cItf); - } - - public void BindingType.bindFc(final String cItf, final Object sItf) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - _bc.bindFc(cItf,sItf); - } - - public void BindingType.unbindFc(final String cItf) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - _bc.unbindFc(cItf); - } - -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AComponent.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AComponent.aj deleted file mode 100644 index 812486070372e27a72ca20e3825c3203574a8dff..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AComponent.aj +++ /dev/null @@ -1,77 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.BaseType; - - -/** - * This aspect introduces the features provided by the Component interface. - * These features are introduced for all classes that implement the BaseType - * marker interface. - * - * @author Lionel Seinturier - */ -public aspect AComponent { - - /** - * The reference towards the component controller. - * This reference is public to be visible by other aspects. - */ - public ComponentItf BaseType._fcComp; - - - // ----------------------------------------------------------- - // Introduction of the Component interface - // ----------------------------------------------------------- - - declare parents: BaseType+ implements Component; - - public Type BaseType.getFcType() { - return _fcComp.getFcType(); - } - - public Object BaseType.getFcInterface(String interfaceName) - throws NoSuchInterfaceException { - return _fcComp.getFcInterface(interfaceName); - } - - public Object[] BaseType.getFcInterfaces() { - return _fcComp.getFcInterfaces(); - } - - - // ------------------------------------------------------------------ - // Introduction of the ComponentSetterItf interface - // ------------------------------------------------------------------ - - public void BaseType.setFcCompCtrl( ComponentItf _fcComp ) { - this._fcComp = _fcComp; - } -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AContentController.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AContentController.aj deleted file mode 100644 index 425a68d968be1bf43646ba12634d2668a4995419..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/AContentController.aj +++ /dev/null @@ -1,80 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -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.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.ContentType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; - - -/** - * This aspect introduces the features provided by the content controller. - * These features are introduced for all classes that implement the - * ContentType marker interface. - * - * @author Lionel Seinturier - */ -public aspect AContentController { - - // ----------------------------------------------------------- - // Introduction of the ContentController interface - // ----------------------------------------------------------- - - declare parents: ContentType+ implements ContentController; - - public Object[] ContentType.getFcInternalInterfaces() { - ContentController _cc = FractalHelper.getContentController(_fcComp); - return _cc.getFcInternalInterfaces(); - } - - public Object ContentType.getFcInternalInterface(String arg0) - throws NoSuchInterfaceException { - ContentController _cc = FractalHelper.getContentController(_fcComp); - return _cc.getFcInternalInterface(arg0); - } - - public Component[] ContentType.getFcSubComponents() { - ContentController _cc = FractalHelper.getContentController(_fcComp); - return _cc.getFcSubComponents(); - } - - public void ContentType.addFcSubComponent(Component arg0) - throws IllegalContentException, IllegalLifeCycleException { - ContentController _cc = FractalHelper.getContentController(_fcComp); - _cc.addFcSubComponent(arg0); - } - - public void ContentType.removeFcSubComponent(Component arg0) - throws IllegalContentException, IllegalLifeCycleException { - ContentController _cc = FractalHelper.getContentController(_fcComp); - _cc.removeFcSubComponent(arg0); - } - -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ALifeCycleController.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ALifeCycleController.aj deleted file mode 100644 index 91ab0734152867abb769f0ba9658e675078f88a9..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ALifeCycleController.aj +++ /dev/null @@ -1,123 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.ContentController; -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.api.control.SuperController; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.Factory; - -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleCoordinatorItf; - - -/** - * This aspect defines the methods which are control methods and which must be - * excluded from the lifecycle control. - * - * @author Lionel Seinturier - */ -public aspect ALifeCycleController extends AAbstractLifeCycleController { - - /** Pointcut for method executions of controllers. */ - pointcut controllerMethodsExecution(): - attributeControllerExecution() || - bindingControllerExecution() || - contentControllerExecution() || - componentInterfaceExecution() || - factoryControllerExecution() || - lifecycleControllerExecution() || - nameControllerExecution() || - superControllerExecution(); - - /** Pointcut for method executions of the attribute controller. */ - pointcut attributeControllerExecution(): - execution(void *.set*(..)) || - execution(* *.get*()); - - /** Pointcut for method executions of the binding controller. */ - pointcut bindingControllerExecution(): - execution( * BindingController.*(..) ); -// execution( String[] *.listFc() ) || -// execution( Object *.getFc(String) ) || -// execution( void *.bindFc(String,Object) ) || -// execution( void *.unbindFc(String) ) || -// execution( BindingController *.getFcBindingController() ) || -// execution( BindingController *.createFcBindingController() ); - - /** Pointcut for method executions of the Component interface. */ - pointcut componentInterfaceExecution(): - execution( * Component.*(..) ); -// execution( void *.initFc(Type,Object,Object) ) || -// execution( Type *.getFcType() ) || -// execution( Object *.getFcInterface(String) ) || -// execution( Object[] *.getFcInterfaces() ) || -// execution( Object *.getControllerDesc() ) || -// execution( Object *.getContentDesc() ); - - /** CPointcut for method executions of the content controller. */ - pointcut contentControllerExecution(): - execution( * ContentController.*(..) ); -// execution( Object[] *.getFcInternalInterfaces() ) || -// execution( Object *.getFcInternalInterface(String) ) || -// execution( Component[] *.getFcSubComponents() ) || -// execution( void *.addFcSubComponent(Component) ) || -// execution( void *.removeFcSubComponent(Component) ) || -// execution( ContentController *.getFcContentController() ); - - /** Pointcut for method executions of the Factory interface. */ - pointcut factoryControllerExecution(): - execution( * Factory.*(..) ); -// execution( Object *.getFcContentDesc() ) || -// execution( Object *.getFcControllerDesc() ) || -// execution( Type *.getFcInstanceType() ) || -// execution( Component *.newFcInstance() ) || -// execution( Factory *.getFcFactory() ); - - /** Pointcut for method executions of the life cycle controller. */ - pointcut lifecycleControllerExecution(): - execution( * LifeCycleCoordinatorItf.*(..) ); -// execution( String *.getFcState() ) || -// execution( void *.startFc() ) || -// execution( void *.stopFc() ) || -// execution( boolean *.isFcStarted() ) || -// execution( LifeCycleCoordinatorItf *.getFcLifeCycleController() ); - - /** Pointcut for method executions of the name controller. */ - pointcut nameControllerExecution(): - execution( * NameController.*(..) ); -// execution( String *.getFcName() ) || -// execution( void *.setFcName(String) ) || -// execution( NameController *.getFcNameController() ); - - /** Pointcut for method executions of the super controller. */ - pointcut superControllerExecution(): - execution( * SuperController.*(..) ); -// execution( Component[] *.getFcSuperComponents() ) || -// execution( void *.addFcSuperComponent(Component) ) || -// execution( void *.removeFcSuperComponent(Component) ) || -// execution( SuperController *.getFcSuperController() ); - -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ANameController.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ANameController.aj deleted file mode 100644 index 32bf62db265b6bf62a63cfb6b95d44f6773b0594..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ANameController.aj +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import org.objectweb.fractal.api.control.NameController; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.BaseType; -import org.objectweb.fractal.aokell.lib.membrane.marker.NameType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; - - -/** - * This aspect introduces the features provided by the name controller. - * These features are introduced for all classes that implement the NameType - * marker interface. - * - * @author Lionel Seinturier - */ -public aspect ANameController { - - // ----------------------------------------------------------- - // Introduction of the NameController interface - // ----------------------------------------------------------- - - declare parents: NameType+ implements NameController; - - public String NameType.getFcName() { - NameController _nc = FractalHelper.getNameController(_fcComp); - return _nc.getFcName(); - } - - public void NameType.setFcName(String arg0) { - NameController _nc = FractalHelper.getNameController(_fcComp); - _nc.setFcName(arg0); - } - -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ASuperController.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ASuperController.aj deleted file mode 100644 index 05d731fea6241a6e11abb568e813be446385d427..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ASuperController.aj +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import org.objectweb.fractal.api.Component; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; -import org.objectweb.fractal.aokell.lib.membrane.marker.SuperType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; - - -/** - * This aspect introduces the features provided by the super controller. - * These features are introduced for all classes that implement the - * SuperType marker interface. - * - * @author Lionel Seinturier - */ -public aspect ASuperController { - - // ----------------------------------------------------------- - // Introduction of the SuperController interface - // ----------------------------------------------------------- - - public Component[] SuperType.getFcSuperComponents() { - SuperControllerNotifier _sc = FractalHelper.getSuperController(_fcComp); - return _sc.getFcSuperComponents(); - } - - // ----------------------------------------------------------- - // Introduction of the SuperControllerNotifier interface - // ----------------------------------------------------------- - - public void SuperType.addedToFc( Component c ) { - SuperControllerNotifier _sc = FractalHelper.getSuperController(_fcComp); - _sc.addedToFc(c); - } - - public void SuperType.removedFromFc( Component c ) { - SuperControllerNotifier _sc = FractalHelper.getSuperController(_fcComp); - _sc.removedFromFc(c); - } - -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ATemplate.aj b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ATemplate.aj deleted file mode 100644 index e89855bd6b43cb8c02295d3b00ad5fc213f831b5..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/ATemplate.aj +++ /dev/null @@ -1,70 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -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.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.TemplateType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; - - -/** - * This aspect introduces the features provided by the Factory interface. - * These features are introduced for all classes that implement the TemplateType - * marker interface. - * - * @author Lionel Seinturier - */ -public aspect ATemplate { - - // ----------------------------------------------------------- - // Introduction of the Factory interface - // ----------------------------------------------------------- - - public Object TemplateType.getFcContentDesc() { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.getFcContentDesc(); - } - - public Object TemplateType.getFcControllerDesc() { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.getFcControllerDesc(); - } - - public Type TemplateType.getFcInstanceType() { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.getFcInstanceType(); - } - - public Component TemplateType.newFcInstance() - throws InstantiationException { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.newFcInstance(); - } - -} diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/package.html b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/package.html deleted file mode 100644 index 0027803ac2ce7a040271ddef6821cca8631e6c34..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/glue/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -

-This package contains the AspectJ aspects which integrate the control logic into -components. There is one aspect per controller type. Each aspect is responsible -for integrating the logic of a control interface. -

- - - diff --git a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/tools/content/ContentResolverHelper.java b/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/tools/content/ContentResolverHelper.java deleted file mode 100644 index 21f53e825b66e683ae8dc635e23bbad86f5d1d1b..0000000000000000000000000000000000000000 --- a/aokell/features/glue/aspectj/src/org/objectweb/fractal/aokell/tools/content/ContentResolverHelper.java +++ /dev/null @@ -1,91 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.tools.content; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; - -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType; - - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the glue feature. These methods are used - * by the content resolver tool. - * - * @author Lionel Seinturier - */ -public class ContentResolverHelper { - - private PrintWriter pw; - - public void newFile( - String generatedDirname, String packagename, String classname ) - throws IOException - { - String dirname = generatedDirname+"/"+packagename.replace('.','/'); - String aspectname = "A"+classname; - String filename = dirname+"/"+aspectname+".aj"; - new File(dirname).mkdirs(); - - System.out.println("Writing into: "+filename); - - FileWriter fw = new FileWriter(filename); - pw = new PrintWriter(fw); - - pw.println("/*"); - pw.print(" * Generated by AOKell ContentResolver on: "); - pw.println(new Date().toString()); - pw.println(" */"); - pw.println(); - - pw.println("package "+packagename+";"); - pw.println(); - pw.println("public aspect "+aspectname+" {"); - } - - public void generateClause( Object contentDesc, Object ctrlDesc ) - throws IOException { - - if( ((String)ctrlDesc).endsWith("Template") ) { - return; - } - - pw.print(" declare parents: "); - String msg = contentDesc+" implements "+LifeCycleInterceptorType.class.getName(); - pw.print(msg); - pw.print("; // "); - pw.println(ctrlDesc); - - System.out.println(" "+msg); - } - - public void epilogue() throws IOException { - pw.println("}"); - pw.close(); - } -} diff --git a/aokell/features/glue/spoon/examples-j2me-cldc/common/glue.xml b/aokell/features/glue/spoon/examples-j2me-cldc/common/glue.xml deleted file mode 100644 index b80f74da6fdbc60fab9112976e2d208b8de66824..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples-j2me-cldc/common/glue.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/glue/spoon/examples-j2me-cldc/helloworld/etc/build.properties b/aokell/features/glue/spoon/examples-j2me-cldc/helloworld/etc/build.properties deleted file mode 100644 index 878ad0097476e984b003656d418e5342612454eb..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples-j2me-cldc/helloworld/etc/build.properties +++ /dev/null @@ -1 +0,0 @@ -conf.processor hw2.ConfProcessor \ No newline at end of file diff --git a/aokell/features/glue/spoon/examples-j2me-cldc/helloworld/src/hw2/ConfProcessor.java b/aokell/features/glue/spoon/examples-j2me-cldc/helloworld/src/hw2/ConfProcessor.java deleted file mode 100644 index ede29410d152c7b8f43d95c52493c86d5e43a641..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples-j2me-cldc/helloworld/src/hw2/ConfProcessor.java +++ /dev/null @@ -1,62 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package hw2; - -import hw.kvm.ClientImpl; -import hw.kvm.ServerImpl; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.glue.processor.ItfImplProcessor; -import org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - - - -/** - * This processor introduces the component marker types into the component - * implementations of the Hello World example. - * - * @author Lionel Seinturier - */ -public class ConfProcessor extends ItfImplProcessor { - - public ConfProcessor() { - super(); - setMarkers(markers); - } - - /** - * Store association between component implementations and their component - * marker type. - */ - private static Map markers = new HashMap(); - - static { - markers.put( ClientImpl.class.getName(), PrimitiveType.class ); - markers.put( ServerImpl.class.getName(), ParametricPrimitiveType.class ); - } - -} diff --git a/aokell/features/glue/spoon/examples/bench/etc/build.properties b/aokell/features/glue/spoon/examples/bench/etc/build.properties deleted file mode 100644 index 3fa0f52bafad94150b23b3a653f46365592fa81a..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/bench/etc/build.properties +++ /dev/null @@ -1 +0,0 @@ -conf.processor benchmain.ConfProcessor \ No newline at end of file diff --git a/aokell/features/glue/spoon/examples/bench/src/benchmain/ConfProcessor.java b/aokell/features/glue/spoon/examples/bench/src/benchmain/ConfProcessor.java deleted file mode 100644 index b1262b5d37729d084d79ec91efe0ecc6b841b858..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/bench/src/benchmain/ConfProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package benchmain; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.glue.processor.ItfImplProcessor; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - - -/** - * This processor introduces the component marker types into the component - * implementations of the bench example. - * - * @author Lionel Seinturier - */ -public class ConfProcessor extends ItfImplProcessor { - - public ConfProcessor() { - super(); - setMarkers(markers); - } - - /** - * Store association between component implementations and their component - * marker type. - */ - private static Map markers = new HashMap(); - - static { - markers.put( bench.ClientImpl.class.getName(), PrimitiveType.class ); - markers.put( bench.Bench.class.getName(), PrimitiveType.class ); - } - -} diff --git a/aokell/features/glue/spoon/examples/benchsep/etc/build.properties b/aokell/features/glue/spoon/examples/benchsep/etc/build.properties deleted file mode 100644 index 527eb35ca6535e0407d7c7200d2a4f31157eb0f3..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/benchsep/etc/build.properties +++ /dev/null @@ -1 +0,0 @@ -conf.processor benchsepmain.ConfProcessor \ No newline at end of file diff --git a/aokell/features/glue/spoon/examples/benchsep/src/benchsepmain/ConfProcessor.java b/aokell/features/glue/spoon/examples/benchsep/src/benchsepmain/ConfProcessor.java deleted file mode 100644 index 17e0e97d2ad555f5a4993d9b34fb5357026cccc6..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/benchsep/src/benchsepmain/ConfProcessor.java +++ /dev/null @@ -1,57 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package benchsepmain; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.glue.processor.ItfImplProcessor; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType; - - -/** - * This processor introduces the component marker types into the component - * implementations of the benchsep example. - * - * @author Lionel Seinturier - */ -public class ConfProcessor extends ItfImplProcessor { - - public ConfProcessor() { - super(); - setMarkers(markers); - } - - /** - * Store association between component implementations and their component - * marker type. - */ - private static Map markers = new HashMap(); - - static { - markers.put( benchsep.ClientImpl.class.getName(), LifeCycleInterceptorType.class ); - markers.put( benchsep.Bench.class.getName(), LifeCycleInterceptorType.class ); - } - -} diff --git a/aokell/features/glue/spoon/examples/collection/etc/build.properties b/aokell/features/glue/spoon/examples/collection/etc/build.properties deleted file mode 100644 index 1f52558e238be46cc9b307aa4cecd9c6dfed25c4..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/collection/etc/build.properties +++ /dev/null @@ -1 +0,0 @@ -conf.processor org.objectweb.fractal.aokell.glue.processor.EmptyProcessor \ No newline at end of file diff --git a/aokell/features/glue/spoon/examples/comanche/etc/build.properties b/aokell/features/glue/spoon/examples/comanche/etc/build.properties deleted file mode 100644 index 51d4e9faff0659358e26216c2b92ce9208823735..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/comanche/etc/build.properties +++ /dev/null @@ -1 +0,0 @@ -conf.processor comanchemain.ConfProcessor \ No newline at end of file diff --git a/aokell/features/glue/spoon/examples/comanche/src/comanchemain/ConfProcessor.java b/aokell/features/glue/spoon/examples/comanche/src/comanchemain/ConfProcessor.java deleted file mode 100644 index a39b082709f4d4addf506f1cb91c0240b53e57b0..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/comanche/src/comanchemain/ConfProcessor.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package comanchemain; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.glue.processor.ItfImplProcessor; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - - -/** - * This processor introduces the component marker types into the component - * implementations of the comanche example. - * - * @author Lionel Seinturier - */ -public class ConfProcessor extends ItfImplProcessor { - - public ConfProcessor() { - super(); - setMarkers(markers); - } - - /** - * Store association between component implementations and their component - * marker type. - */ - private static Map markers = new HashMap(); - - static { - markers.put( comanche.BasicLogger.class.getName(), PrimitiveType.class ); - markers.put( comanche.ErrorRequestHandler.class.getName(), PrimitiveType.class ); - markers.put( comanche.FileRequestHandler.class.getName(), PrimitiveType.class ); - markers.put( comanche.MultiThreadScheduler.class.getName(), PrimitiveType.class ); - markers.put( comanche.RequestAnalyzer.class.getName(), PrimitiveType.class ); - markers.put( comanche.RequestDispatcher.class.getName(), PrimitiveType.class ); - markers.put( comanche.RequestReceiver.class.getName(), PrimitiveType.class ); - markers.put( comanche.SequentialScheduler.class.getName(), PrimitiveType.class ); - } - -} diff --git a/aokell/features/glue/spoon/examples/common/glue.xml b/aokell/features/glue/spoon/examples/common/glue.xml deleted file mode 100644 index 617d34958b50017a94fb88b467068b28d962fdee..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/common/glue.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/glue/spoon/examples/estore/etc/build.properties b/aokell/features/glue/spoon/examples/estore/etc/build.properties deleted file mode 100644 index 024f5b4881f27a2d043b30a8eb840adc7c8c3d37..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/estore/etc/build.properties +++ /dev/null @@ -1 +0,0 @@ -conf.processor estore.ConfProcessor \ No newline at end of file diff --git a/aokell/features/glue/spoon/examples/estore/src/estore/ConfProcessor.java b/aokell/features/glue/spoon/examples/estore/src/estore/ConfProcessor.java deleted file mode 100644 index 0142b4e12cbf000b3a120362374e801d5b5841b0..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/estore/src/estore/ConfProcessor.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package estore; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.glue.processor.ItfImplProcessor; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - - -/** - * This processor introduces the component marker types into the component - * implementations of the estore example. - * - * @author Lionel Seinturier - */ -public class ConfProcessor extends ItfImplProcessor { - - public ConfProcessor() { - super(); - setMarkers(markers); - } - - /** - * Store association between component implementations and their component - * marker type. - */ - private static Map markers = new HashMap(); - - static { - markers.put( estore.bank.account.AccountImpl.class.getName(), PrimitiveType.class ); - markers.put( estore.bank.desk.DeskImpl.class.getName(), PrimitiveType.class ); - markers.put( estore.client.ClientImpl.class.getName(), PrimitiveType.class ); - markers.put( estore.provider.ProviderImpl.class.getName(), PrimitiveType.class ); - markers.put( estore.store.StoreImpl.class.getName(), PrimitiveType.class ); - } - -} diff --git a/aokell/features/glue/spoon/examples/helloworld/etc/build.properties b/aokell/features/glue/spoon/examples/helloworld/etc/build.properties deleted file mode 100644 index d9db4a8b08be56e7e54ce6f0e0185041268588ef..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/helloworld/etc/build.properties +++ /dev/null @@ -1 +0,0 @@ -conf.processor hw.ConfProcessor \ No newline at end of file diff --git a/aokell/features/glue/spoon/examples/helloworld/src/hw/ConfProcessor.java b/aokell/features/glue/spoon/examples/helloworld/src/hw/ConfProcessor.java deleted file mode 100644 index c0e698cc6339c9cb91d5bf5918356ce668d9e707..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/examples/helloworld/src/hw/ConfProcessor.java +++ /dev/null @@ -1,71 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package hw; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.glue.processor.ItfImplProcessor; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - - -/** - * This processor introduces the component marker types into the component - * implementations of the Hello World example. - * - * @author Lionel Seinturier - */ -public class ConfProcessor extends ItfImplProcessor { - - public ConfProcessor() { - super(); - setMarkers(markers); - } - - /** - * Store association between component implementations and their component - * marker type. - */ - private static Map markers = new HashMap(); - - static { - markers.put( cs.impl.ClientImpl.class.getName(), PrimitiveType.class ); - markers.put( cs.impl.ServerImpl.class.getName(), ParametricPrimitiveType.class ); - - markers.put( csadl.impl.ClientImpl.class.getName(), PrimitiveType.class ); - markers.put( csadl.impl.ServerImpl.class.getName(), PrimitiveType.class ); - - markers.put( cssep.impl.ClientImpl.class.getName(), LifeCycleInterceptorType.class ); - markers.put( cssep.impl.ServerImpl.class.getName(), LifeCycleInterceptorType.class ); - - markers.put( cstemplate.impl.ClientImpl.class.getName(), PrimitiveType.class ); - markers.put( cstemplate.impl.ServerImpl.class.getName(), ParametricPrimitiveType.class ); - - markers.put( cstemplateadl.impl.ClientImpl.class.getName(), PrimitiveType.class ); - markers.put( cstemplateadl.impl.ServerImpl.class.getName(), ParametricPrimitiveType.class ); - } - -} diff --git a/aokell/features/glue/spoon/glue.xml b/aokell/features/glue/spoon/glue.xml deleted file mode 100644 index ad9c54a99e881dd27c954496798b18f098bad090..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/glue.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/aokell/features/glue/spoon/lib/JSAP-2.0a.jar b/aokell/features/glue/spoon/lib/JSAP-2.0a.jar deleted file mode 100644 index da8a1c643bb23ff727fdf9c69b0c5debcc3702b9..0000000000000000000000000000000000000000 Binary files a/aokell/features/glue/spoon/lib/JSAP-2.0a.jar and /dev/null differ diff --git a/aokell/features/glue/spoon/lib/org.eclipse.jdt.core_3.2.0.v_670.jar b/aokell/features/glue/spoon/lib/org.eclipse.jdt.core_3.2.0.v_670.jar deleted file mode 100644 index 2f0dd4d1e95e15bc1e8eca284ec4c9cd08c6f32e..0000000000000000000000000000000000000000 Binary files a/aokell/features/glue/spoon/lib/org.eclipse.jdt.core_3.2.0.v_670.jar and /dev/null differ diff --git a/aokell/features/glue/spoon/lib/spoon-20060719b.jar b/aokell/features/glue/spoon/lib/spoon-20060719b.jar deleted file mode 100644 index d8bafb73ea5f2162f434e8d07e3f58d85bcc3d99..0000000000000000000000000000000000000000 Binary files a/aokell/features/glue/spoon/lib/spoon-20060719b.jar and /dev/null differ diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/AOKellProcessor.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/AOKellProcessor.java deleted file mode 100644 index 4d2877fb95dee0bbbf859344b648281ce62f3805..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/AOKellProcessor.java +++ /dev/null @@ -1,59 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import org.objectweb.fractal.aokell.glue.processor.CtrlItfInjectorProcessor; -import org.objectweb.fractal.aokell.glue.processor.LifeCycleInterceptorProcessor; - -import spoon.processing.AbstractProcessor; -import spoon.processing.ProcessingManager; -import spoon.reflect.declaration.CtClass; - -/** - * This is the main Spoon processor for AOKell. - * This processor simply registers needed processors. - * - * @author Lionel Seinturier - */ -public class AOKellProcessor extends AbstractProcessor { - - public AOKellProcessor() { - } - - public boolean isToBeProcessed(CtClass ct) { - return first; - } - - private boolean first = true; - - public void process(CtClass ct) { - - ProcessingManager pm = getManager(); - pm.addProcessor( new LifeCycleInterceptorProcessor() ); - pm.addProcessor( new CtrlItfInjectorProcessor() ); - - first = false; - } - -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/SpoonHelper.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/SpoonHelper.java deleted file mode 100644 index 6b512094dbe254e1c8aec385d1a1c120a7014d60..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/SpoonHelper.java +++ /dev/null @@ -1,235 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue; - -import java.util.List; -import java.util.Set; - -import spoon.reflect.declaration.CtClass; -import spoon.reflect.declaration.CtInterface; -import spoon.reflect.declaration.CtMethod; -import spoon.reflect.declaration.CtParameter; -import spoon.reflect.factory.TypeFactory; -import spoon.reflect.reference.CtTypeReference; -import spoon.template.Substitution; -import spoon.template.Template; - -/** - * Helper class for working with Spoon. - * - * @author Lionel Seinturier - */ -public class SpoonHelper { - - /** - * If the given method implements a method declared in an interface of the - * given class, return true. Else return false. - */ - public static boolean isInterfaceMethodImplementation( - CtClass cl, CtMethod meth ) { - - String name = meth.getSimpleName(); - List> params = meth.getParameters(); - Class[] paramClassTypes = getClassParameterTypes(params); - CtTypeReference[] paramCtRefTypes = getTypeRefParameterTypes(params); - CtTypeReference retType = meth.getType(); - - Set> impls = cl.getSuperInterfaces(); - for (CtTypeReference impl : impls) { - String qname = impl.getQualifiedName(); - try { - Class itf = Class.forName(qname); - try { - itf.getMethod(name,paramClassTypes); - return true; - } - catch( NoSuchMethodException nsme ) {} - // The method is not defined in the current interface - } - catch( ClassNotFoundException cnfe ) { - - /* - * The interface can not be loaded with the Java reflection API. - * Try to check whether it is available in the Spoon model. - * - * Note: conversely some interfaces can be loaded with the - * reflection API but are not in the Spoon model. This is the - * case for any interface (e.g. java.lang.Runnable) which is not - * in the Spoon source set. - */ - - CtInterface ctitf = cl.getFactory().Interface().get(qname); - if( ctitf == null ) { - throw new RuntimeException(qname+" not found"); - } - CtMethod m = ctitf.getMethod(retType,name,paramCtRefTypes); - if( m != null ) { - return true; - } - } - - } - - return false; - } - - - /** - * Return the type references of the given list of parameters. - */ - public static CtTypeReference[] getTypeRefParameterTypes( List> params ) { - - CtTypeReference[] result = new CtTypeReference[params.size()]; - int i = 0; - for (CtParameter param : params) { - CtTypeReference type = param.getType(); - TypeFactory tf = param.getFactory().Type(); - String qname = type.getQualifiedName(); - result[i] = tf.createReference(qname); - i++; - } - - return result; - } - - /** - * Return the classes of the given list of parameters. - */ - public static Class[] getClassParameterTypes( List> params ) { - - Class[] result = new Class[params.size()]; - int i = 0; - for (CtParameter param : params) { - CtTypeReference type = param.getType(); - result[i] = type.getActualClass(); - if( result[i] == null ) { - final String qname = type.getQualifiedName(); - throw new RuntimeException(qname+" not found"); - } - i++; - } - - return result; - } - - /** - * Return true if one of the subclasses of the given CtClass implements the - * given interface. - */ - public static boolean deepImpls( CtClass ct, Class itf ) { - - /* - * Recurse in super classes. - */ - CtTypeReference suptr = ct.getSuperclass(); - if( suptr == null ) { - // No super class - return false; - } - - Class supcl = suptr.getActualClass(); - CtClass supctcl = ct.getFactory().Class().get(supcl); - if( supctcl == null ) { - // The super class is not in the Spoon model and will not be spooned. - // Use Java reflection to check whether the interface is implemented. - return itf.isAssignableFrom(supcl); - } - - // Check whether the super class implements directly the interface - if( impls(supctcl,itf) ) { - return true; - } - - return deepImpls(supctcl,itf); - } - - /** - * Return true if the given CtClass implements directly the given interface. - * This method does not recurse in super classes and super interfaces and - * simply checks the presence of the given interface in the list of - * interfaces of the implements clause. - */ - public static boolean impls( CtClass ct, Class itf ) { - - Set> supers = ct.getSuperInterfaces(); - CtTypeReference itfctr = ct.getFactory().Type().createReference(itf); - - /* - * Check whether the interface is a super-type of one of the interfaces - * declared in the implements clause of the CtClass. - */ - for (CtTypeReference sup : supers) { - if( sup.isSubtypeOf(itfctr) ) { - return true; - } - } - - return false; - } - - /** - * Insert a template in a CtClass - * if the CtClass implements the given type and - * if none of the super classes of the CtClass already implements the given - * type (to avoid duplicate insertion of the template). - * - * @param ct the CtClass where the insertion must be performed - * @param typeToMatch the type to match (a class or an interface) - * @param template the Spoon template containing the code to insert - */ - public static void insert( CtClass ct, Class typeToMatch, Template template ) { - - if( ! impls(ct,typeToMatch) ) { - return; - } - if( deepImpls(ct,typeToMatch) ) { - return; - } - - insert(ct,template); - } - - /** - * Insert a template in a CtClass. - * - * @param ct the CtClass where the insertion must be performed - * @param template the Spoon template containing the code to insert - */ - public static void insert( CtClass ct, Template template ) { - - // Insert the template - Substitution.insertAll(ct,template); - - // Add implemented interfaces (except Template) - CtTypeReference templtr = ct.getFactory().Type().createReference(Template.class); - Class c = template.getClass(); - CtClass t = ct.getFactory().Template().get(c); - Set> supers = t.getSuperInterfaces(); - for (CtTypeReference sup : supers) { - if( ! templtr.isAssignableFrom(sup) ) { - ct.getSuperInterfaces().add(sup); - } - } - } -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/package.html b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/package.html deleted file mode 100644 index 77933dcc6a4b555448d82bba912e43b2bf7125e6..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/package.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - -

-This package contains the implementation of the Spoon version of the glue -feature. -

- - - diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/CtrlItfInjectorProcessor.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/CtrlItfInjectorProcessor.java deleted file mode 100644 index 9e86490cd2841fc8f9bdd9c5fe4a616123680420..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/CtrlItfInjectorProcessor.java +++ /dev/null @@ -1,75 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.processor; - - -import org.objectweb.fractal.aokell.glue.SpoonHelper; -import org.objectweb.fractal.aokell.glue.template.BindingControllerTemplate; -import org.objectweb.fractal.aokell.glue.template.ComponentControllerTemplate; -import org.objectweb.fractal.aokell.glue.template.ContentControllerTemplate; -import org.objectweb.fractal.aokell.glue.template.LifeCycleControllerTemplate; -import org.objectweb.fractal.aokell.glue.template.NameControllerTemplate; -import org.objectweb.fractal.aokell.glue.template.SuperControllerTemplate; -import org.objectweb.fractal.aokell.glue.template.TemplateControllerTemplate; -import org.objectweb.fractal.aokell.lib.membrane.marker.BaseType; -import org.objectweb.fractal.aokell.lib.membrane.marker.BindingType; -import org.objectweb.fractal.aokell.lib.membrane.marker.ContentType; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleType; -import org.objectweb.fractal.aokell.lib.membrane.marker.NameType; -import org.objectweb.fractal.aokell.lib.membrane.marker.SuperType; -import org.objectweb.fractal.aokell.lib.membrane.marker.TemplateType; - -import spoon.processing.AbstractProcessor; -import spoon.reflect.declaration.CtClass; -import spoon.template.Template; - -/** - * This processor injects control interfaces into component content classes - * based on the marker types implemented by these classes. - * - * @author Lionel Seinturier - */ -public class CtrlItfInjectorProcessor extends AbstractProcessor> { - - public CtrlItfInjectorProcessor() {} - - final private static Template lifecycleControllerTemplate = new LifeCycleControllerTemplate(); - final private static Template componentControllerTemplate = new ComponentControllerTemplate(); - final private static Template bindingControllerTemplate = new BindingControllerTemplate(); - final private static Template contentControllerTemplate = new ContentControllerTemplate(); - final private static Template nameControllerTemplate = new NameControllerTemplate(); - final private static Template superControllerTemplate = new SuperControllerTemplate(); - final private static Template templateControllerTemplate = new TemplateControllerTemplate(); - - public void process(CtClass ct) { - SpoonHelper.insert(ct,LifeCycleType.class,lifecycleControllerTemplate); - SpoonHelper.insert(ct,BaseType.class,componentControllerTemplate); - SpoonHelper.insert(ct,BindingType.class,bindingControllerTemplate); - SpoonHelper.insert(ct,ContentType.class,contentControllerTemplate); - SpoonHelper.insert(ct,NameType.class,nameControllerTemplate); - SpoonHelper.insert(ct,SuperType.class,superControllerTemplate); - SpoonHelper.insert(ct,TemplateType.class,templateControllerTemplate); - } - -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/EmptyProcessor.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/EmptyProcessor.java deleted file mode 100644 index e8a06f849573754e88e2fd797555d8582b3b051c..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/EmptyProcessor.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.processor; - -import spoon.processing.AbstractProcessor; -import spoon.reflect.declaration.CtClass; - -/** - * Empty processor. - * This class is used whenever a processor is mandatory (for example for - * simplifying the build process of examples distributed with AOKell) but that - * no particular processing is required (see for example the collection - * example). - * - * @author Lionel Seinturier - */ -public class EmptyProcessor extends AbstractProcessor { - - public EmptyProcessor() { - } - - public boolean isToBeProcessed(CtClass ct) { - return false; - } - - public void process(CtClass ct) { - } - -} - diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/ItfImplProcessor.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/ItfImplProcessor.java deleted file mode 100644 index 75c7c8f832f03723745d55c2a1d6a1d6ba39c6ed..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/ItfImplProcessor.java +++ /dev/null @@ -1,71 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.processor; - -import java.util.Map; -import java.util.Set; - -import spoon.processing.AbstractProcessor; -import spoon.reflect.declaration.CtClass; -import spoon.reflect.reference.CtTypeReference; - -/** - * This processor adds an interface in the list of interfaces implemented by a - * class. This processor is typically used to introduce marker interfaces. - * - * @author Lionel Seinturier - */ -public class ItfImplProcessor extends AbstractProcessor> { - - public ItfImplProcessor() { - super(); - } - - /** - * Store association between fully-qualified names of classes and the - * interface which must be introduced. - */ - private Map markers; - - public void setMarkers( Map markers ) { - this.markers = markers; - } - - public void process(CtClass ct) { - /* - * Add the marker type to the list of super interfaces implemented by - * the processed class. - */ - Set> supers = ct.getSuperInterfaces(); - Class marker = markers.get(ct.getQualifiedName()); - supers.add(getFactory().Type().createReference(marker)); - } - - public boolean isToBeProcessed(CtClass ct) { - /* - * Only classes which are registered with markers need to be processed. - */ - return markers.containsKey(ct.getQualifiedName()); - } -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/LifeCycleInterceptorProcessor.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/LifeCycleInterceptorProcessor.java deleted file mode 100644 index 29fda9a72e8a2ab52363126d4c28065b7894d28b..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/LifeCycleInterceptorProcessor.java +++ /dev/null @@ -1,86 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.processor; - -import java.util.Set; - -import org.objectweb.fractal.aokell.glue.SpoonHelper; -import org.objectweb.fractal.aokell.glue.template.LifeCycleInterceptorBeforeTemplate; -import org.objectweb.fractal.aokell.glue.template.LifeCycleInterceptorTemplate; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; - -import spoon.processing.AbstractProcessor; -import spoon.reflect.declaration.CtClass; -import spoon.reflect.declaration.CtMethod; -import spoon.template.Template; - -/** - * This processor introduces the features releted to the interception performed - * by the lifecycle controller. - * These features are introduced for all classes that implement the - * LifeCycleInterceptorType marker interface. - * - * @author Lionel Seinturier - */ -public class LifeCycleInterceptorProcessor extends AbstractProcessor> { - - public boolean isToBeProcessed(CtClass ct) { - return SpoonHelper.impls(ct,LifeCycleInterceptorType.class); - } - - private static Template lifecycleInterceptorTemplate = - new LifeCycleInterceptorTemplate(); - - public void process(CtClass ct) { - - /* - * Insert the implementation of the LifeCycleInterceptorItf interface. - * The 2nd parameter is really needed and is not redundant with - * isTobeProcessed(). Read the code the insert method. - */ - SpoonHelper.insert( - ct, LifeCycleInterceptorType.class, - lifecycleInterceptorTemplate); - - /* - * Insert before each method of the processed class, a if statement to - * test whether the component is started or not. - */ - Set> methods = ct.getMethods(); - for( CtMethod method : methods ) { - String methodName = method.getSimpleName(); - - // Skip control methods and methods not defined in an interface - if( ! FractalHelper.isFcControllerMethodName(methodName) && - SpoonHelper.isInterfaceMethodImplementation(ct,method) ) { - method.getBody().insertBegin( - new LifeCycleInterceptorBeforeTemplate(). - getSubstitution(method.getDeclaringType()) - ); - } - } - } - -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/package.html b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/package.html deleted file mode 100644 index 107640c09e7dff5354c71bb48596b63cd74ad140..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/processor/package.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - -

-This package contains Spoon processors for gluing controllers with component -implementations. -

- - - diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/BindingControllerTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/BindingControllerTemplate.java deleted file mode 100644 index bf9a153148f5c102c7805abca9f28a31a1882345..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/BindingControllerTemplate.java +++ /dev/null @@ -1,99 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -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 spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by BindingControllerProcessor. - * - * @author Lionel Seinturier - */ -public class BindingControllerTemplate implements Template, BindingController { - - @Local - public BindingControllerTemplate() {} - - /** - * The reference towards the component controller. - * This field is injected by the ComponentControllerTemplate. - */ - @Local - private ComponentItf _fcComp; - - - // ----------------------------------------------------------- - // BindingController interface implementation - // ----------------------------------------------------------- - - /** - * Method introduced by AOKell. - * Part of the implementation of the binding controller. - */ - public String[] listFc() { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - return _bc.listFc(); - } - - /** - * Method introduced by AOKell. - * Part of the implementation of the binding controller. - */ - public Object lookupFc(final String cItf) - throws NoSuchInterfaceException { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - return _bc.lookupFc(cItf); - } - - /** - * Method introduced by AOKell. - * Part of the implementation of the binding controller. - */ - public void bindFc(final String cItf, final Object sItf) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - _bc.bindFc(cItf,sItf); - } - - /** - * Method introduced by AOKell. - * Part of the implementation of the binding controller. - */ - public void unbindFc(final String cItf) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - BindingController _bc = FractalHelper.getBindingController(_fcComp); - _bc.unbindFc(cItf); - } -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/ComponentControllerTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/ComponentControllerTemplate.java deleted file mode 100644 index 5eab1673f292861d42c37ce2d56e13fe8ef0c084..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/ComponentControllerTemplate.java +++ /dev/null @@ -1,79 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.control.component.ComponentSetterItf; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; - -import spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by this ComponentControllerProcessor. - * - * @author Lionel Seinturier - */ -public class ComponentControllerTemplate implements Template, Component, ComponentSetterItf { - - @Local - public ComponentControllerTemplate() {} - - /** - * The reference towards the component controller. - * - * Visibility set to protected to let the field be visible by subclasses. - */ - protected ComponentItf _fcComp; - - - // ----------------------------------------------------------- - // Component interface implementation - // ----------------------------------------------------------- - - public Type getFcType() { - return _fcComp.getFcType(); - } - - public Object getFcInterface(String interfaceName) - throws NoSuchInterfaceException { - return _fcComp.getFcInterface(interfaceName); - } - - public Object[] getFcInterfaces() { - return _fcComp.getFcInterfaces(); - } - - - // ------------------------------------------------------------------ - // ComponentSetterItf interface implementation - // ------------------------------------------------------------------ - - public void setFcCompCtrl( ComponentItf _fcComp ) { - this._fcComp = _fcComp; - } -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/ContentControllerTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/ContentControllerTemplate.java deleted file mode 100644 index 72d77bd900d4b3f231d3bc97caaff55ffef00b25..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/ContentControllerTemplate.java +++ /dev/null @@ -1,88 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -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 spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by LifeCycleControllerProcessor. - * - * @author Lionel Seinturier - */ -public class ContentControllerTemplate implements Template, ContentController { - - @Local - public ContentControllerTemplate() {} - - /** - * The reference towards the component controller. - * This field is injected by the ComponentControllerTemplate. - */ - @Local - private ComponentItf _fcComp; - - - // ----------------------------------------------------------- - // ContentController interface implementation - // ----------------------------------------------------------- - - public Object[] getFcInternalInterfaces() { - ContentController _cc = FractalHelper.getContentController(_fcComp); - return _cc.getFcInternalInterfaces(); - } - - public Object getFcInternalInterface(String arg0) - throws NoSuchInterfaceException { - ContentController _cc = FractalHelper.getContentController(_fcComp); - return _cc.getFcInternalInterface(arg0); - } - - public Component[] getFcSubComponents() { - ContentController _cc = FractalHelper.getContentController(_fcComp); - return _cc.getFcSubComponents(); - } - - public void addFcSubComponent(Component arg0) - throws IllegalContentException, IllegalLifeCycleException { - ContentController _cc = FractalHelper.getContentController(_fcComp); - _cc.addFcSubComponent(arg0); - } - - public void removeFcSubComponent(Component arg0) - throws IllegalContentException, IllegalLifeCycleException { - ContentController _cc = FractalHelper.getContentController(_fcComp); - _cc.removeFcSubComponent(arg0); - } - -} \ No newline at end of file diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleControllerTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleControllerTemplate.java deleted file mode 100644 index 86c852946ff61db94ba3085824394fa162760156..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleControllerTemplate.java +++ /dev/null @@ -1,73 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.LifeCycleController; - -import spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by LifeCycleControllerProcessor. - * - * @author Lionel Seinturier - */ -public class LifeCycleControllerTemplate - implements Template, LifeCycleController { - - @Local - public LifeCycleControllerTemplate() {} - - /** - * The reference towards the component controller. - * This field is injected by the ComponentControllerTemplate. - */ - @Local - private ComponentItf _fcComp; - - - // ----------------------------------------------------------- - // LifecycleController interface implementation - // ----------------------------------------------------------- - - public String getFcState() { - LifeCycleController _lc = FractalHelper.getLifeCycleController(_fcComp); - return _lc.getFcState(); - } - - public void startFc() throws IllegalLifeCycleException { - LifeCycleController _lc = FractalHelper.getLifeCycleController(_fcComp); - _lc.startFc(); - } - - public void stopFc() throws IllegalLifeCycleException { - LifeCycleController _lc = FractalHelper.getLifeCycleController(_fcComp); - _lc.stopFc(); - } - -} \ No newline at end of file diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleInterceptorBeforeTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleInterceptorBeforeTemplate.java deleted file mode 100644 index 9a4281d0d31e0dc126cc8c8cb020b0f59af1fd8e..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleInterceptorBeforeTemplate.java +++ /dev/null @@ -1,55 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import spoon.template.Local; -import spoon.template.StatementListTemplateParameter; -import spoon.template.Template; - -/** - * Template applied to all classes which are processed by - * LifeCycleControllerProcessor. This template defines some before code inserted - * at the beginning of all processed methods. - * - * @author Lionel Seinturier - */ -public class LifeCycleInterceptorBeforeTemplate - extends StatementListTemplateParameter implements Template { - - /** - * Define the code which will be introduced before each method of the - * processed class. - */ - public void statements() { - if( ! isFcStarted ) { - throw new RuntimeException( - "Component "+this+ - " must be started before accepting method calls"); - } - - } - - @Local - private boolean isFcStarted = false; -} \ No newline at end of file diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleInterceptorTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleInterceptorTemplate.java deleted file mode 100644 index 47e055bdcaf72bee9b8e6a81b993422d984f0808..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/LifeCycleInterceptorTemplate.java +++ /dev/null @@ -1,63 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleInterceptorItf; - -import spoon.template.Local; -import spoon.template.Template; - -/** - * Template applied to all classes which are processed by - * LifeCycleControllerProcessor. This template defines the _isFcStarted - * field which will be introduced and the statements which will be inserted - * at the beginning of all methods. - * - * @author Lionel Seinturier - */ -public class LifeCycleInterceptorTemplate - implements Template, LifeCycleInterceptorItf { - - @Local - public LifeCycleInterceptorTemplate() {} - - /** - * Introduced field to store the state of the lifecycle controller. This - * field caches the state which is managed by the lifecycle controller. - * This field is used to provide a more performant test on the lifecycle - * controller state (saves a method call). - * - * Visibility set to protected to let the field be visible by subclasses. - */ - protected boolean isFcStarted = false; - - /** - * Set the state of the component. - * - * @param isFcStarted true if the component is started - */ - public void setFcState( boolean isFcStarted ) { - this.isFcStarted = isFcStarted; - } -} diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/NameControllerTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/NameControllerTemplate.java deleted file mode 100644 index 99057d12830d85453b7c03491f07ff8cd9651ade..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/NameControllerTemplate.java +++ /dev/null @@ -1,65 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.api.control.NameController; - -import spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by NameControllerProcessor. - * - * @author Lionel Seinturier - */ -public class NameControllerTemplate implements Template, NameController { - - @Local - public NameControllerTemplate() {} - - /** - * The reference towards the component controller. - * This field is injected by the ComponentControllerTemplate. - */ - @Local - private ComponentItf _fcComp; - - - // ----------------------------------------------------------- - // NameController interface implementation - // ----------------------------------------------------------- - - public String getFcName() { - NameController _nc = FractalHelper.getNameController(_fcComp); - return _nc.getFcName(); - } - - public void setFcName(String arg0) { - NameController _nc = FractalHelper.getNameController(_fcComp); - _nc.setFcName(arg0); - } -} \ No newline at end of file diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/SuperControllerTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/SuperControllerTemplate.java deleted file mode 100644 index 8889e6548717a136bbf0afb84cd542033b52b9cb..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/SuperControllerTemplate.java +++ /dev/null @@ -1,75 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; - -import spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by NameControllerProcessor. - * - * @author Lionel Seinturier - */ -public class SuperControllerTemplate implements Template, SuperControllerNotifier { - - @Local - public SuperControllerTemplate() {} - - /** - * The reference towards the component controller. - * This field is injected by the ComponentControllerTemplate. - */ - @Local - private ComponentItf _fcComp; - - - // ----------------------------------------------------------- - // SuperController interface implementation - // ----------------------------------------------------------- - - public Component[] getFcSuperComponents() { - SuperControllerNotifier _sc = FractalHelper.getSuperController(_fcComp); - return _sc.getFcSuperComponents(); - } - - // ----------------------------------------------------------- - // SuperControllerItf interface implementation - // ----------------------------------------------------------- - - public void addedToFc( Component c ) { - SuperControllerNotifier _sc = FractalHelper.getSuperController(_fcComp); - _sc.addedToFc(c); - } - - public void removedFromFc( Component c ) { - SuperControllerNotifier _sc = FractalHelper.getSuperController(_fcComp); - _sc.removedFromFc(c); - } -} \ No newline at end of file diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/TemplateControllerTemplate.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/TemplateControllerTemplate.java deleted file mode 100644 index 2b59de73ce0ef119e32bbc19044d1db83a1c2904..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/TemplateControllerTemplate.java +++ /dev/null @@ -1,79 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.glue.template; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -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 spoon.template.Local; -import spoon.template.Template; - -/** - * This template defines the elements which are introduced in all classes - * which are processed by TemplateControllerProcessor. - * - * @author Lionel Seinturier - */ -public class TemplateControllerTemplate implements Template, Factory { - - @Local - public TemplateControllerTemplate() {} - - /** - * The reference towards the component controller. - * This field is injected by the ComponentControllerTemplate. - */ - @Local - private ComponentItf _fcComp; - - - // ----------------------------------------------------------- - // TemplateController interface implementation - // ----------------------------------------------------------- - - public Object getFcContentDesc() { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.getFcContentDesc(); - } - - public Object getFcControllerDesc() { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.getFcControllerDesc(); - } - - public Type getFcInstanceType() { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.getFcInstanceType(); - } - - public Component newFcInstance() - throws InstantiationException { - Factory _fc = FractalHelper.getFactory(_fcComp); - return _fc.newFcInstance(); - } -} \ No newline at end of file diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/package.html b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/package.html deleted file mode 100644 index 7f3b9e01d44eb907fcff4edbf992b28e867ba46a..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/glue/template/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - -

-This package contains code templates used by Spoon processors. -

- - - diff --git a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/tools/content/ContentResolverHelper.java b/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/tools/content/ContentResolverHelper.java deleted file mode 100644 index 1c031fc8d36578e94c784ece528c0948a05fc691..0000000000000000000000000000000000000000 --- a/aokell/features/glue/spoon/src/org/objectweb/fractal/aokell/tools/content/ContentResolverHelper.java +++ /dev/null @@ -1,107 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.tools.content; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; - -import org.objectweb.fractal.aokell.glue.processor.ItfImplProcessor; -import org.objectweb.fractal.aokell.lib.membrane.marker.LifeCycleInterceptorType; - - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the glue feature. These methods are used - * by the content resolver tool. - * - * @author Lionel Seinturier - */ -public class ContentResolverHelper { - - private PrintWriter pw; - - public void newFile( - String generatedDirname, String packagename, String classname ) - throws IOException - { - String dirname = generatedDirname+"/"+packagename.replace('.','/'); - String aspectname = "ConfProcessor"; - String filename = dirname+"/"+aspectname+".java"; - new File(dirname).mkdirs(); - - System.out.println("Writing into: "+filename); - - FileWriter fw = new FileWriter(filename); - pw = new PrintWriter(fw); - - pw.println("/*"); - pw.print(" * Generated by AOKell ContentResolver on: "); - pw.println(new Date().toString()); - pw.println(" */"); - pw.println(); - - pw.println("package "+packagename+";"); - pw.println(); - pw.println("import java.util.HashMap;"); - pw.println("import java.util.Map;"); - pw.println(); - pw.println("public class "+aspectname); - pw.println(" extends "+ItfImplProcessor.class.getName()+" {"); - pw.println(); - pw.println(" public ConfProcessor() {"); - pw.println(" super();"); - pw.println(" setMarkers(markers);"); - pw.println(" }"); - pw.println(); - pw.println(" private static Map markers = new HashMap();"); - pw.println(); - pw.println(" static {"); - } - - public void generateClause( Object contentDesc, Object ctrlDesc ) - throws IOException { - - if( ((String)ctrlDesc).endsWith("Template") ) { - return; - } - - pw.println(" markers.put("); - pw.println(" "+contentDesc+".class.getName(),"); - pw.println(" "+LifeCycleInterceptorType.class.getName()+".class"); - pw.println(" ); // "+ctrlDesc); - - String msg = - contentDesc+" implements "+LifeCycleInterceptorType.class.getName(); - System.out.println(" "+msg); - } - - public void epilogue() throws IOException { - pw.println(" }"); - pw.println("}"); - pw.close(); - } -} diff --git a/aokell/features/loggable/README.txt b/aokell/features/loggable/README.txt deleted file mode 100644 index 6812188fda81bef3a9df6fa3c144d9118fefabd5..0000000000000000000000000000000000000000 --- a/aokell/features/loggable/README.txt +++ /dev/null @@ -1,8 +0,0 @@ -This directory contains the implementation of the loggable feature. When this -feature is enabled, each primitive component is bound to a logger and a monolog -factory instance. These instances can be retrieved by calling respectively, -lookupFc("logger") and lookupFc("monolog-factory"). - -Two versions exist: -- off (default): the feature is disabled, -- on: the feature is enabled. diff --git a/aokell/features/loggable/off/src/org/objectweb/fractal/aokell/lib/util/LoggableHelper.java b/aokell/features/loggable/off/src/org/objectweb/fractal/aokell/lib/util/LoggableHelper.java deleted file mode 100644 index ccb2911bc71c19dee757fcac25331f92d0828148..0000000000000000000000000000000000000000 --- a/aokell/features/loggable/off/src/org/objectweb/fractal/aokell/lib/util/LoggableHelper.java +++ /dev/null @@ -1,51 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.util; - -import org.objectweb.fractal.api.Component; - - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the loggable feature. - * - * @author Lionel Seinturier - */ -public class LoggableHelper { - - /** - * Initialize the logging mechanism. - */ - public static void init() { - // Indeed empty, the logging feature is off - } - - /** - * Bind the logger and monolog-factory interfaces. - */ - public static void bind( Component compctrl ) { - // Indeed empty, the logging feature is off - } - -} diff --git a/aokell/features/loggable/on/lib/ow_monolog.jar b/aokell/features/loggable/on/lib/ow_monolog.jar deleted file mode 100644 index ab33685921c2cdc0680fabfe9f4ea0cbdce26517..0000000000000000000000000000000000000000 Binary files a/aokell/features/loggable/on/lib/ow_monolog.jar and /dev/null differ diff --git a/aokell/features/loggable/on/src/org/objectweb/fractal/aokell/lib/util/LoggableHelper.java b/aokell/features/loggable/on/src/org/objectweb/fractal/aokell/lib/util/LoggableHelper.java deleted file mode 100644 index ea501d3855048a35f954d7eaccf085d0106f22ea..0000000000000000000000000000000000000000 --- a/aokell/features/loggable/on/src/org/objectweb/fractal/aokell/lib/util/LoggableHelper.java +++ /dev/null @@ -1,87 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, UTSL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.util; - -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.util.ComponentHelper; -import org.objectweb.util.monolog.Monolog; -import org.objectweb.util.monolog.api.Loggable; -import org.objectweb.util.monolog.api.Logger; -import org.objectweb.util.monolog.api.MonologFactory; - - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the loggable feature. - * - * @author Lionel Seinturier - */ -public class LoggableHelper { - - /** - * Initialize the logging mechanism. - */ - public static void init() { - String monologConfFile = System.getProperty("monolog-conf-file"); - if( monologConfFile != null ) { - if( Monolog.monologFactory == Monolog.getDefaultMonologFactory() ) { - Monolog.getMonologFactory(monologConfFile); - } - } - } - - /** - * Bind the logger and monolog-factory interfaces. - */ - public static void bind( Component compctrl ) { - - compctrl = MembraneHelper.getFcCompCtrlImpl(compctrl); - - try { - if( Monolog.monologFactory == Monolog.getDefaultMonologFactory() ) { - Monolog.initialize(); - } - StringBuffer path = new StringBuffer(); - ComponentHelper.toString(compctrl, path); - String s = path.toString().substring(1).replace('/', '.'); - MonologFactory mf = Monolog.monologFactory; - Logger logger = Monolog.monologFactory.getLogger(s); - Object content = compctrl.getFcInterface("/content"); - if (content instanceof Loggable) { - ((Loggable)content).setLogger(logger); - ((Loggable)content).setLoggerFactory(mf); - } - 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) { - } - } - -} diff --git a/aokell/features/membrane/README.txt b/aokell/features/membrane/README.txt deleted file mode 100644 index c7d9048a21d4b3b7d90c021ae3720b2853bfa6ac..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -This directory contains the implementation of the membrane feature. This -feature deals with the way membrane are implemented. - -Two versions exist: -- oo (default): membranes are implemented with Java objects -- comp: membranes are implemented with Fractal components \ No newline at end of file diff --git a/aokell/features/membrane/comp/membrane.xml b/aokell/features/membrane/comp/membrane.xml deleted file mode 100644 index 8401cc1d8c9f1c3231b88b862c72d6984c3d7c09..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/membrane.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/AOKellMembranes.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/AOKellMembranes.java deleted file mode 100644 index 8102749620d8585d439165f90244aab219b08530..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/AOKellMembranes.java +++ /dev/null @@ -1,144 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell; - -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; -import org.objectweb.fractal.aokell.lib.membrane.composite.CompositeTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.composite.CompositeType; -import org.objectweb.fractal.aokell.lib.membrane.composite.ParametricCompositeTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.composite.ParametricCompositeType; -import org.objectweb.fractal.aokell.lib.membrane.flat.FlatTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.flat.FlatType; -import org.objectweb.fractal.aokell.lib.membrane.flat.ParametricFlatTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.flat.ParametricFlatType; -import org.objectweb.fractal.aokell.lib.membrane.marker.BaseType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; - - -/** - * The class defines the membranes supported by AOKell. - * - * @author Lionel Seinturier - */ -public class AOKellMembranes { - - /** - * Return the membranes supported by AOKell. - */ - public static MembraneDef[] getMembranes() { - return MEMBRANES; - } - - /** AOKell membranes. */ - final public static MembraneDef[] MEMBRANES = - new MembraneDef[]{ - new MembraneDef( - "bootstrap", - "org.objectweb.fractal.aokell.lib.membrane.Base", - BaseType.class), - - new MembraneDef( - "flatPrimitive", - "org.objectweb.fractal.aokell.lib.membrane.flat.Flat", - FlatType.class), - new MembraneDef( - "primitive", - "org.objectweb.fractal.aokell.lib.membrane.primitive.Primitive", - PrimitiveType.class), - new MembraneDef( - "composite", - "org.objectweb.fractal.aokell.lib.membrane.composite.Composite", - CompositeType.class), - - // ---------- - // Parametric - // ---------- - new MembraneDef( - "flatParametricPrimitive", - "org.objectweb.fractal.aokell.lib.membrane.flat.Flat", - ParametricFlatType.class), - new MembraneDef( - "parametricPrimitive", - "org.objectweb.fractal.aokell.lib.membrane.primitive.Primitive", - ParametricPrimitiveType.class), - new MembraneDef( - "parametricComposite", - "org.objectweb.fractal.aokell.lib.membrane.composite.Composite", - ParametricCompositeType.class), - - // -------- - // Template - // -------- - new MembraneDef( - "flatPrimitiveTemplate", - "org.objectweb.fractal.aokell.lib.membrane.flat.FlatTemplate", - FlatTemplateType.class), - new MembraneDef( - "primitiveTemplate", - "org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveTemplate", - PrimitiveTemplateType.class), - new MembraneDef( - "compositeTemplate", - "org.objectweb.fractal.aokell.lib.membrane.composite.CompositeTemplate", - CompositeTemplateType.class), - - // ------------------- - // Parametric template - // ------------------- - new MembraneDef( - "flatParametricPrimitiveTemplate", - "org.objectweb.fractal.aokell.lib.membrane.flat.ParametricFlatTemplate", - ParametricFlatTemplateType.class), - new MembraneDef( - "parametricPrimitiveTemplate", - "org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveTemplate", - ParametricPrimitiveTemplateType.class), - new MembraneDef( - "parametricCompositeTemplate", - "org.objectweb.fractal.aokell.lib.membrane.composite.ParametricCompositeTemplate", - ParametricCompositeTemplateType.class), - - // ------------ - // Auto-binding - // ------------ - new MembraneDef( - "autoBindingPrimitive", - "org.objectweb.fractal.aokell.lib.membrane.primitive.AutoBindingPrimitive", - PrimitiveType.class), - new MembraneDef( - "autoBindingComposite", - "org.objectweb.fractal.aokell.lib.membrane.composite.AutoBindingComposite", - CompositeType.class), - - // ------------------------------------------- - // Membrane definitions for control components - // ------------------------------------------- - new MembraneDef("mPrimitive",null,null), - new MembraneDef("mComposite",null,null) - }; - -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeController.fractal deleted file mode 100644 index 025453bd77b0efc38f0467f418085ab7ee3465a2..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerType.fractal deleted file mode 100644 index 7176be1d7e0cc58e7c19b2ae2c733bf3243faaf8..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/BindingControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/BindingControllerType.fractal deleted file mode 100644 index fa33c12b14ae86a2edf45ca6c367c98450599730..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/BindingControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeAutoBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeAutoBindingController.fractal deleted file mode 100644 index 95c841957a94dbddb3986e32e8d72b577e1e87b2..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeAutoBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingController.fractal deleted file mode 100644 index b49ab8d7ab9c36c458233e9c9bf1066610df751a..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingControllerType.fractal deleted file mode 100644 index a88215e259194e7a3b77de71247f6dfed47e4c6e..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingControllerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeTemplateBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeTemplateBindingController.fractal deleted file mode 100644 index 3a8ab330c3602ea3f600582853ed43090de8a089..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeTemplateBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingController.fractal deleted file mode 100644 index 0a7ca3527efd72ba36d708ac50a4e38456aa56e7..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingControllerType.fractal deleted file mode 100644 index 290f65d3b5544ac82d3a745b60d18905715eefa5..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingControllerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatTemplateBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatTemplateBindingController.fractal deleted file mode 100644 index 6fef033b0cc793796853be3f15a5c8a569b163f2..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/FlatTemplateBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveAutoBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveAutoBindingController.fractal deleted file mode 100644 index 46c79460e5ec94c8f569a605e47f068b782059e0..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveAutoBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingController.fractal deleted file mode 100644 index dde6fd3e61db37d2a3e3a80a359ef66e319e1ad7..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingControllerType.fractal deleted file mode 100644 index 36218a1934b05b7baa90f4667128051c1f752e0c..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingControllerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveTemplateBindingController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveTemplateBindingController.fractal deleted file mode 100644 index 53f949f5782028af5e7de3bf511446f9f99a86af..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveTemplateBindingController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/UseBindingControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/UseBindingControllerType.fractal deleted file mode 100644 index 415229b25fe8dfba93cd2c8726d57f36a3549e6c..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/binding/UseBindingControllerType.fractal +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/ComponentControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/ComponentControllerType.fractal deleted file mode 100644 index 959db95a31900647ff04d41b646d0a93b0850828..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/ComponentControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/CompositeComponentController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/CompositeComponentController.fractal deleted file mode 100644 index 4d77e2bb4e867139a007e581dd51f0f3820f5eb0..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/CompositeComponentController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/CompositeComponentControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/CompositeComponentControllerType.fractal deleted file mode 100644 index e851a8873c03e0c325ae0779eaef28db58f252ab..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/CompositeComponentControllerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/NonCompositeComponentController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/NonCompositeComponentController.fractal deleted file mode 100644 index ef6ad85415b71d5479898b986f8eb26da40a240e..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/NonCompositeComponentController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/NonCompositeComponentControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/NonCompositeComponentControllerType.fractal deleted file mode 100644 index f9c6678027b979e458d722c8b8698aed45065d0d..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/NonCompositeComponentControllerType.fractal +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/UseComponentControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/UseComponentControllerType.fractal deleted file mode 100644 index 1140a50e6b4cbc85591e00aaf2039231c7ddc4ff..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/component/UseComponentControllerType.fractal +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/ContentController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/ContentController.fractal deleted file mode 100644 index 3ac27579b072c32ff8c2fda36c10f556416a27a7..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/ContentController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/ContentControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/ContentControllerType.fractal deleted file mode 100644 index 5bdc1c83f46ebc0ff38cca709a62e200456ab1f4..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/ContentControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/TemplateContentController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/TemplateContentController.fractal deleted file mode 100644 index 28d176f6b2e55d475f88c0019f562b23c0f1e67b..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/TemplateContentController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/UseContentControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/UseContentControllerType.fractal deleted file mode 100644 index e9f5218eaa6a3b10b20169ac30acca4c1aff1c99..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/content/UseContentControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/factory/FactoryController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/factory/FactoryController.fractal deleted file mode 100644 index 5687d5ce3a09fe0b62fa8a3a5382caa5f2f5f80b..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/factory/FactoryController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/factory/FactoryControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/factory/FactoryControllerType.fractal deleted file mode 100644 index 45a34804d0e8cd76315908bf336408fdb00757e5..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/factory/FactoryControllerType.fractal +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/CompositeLifeCycleController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/CompositeLifeCycleController.fractal deleted file mode 100644 index cda8667d101a5c5552c0d3dffbf862dacd6857b6..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/CompositeLifeCycleController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/CompositeLifeCycleControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/CompositeLifeCycleControllerType.fractal deleted file mode 100644 index 5b50357ad0499be3c5340e43595fba94a8c8ad48..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/CompositeLifeCycleControllerType.fractal +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/NonCompositeLifeCycleController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/NonCompositeLifeCycleController.fractal deleted file mode 100644 index f100bcf96f3c78e8c013932f1f7a62db28503bf1..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/NonCompositeLifeCycleController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/NonCompositeLifeCycleControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/NonCompositeLifeCycleControllerType.fractal deleted file mode 100644 index 5e62cfb4ab7a174a1b4e442dc544c2d78477b353..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/lifecycle/NonCompositeLifeCycleControllerType.fractal +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneController.fractal deleted file mode 100644 index 68a790d1227a84816fb95f1ba08b4ccbe4cbfb60..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerImpl.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerImpl.java deleted file mode 100644 index 138609a2e37bb6b65e33ea5c0a04763517a1bc99..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.membrane; - -import org.objectweb.fractal.aokell.lib.control.CloneCtrlException; -import org.objectweb.fractal.aokell.lib.control.Controller; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.api.Component; - - -/** - * Implementation of the name controller. - * - * @author Lionel Seinturier - */ -public class MembraneControllerImpl - implements MembraneControllerItf, Controller { - - public MembraneControllerImpl() {} - - // -------------------------------------------------------------- - // MembraneControllerItf interface - // -------------------------------------------------------------- - - public Component getFcMembrane() { - return FractalHelper.getTopMostComponent(compctrl); - } - - - // -------------------------------------------------------------- - // Controller implementation - // -------------------------------------------------------------- - - private Component compctrl; - - /** - * Set the reference towards the component controller associated to this - * controller. - */ - public void setFcCompCtrl( Component compctrl ) { - this.compctrl = compctrl; - } - - /** - * Initialize the controller. - */ - public void initFcCtrl() { - // Indeed nothing - } - - /** - * Clone the controller state from the current component to another one. - * This method may receive some hints on how to do this, or provide some - * hints on how this has been done. For instance, the hints may be a map - * that is read and/or written by the controller. The raison d'etre of - * these hints is that when its state is cloned, a controller may produce - * results that are needed by other controllers. - * - * @param dst the destination component - * @param hints hints for performing the operation - */ - public void cloneFcCtrl( Component dst, Object hints ) - throws CloneCtrlException { - // Indeed nothing - } -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerItf.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerItf.java deleted file mode 100644 index efa687b32efda571c9ecaea896fee390e89e9cce..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerItf.java +++ /dev/null @@ -1,47 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.membrane; - -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * Membrane control interface. - * - * @author Lionel Seinturier - */ -public interface MembraneControllerItf { - - final public static String NAME = "/membrane-controller"; - - final public static InterfaceType TYPE = - new InterfaceTypeImpl( - NAME, - MembraneControllerItf.class.getName(), - false, false, false); - - public Component getFcMembrane(); -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerType.fractal deleted file mode 100644 index a904506ff3f7d42f7006c1c877750e662e549033..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/membrane/MembraneControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/NameController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/NameController.fractal deleted file mode 100644 index b535d0ed84fdf723a6f9530bd95a46ea46074f36..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/NameController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/NameControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/NameControllerType.fractal deleted file mode 100644 index b0a54672754601be174e971844573f9d70bce565..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/NameControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/UseNameControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/UseNameControllerType.fractal deleted file mode 100644 index 9b7a2894e6d53cbaf737e6b5869d35ca9c03947b..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/name/UseNameControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/SuperController.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/SuperController.fractal deleted file mode 100644 index e0a81cea8ec94ee7f1b763c91422a27f24d2a978..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/SuperController.fractal +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/SuperControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/SuperControllerType.fractal deleted file mode 100644 index 0024d279725e04600094d1ac711c2f936d447bcd..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/SuperControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/UseSuperControllerType.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/UseSuperControllerType.fractal deleted file mode 100644 index 4a6f15eb901d197c076093463a8c4defa7d79d48..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/control/superc/UseSuperControllerType.fractal +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java deleted file mode 100644 index b845f2ba23bcd6b60cbe7d0a91c747fa64b83117..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java +++ /dev/null @@ -1,186 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.factory; - -import org.objectweb.fractal.aokell.Membranes; -import org.objectweb.fractal.aokell.lib.control.Controller; -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf; -import org.objectweb.fractal.aokell.lib.membrane.MCompositeImpl; -import org.objectweb.fractal.aokell.lib.membrane.MPrimitiveImpl; -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.factory.InstantiationException; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * The singleton implementation of the membrane factory. - * - * @author Lionel Seinturier - */ -public class MembraneFactoryImpl implements MembraneFactoryItf { - - private MembraneFactoryImpl() {} - private static MembraneFactoryItf singleton = new MembraneFactoryImpl(); - public static MembraneFactoryItf get() { return singleton; } - - - /** - * Create a new control membrane. - */ - public Component newFcMembrane( - Type type, Object controllerDesc, Object contentDesc, - Object content ) - throws InstantiationException { - - /* - * Control membrane for controllers, i.e. components associated to the - * mPrimitive and mComposite controller descriptions. - */ - if( controllerDesc.equals("mPrimitive") ) { - Component ctrlctrl = new MPrimitiveImpl(type,content); - - if( !(content instanceof Controller) ) { - throw new InstantiationException( - "Component-controller class "+ - content.getClass().getName()+" should implement "+ - Controller.class.getName() ); - } - - // Set the reference to the component-controller - Controller ctrl = (Controller)content; - ctrl.setFcCompCtrl(ctrlctrl); - - return ctrlctrl; - } - if( controllerDesc.equals("mComposite") ) { - return new MCompositeImpl(type,content); - } - - /* - * Control membrane for regular components. - * - * Instantiate the control membrane which is a composite associated to - * the given controller description. - */ - MembraneDef mdef = Membranes.get().getMembraneDef(controllerDesc); - Component membrane = mdef.newFcStaticMembrane(); - - /* - * Retrieve the component controller from the control membrane and - * initialize it. The purpose of the initFc method is to initialize the - * management of the component external interfaces. - * - * In the case of composite component, the content controller is in - * charge of the internal interfaces. Initialize it also. - */ - ComponentItf compctrlimpl = - (ComponentItf) MembraneHelper.getFcCompCtrlImpl(membrane); - compctrlimpl.initFc(type,controllerDesc,contentDesc,content); - - ContentControllerItf cc = null; - try { - cc = MembraneHelper.getFcContentCtrl(membrane); - cc.initFc(type,controllerDesc,contentDesc,compctrlimpl,content); - } - catch( RuntimeException re ) { - // No content controller in this membrane. This is not a composite. - } - - /* - * Initialize controllers. - */ - Component[] subs = FractalHelper.getAllSubComponents(membrane); - for (int i = 0; i < subs.length; i++) { - Object subcontent = FractalHelper.getContent(subs[i]); - if( subcontent != null ) { - // subcontent may be null for composites - if( subcontent instanceof Controller ) { - Controller ctrl = (Controller)subcontent; - ctrl.initFcCtrl(); - } - } - } - - /* - * Initialize the list of control interfaces implemented by this - * membrane. - */ - Object[] itfs = membrane.getFcInterfaces(); - for (int i = 0; i < itfs.length; i++) { - Interface itf = (Interface) itfs[i]; - - if( itf.getFcItfName().startsWith("//") ) { - - InterfaceType it = (InterfaceType) itf.getFcItfType(); - InterfaceTypeImpl itused = - new InterfaceTypeImpl( - it.getFcItfName().substring(2), // remove // - it.getFcItfSignature(), - it.isFcClientItf(), - it.isFcOptionalItf(), - it.isFcCollectionItf() ); - - /* - * Register the interfaces exported by the membrane: - * - with the component controller, - * - with the content controller (for internal interfaces). - * - * These interfaces are register with a type where the heading - * // has been removed from the name. For example, - * //binding-controller is registered under binding-controller - * which is the usual name used at level 0. - * - * Caution: itf.getFcItfName() == "//"+itused.getFcItfName() - */ - compctrlimpl.addFcController(new InterfaceType[]{itused},itf); - if( cc != null ) { - cc.addFcController(new InterfaceType[]{itused},itf); - } - } - } - - return (Component) compctrlimpl; - } - - /** - * Return true if the content class associated to the given controller - * description must implement the BindingController interface when its type - * defines at least one client interface. - */ - public boolean checkFcContentForBC( Object controllerDesc ) { - if( controllerDesc.equals("mPrimitive") || - controllerDesc.equals("mComposite") ) - return false; - - return true; - } - -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/Base.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/Base.fractal deleted file mode 100644 index ea6df476d42cbe5661c563af155f60d87f55644f..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/Base.fractal +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MCompositeImpl.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MCompositeImpl.java deleted file mode 100644 index da5e72e0dfd5e2763e4e80c92b69900ab5bbf322..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MCompositeImpl.java +++ /dev/null @@ -1,102 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.membrane; - -import java.util.ArrayList; -import java.util.List; - -import org.objectweb.fractal.aokell.lib.interf.Delegator; -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -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.type.InterfaceType; - - -/** - * Implementation of the control membrane for mcomposite components which are - * composite control components. MCompositeImpl implements thus a level of - * control for controllers. - * - * @author Lionel Seinturier - */ -public class MCompositeImpl - extends MPrimitiveImpl - implements ContentController { - - public MCompositeImpl( Type type, Object content ) { - - super(type,content); - - fcInterfaces.add( Delegator.generate(CONTENT_TYPE,this,this,false,false) ); - } - - protected boolean isBoundable( InterfaceType it ) { - // TODO manage composite with a content - return true; - } - - - // ----------------------------------------------------------------- - // Implementation of the ContentController interface - // ----------------------------------------------------------------- - - final public static InterfaceType CONTENT_TYPE = - new InterfaceTypeImpl( - "content-controller", - ContentController.class.getName(), - false, false, false); - - private List fcContent = new ArrayList(); - - public Object[] getFcInternalInterfaces() { - throw new UnsupportedOperationException(); - } - - public Object getFcInternalInterface(String interfaceName) - throws NoSuchInterfaceException { - throw new UnsupportedOperationException(); - } - - public Component[] getFcSubComponents() { - return (Component[]) fcContent.toArray(new Component[fcContent.size()]); - } - - public void addFcSubComponent(Component arg0) - throws IllegalContentException, IllegalLifeCycleException { - fcContent.add(arg0); - - if( arg0 instanceof MPrimitiveImpl ) { - ((MPrimitiveImpl)arg0).fcSupers.add(this); - } - } - - public void removeFcSubComponent(Component arg0) - throws IllegalContentException, IllegalLifeCycleException { - fcContent.remove(arg0); - } -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MPrimitiveImpl.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MPrimitiveImpl.java deleted file mode 100644 index eee50f87e4d7abd743e962e32ffb84b36b0d05dc..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MPrimitiveImpl.java +++ /dev/null @@ -1,281 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.membrane; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.objectweb.fractal.aokell.lib.interf.Delegator; -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -import org.objectweb.fractal.api.Component; -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.IllegalBindingException; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; -import org.objectweb.fractal.api.control.NameController; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; - - -/** - * Implementation of the control membrane for mprimitive components which are - * primitive control components. MPrimitiveImpl implements thus a level of - * control for controllers. - * - * @author Lionel Seinturier - */ -public class MPrimitiveImpl - implements - Component, BindingController, NameController, SuperControllerNotifier { - - private Type type; - private Object content; - - public MPrimitiveImpl( Type type, Object content ) { - - this.type = type; - this.content = content; - - ComponentType ct = (ComponentType) type; - InterfaceType[] its = ct.getFcInterfaceTypes(); - for (int i = 0; i < its.length; i++) { - Object itf = - Delegator.generate(its[i],this,content,false,isBoundable(its[i])); - fcInterfaces.add(itf); - } - - fcInterfaces.add( Delegator.generate(COMPONENT_TYPE,this,this,false,false) ); - fcInterfaces.add( Delegator.generate(BINDING_TYPE,this,this,false,false) ); - fcInterfaces.add( Delegator.generate(NAME_TYPE,this,this,false,false) ); - fcInterfaces.add( Delegator.generate(SUPER_TYPE,this,this,false,false) ); - } - - protected boolean isBoundable( InterfaceType it ) { - return it.isFcClientItf(); - } - - - // ----------------------------------------------------------------- - // Implementation of the Component interface - // ----------------------------------------------------------------- - - final public static InterfaceType COMPONENT_TYPE = - new InterfaceTypeImpl( - "component", - Component.class.getName(), - false, false, false); - - public Type getFcType() { - return type; - } - - public Object getFcInterface(String interfaceName) - throws NoSuchInterfaceException { - - for (Iterator iter = fcInterfaces.iterator(); iter.hasNext();) { - Interface itf = (Interface) iter.next(); - if( itf.getFcItfName().equals(interfaceName) ) { - return itf; - } - } - - // TODO support dynamically created collection interface instances - - if( interfaceName.equals("/content") ) { - return content; - } - - /* - * Delegate the query to the component controller. - * Needed for hidden interfaces (e.g. ///content ou ///desc). - */ - if( ! interfaceName.equals("//component") ) { - Component compctrl = (Component) getFcInterface("//component"); - return compctrl.getFcInterface(interfaceName.substring(2)); - } - - throw new NoSuchInterfaceException(interfaceName); - } - - public Object[] getFcInterfaces() { - return fcInterfaces.toArray(); - } - - protected List fcInterfaces = new ArrayList(); - - private Set getFcSingletonClientItfTypeNames() { - if( singletonClientItfTypeNames == null ) { - singletonClientItfTypeNames = new HashSet(); - InterfaceType[] its = ((ComponentType)type).getFcInterfaceTypes(); - for (int i = 0; i < its.length; i++) { - if( its[i].isFcClientItf() && ! its[i].isFcCollectionItf() ) { - singletonClientItfTypeNames.add(its[i].getFcItfName()); - } - } - } - return singletonClientItfTypeNames; - } - - private Set getFcCollectionClientItfTypeNames() { - if( collectionClientItfTypeNames == null ) { - collectionClientItfTypeNames = new HashSet(); - InterfaceType[] its = ((ComponentType)type).getFcInterfaceTypes(); - for (int i = 0; i < its.length; i++) { - if( its[i].isFcClientItf() && its[i].isFcCollectionItf() ) { - collectionClientItfTypeNames.add(its[i].getFcItfName()); - } - } - } - return collectionClientItfTypeNames; - } - - private Set singletonClientItfTypeNames; - private Set collectionClientItfTypeNames; - - - // ----------------------------------------------------------------- - // Implementation of the BindingController interface - // ----------------------------------------------------------------- - - final public static InterfaceType BINDING_TYPE = - new InterfaceTypeImpl( - "binding-controller", - BindingController.class.getName(), - false, false, false); - - // key: String interfaceName / value: Object bound interface - private Map fcBindings = new HashMap(); - - public String[] listFc() { - - // Singleton client interfaces - Set names = new HashSet(); - names.addAll( getFcSingletonClientItfTypeNames() ); - - // Collection client interfaces - Set col = getFcCollectionClientItfTypeNames(); - for (Iterator iter = col.iterator(); iter.hasNext();) { - String arg0 = (String) iter.next(); - for (Iterator iter2 = fcBindings.entrySet().iterator(); iter2.hasNext();) { - Map.Entry entry = (Map.Entry) iter2.next(); - String itfName = (String) entry.getKey(); - if( itfName.startsWith(arg0) ) { - names.add( itfName ); - } - } - } - - return (String[]) names.toArray( new String[names.size()] ); - } - - public Object lookupFc(String arg0) throws NoSuchInterfaceException { - - // Singleton client interfaces - if( fcBindings.containsKey(arg0) ) { - return fcBindings.get(arg0); - } - - // Collection client interfaces - Set col = getFcCollectionClientItfTypeNames(); - if( col.contains(arg0) ) { - List bound = new ArrayList(); - for (Iterator iter = fcBindings.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry) iter.next(); - String itfName = (String) entry.getKey(); - if( itfName.startsWith(arg0) ) { - bound.add( entry.getValue() ); - } - } - return bound; - } - - throw new NoSuchInterfaceException(arg0); - } - - public void bindFc(String arg0, Object arg1) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - fcBindings.put(arg0,arg1); - } - - public void unbindFc(String arg0) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - fcBindings.remove(arg0); - } - - - // ----------------------------------------------------------------- - // Implementation of the NameController interface - // ----------------------------------------------------------------- - - final public static InterfaceType NAME_TYPE = - new InterfaceTypeImpl( - "name-controller", - NameController.class.getName(), - false, false, false); - - private String fcName; - - public String getFcName() { - return fcName; - } - - public void setFcName(String arg0) { - fcName = arg0; - } - - - // ----------------------------------------------------------------- - // Implementation of the SuperControllerNotifier interface - // ----------------------------------------------------------------- - - final public static InterfaceType SUPER_TYPE = - new InterfaceTypeImpl( - "super-controller", - SuperControllerNotifier.class.getName(), - false, false, false); - - protected List fcSupers = new ArrayList(); - - public Component[] getFcSuperComponents() { - return (Component[]) fcSupers.toArray(new Component[fcSupers.size()]); - } - - public void addedToFc( Component c ) { - fcSupers.add(c); - } - - public void removedFromFc( Component c ) { - fcSupers.remove(c); - } -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MembraneDef.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MembraneDef.java deleted file mode 100644 index 7573f74bbdddf515e083f295879905e76c9ff1f4..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/MembraneDef.java +++ /dev/null @@ -1,92 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.membrane; - -import org.objectweb.fractal.aokell.lib.util.PlatformHelper; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.factory.InstantiationException; - - -/** - * Class holding data for defining a membrane. - * - * @author Lionel Seinturier - */ -public class MembraneDef { - - /** The controller description (e.g. primitive, composite). */ - private Object controllerdesc; - - /** The fully qualified name of the membrane ADL definition. */ - private String adl; - - /** The Java marker type for the membrane (must be an Java interface). */ - private Class type; - - public MembraneDef(Object controllerdesc, String adl, Class type) { - this.controllerdesc = controllerdesc; - this.adl = adl; - this.type = type; - } - - public Object getControllerDesc() { - return controllerdesc; - } - - public String getAdl() { - return adl; - } - - public Class getType() { - return type; - } - - private StaticFactoryItf adlsf; - - /** - * Return a new instance of this membrane, i.e. create an instance of the - * composite reference by the field adl. - */ - public Component newFcStaticMembrane() throws InstantiationException { - - try { - if( adlsf == null ) { - Class adlcl = PlatformHelper.loadClass(adl); - if( ! StaticFactoryItf.class.isAssignableFrom(adlcl) ) { - throw new Exception( - adlcl.getName()+" should implement "+ - StaticFactoryItf.class.getName()); - } - adlsf = (StaticFactoryItf) adlcl.newInstance(); - } - - return adlsf.newFcStaticMembrane(); - } - catch( Exception e ) { - e.printStackTrace(); - throw new InstantiationException(e.getMessage()); - } - } - -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/StaticFactoryItf.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/StaticFactoryItf.java deleted file mode 100644 index 8760840796e70bf40d230cc3ac127b9f5b78f1ab..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/StaticFactoryItf.java +++ /dev/null @@ -1,40 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.membrane; - -import org.objectweb.fractal.api.Component; - - -/** - * Interface implemented by factories creating instances of membranes. - * These factories are generated by MembraneCompiler as compiled versions - * (hence the term static) of ADL descriptions for membranes. - * - * @author Lionel Seinturier - */ -public interface StaticFactoryItf { - - public Component newFcStaticMembrane() throws Exception; - -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal deleted file mode 100644 index f75c7608be69407dbb9357d2e6df0d56c521a0f7..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/AutoBindingComposite.fractal +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal deleted file mode 100644 index 25e72df73000347ebc6be52785037a7f4f168baf..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/Composite.fractal +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal deleted file mode 100644 index dc4edca32d239a55d322d54cfab2237f563c2c98..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/CompositeTemplate.fractal +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/ParametricCompositeTemplate.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/ParametricCompositeTemplate.fractal deleted file mode 100644 index d24c9d62b47d9f58224abff3e0ae7b76f35ae7c6..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/composite/ParametricCompositeTemplate.fractal +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal deleted file mode 100644 index dd79b8bdcb431792705800cbf07d90526aa8e1ed..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/Flat.fractal +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal deleted file mode 100644 index 4a14ccc18dbd337898871ced52e086057d012d49..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/FlatTemplate.fractal +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/ParametricFlatTemplate.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/ParametricFlatTemplate.fractal deleted file mode 100644 index f29e7fbb1c470e5f6232fdc18fa1364d843585b4..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/flat/ParametricFlatTemplate.fractal +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/package.html b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/package.html deleted file mode 100644 index a9ece5085da188b8e214340c5985a4574b3a0367..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - -

-This package contains the definition of control membranes. -

- - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal deleted file mode 100644 index ba2990175ef0c0b0737f16d3ca5e40fe336bb350..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/AutoBindingPrimitive.fractal +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/ParametricPrimitiveTemplate.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/ParametricPrimitiveTemplate.fractal deleted file mode 100644 index 730395a27b6efa9ebe6762c0a23c58c4bdc995f0..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/ParametricPrimitiveTemplate.fractal +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal deleted file mode 100644 index 57e9b75432f76aec04544db5963f5a1431e147f2..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/Primitive.fractal +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal deleted file mode 100644 index 6be69aa1404bd6fe2f6f7340fa85db9ff8803aba..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/membrane/primitive/PrimitiveTemplate.fractal +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java deleted file mode 100644 index b9aa3e6bdee6d2d998378331295b17ff2b9eb1d3..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java +++ /dev/null @@ -1,129 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.util; - -import java.util.ArrayList; -import java.util.List; - -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; - - -/** - * This class some feature-dependant helper methods. - * - * @author Lionel Seinturier - */ -public class MembraneHelper { - - /** - * Return the component controller implementation associated to the given - * component. - */ - public static Component getFcCompCtrlImpl( Component comp ) { - - Interface itf = - (Interface) FractalHelper.getFcInterface(comp,"//component"); - Interface last = FractalHelper.followBindingsUpToLastInterface(itf); - Component c = last.getFcItfOwner(); - Object content = FractalHelper.getContent(c); - - return (Component) content; - } - - /** - * Return the controller implementations associated to the given component. - */ - public static Object[] getFcControllerImpls( Component comp ) { - - Object[] ctrls = ((ComponentItf)comp).getFcControllers(); - List impls = new ArrayList(); - for (int i = 0; i < ctrls.length; i++) { - if( ctrls[i] instanceof Interface ) { - Interface itf = - FractalHelper.followBindingsUpToLastInterface( - (Interface) ctrls[i] ); - Component c = itf.getFcItfOwner(); - Object content = FractalHelper.getContent(c); - impls.add(content); - } - } - - return impls.toArray(); - } - - /** - * Return the component controller reference associated to the given - * component. - */ - public static ComponentItf getFcCompCtrl( Component comp ) { - return (ComponentItf) FractalHelper.getFcInterface(comp,"//component"); - } - - /** - * Return the binding controller reference associated to the given - * component. - */ - public static BindingController getFcBindingCtrl( Component comp ) { - return (BindingController) FractalHelper.getFcInterface(comp,"//binding-controller"); - } - - /** - * Return the content controller reference associated to the given - * component. - */ - public static ContentControllerItf getFcContentCtrl( Component comp ) { - return (ContentControllerItf) FractalHelper.getFcInterface(comp,"//content-controller"); - } - - /** - * Return the lifecycle controller reference associated to the given - * component. - */ - public static LifeCycleController getFcLifeCycleCtrl( Component comp ) { - return (LifeCycleController) FractalHelper.getFcInterface(comp,"//lifecycle-controller"); - } - - /** - * Return the super controller reference associated to the given component. - */ - public static SuperControllerNotifier getFcSuperCtrl( Component comp ) { - return (SuperControllerNotifier) FractalHelper.getFcInterface(comp,"//super-controller"); - } - - /** - * Return the content associated to the given component. - * With componentized membranes, the given component is a meta-component - * (i.e. component instance associated to a control-component). The return - * value is the content (M0 instance) controlled by the control-component. - */ - public static Object getFcContent( Component comp ) { - return FractalHelper.getFcInterface(comp,"///content"); - } -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/Backend.fractal b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/Backend.fractal deleted file mode 100644 index ede9feefd39f5734e7a8ff6834f5cd421c7afb4a..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/Backend.fractal +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/BindingBuilder.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/BindingBuilder.java deleted file mode 100644 index acadf40b01179da30176286d771bba2fa80ef1cc..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/BindingBuilder.java +++ /dev/null @@ -1,71 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.tools.membrane; - -import java.io.PrintWriter; -import java.util.Map; - -/** - * Implementation of the BindingBuilder for generating AOKell membranes. - * This implementation is based on the original one written by E. Bruneton for - * Fractal ADL. - * - * @author Lionel Seinturier - */ -public class BindingBuilder - implements org.objectweb.fractal.adl.bindings.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("FractalHelper.getBindingController("); - pw.print(client); - pw.print(").bindFc(\""); - pw.print(clientItf); - pw.print("\", "); - if (type == IMPORT_BINDING) { - pw.print("FractalHelper.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/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/ComponentBuilder.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/ComponentBuilder.java deleted file mode 100644 index 1cb00a57691c3c6774bb70ebb63b8e341a7fba7a..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/ComponentBuilder.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.tools.membrane; - -import java.io.PrintWriter; -import java.util.Map; - -/** - * Implementation of the ComponentBuilder for generating AOKell membranes. - * This implementation is based on the original one written by E. Bruneton for - * Fractal ADL. - * - * @author Lionel Seinturier - */ -public class ComponentBuilder - implements org.objectweb.fractal.adl.components.ComponentBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the ComponentBuilder interface - // -------------------------------------------------------------------------- - - public void addComponent ( - final Object superComponent, - final Object subComponent, - final String name, - final Object context) - { - PrintWriter pw = (PrintWriter)((Map)context).get("printwriter"); - pw.print("FractalHelper.getContentController("); - pw.print(superComponent); - pw.print(").addFcSubComponent("); - pw.print(subComponent); - pw.println(");"); - - pw.print("FractalHelper.getSuperController("); - pw.print(subComponent); - pw.print(").addedToFc("); - pw.print(superComponent); - pw.println(");"); - } - - public void startComponent (final Object component, final Object context) { - // does nothing - } -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/ImplementationBuilder.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/ImplementationBuilder.java deleted file mode 100644 index 6f85cc77fd6a252c3fdd8266f7d3cfa375d9de1a..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/ImplementationBuilder.java +++ /dev/null @@ -1,96 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.tools.membrane; - -import java.io.PrintWriter; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * Implementation of the ImplementationBuilder for generating AOKell membranes. - * This implementation is based on the original one written by E. Bruneton for - * Fractal ADL. - * - * @author Lionel Seinturier - */ -public class ImplementationBuilder - implements org.objectweb.fractal.adl.implementations.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 String definition, - 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("Component "); - pw.print(id); - pw.print(" = gf.newFcInstance("); - pw.print(type); - pw.print(",\""); - pw.print(controllerDesc); - pw.print("\","); - pw.print("null"); - pw.println(");"); - - 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("Component "); - pw.print(id); - pw.print(" = gf.newFcInstance("); - pw.print(type); - pw.print(",\""); - pw.print(controllerDesc); - pw.print("\",\""); - pw.print(contentDesc); - pw.println("\");"); - - primitiveCounters.put(context, new Integer(i.intValue() + 1)); - return id; - } - } -} diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/MembraneCompiler.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/MembraneCompiler.java deleted file mode 100644 index fae1f0b1eaf3d896025cd65b4e42746697f8bb53..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/MembraneCompiler.java +++ /dev/null @@ -1,208 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005 INRIA, 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: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.tools.membrane; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.objectweb.fractal.adl.ADLException; -import org.objectweb.fractal.adl.Factory; -import org.objectweb.fractal.adl.FactoryFactory; -import org.objectweb.fractal.aokell.AOKellMembranes; -import org.objectweb.fractal.aokell.lib.factory.GenericFactoryImpl; -import org.objectweb.fractal.aokell.lib.factory.TypeFactoryImpl; -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; -import org.objectweb.fractal.aokell.lib.membrane.StaticFactoryItf; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -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; - - -/** - * Source code generator for Java classes implementing membranes types and - * component parts. The Java classes are obtained with a modified version of the - * Fractal ADL Java backend. - * - * @author Lionel Seinturier - */ -public class MembraneCompiler { - - /** The directory where generated files are stored. */ - private static String generatedDirname = "generated"; - - /** The Membranes (like AOKellMembranes). */ - private static MembraneDef[] Membrane = AOKellMembranes.getMembranes(); - - private static void usage() { - System.out.println("java "+MembraneCompiler.class.getName()+" [-d dir] com.example.Membranes"); - System.out.print("Compile into Java source files "); - System.out.println("the Fractal ADL definitions of control membranes"); - System.out.println("Option:"); - System.out.print(" -d dir : the directory where files will be generated"); - System.out.println("(default generated/)"); - System.out.println(" com.example.Membranes : the membrane class file"); - - } - - public static void main(String[] args) throws Exception { - if( args.length != 0 ) { - if((! args[0].equals("-d")) || args.length < 2 || args.length > 3 ) { - usage(); - return; - } - generatedDirname = args[1]; - System.out.println(Membrane.length); - if( args.length == 3 ){ - System.out.println("Membrane = "+args[2]); - Object instance = MembraneCompiler.class.getClassLoader().loadClass(args[2]).newInstance(); - Membrane = (MembraneDef[])instance.getClass().getMethod("getMembranes", null).invoke(instance, null); - } - } - System.out.println(Membrane.length); - new MembraneCompiler(Membrane).compile(); - } - - /** - * Contruct a new membrane compiler. - * - * @param adls the membrane ADL descriptions - * @param markers the marker types for generating component parts - */ - public MembraneCompiler( Map adls, Map markers ) { - this.adls = adls; - this.markers = markers; - } - - /** - * Contruct a new membrane compiler. - * - * @param mdefs an array of membrane definitions - */ - public MembraneCompiler( MembraneDef[] mdefs ) { - - adls = new HashMap(); - markers = new HashMap(); - - for (int i = 0; i < mdefs.length; i++) { - adls.put( mdefs[i].getControllerDesc(), mdefs[i].getAdl() ); - markers.put( mdefs[i].getControllerDesc(), mdefs[i].getType() ); - } - } - - private Map adls; - private Map markers; - - public void compile() throws ADLException, IOException { - - /* - * Generate the membranes. - */ - for (Iterator iter = adls.values().iterator(); iter.hasNext();) { - String adl = (String) iter.next(); - - if( adl != null ) { - int lastdot = adl.lastIndexOf('.'); - String packagename = adl.substring(0,lastdot); - String classname = adl.substring(lastdot+1); - compileMembrane(packagename,classname); - } - } - System.out.println(); - - System.out.println("Done."); - } - - protected void compileMembrane( String packagename, String classname ) - throws ADLException, IOException { - - String dirname = generatedDirname+"/"+packagename.replace('.','/'); - String filename = dirname+"/"+classname+".java"; - new File(dirname).mkdirs(); - System.out.println("Compiling into: "+filename); - - FileWriter fw = new FileWriter(filename); - PrintWriter pw = new PrintWriter(fw); - prologue(pw,packagename); - prologueMembrane(pw,classname); - - pw.println(" // --------------------------------------------------"); - Map context = new HashMap(); - context.put("printwriter",pw); - // Create the Root component - Factory f = FactoryFactory.getFactory("org.objectweb.fractal.aokell.tools.membrane.Backend"); - Object root = f.newComponent(packagename+"."+classname,context); - pw.println(" // --------------------------------------------------"); - - epilogueMembrane(pw,root); - pw.close(); - fw.close(); - } - - protected void prologue( PrintWriter pw, String packagename ) - throws IOException { - - pw.println("/*"); - pw.print(" * Generated by AOKell Membrane Compiler on: "); - pw.println(new Date().toString()); - pw.println(" */"); - pw.println("package "+packagename+";"); - pw.println(); - } - - protected void prologueMembrane( PrintWriter pw, String classname ) - throws IOException { - - pw.println("import "+Component.class.getName()+";"); - pw.println("import "+GenericFactory.class.getName()+";"); - pw.println("import "+ComponentType.class.getName()+";"); - pw.println("import "+InterfaceType.class.getName()+";"); - pw.println("import "+TypeFactory.class.getName()+";"); - pw.println("import "+GenericFactoryImpl.class.getName()+";"); - pw.println("import "+TypeFactoryImpl.class.getName()+";"); - pw.println("import "+FractalHelper.class.getName()+";"); - pw.println(); - - pw.print("public class "+classname); - pw.println(" implements "+StaticFactoryItf.class.getName()+" {"); - pw.println(" public Component newFcStaticMembrane() throws Exception {"); - pw.println(" TypeFactory tf = TypeFactoryImpl.get();"); - pw.println(" GenericFactory gf = GenericFactoryImpl.get();"); - } - - protected void epilogueMembrane( PrintWriter pw, Object root ) - throws IOException { - pw.println(" return "+root+";"); - pw.println(" }"); - pw.println("}"); - } -} \ No newline at end of file diff --git a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/TypeBuilder.java b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/TypeBuilder.java deleted file mode 100644 index e26e93237fd0abdf64f8b26d1bdbcb9564e954da..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/TypeBuilder.java +++ /dev/null @@ -1,110 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.tools.membrane; - -import java.io.PrintWriter; -import java.util.Map; -import java.util.WeakHashMap; - -/** - * Implementation of the TypeBuilder for generating AOKell membranes. - * This implementation is based on the original one written by E. Bruneton for - * Fractal ADL. - * - * @author Lionel Seinturier - */ -public class TypeBuilder - implements org.objectweb.fractal.adl.types.TypeBuilder { - - // -------------------------------------------------------------------------- - // Implementation of the TypeBuilder interface - // -------------------------------------------------------------------------- - - 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(" = tf.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)((Map)context).get("printwriter"); - pw.print("ComponentType "); - pw.print(id); - pw.print(" = tf.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/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/package.html b/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/package.html deleted file mode 100644 index 44881a9fc1bc77fd1dc3b24392b19da50754c984..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/comp/src/org/objectweb/fractal/aokell/tools/membrane/package.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - -

-This package contains the membrane compiler tool which is used to compile ADL -descriptions of AOKell membranes. -

- - - diff --git a/aokell/features/membrane/oo/membrane.xml b/aokell/features/membrane/oo/membrane.xml deleted file mode 100644 index a0d2a5cf95c48c1d30f91250422ee72a776882cd..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/membrane.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/AOKellMembranes.java b/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/AOKellMembranes.java deleted file mode 100644 index 99f2dc9c6ee9b579f06ee3335d50d768951aced4..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/AOKellMembranes.java +++ /dev/null @@ -1,42 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell; - -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; - - -/** - * This class defines the membranes supported by AOKell. - * - * @author Lionel Seinturier - */ -public class AOKellMembranes { - - /** - * Return the definitions of membranes supported by AOKell. - */ - public static MembraneDef[] getMembranes() { - return BasicMembranes.getMembranes(); - } -} diff --git a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/BasicMembranes.java b/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/BasicMembranes.java deleted file mode 100644 index 5f4dea2f1b3a5d3f9cc96226619d5c8379ddcbcd..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/BasicMembranes.java +++ /dev/null @@ -1,411 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell; - -import org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerImpl; -import org.objectweb.fractal.aokell.lib.control.attribute.AttributeControllerItf; -import org.objectweb.fractal.aokell.lib.control.binding.BindingControllerDef; -import org.objectweb.fractal.aokell.lib.control.binding.CompositeAutoBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.binding.CompositeBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.binding.CompositeTemplateBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.binding.FlatBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.binding.FlatTemplateBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.binding.PrimitiveAutoBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.binding.PrimitiveBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.binding.PrimitiveTemplateBindingControllerImpl; -import org.objectweb.fractal.aokell.lib.control.component.ComponentImpl; -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.control.component.CompositeComponentImpl; -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerImpl; -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf; -import org.objectweb.fractal.aokell.lib.control.content.TemplateContentControllerImpl; -import org.objectweb.fractal.aokell.lib.control.factory.FactoryControllerImpl; -import org.objectweb.fractal.aokell.lib.control.factory.FactoryDef; -import org.objectweb.fractal.aokell.lib.control.lifecycle.CompositeLifeCycleControllerImpl; -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleControllerImpl; -import org.objectweb.fractal.aokell.lib.control.lifecycle.LifeCycleControllerDef; -import org.objectweb.fractal.aokell.lib.control.name.NameControllerImpl; -import org.objectweb.fractal.aokell.lib.control.name.NameControllerItf; -import org.objectweb.fractal.aokell.lib.control.superc.SuperControllerDef; -import org.objectweb.fractal.aokell.lib.control.superc.SuperControllerImpl; -import org.objectweb.fractal.aokell.lib.membrane.ControllerDef; -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; -import org.objectweb.fractal.aokell.lib.membrane.composite.CompositeTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.composite.CompositeType; -import org.objectweb.fractal.aokell.lib.membrane.composite.ParametricCompositeTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.composite.ParametricCompositeType; -import org.objectweb.fractal.aokell.lib.membrane.flat.FlatTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.flat.FlatType; -import org.objectweb.fractal.aokell.lib.membrane.flat.ParametricFlatTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.flat.ParametricFlatType; -import org.objectweb.fractal.aokell.lib.membrane.marker.BaseType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.ParametricPrimitiveType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveTemplateType; -import org.objectweb.fractal.aokell.lib.membrane.primitive.PrimitiveType; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * This class defines the basic membranes which are defined by Julia. - * - * @author Lionel Seinturier - */ -public class BasicMembranes { - - /** - * Return the definitions of membranes supported by AOKell. - */ - public static MembraneDef[] getMembranes() { - return MEMBRANES; - } - - - // ------------------------------------------------- - // Component controller definition - // ------------------------------------------------- - - final public static ControllerDef componentControllerDef = - new ControllerDef( - ComponentItf.TYPE, - ComponentImpl.class - ); - - final public static ControllerDef compositeComponentControllerDef = - new ControllerDef( - ComponentItf.TYPE, - CompositeComponentImpl.class - ); - - - // ------------------------------------------------- - // Binding controller definition - // ------------------------------------------------- - - final public static ControllerDef flatBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - FlatBindingControllerImpl.class - ); - - final public static ControllerDef primitiveBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - PrimitiveBindingControllerImpl.class - ); - - final public static ControllerDef compositeBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - CompositeBindingControllerImpl.class - ); - - final public static ControllerDef flatTemplateBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - FlatTemplateBindingControllerImpl.class - ); - - final public static ControllerDef primitiveTemplateBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - PrimitiveTemplateBindingControllerImpl.class - ); - - final public static ControllerDef compositeTemplateBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - CompositeTemplateBindingControllerImpl.class - ); - - final public static ControllerDef primitiveAutoBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - PrimitiveAutoBindingControllerImpl.class - ); - - final public static ControllerDef compositeAutoBindingControllerDef = - new ControllerDef( - BindingControllerDef.TYPE, - CompositeAutoBindingControllerImpl.class - ); - - - // ------------------------------------------------- - // Lifecycle controller definition - // ------------------------------------------------- - - final public static ControllerDef nonCompositeLifeCycleControllerDef = - new ControllerDef( - LifeCycleControllerDef.PRIMITIVE_TYPE, - LifeCycleControllerImpl.class - ); - - final public static ControllerDef compositeLifeCycleControllerDef = - new ControllerDef( - LifeCycleControllerDef.COMPOSITE_TYPE, - CompositeLifeCycleControllerImpl.class - ); - - - // ------------------------------------------------- - // Name controller definition - // ------------------------------------------------- - - final public static ControllerDef nameControllerDef = - new ControllerDef( - NameControllerItf.TYPE, - NameControllerImpl.class - ); - - - // ------------------------------------------------- - // Super controller definition - // ------------------------------------------------- - - final public static ControllerDef superControllerDef = - new ControllerDef( - SuperControllerDef.TYPE, - SuperControllerImpl.class - ); - - - // ------------------------------------------------- - // Content controller definition - // ------------------------------------------------- - - final public static ControllerDef contentControllerDef = - new ControllerDef( - ContentControllerItf.TYPE, - ContentControllerImpl.class - ); - - final public static ControllerDef templateContentControllerDef = - new ControllerDef( - ContentControllerItf.TYPE, - TemplateContentControllerImpl.class - ); - - - // ------------------------------------------------- - // Factory controller definition - // ------------------------------------------------- - - final public static ControllerDef factoryControllerDef = - new ControllerDef( - new InterfaceType[]{ - FactoryDef.TYPE, - FactoryDef.HIDDEN_TYPE - }, - FactoryControllerImpl.class - ); - - - // ------------------------------------------------- - // Attribute controller definition - // ------------------------------------------------- - - final public static ControllerDef attributeControllerDef = - new ControllerDef( - AttributeControllerItf.TYPE, - AttributeControllerImpl.class - ); - - - // ------------------------------------------------- - // AOKell membrane definitions - // ------------------------------------------------- - - final public static MembraneDef[] MEMBRANES = - new MembraneDef[]{ - new MembraneDef( - "bootstrap", - new ControllerDef[] { - componentControllerDef - }, - BaseType.class), - - new MembraneDef( - "flatPrimitive", - new ControllerDef[] { - flatBindingControllerDef, - componentControllerDef, - nonCompositeLifeCycleControllerDef, - nameControllerDef - }, - FlatType.class), - new MembraneDef( - "primitive", - new ControllerDef[] { - primitiveBindingControllerDef, - componentControllerDef, - nonCompositeLifeCycleControllerDef, - nameControllerDef, - superControllerDef - }, - PrimitiveType.class), - new MembraneDef( - "composite", - new ControllerDef[] { - compositeBindingControllerDef, - compositeComponentControllerDef, - contentControllerDef, - compositeLifeCycleControllerDef, - nameControllerDef, - superControllerDef, - }, - CompositeType.class), - - // ---------- - // Parametric - // ---------- - new MembraneDef( - "flatParametricPrimitive", - new ControllerDef[] { - flatBindingControllerDef, - componentControllerDef, - nonCompositeLifeCycleControllerDef, - nameControllerDef - }, - ParametricFlatType.class), - new MembraneDef( - "parametricPrimitive", - new ControllerDef[] { - primitiveBindingControllerDef, - componentControllerDef, - nonCompositeLifeCycleControllerDef, - nameControllerDef, - superControllerDef - }, - ParametricPrimitiveType.class), - new MembraneDef( - "parametricComposite", - new ControllerDef[] { - compositeBindingControllerDef, - compositeComponentControllerDef, - contentControllerDef, - compositeLifeCycleControllerDef, - nameControllerDef, - superControllerDef - }, - ParametricCompositeType.class), - - // -------- - // Template - // -------- - new MembraneDef( - "flatPrimitiveTemplate", - new ControllerDef[] { - flatTemplateBindingControllerDef, - componentControllerDef, - factoryControllerDef, - nameControllerDef - }, - FlatTemplateType.class), - new MembraneDef( - "primitiveTemplate", - new ControllerDef[] { - primitiveTemplateBindingControllerDef, - componentControllerDef, - factoryControllerDef, - nameControllerDef, - superControllerDef - }, - PrimitiveTemplateType.class), - new MembraneDef( - "compositeTemplate", - new ControllerDef[] { - compositeTemplateBindingControllerDef, - compositeComponentControllerDef, - templateContentControllerDef, - factoryControllerDef, - nameControllerDef, - superControllerDef - }, - CompositeTemplateType.class), - - // ------------------- - // Parametric template - // ------------------- - new MembraneDef( - "flatParametricPrimitiveTemplate", - new ControllerDef[] { - attributeControllerDef, - flatTemplateBindingControllerDef, - componentControllerDef, - factoryControllerDef, - nameControllerDef - }, - ParametricFlatTemplateType.class), - new MembraneDef( - "parametricPrimitiveTemplate", - new ControllerDef[] { - attributeControllerDef, - primitiveTemplateBindingControllerDef, - componentControllerDef, - factoryControllerDef, - nameControllerDef, - superControllerDef - }, - ParametricPrimitiveTemplateType.class), - new MembraneDef( - "parametricCompositeTemplate", - new ControllerDef[] { - attributeControllerDef, - compositeTemplateBindingControllerDef, - compositeComponentControllerDef, - templateContentControllerDef, - factoryControllerDef, - nameControllerDef, - superControllerDef - }, - ParametricCompositeTemplateType.class), - - // ------------ - // Auto-binding - // ------------ - new MembraneDef( - "autoBindingPrimitive", - new ControllerDef[] { - primitiveAutoBindingControllerDef, - componentControllerDef, - nonCompositeLifeCycleControllerDef, - nameControllerDef, - superControllerDef - }, - PrimitiveType.class), - new MembraneDef( - "autoBindingComposite", - new ControllerDef[] { - compositeAutoBindingControllerDef, - compositeComponentControllerDef, - contentControllerDef, - compositeLifeCycleControllerDef, - nameControllerDef, - superControllerDef - }, - CompositeType.class), - }; - -} diff --git a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java b/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java deleted file mode 100644 index 3479da549bae9ceb280a1d0ea373b4abb73827b4..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/factory/MembraneFactoryImpl.java +++ /dev/null @@ -1,220 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.factory; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.objectweb.fractal.aokell.Membranes; -import org.objectweb.fractal.aokell.lib.control.Controller; -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf; -import org.objectweb.fractal.aokell.lib.membrane.ControllerDef; -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; -import org.objectweb.fractal.aokell.lib.type.ComponentTypeImpl; -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 org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * The singleton implementation of the membrane factory. - * - * @author Lionel Seinturier - */ -public class MembraneFactoryImpl implements MembraneFactoryItf { - - private MembraneFactoryImpl() {} - private static MembraneFactoryItf singleton = new MembraneFactoryImpl(); - public static MembraneFactoryItf get() { return singleton; } - - - /** - * Create a new control membrane. - */ - public Component newFcMembrane( - Type type, Object controllerDesc, Object contentDesc, - Object content ) - throws InstantiationException { - - /* - * Instantiate controllers. - */ - Controller[] ctrls = newFcControllers(controllerDesc); - - /* - * Retrieve the component controller and initialize it. - * The purpose of the initFc method is to initialize the management of - * the component external interfaces. - * - * In the case of composite component, the content controller is in - * charge of the internal interfaces. Initialize it also. - - */ - ComponentItf compctrl = null; - ContentControllerItf cc = null; - - for (int i = 0; i < ctrls.length; i++) { - if( ctrls[i] instanceof ComponentItf ) { - compctrl = (ComponentItf) ctrls[i]; - } - else if( ctrls[i] instanceof ContentControllerItf ) { - cc = (ContentControllerItf) ctrls[i]; - } - } - - if( compctrl == null ) { - throw new InstantiationException( - "Unexpected error. compctrl shouldn't be null."); - } - - /* - * The type of the component is obtained by concatening business and - * control interface types. - */ - ComponentType busct = (ComponentType) type; - InterfaceType[] busits = busct.getFcInterfaceTypes(); - InterfaceType[] ctrlits = getFcControllerTypes(controllerDesc); - List all = new ArrayList(); - all.addAll( Arrays.asList(busits) ); - for (int i = 0; i < ctrlits.length; i++) { - String ctrlitname = ctrlits[i].getFcItfName(); - if( ctrlitname.charAt(0) != '/' ) { - try { - busct.getFcInterfaceType(ctrlitname); - } - catch( NoSuchInterfaceException nsie ) { - // Only add if the interface type does not already exist - all.add(ctrlits[i]); - } - } - } - InterfaceType[] its = (InterfaceType[]) - all.toArray( new InterfaceType[all.size()] ); - ComponentType ct = new ComponentTypeImpl(its); - - /* - * If cc is null, the component is composite and this is not an error. - */ - compctrl.initFc(ct,controllerDesc,contentDesc,content); - if( cc != null ) { - cc.initFc(ct,controllerDesc,contentDesc,compctrl,content); - } - - /* - * Initialize controllers. - */ - initFcControllers(controllerDesc,ctrls,compctrl,cc); - - return compctrl; - } - - - /** - * Return true if the content class associated to the given controller - * description must implement the BindingController interface when its type - * defines at least one client interface. - */ - public boolean checkFcContentForBC( Object controllerDesc ) { - // Always true for AOKell with pure object-oriented membranes - return true; - } - - - // ----------------------------------------------------------------- - // Implementation specific - // ----------------------------------------------------------------- - - private Controller[] newFcControllers( Object controllerDesc ) - throws InstantiationException { - - Membranes mr = Membranes.get(); - MembraneDef mdef = mr.getMembraneDef(controllerDesc); - ControllerDef[] ctrldefs = mdef.getCtrls(); - Controller[] ctrls = new Controller[ ctrldefs.length ]; - - for (int i = 0; i < ctrldefs.length; i++) { - Class ctrlcl = ctrldefs[i].getImpl(); - try { - ctrls[i] = (Controller) ctrlcl.newInstance(); - } - catch( Exception e ) { - String msg = e.getClass().getName()+": "+e.getMessage(); - throw new InstantiationException(msg); - } - } - - return ctrls; - } - - private InterfaceType[] getFcControllerTypes( Object controllerDesc ) - throws InstantiationException { - - Membranes mr = Membranes.get(); - MembraneDef mdef = mr.getMembraneDef(controllerDesc); - ControllerDef[] ctrldefs = mdef.getCtrls(); - List types = new ArrayList(); - - for (int i = 0; i < ctrldefs.length; i++) { - types.addAll( Arrays.asList(ctrldefs[i].getTypes()) ); - } - - InterfaceType[] res = (InterfaceType[]) - types.toArray( new InterfaceType[types.size()] ); - return res; - } - - /** - * Initialize the controllers. - */ - private void initFcControllers( - Object controllerDesc, Controller[] ctrls, - ComponentItf compctrl, ContentControllerItf cc ) - throws InstantiationException { - - Membranes mr = Membranes.get(); - MembraneDef mdef = mr.getMembraneDef(controllerDesc); - ControllerDef[] ctrldefs = mdef.getCtrls(); - - // Registering the controller interfaces with the component controller - // Note: ctrls.length = ctrldefs.length - for (int i = 0; i < ctrls.length; i++) { - compctrl.addFcController(ctrldefs[i].getTypes(),ctrls[i]); - if( cc != null ) { - cc.addFcController(ctrldefs[i].getTypes(),ctrls[i]); - } - } - - // Initialize the controllers - for (int i = 0; i < ctrls.length; i++) { - ctrls[i].setFcCompCtrl(compctrl); - ctrls[i].initFcCtrl(); - } - } - -} diff --git a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/ControllerDef.java b/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/ControllerDef.java deleted file mode 100644 index 1249fa81161b77882f35db95c08a0501c41b7b4f..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/ControllerDef.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.membrane; - -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * Class holding data for defining a controller. - * - * @author Lionel Seinturier - */ -public class ControllerDef { - - /** - * The Fractal interface types implemented by the controller. - * - * Most of the time there is only one interface type. - * One exception is the factory controller which implements two interfaces: - * one associated with {@link org.objectweb.fractal.api.Factory} and - * one associated with {@link org.objectweb.fractal.julia.factory.Template}. - */ - private InterfaceType[] types; - - /** The class implementating the controller. */ - private Class impl; - - public ControllerDef( InterfaceType type, Class impl ) { - this.types = new InterfaceType[]{type}; - this.impl = impl; - } - - public ControllerDef( InterfaceType[] types, Class impl ) { - this.types = types; - this.impl = impl; - } - - public InterfaceType[] getTypes() { - return types; - } - - public Class getImpl() { - return impl; - } -} diff --git a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/MembraneDef.java b/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/MembraneDef.java deleted file mode 100644 index 7fc151638d9bce44d254754115a4e44014fca6b6..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/MembraneDef.java +++ /dev/null @@ -1,109 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.membrane; - -import java.util.HashSet; -import java.util.Set; - -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * Class holding data for defining a membrane. - * - * @author Lionel Seinturier - */ -public class MembraneDef { - - /** The controller description (e.g. primitive, composite). */ - private Object controllerdesc; - - /** The array of controller definitions implemented by this membrane. */ - private ControllerDef[] ctrls; - - /** The Java marker type for the membrane (must be an Java interface). */ - private Class type; - - public MembraneDef( - Object controllerdesc, ControllerDef[] ctrls, Class type ) { - - this.controllerdesc = controllerdesc; - this.ctrls = ctrls; - this.type = type; - } - - public Object getControllerDesc() { - return controllerdesc; - } - - public ControllerDef[] getCtrls() { - return ctrls; - } - - public Class getType() { - return type; - } - - /** - * Register a new controller definition with this membrane. - * - * @param ctrl the controller definition to add - * @exception IllegalArgumentException - * if a definition with the same controller name already exists - */ - public void registerControllerDef( ControllerDef ctrl ) { - - /* - * This shouldn't be too frequent. - * It is bearable to deal with an array instead of a collection. - */ - - InterfaceType[] its = ctrl.getTypes(); - Set names = new HashSet(); - for (int i = 0; i < its.length; i++) { - names.add( its[i].getFcItfName() ); - } - - for (int i = 0; i < ctrls.length; i++) { - InterfaceType[] it2s = ctrls[i].getTypes(); - for (int j = 0; j < it2s.length; j++) { - String ctrlname = it2s[j].getFcItfName(); - if( names.contains(ctrlname) ) { - throw new IllegalArgumentException( - "A definition for a "+ctrlname+ - " controller already exist in membrane "+ - controllerdesc ); - } - } - } - - int length = this.ctrls.length; - ControllerDef[] ctrls = new ControllerDef[ length + 1 ]; - System.arraycopy(this.ctrls,0,ctrls,0,length); - ctrls[length] = ctrl; - - this.ctrls = ctrls; - } - -} diff --git a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/package.html b/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/package.html deleted file mode 100644 index a9ece5085da188b8e214340c5985a4574b3a0367..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/membrane/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - -

-This package contains the definition of control membranes. -

- - - diff --git a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java b/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java deleted file mode 100644 index 7cee512acc1f6d82aadacd37f0037ebd472faf54..0000000000000000000000000000000000000000 --- a/aokell/features/membrane/oo/src/org/objectweb/fractal/aokell/lib/util/MembraneHelper.java +++ /dev/null @@ -1,137 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.util; - -import org.objectweb.fractal.aokell.Membranes; -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf; -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.control.LifeCycleController; -import org.objectweb.fractal.julia.control.content.SuperControllerNotifier; - - - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the membrane feature. - * - * @author Lionel Seinturier - */ -public class MembraneHelper { - - /** - * Return the component controller implementation associated to the given - * component. This method returns the given parameter with object-oriented - * membranes. - */ - public static Component getFcCompCtrlImpl( Component comp ) { - return comp; - } - - /** - * Return the controller implementations associated to the given component. - */ - public static Object[] getFcControllerImpls( Component comp ) { - return ((ComponentItf)comp).getFcControllers(); - } - - /** - * Return the component controller reference associated to the given - * component. This method returns the given parameter with object-oriented - * membranes. - */ - public static ComponentItf getFcCompCtrl( Component comp ) { - return (ComponentItf) comp; - } - - /** - * Return the binding controller reference associated to the given - * component. - */ - public static BindingController getFcBindingCtrl( Component comp ) { - return FractalHelper.getBindingController(comp); - } - - /** - * Return the content controller reference associated to the given - * component. - */ - public static ContentControllerItf getFcContentCtrl( Component comp ) { - return FractalHelper.getContentControllerItf(comp); - } - - /** - * Return the lifecycle controller reference associated to the given - * component. - */ - public static LifeCycleController getFcLifeCycleCtrl( Component comp ) { - return FractalHelper.getLifeCycleController(comp); - } - - /** - * Return the super controller reference associated to the given component. - */ - public static SuperControllerNotifier getFcSuperCtrl( Component comp ) { - return FractalHelper.getSuperController(comp); - } - - /** - * Return the content associated to the given component. - */ - public static Object getFcContent( Component comp ) { - return FractalHelper.getContent(comp); - } - - /** - * Duplicate an existing membrane definition. - * The purpose of this method is to facilitate the creation of new membrane - * definitions based on existing ones. The duplicated membrane definition is - * registered with the membrane repository. - * - * @param srcControllerDesc the membrane to duplicate - * @param newControllerDesc the controller description of the new membrane - * @param newType the type of the new membrane - * @return the defintion of the new membrane - * - * @exception IllegalArgumentException - * if the source membrane does not exists - */ - public static MembraneDef duplicateMembraneDef( - Object srcControllerDesc, Object newControllerDesc, Class newType ) { - - Membranes mrepository = Membranes.get(); - MembraneDef md = mrepository.getMembraneDef(srcControllerDesc); - if( md == null ) { - throw new IllegalArgumentException( - "Membrane "+srcControllerDesc+" does not exist"); - } - - MembraneDef newmd = - new MembraneDef( newControllerDesc, md.getCtrls(), newType ); - mrepository.register(newmd); - return newmd; - } -} diff --git a/aokell/features/platform/README.txt b/aokell/features/platform/README.txt deleted file mode 100644 index 7ae14cd7e20d84987b5ce9273a9c204eae1d1c64..0000000000000000000000000000000000000000 --- a/aokell/features/platform/README.txt +++ /dev/null @@ -1,15 +0,0 @@ -This directory contains the implementation of the platform feature. This feature -allows generating versions of AOKell for different types of Java platforms. - -Three versions exist: -- j2se (default): - with this version, AOKell runs on any standard J2SE virtual machine. -- j2me-cdc: - the target platform is J2ME CDC . - With this version, AOKell can be used on virtual machines for PDA such as - IBM J9 VM . -- j2me-cldc: - the target platform is J2ME CLDC . - With this version, AOKell can be used on virtual machines for smart phones - and embedded devices such as Sun KVM - . diff --git a/aokell/features/platform/j2me-cdc/examples/common/platform.xml b/aokell/features/platform/j2me-cdc/examples/common/platform.xml deleted file mode 100644 index 99b32432b391119f45bee6b48900bc623b9efa18..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2me-cdc/examples/common/platform.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/platform/j2me-cdc/lib/xercesImpl.jar b/aokell/features/platform/j2me-cdc/lib/xercesImpl.jar deleted file mode 100644 index 33990e8a1fdf24e15701e4cf8d9f091038394ecd..0000000000000000000000000000000000000000 Binary files a/aokell/features/platform/j2me-cdc/lib/xercesImpl.jar and /dev/null differ diff --git a/aokell/features/platform/j2me-cdc/lib/xml-apis.jar b/aokell/features/platform/j2me-cdc/lib/xml-apis.jar deleted file mode 100644 index b338fb66932a763d6939dc93f27ed985ca5d1ebb..0000000000000000000000000000000000000000 Binary files a/aokell/features/platform/j2me-cdc/lib/xml-apis.jar and /dev/null differ diff --git a/aokell/features/platform/j2me-cdc/platform.xml b/aokell/features/platform/j2me-cdc/platform.xml deleted file mode 100644 index 727ef9f4ed34516bc3c5a133f8e103222987ccf4..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2me-cdc/platform.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/platform/j2me-cdc/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java b/aokell/features/platform/j2me-cdc/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java deleted file mode 100644 index 84095f42bfe4d37fecb46d4076ce15d3cdb6adc6..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2me-cdc/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java +++ /dev/null @@ -1,168 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the platform feature. - * - * @author Lionel Seinturier - */ -public class PlatformHelper { - - // ------------------------------------------------------------------ - // Class and ressource loading primitives - // ------------------------------------------------------------------ - - /* - * Thread.currentThread().setContextClassLoader() is needed to provide a - * correct behavior with the RMIClassLoader used by fractalrmi. - * - * RMIClassLoader is needed when one remotely downloads code (e.g. - * communication stubs) with the java.rmi.server.codebase property. - */ - - /** - * Set the loader to be used by AOKell for loading classes. - * - * @param cl the loader. - * This parameter must implement ClassLoader. It is declared as an - * Object in order to be compliant with the J2ME version of AOKell. - */ - public static void setLoader( Object cl ) { - Thread.currentThread().setContextClassLoader( (ClassLoader) cl ); - } - - /** - * Load a class. - */ - public static Class loadClass(String name) throws ClassNotFoundException { - return Thread.currentThread().getContextClassLoader().loadClass(name); - } - - /** - * Load a ressource. - */ - public static InputStream getResourceAsStream( String name ) { - return Thread.currentThread().getContextClassLoader().getResourceAsStream(name); - } - - - // ------------------------------------------------------------------ - // AOKell class loader for registering classes generated on the fly - // by the fcinterface.rt or the glue.spoon-rt features. - // ------------------------------------------------------------------ - - /** - * Define a new class. - */ - public static Class defineClass( String name, byte[] b ) { - return AOKellClassLoader.get().defineClass(name,b); - } - - - /** - * AOKell class loader. - * - * @author Lionel Seinturier - */ - private static class AOKellClassLoader extends ClassLoader { - - /* - * Thread.currentThread().getContextClassLoader() is needed as a parent - * of this class loader to provide a correct behavior with the - * RMIClassLoader used by fractalrmi. - * - * RMIClassLoader is needed when one remotely downloads code (e.g. - * communication stubs) with the java.rmi.server.codebase property. - */ - - private AOKellClassLoader() { - super(Thread.currentThread().getContextClassLoader()); - } - - /** Return the singleton instance of this class. */ - public static AOKellClassLoader get() { - if( singleton == null || - singleton.getParent() != - Thread.currentThread().getContextClassLoader() ) { - - /* - * The context class loader may change, for example, when - * fractalrmi uses the java.rmi.server.codebase property. - */ - - singleton = new AOKellClassLoader(); - } - return singleton; - } - - private static AOKellClassLoader singleton;; - - public Class defineClass(String name, byte[] b) { - return defineClass(name,b,0,b.length); - } - } - - - // ------------------------------------------------------------------ - // Filesystem related functions (no filesystem available with the - // platform.j2me-cldc feature. - // ------------------------------------------------------------------ - - /** - * Utility method to write the bytecode from a class to a file. This method - * creates the directory structure corresponding to package names. - * - * @param dirname the root directory name - * @param classname the name of the class - * @param b the bytecode - */ - public static void dumpClassToFile( - String dirname, String classname, byte[] b ) throws IOException { - - File dir = new File(dirname); - if( !dir.exists() || !dir.isDirectory() ) { - throw new IOException(dir+" must exist and be a directory"); - } - - // Create the directory structure - int lastdot = classname.lastIndexOf('.'); - String filedirname = classname.substring(0,lastdot); - String filename = classname.substring(lastdot+1); - File filedir = new File(dir,filedirname.replace('.','/')); - filedir.mkdirs(); - - // Write the file - File classfile = new File(filedir,filename+".class"); - FileOutputStream fos = new FileOutputStream(classfile); - fos.write(b); - fos.close(); - } -} diff --git a/aokell/features/platform/j2me-cldc/examples/common/platform.xml b/aokell/features/platform/j2me-cldc/examples/common/platform.xml deleted file mode 100644 index bb33025c68d8623634d1b4f47273086ac56d1e46..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2me-cldc/examples/common/platform.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/platform/j2me-cldc/lib/cldc-1.1.jar b/aokell/features/platform/j2me-cldc/lib/cldc-1.1.jar deleted file mode 100644 index 5bee3a080c7260b709c858b4068bb0f461706fff..0000000000000000000000000000000000000000 Binary files a/aokell/features/platform/j2me-cldc/lib/cldc-1.1.jar and /dev/null differ diff --git a/aokell/features/platform/j2me-cldc/lib/fractal-util-j2me.jar b/aokell/features/platform/j2me-cldc/lib/fractal-util-j2me.jar deleted file mode 100644 index 1e1792b3d2ef587d481c5f6fb975a30a7c347938..0000000000000000000000000000000000000000 Binary files a/aokell/features/platform/j2me-cldc/lib/fractal-util-j2me.jar and /dev/null differ diff --git a/aokell/features/platform/j2me-cldc/lib/jdiet-20060719.jar b/aokell/features/platform/j2me-cldc/lib/jdiet-20060719.jar deleted file mode 100644 index 5fc54ae5f32ea03feb1f6c61b1e32fc757b3fef9..0000000000000000000000000000000000000000 Binary files a/aokell/features/platform/j2me-cldc/lib/jdiet-20060719.jar and /dev/null differ diff --git a/aokell/features/platform/j2me-cldc/lib/jdiet-rt-20060719.jar b/aokell/features/platform/j2me-cldc/lib/jdiet-rt-20060719.jar deleted file mode 100644 index 601ef68c27deba08f1232d84ec11fe89e551d941..0000000000000000000000000000000000000000 Binary files a/aokell/features/platform/j2me-cldc/lib/jdiet-rt-20060719.jar and /dev/null differ diff --git a/aokell/features/platform/j2me-cldc/platform.xml b/aokell/features/platform/j2me-cldc/platform.xml deleted file mode 100644 index 0bdb033749576ac3f178a028c9e023e64e871383..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2me-cldc/platform.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/aokell/features/platform/j2me-cldc/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java b/aokell/features/platform/j2me-cldc/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java deleted file mode 100644 index 979d46e8f66c77a9a47a6cbc860c98c951be34ff..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2me-cldc/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java +++ /dev/null @@ -1,82 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.util; - -import java.io.IOException; - - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the platform feature. - * - * @author Lionel Seinturier - */ -public class PlatformHelper { - - /** - * Set the loader to be used by AOKell for loading classes. - * - * @param cl the loader. - * This parameter must implement ClassLoader. It is declared as an - * Object in order to be compliant with the J2ME version of AOKell. - */ - public static void setLoader( Object cl ) { - /* - * To simplify the writing of the AOKell code which is common to all - * features, I have kept a setLoader method even though it can not be - * implemented for J2ME. - * - * UnsupportedOperationException is not in the CLDC API. - */ - throw new RuntimeException("Unsupported operation with J2ME"); - } - - /** - * Return the loader used by AOKell for loading classes. - */ - public static Class loadClass(String name) throws ClassNotFoundException { - return Class.forName(name); - } - - - // ------------------------------------------------------------------ - // Filesystem related functions (no filesystem available with the - // platform.j2me-cldc feature. - // ------------------------------------------------------------------ - - /** - * Utility method to write the bytecode from a class to a file. This method - * creates the directory structure corresponding to package names. - * - * @param dirname the root directory name - * @param classname the name of the class - * @param b the bytecode - */ - public static void dumpClassToFile( - String dirname, String classname, byte[] b ) throws IOException { - // No filesystem, we can not dump the bytecode into a file. - // Simply ignore the command. - } - -} diff --git a/aokell/features/platform/j2se/examples/common/platform.xml b/aokell/features/platform/j2se/examples/common/platform.xml deleted file mode 100644 index fb70c513f94694df6a9b97d7602b0fc19f34e01c..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2se/examples/common/platform.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/aokell/features/platform/j2se/platform.xml b/aokell/features/platform/j2se/platform.xml deleted file mode 100644 index ca3347d52537dce43e4c249fbe85575650d2d902..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2se/platform.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/aokell/features/platform/j2se/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java b/aokell/features/platform/j2se/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java deleted file mode 100644 index 21fc9a4c20457cc1dad2d003cc10cebd690d9405..0000000000000000000000000000000000000000 --- a/aokell/features/platform/j2se/src/org/objectweb/fractal/aokell/lib/util/PlatformHelper.java +++ /dev/null @@ -1,168 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.util; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -/** - * This class contains helper methods with an implementation which differs - * depending on the choosen version of the platform feature. - * - * @author Lionel Seinturier - */ -public class PlatformHelper { - - // ------------------------------------------------------------------ - // Class and ressource loading primitives - // ------------------------------------------------------------------ - - /* - * Thread.currentThread().setContextClassLoader() is needed to provide a - * correct behavior with the RMIClassLoader used by fractalrmi. - * - * RMIClassLoader is needed when one remotely downloads code (e.g. - * communication stubs) with the java.rmi.server.codebase property. - */ - - /** - * Set the loader to be used by AOKell for loading classes. - * - * @param cl the loader. - * This parameter must implement ClassLoader. It is declared as an - * Object in order to be compliant with the J2ME version of AOKell. - */ - public static void setLoader( Object cl ) { - Thread.currentThread().setContextClassLoader( (ClassLoader) cl ); - } - - /** - * Load a class. - */ - public static Class loadClass(String name) throws ClassNotFoundException { - return AOKellClassLoader.get().loadClass(name); - } - - /** - * Load a ressource. - */ - public static InputStream getResourceAsStream( String name ) { - return AOKellClassLoader.get().getResourceAsStream(name); - } - - - // ------------------------------------------------------------------ - // AOKell class loader for registering classes generated on the fly - // by the fcinterface.rt or the glue.spoon-rt features. - // ------------------------------------------------------------------ - - /** - * Define a new class. - */ - public static Class defineClass( String name, byte[] b ) { - return AOKellClassLoader.get().defineClass(name,b); - } - - - /** - * AOKell class loader. - * - * @author Lionel Seinturier - */ - private static class AOKellClassLoader extends ClassLoader { - - /* - * Thread.currentThread().getContextClassLoader() is needed as a parent - * of this class loader to provide a correct behavior with the - * RMIClassLoader used by fractalrmi. - * - * RMIClassLoader is needed when one remotely downloads code (e.g. - * communication stubs) with the java.rmi.server.codebase property. - */ - - private AOKellClassLoader() { - super(Thread.currentThread().getContextClassLoader()); - } - - /** Return the singleton instance of this class. */ - public static AOKellClassLoader get() { - if( singleton == null || - singleton.getParent() != - Thread.currentThread().getContextClassLoader() ) { - - /* - * The context class loader may change, for example, when - * fractalrmi uses the java.rmi.server.codebase property. - */ - - singleton = new AOKellClassLoader(); - } - return singleton; - } - - private static AOKellClassLoader singleton;; - - public Class defineClass(String name, byte[] b) { - return defineClass(name,b,0,b.length); - } - } - - - // ------------------------------------------------------------------ - // Filesystem related functions (no filesystem available with the - // platform.j2me-cldc feature. - // ------------------------------------------------------------------ - - /** - * Utility method to write the bytecode from a class to a file. This method - * creates the directory structure corresponding to package names. - * - * @param dirname the root directory name - * @param classname the name of the class - * @param b the bytecode - */ - public static void dumpClassToFile( - String dirname, String classname, byte[] b ) throws IOException { - - File dir = new File(dirname); - if( !dir.exists() || !dir.isDirectory() ) { - throw new IOException(dir+" must exist and be a directory"); - } - - // Create the directory structure - int lastdot = classname.lastIndexOf('.'); - String filedirname = classname.substring(0,lastdot); - String filename = classname.substring(lastdot+1); - File filedir = new File(dir,filedirname.replace('.','/')); - filedir.mkdirs(); - - // Write the file - File classfile = new File(filedir,filename+".class"); - FileOutputStream fos = new FileOutputStream(classfile); - fos.write(b); - fos.close(); - } -} diff --git a/aokell/jdoc/asm-list/package-list b/aokell/jdoc/asm-list/package-list deleted file mode 100644 index a5d8120a2ddf779ee56f5caf3a59dd10c76e8f01..0000000000000000000000000000000000000000 --- a/aokell/jdoc/asm-list/package-list +++ /dev/null @@ -1 +0,0 @@ -org.objectweb.asm diff --git a/aokell/jdoc/aspectjrt-list/package-list b/aokell/jdoc/aspectjrt-list/package-list deleted file mode 100644 index 10c6e19a7acf531232aaed19833f399764861975..0000000000000000000000000000000000000000 --- a/aokell/jdoc/aspectjrt-list/package-list +++ /dev/null @@ -1,2 +0,0 @@ -org.aspectj.lang.annotation -org.aspectj.lang.reflect diff --git a/aokell/src/org/objectweb/fractal/aokell/AOKell.java b/aokell/src/org/objectweb/fractal/aokell/AOKell.java deleted file mode 100644 index 5fb66699a95f47aaed247b4acb8f31f888b96625..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/AOKell.java +++ /dev/null @@ -1,123 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell; - -import org.objectweb.fractal.aokell.lib.factory.GenericFactoryImpl; -import org.objectweb.fractal.aokell.lib.type.ComponentTypeImpl; -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -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.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; - - -/** - * The AOKell factory component. - * This component returns the reference of the Fractal bootstrap component. - * - * @author Lionel Seinturier - */ -public class AOKell implements Factory { - - public AOKell() {} - - - /** - * Property name for dumping run-time generated code. - * The value associated to this property contains the directory into which - * run-time generated code such as Fractal interface implementations are - * dumped. No dumping if the value is null. - * This property is used in org.objectweb.fractal.aokell.lib.asm. - */ - final public static String DUMP_GENERATED_PROP_NAME = - "org.objectweb.fractal.aokell.dumpgenerated"; - - - /** Return the Fractal type of this component. */ - public Type getFcInstanceType() { - return TYPE; - } - - /** Return the Fractal controller description of this component. */ - public Object getFcControllerDesc() { - return CONTROLLER_DESC; - } - - /** Return the Fractal content description of this component. */ - public Object getFcContentDesc() { - /* - * Hard-coding the name of the bootstrap component to avoid a compile - * dependency from this class to org.objectweb.fractal.aokell.component which would hinder the - * modularity of the build process. - */ - return "org.objectweb.fractal.aokell.component.BootstrapComponentImpl"; - } - - /** The singleton instance of the bootstrap component. */ - private static Component bootstrap; - - /** - * Return the reference of the bootstrap component. - * This method is called by Fractal.getBootstrapComponent(). - * The bootstrap component provides the following interfaces: - *
    - *
  • org.objectweb.fractal.api.type.TypeFactory
  • - *
  • org.objectweb.fractal.api.factory.GenericFactory
  • - *
- */ - public Component newFcInstance() throws InstantiationException { - - if( bootstrap != null ) - return bootstrap; - - // Create the bootstrap component - GenericFactory gf = GenericFactoryImpl.get(); - bootstrap = - gf.newFcInstance( - getFcInstanceType(), - getFcControllerDesc(), - getFcContentDesc() ); - - return bootstrap; - } - - final private static ComponentType TYPE = - new ComponentTypeImpl( - new InterfaceType[] { - new InterfaceTypeImpl( - "type-factory", - TypeFactory.class.getName(), - false, false, false), - new InterfaceTypeImpl( - "generic-factory", - GenericFactory.class.getName(), - false, false, false) - }); - - final private static Object CONTROLLER_DESC = "bootstrap"; -} diff --git a/aokell/src/org/objectweb/fractal/aokell/Membranes.java b/aokell/src/org/objectweb/fractal/aokell/Membranes.java deleted file mode 100644 index 09a78d68eee10cba22bef1842c80ecd07e3ada6a..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/Membranes.java +++ /dev/null @@ -1,116 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell; - -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.lib.membrane.MembraneDef; - - -/** - * Membrane repository. - * This class is a singleton. - * - * @author Lionel Seinturier - */ -public class Membranes { - - /** The singleton instance of itself. */ - private static Membranes singleton = new Membranes(); - private Membranes() { - /* - * Register AOKell default membranes. - */ - register(AOKellMembranes.getMembranes()); - } - - /** - * Return the singleton instance of this class. - */ - public static Membranes get() { return singleton; } - - - // Map - // - /** Membrane definitions. */ - private Map mdefs = new HashMap(); - - - /** - * Register a new membrane. - * - * @param mdef the membrane definition to register - */ - public void register( MembraneDef mdef ) { - - Object controllerdesc = mdef.getControllerDesc(); - if( mdefs.containsKey(controllerdesc) ) { - throw new IllegalArgumentException( - "Membrane "+controllerdesc+" is already registered" ); - } - mdefs.put(controllerdesc,mdef); - } - - /** - * Register new membranes. - */ - public void register( MembraneDef[] mdefs ) { - for (int i = 0; i < mdefs.length; i++) { - register(mdefs[i]); - } - } - - /** - * Return true if the given controller description is registered with the - * repository. - */ - public boolean containsControllerDesc( Object controllerDesc ) { - return mdefs.containsKey(controllerDesc); - } - - /** - * Return the MembraneDef instance associated to the given controller - * description. - */ - public MembraneDef getMembraneDef( Object controllerDesc ) { - return (MembraneDef) mdefs.get(controllerDesc); - } - - /** - * Erase all registered membrane definitions. - * - * This method is needed to be able to launch tests or to launch several - * times an application within the same JVM. As Membranes is a singleton, - * reseting the repository of membrane definitions allows re-registering - * the same definition without causing an IllegalArgumentException in - * register(). - * - * This method should be used cautiously. This method is declared with the - * "package public" modifier to limit any possible misuse. - */ - void reset() { - mdefs = new HashMap(); - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/component/BootstrapComponentImpl.java b/aokell/src/org/objectweb/fractal/aokell/component/BootstrapComponentImpl.java deleted file mode 100644 index a4ee49869a965579b09b45615cc76e40a539ad90..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/component/BootstrapComponentImpl.java +++ /dev/null @@ -1,81 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.component; - -import org.objectweb.fractal.aokell.lib.factory.GenericFactoryImpl; -import org.objectweb.fractal.aokell.lib.factory.TypeFactoryImpl; -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 org.objectweb.fractal.api.type.TypeFactory; - - -/** - * Bootstrap component providing a - * TypeFactory - * and a - * GenericFactory. - * - * @author Lionel Seinturier - */ -public class BootstrapComponentImpl implements TypeFactory, GenericFactory { - - // ----------------------------------------------------------------- - // Implementation of the TypeFactory interface - // ----------------------------------------------------------------- - - private TypeFactory tf = TypeFactoryImpl.get(); - - public InterfaceType createFcItfType( - String name, String signature, - boolean isClient, boolean isOptional, boolean isCollection) - throws InstantiationException { - - return tf.createFcItfType( - name,signature,isClient,isOptional,isCollection); - } - - public ComponentType createFcType(InterfaceType[] interfaceTypes) - throws InstantiationException { - - return tf.createFcType(interfaceTypes); - } - - // ----------------------------------------------------------------- - // Implementation of the GenericFactory interface - // ----------------------------------------------------------------- - - private GenericFactory gf = GenericFactoryImpl.get(); - - public Component newFcInstance( - Type type, Object controllerDesc, Object contentDesc) - throws InstantiationException { - - return gf.newFcInstance(type,controllerDesc,contentDesc); - } - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/component/package.html b/aokell/src/org/objectweb/fractal/aokell/component/package.html deleted file mode 100644 index d19fbee4e3993e6829d47017846155d273469f92..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/component/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - -

-This package contains the implementation of the Fractal bootstrap component. -

- - - diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/ComponentInterfaceImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/ComponentInterfaceImpl.java deleted file mode 100644 index f00ae17d0bddfbcd7af6e6b70f986d82b2a5f9a8..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/ComponentInterfaceImpl.java +++ /dev/null @@ -1,66 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.julia.ComponentInterface; - -/** - * Default implementation of the {@link ComponentInterface} interface. - * This class is extended by classes which implement server interfaces - * associated to primitive components. - * - * @author Lionel Seinturier - */ -public class ComponentInterfaceImpl - extends InterfaceImpl - implements ComponentInterface { - - public ComponentInterfaceImpl() { - } - - public ComponentInterfaceImpl( - Component fcItfOwner, String fcItfName, - Type fcItfType, boolean fcInternalItf ) { - super(fcItfOwner,fcItfName,fcItfType,fcInternalItf); - } - - - // ------------------------------------------------------------------ - // Implementation of the ComponentInterface interface - // ------------------------------------------------------------------ - - public Object getFcItfImpl() { - return fcContent; - } - - public boolean hasFcInterceptor() { - return false; - } - - public Object clone() { - return InterfaceImpl.clone(this); - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/InterfaceImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/InterfaceImpl.java deleted file mode 100644 index ab192e8441c1b9ba5b3a7ce95db9da2038b3ba0a..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/InterfaceImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib; - -import org.objectweb.fractal.aokell.lib.util.PlatformHelper; -import org.objectweb.fractal.api.Component; -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.util.Fractal; - -/** - * Default implementation of the {@link Interface} interface. - * This class is extended by classes which implement component interfaces. - * - * @author Lionel Seinturier - */ -public class InterfaceImpl implements Interface { - - private Component fcItfOwner; - private String fcItfName; - private Type fcItfType; - private boolean fcInternalItf; - - - public InterfaceImpl(Component fcItfOwner, String fcItfName, - Type fcItfType, boolean fcInternalItf) { - init(fcItfOwner,fcItfName,fcItfType,fcInternalItf); - } - - public InterfaceImpl() { - } - - public void init(Component fcItfOwner, String fcItfName, - Type fcItfType, boolean fcInternalItf) { - - setFcItfOwner(fcItfOwner); - setFcItfName(fcItfName); - setFcItfType(fcItfType); - setFcInternalItf(fcInternalItf); - } - - - // ------------------------------------------------------------------ - // Implementation of the Interface interface - // ------------------------------------------------------------------ - - public Component getFcItfOwner() { - return fcItfOwner; - } - - public String getFcItfName() { - return fcItfName; - } - - public Type getFcItfType() { - return fcItfType; - } - - public boolean isFcInternalItf() { - return fcInternalItf; - } - - - // ------------------------------------------------------------------ - // Content instance associated to this interface - // ------------------------------------------------------------------ - - // Accessed by dynamically generated sub-classes - protected Object fcContent; - - public void setFcItfImpl( Object fcContent ) { - this.fcContent = fcContent; - } - - // ------------------------------------------------------------------ - // Implementation specific methods - // ------------------------------------------------------------------ - - /** - * If this interface can play the role of the source interface in a binding, - * return the target interface currently bound to it (if there is one.) - * Client interfaces or server interfaces owned by a composite can play the - * role of the source interface in a binding. - */ - public Object lookupFc() { - try { - return bc.lookupFc(fcItfName); - } - catch( NullPointerException npe ) { - setBC(); - if( bc == null ) { - String mess = fcItfOwner+" should have a binding controller"; - throw new RuntimeException(mess); - } - return lookupFc(); - } - catch( NoSuchInterfaceException nsie ) { - String mess = "No such interface exception: "+nsie.getMessage(); - throw new RuntimeException(mess); - } - } - - /** The binding controller associated to the owner of this interface. */ - protected BindingController bc; - - protected void setBC() { - try { - bc = Fractal.getBindingController(fcItfOwner); - } - catch( NoSuchInterfaceException nsie ) { - String mess = "No such interface exception: "+nsie.getMessage(); - throw new RuntimeException(mess); - } - } - - public void setFcItfOwner( Component fcItfOwner ) { - this.fcItfOwner = fcItfOwner; - bc = null; - } - - public void setFcItfName( String fcItfName ) { - this.fcItfName = fcItfName; - } - - public void setFcItfType( Type fcItfType ) { - this.fcItfType = fcItfType; - } - - public void setFcInternalItf(boolean fcInternalItf) { - this.fcInternalItf = fcInternalItf; - } - - - // ------------------------------------------------------------------ - // Implementation of a mechanism for cloning InterfaceImpl instances - // ------------------------------------------------------------------ - - /* - * The following method could not be replaced by a constructor. - * We need in ComponentImpl to be able to create instances of sub-classes - * of InterfaceImpl generated on the fly in - * org.objectweb.fractal.aokell.lib.asm. - * - * The following method could be replaced by redefining clone() inherited - * from Object. However this would not work for the J2ME compliant version - * of AOKell as clone() is not part of the CLDC API. To avoid having two - * different versions of the cloning mechanism, the following scheme, which - * fits both cases, has been implemented. - */ - - /** - * Return a clone of the given InterfaceImpl. - */ - public static InterfaceImpl clone( InterfaceImpl src ) { - - String clname = src.getClass().getName(); - - InterfaceImpl target = null; - try { - Class cl = PlatformHelper.loadClass(clname); - target = (InterfaceImpl) cl.newInstance(); - } - catch( Exception e ) { - throw new RuntimeException(e.getMessage()); - } - - target.setFcItfOwner( src.getFcItfOwner() ); - target.setFcItfName( src.getFcItfName() ); - target.setFcItfType( src.getFcItfType() ); - target.setFcInternalItf( src.isFcInternalItf() ); - - return target; - } - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/CloneCtrlException.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/CloneCtrlException.java deleted file mode 100644 index 74d7ead43f57246b2f4f06baa833993f51f01dee..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/CloneCtrlException.java +++ /dev/null @@ -1,39 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control; - -/** - * This exception is raised by the cloneFcCtrl methods defined by controllers - * whenever an error occurs during the state cloning process. - * - * @author Lionel Seinturier - */ -public class CloneCtrlException extends Exception { - - private static final long serialVersionUID = 4544016233807153456L; - - public CloneCtrlException(String mess) { - super(mess); - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/Controller.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/Controller.java deleted file mode 100644 index 39d513c8e7622b5cb1acf911647bdfc656af8939..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/Controller.java +++ /dev/null @@ -1,60 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control; - -import org.objectweb.fractal.api.Component; - -/** - * Interface for defining a controller. - * - * @author Lionel Seinturier - */ -public interface Controller { - - /** - * Set the reference towards the component controller associated to this - * controller. - */ - public void setFcCompCtrl( Component compctrl ); - - /** - * Initialize the controller. - */ - public void initFcCtrl(); - - /** - * Clone the controller state from the current component to another one. - * This method may receive some hints on how to do this, or provide some - * hints on how this has been done. For instance, the hints may be a map - * that is read and/or written by the controller. The raison d'etre of - * these hints is that when its state is cloned, a controller may produce - * results that are needed by other controllers. - * - * @param dst the destination component - * @param hints hints for performing the operation - */ - public void cloneFcCtrl( Component dst, Object hints ) - throws CloneCtrlException; - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerCloneableItf.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerCloneableItf.java deleted file mode 100644 index 537c5206e5a47b644a2f7f17c739177fead600a9..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerCloneableItf.java +++ /dev/null @@ -1,49 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.attribute; - -import org.objectweb.fractal.aokell.lib.control.CloneCtrlException; - -/** - * This interface is implemented by Fractal interface implementations. - * - * The cloneFcCtrl method is called whenever a template component is - * instantiated to clone the state of the attribute controller. The - * implementation of this method depends on the attributes defined in the - * attribute controller. - * - * @author Lionel Seinturier - */ -public interface AttributeControllerCloneableItf { - - /** - * Clone the attribute controller state from the current component to - * another one. - * - * @param dst the destination component - */ - public void cloneFcCtrl( AttributeControllerCloneableItf dst ) - throws CloneCtrlException; - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerImpl.java deleted file mode 100644 index 9dda16cea31b702513f0dacee8ebc94b3d4b5f13..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerImpl.java +++ /dev/null @@ -1,118 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.attribute; - -import org.objectweb.fractal.aokell.lib.control.CloneCtrlException; -import org.objectweb.fractal.aokell.lib.control.Controller; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -import org.objectweb.fractal.api.Component; - - -/** - * Implementation of the attribute controller. - * - * The role played by this class is very special in sense that when the - * attribute controller is looked up on a component - * (e.g. with aComp.getFcInterface("attribute-controller")) - * this is not this instance that is returned. Indeed the attribute controller - * is defined in the component type with something like: - * - * ComponentType sType = tf.createFcType(new InterfaceType[] { - * tf.createFcItfType("s", "cs.impl.Service", false, false, false), - * tf.createFcItfType( - * "attribute-controller", - * "cs.impl.ServiceAttributes", - * false, - * false, - * false) - * }); - * - * Hence the attribute controller is seen as a business server interface. - * The goal of the current class is to provide an implementation for - * cloneCtrl(). This method is called when a template is instantiated to - * transfert the state of the attribute controller to the new instance. - * - * @author Lionel Seinturier - */ -public class AttributeControllerImpl - implements AttributeControllerItf, Controller { - - public AttributeControllerImpl() {} - - - // -------------------------------------------------------------- - // AttributeController interface - // -------------------------------------------------------------- - - // Empty - - // -------------------------------------------------------------- - // Controller implementation - // -------------------------------------------------------------- - - private Component compctrl; - - /** - * Set the reference towards the component controller associated to this - * controller. - */ - public void setFcCompCtrl( Component compctrl ) { - this.compctrl = compctrl; - } - - /** - * Initialize the controller. - */ - public void initFcCtrl() { - // Indeed nothing - } - - /** - * Clone the controller state from the current component to another one. - * This method may receive some hints on how to do this, or provide some - * hints on how this has been done. For instance, the hints may be a map - * that is read and/or written by the controller. The raison d'etre of - * these hints is that when its state is cloned, a controller may produce - * results that are needed by other controllers. - * - * @param dst the destination component - * @param hints hints for performing the operation - */ - public void cloneFcCtrl( Component dst, Object hints ) - throws CloneCtrlException { - - Component compctrl = MembraneHelper.getFcCompCtrl(this.compctrl); - AttributeControllerCloneableItf src = - (AttributeControllerCloneableItf) - FractalHelper.getAttributeController(compctrl); - - AttributeControllerCloneableItf target = - (AttributeControllerCloneableItf) - FractalHelper.getAttributeController(dst); - - src.cloneFcCtrl(target); - } - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerItf.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerItf.java deleted file mode 100644 index 630f96e2808928e606e9cc27ced89f54cbac99ff..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/AttributeControllerItf.java +++ /dev/null @@ -1,46 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.attribute; - -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -import org.objectweb.fractal.api.control.AttributeController; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * Attribute control interface. - * - * @author Lionel Seinturier - */ -public interface AttributeControllerItf extends AttributeController { - - final public static String NAME = "/attribute-controller"; - - final public static InterfaceType TYPE = - new InterfaceTypeImpl( - NAME, - AttributeControllerItf.class.getName(), - false, false, false); - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/package.html b/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/package.html deleted file mode 100644 index ffa12e39ad4a6e3b82002cedbfa72bc761a5fddd..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/attribute/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -

-This package contains the implementation of the -AttributeController -interface. -

- - - diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java deleted file mode 100644 index 9c0c385b1c8854d4d7694d2cc210dade3ce0c9b4..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/AbstractBindingControllerImpl.java +++ /dev/null @@ -1,625 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import org.objectweb.fractal.aokell.lib.control.CloneCtrlException; -import org.objectweb.fractal.aokell.lib.control.Controller; -import org.objectweb.fractal.aokell.lib.control.component.ComponentItf; -import org.objectweb.fractal.aokell.lib.membrane.marker.BindingType; -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -import org.objectweb.fractal.aokell.lib.util.PlatformHelper; -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.LifeCycleController; -import org.objectweb.fractal.api.type.ComponentType; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * Root class for binding controllers implementations. - * - * @author Lionel Seinturier - */ -public abstract class AbstractBindingControllerImpl - implements BindingController, Controller { - - /** - * The bindings managed by this component. - * key=client interface name. - * value=bound server interface. - */ - private Map bindings = new HashMap(); - - /** The object bound to the "component" client interface. */ - private Object componentBinding; - - - public AbstractBindingControllerImpl() {} - - - // -------------------------------------------------------------- - // BindingController interface - // -------------------------------------------------------------- - - /** - * 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. - */ - public String[] listFc() { - - /* - * For Julia-like components, notify the content. AO components can not - * be notified: the control interface is directly introduced into the - * content. - */ - Object contentPart = MembraneHelper.getFcContent(compctrl); - if( ! (contentPart instanceof BindingType) && - contentPart instanceof BindingController ) { - return ((BindingController)contentPart).listFc(); - } - - // Get currently bound interface names - Set names = new HashSet(bindings.keySet()); - - // Add boundable interfaces not currently bound - Object[] itfs = getFcInterfaces(); - for (int i = 0; i < itfs.length; i++) { - Interface itf = (Interface) itfs[i]; - InterfaceType it = (InterfaceType) itf.getFcItfType(); - if( it.isFcClientItf() && - ! FractalHelper.isFcControllerInterfaceName(itf.getFcItfName()) ) { - names.add( itf.getFcItfName() ); - } - } - - return (String[]) names.toArray(new String[names.size()]); - } - - /** - * 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. - * - * @param arg0 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(String arg0) throws NoSuchInterfaceException { - - Interface itf = null; - try { - // throw NoSuchInterfaceException if the interface does not exist - itf = (Interface) getFcBoundableInterface(arg0); - } - catch( NoSuchInterfaceException nsie ) { - /* - * Check whether the request is for a collection interface not - * currently bound. If so and if the content provides an - * implementation of the binding controller interface, delegate the - * request. Else, propagate the exception. - */ - Component compctrl = MembraneHelper.getFcCompCtrlImpl(this.compctrl); - ComponentType ct = (ComponentType) compctrl.getFcType(); - InterfaceType[] its = ct.getFcInterfaceTypes(); - for (int i = 0; i < its.length; i++) { - if( arg0.startsWith(its[i].getFcItfName()) ) { - Object contentPart = MembraneHelper.getFcContent(this.compctrl); - if( ! (contentPart instanceof BindingType) && - contentPart instanceof BindingController ) { - return ((BindingController)contentPart).lookupFc(arg0); - } - } - } - - throw nsie; - } - - /* - * For Julia-like components, notify the content. AO components can not - * be notified: the control interface is directly introduced into the - * content. - */ - Object contentPart = MembraneHelper.getFcContent(compctrl); - if( ! (contentPart instanceof BindingType) && - contentPart instanceof BindingController ) { - return ((BindingController)contentPart).lookupFc(arg0); - } - - if( arg0.equals("component") ) { - // Do not perform any check for the interface "component" - return componentBinding; - } - - if( bindings.containsKey(arg0) ) { - return bindings.get(arg0); - } - - // Bindings for collection interfaces are registered with the name of - // the interface followed by a suffix (0, 1, 2, ...). Hence looking up - // only the interface name returns null. We then return as a List - // all the interfaces whose binding name starts with the prefix. - - InterfaceType it = (InterfaceType) itf.getFcItfType(); - - if( it.isFcCollectionItf() ) { - Set sorted = new TreeSet(bindings.keySet()); - List bounds = null; - for (Iterator iter = sorted.iterator(); iter.hasNext();) { - String element = (String) iter.next(); - if( element.startsWith(arg0) ) { - if( bounds == null ) - bounds = new ArrayList(); - bounds.add( bindings.get(element) ); - } - } - return bounds; - } - - /* - * When this point is reached, the interface exists but this is not a - * collection interface (hence this is a singleton interface), and it is - * not bound. - */ - - return null; - } - - /** - * 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 arg0 the name of a client interface of the component to - * which this interface belongs. - * @param arg1 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. - */ - public void bindFc(String arg0, Object arg1) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - - if( arg0.equals("component") ) { - // Do not perform any check for the interface "component" - componentBinding = arg1; - bindFcContent(arg0,arg1); - return; - } - - Interface itf = null; - try { - itf = (Interface) getFcBoundableInterface(arg0); - } - catch( NoSuchInterfaceException nsie ) { - /* - * Try to register the interface with the component controller or - * the content controller (for composites). - * May throw NoSuchInterfaceException again. - */ - itf = registerFcInterface(arg0); - } - - // Test whether the binding is legal - testLegalBinding(itf,arg1); - - bindFcContent(arg0,arg1); - - // Test whether the interface is not already bound - if( bindings.containsKey(arg0) ) - throw new IllegalBindingException( - "Interface "+arg0+" already bound"); - - // All tests cleared. Record the binding. - bindings.put(arg0,arg1); - } - - /** - * If the content and the component parts are separated, and if the - * content part implements the BindingController interface, invoke it. - */ - protected void bindFcContent(String arg0, Object arg1) { - - /* - * For Julia-like components, notify the content. AO components can not - * be notified: the control interface is directly introduced into the - * content. - */ - Object contentPart = MembraneHelper.getFcContent(compctrl); - if( ! (contentPart instanceof BindingType) && - contentPart instanceof BindingController ) { - try { - ((BindingController)contentPart).bindFc(arg0,arg1); - } - // Ignore exceptions which may be thrown by the content - catch( NoSuchInterfaceException nsie ) {} - catch( IllegalBindingException ibe ) {} - catch( IllegalLifeCycleException ilce ) {} - } - } - - /** - * 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 arg0 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. - */ - public void unbindFc(String arg0) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - - /* - * For Julia-like components, notify the content. AO components can not - * be notified: the control interface is directly introduced into the - * content. - */ - Object contentPart = MembraneHelper.getFcContent(compctrl); - if( ! (contentPart instanceof BindingType) && - contentPart instanceof BindingController ) { - try { - ((BindingController)contentPart).unbindFc(arg0); - } - // Ignore exceptions which may be thrown by the content - catch( NoSuchInterfaceException nsie ) {} - catch( IllegalBindingException ibe ) {} - catch( IllegalLifeCycleException ilce ) {} - } - - // throw NoSuchInterfaceException if the interface does not exist - Interface itf = (Interface) getFcBoundableInterface(arg0); - - // Test whether the interface is bound - if( !bindings.containsKey(arg0) ) { - throw new IllegalBindingException("Interface "+arg0+" not bound"); - } - - // Test whether the component is stopped - testLifeCyleBeforeUnbinding(compctrl); - - // Remove the binding - bindings.remove(arg0); - - /* - * Unregister the source interface from its component controllers - * (needed for collection). - */ - ComponentItf compctrl = MembraneHelper.getFcCompCtrl(this.compctrl); - compctrl.unregisterFcInterface(arg0); - } - - - // -------------------------------------------------------------- - // Implementation specific - // -------------------------------------------------------------- - - /** - * Test whether the component is stopped before performing an unbind - * operation. Implementations of the binding controller for templates - * override this method with an empty implementation (template membranes do - * not have a lifecycle controller.) - */ - protected void testLifeCyleBeforeUnbinding( Component arg0 ) - throws IllegalLifeCycleException { - - LifeCycleController lc = MembraneHelper.getFcLifeCycleCtrl(arg0); - if( lc.getFcState().equals(LifeCycleController.STARTED) ) { - throw new IllegalLifeCycleException( - "Component must be stopped before performing an operation "+ - "on the binding controller" ); - } - } - - /** - * @return return true if it1 is assignable from it2 - */ - private static boolean isAssignableFrom( - InterfaceType it1, InterfaceType it2 ) { - - Class i1,i2; - try { - i1 = PlatformHelper.loadClass( it1.getFcItfSignature() ); - i2 = PlatformHelper.loadClass( it2.getFcItfSignature() ); - } - catch(ClassNotFoundException cnfe) { - return false; - } - - return i1.isAssignableFrom(i2); - } - - /** - * Test whether the given source interface can be bound to the given target - * interface. - * - * @throws IllegalBindingException if the binding is illegal - */ - protected void testLegalBinding( Interface srcItf, Object arg1 ) - throws IllegalBindingException, NoSuchInterfaceException { - - InterfaceType it = (InterfaceType) srcItf.getFcItfType(); - Interface targetItf = (Interface) arg1; - InterfaceType targetItfType = (InterfaceType) targetItf.getFcItfType(); - - if( (! it.isFcOptionalItf()) && targetItfType.isFcOptionalItf() ) { - throw new IllegalBindingException( - "Mandatory to optional bindings are forbidden: "+ - toString(srcItf,targetItf) ); - } - - if( ! isAssignableFrom(it,targetItfType) ) { - throw new IllegalBindingException( - "The target interface is not a sub-type of the source interface: "+ - toString(srcItf,targetItf) ); - } - - if( ! it.isFcClientItf() ) { - throw new IllegalBindingException( - "The source interface is of type server:"+ - toString(srcItf,targetItf) ); - } - - if( targetItfType.isFcClientItf() ) { - throw new IllegalBindingException( - "Target interface is of type client"+ - toString(srcItf,targetItf) ); - } - } - - /** - * Return a string of the form - * source_component_name.source_interface_name -> target_component_name.target_interface_name - * describing the binding from a source interface to a target interface. - */ - protected static String toString( Interface src, Interface target ) { - - return - FractalHelper.getFcFullyQualifiedName(src.getFcItfOwner()) + "." + - src.getFcItfName() + " -> " + - FractalHelper.getFcFullyQualifiedName(target.getFcItfOwner()) + "." + - target.getFcItfName(); - - } - - protected Object[] getFcInterfaces() { - Component compctrl = MembraneHelper.getFcCompCtrlImpl(this.compctrl); - return compctrl.getFcInterfaces(); - } - - protected Object getFcBoundableInterface( String interfaceName ) - throws NoSuchInterfaceException { - - Object[] itfs = getFcInterfaces(); - for (int i = 0; i < itfs.length; i++) { - - Interface itf = (Interface) itfs[i]; - String itfName = itf.getFcItfName(); - InterfaceType it = (InterfaceType) itf.getFcItfType(); - - if( ! it.isFcClientItf() ) - continue; - if( FractalHelper.isFcControllerInterfaceName(itfName) ) - continue; - - if( itfName.equals(interfaceName) ) - return itf; - if( it.isFcCollectionItf() && it.getFcItfName().equals(interfaceName) ) { - /* - * Given instances of a collection interface (e.g. h0, h1), the - * prefix for the collection (here h) may be requested. In this - * case, the prefix does not correspond to the interface name - * (h0 or h1) but to the name registered in the interface type - * (h). - */ - return itf; - } - } - - throw new NoSuchInterfaceException(interfaceName); - } - - /** - * Register a new interface with the component controller. This method is - * used for registering new instances of a collection interface. - * - * @throws NoSuchInterfaceException - * if the interface is not a collection interface - */ - protected Interface registerFcInterface( String interfaceName ) - throws NoSuchInterfaceException { - - ComponentItf compctrl = MembraneHelper.getFcCompCtrl(this.compctrl); - Interface itf = compctrl.registerFcInterface(interfaceName); - return itf; - } - - - // -------------------------------------------------------------- - // Controller implementation - // -------------------------------------------------------------- - - protected Component compctrl; - - /** - * Set the reference towards the component controller associated to this - * controller. - */ - public void setFcCompCtrl( Component compctrl ) { - this.compctrl = compctrl; - } - - /** - * Initialize the controller. - */ - public void initFcCtrl() { - - Component compctrl = MembraneHelper.getFcCompCtrlImpl(this.compctrl); - - /* - * Initialize the binding towards the component interface. - */ - try { - bindFc("component",compctrl); - } - catch( Exception e ) { - throw new RuntimeException( - "Can not bind hidden client interface component"); - } - } - - /** - * Clone the controller state from the current component to another one. - * This method may receive some hints on how to do this, or provide some - * hints on how this has been done. For instance, the hints may be a map - * that is read and/or written by the controller. The raison d'etre of - * these hints is that when its state is cloned, a controller may produce - * results that are needed by other controllers. - * - * @param dst the destination component - * @param hints hints for performing the operation - */ - public void cloneFcCtrl( Component dst, Object hints ) - throws CloneCtrlException { - - /* - * Map storing associations between the current component (plus its - * content if this is a composite component) and their associated newly - * created component. - */ - Map newContent = (Map) hints; - BindingController newBc = FractalHelper.getBindingController(dst); - - for (Iterator iter = bindings.entrySet().iterator(); iter.hasNext();) { - Map.Entry entry = (Map.Entry) iter.next(); - String srcItfName = (String) entry.getKey(); - Interface dstItf = (Interface) entry.getValue(); - - try { - cloneBinding(srcItfName,dstItf,newContent,newBc); - } - catch(Exception e) { - e.printStackTrace(); - throw new CloneCtrlException(e.getMessage()); - } - } - } - - /** - * Clone a binding. - * - * @param itfName the source interface name - * @param boundItf the interface bound to the source - * @param newContent the map associating old components and new ones - * @param newBc the binding controller of the new component - */ - private void cloneBinding( - String itfName, Interface boundItf, - Map newContent, BindingController newBc) - throws Exception { - - if( boundItf == null ) - return; - - String boundItfName = boundItf.getFcItfName(); - Component boundCompCtrl = boundItf.getFcItfOwner(); - - Component dstBound = (Component) newContent.get(boundCompCtrl); - - if( dstBound == null ) { - /* - * Trying to clone a binding which starts from one of the cloned - * components and which targets a component outside of the scope of - * the cloned components. - */ - return; - } - - Interface dstBoundItf = - (Interface) dstBound.getFcInterface(boundItfName); - - ContentController cc = null; - try { - cc = FractalHelper.getContentControllerItf(dstBound); - - /* - * The target component is composite. - * - * The server interface may be: - * - external, if the target component is located at the same - * hierarchical level as the source component in the containment - * hierarchy, - * - internal, if the target component encloses the source - * component. - * Always return the server interface. - */ - InterfaceType it = (InterfaceType) dstBoundItf.getFcItfType(); - if( it.isFcClientItf() ) { - dstBoundItf = - (Interface) cc.getFcInternalInterface(boundItfName); - } - } - catch( RuntimeException re ) { - /* - * The target component is primitive. - * Nothing else to do. - */ - } - - // Record the new binding - newBc.bindFc(itfName,dstBoundItf); - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/BindingControllerDef.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/BindingControllerDef.java deleted file mode 100644 index 544a1c1d2cc89828b9c6fb633a46458248940d13..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/BindingControllerDef.java +++ /dev/null @@ -1,46 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.aokell.lib.type.InterfaceTypeImpl; -import org.objectweb.fractal.api.control.BindingController; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * This interface contains data related to the binding controller. - * - * @author Lionel Seinturier - */ -public interface BindingControllerDef extends BindingController { - - final public static String NAME = "binding-controller"; - - final public static InterfaceType TYPE = - new InterfaceTypeImpl( - NAME, - BindingController.class.getName(), - false, false, false); - -} \ No newline at end of file diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeAutoBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeAutoBindingControllerImpl.java deleted file mode 100644 index 8c8d1fe79bb9d5c2ee68ad59b8ab8542896eed33..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeAutoBindingControllerImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -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.util.BindingControllerHelper; - -/** - * Implementation of the binding controller for composite components. This - * controller also implements the auto-binding feature for collection interfaces - * imported by a composite. - * - * @author Eric Bruneton - * @author Lionel Seinturier - */ -public class CompositeAutoBindingControllerImpl - extends CompositeBindingControllerImpl - implements BindingController { // Needed for fractalrmi - - public CompositeAutoBindingControllerImpl() { - super(); - } - - - // -------------------------------------------------------------- - // BindingController interface - // -------------------------------------------------------------- - - /** - * Binds the client interface whose name is given to a server interface. - * In addition, auto bind collection interfaces imported by a composite to - * the nested component bound to the collection interface. - */ - public void bindFc(String clientItfName, Object serverItf) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - - super.bindFc(clientItfName,serverItf); - - if( clientItfName.equals("component") ) { - // Do not perform any check for the interface "component" - return; - } - - Interface clientItf = (Interface) getFcBoundableInterface(clientItfName); - InterfaceType clientItfType = (InterfaceType) clientItf.getFcItfType(); - - if (clientItfType.isFcCollectionItf()) { - String sItfName = clientItfType.getFcItfName(); - ContentController cc; - try { - cc = MembraneHelper.getFcContentCtrl(compctrl); - } catch (RuntimeException e) { - cc = null; - } - if (cc != null && !clientItfName.equals(sItfName)) { - Object sItf = cc.getFcInternalInterface(sItfName); - Object itf = cc.getFcInternalInterface(clientItfName); - try { - Object[] itfs = - BindingControllerHelper.getFcClientItfsBoundTo((Interface)sItf).toArray(); - for (int i = 0; i < itfs.length; ++i) { - Interface cItf = (Interface)itfs[i]; - InterfaceType cItfType = (InterfaceType)cItf.getFcItfType(); - if (cItfType.isFcCollectionItf()) { - Component c = cItf.getFcItfOwner(); - BindingController bc = (BindingController) - c.getFcInterface("binding-controller"); - String s = - cItfType.getFcItfName() + - clientItfName.substring(sItfName.length()); - bc.bindFc(s, itf); - } - } - } catch (Exception e) { - throw new IllegalBindingException( - "Error during automatic creation of bindings from the model binding"); - } - } - if (clientItfName.equals(sItfName)) { - Interface sItf = (Interface)serverItf; - InterfaceType sItfType = (InterfaceType)sItf.getFcItfType(); - if (sItf.isFcInternalItf() && - sItfType.isFcCollectionItf() && - sItf.getFcItfName().equals(sItfType.getFcItfName())) - { - Component sComp = sItf.getFcItfOwner(); - try { - BindingController bc = - (BindingController)sComp.getFcInterface("binding-controller"); - cc = - (ContentController)sComp.getFcInterface("content-controller"); - String s = sItf.getFcItfName(); - String[] itfs = bc.listFc(); - for (int i = 0; i < itfs.length; ++i) { - if (itfs[i].length() > s.length() && itfs[i].startsWith(s)) { - super.bindFc( - clientItfName + itfs[i].substring(s.length()), - cc.getFcInternalInterface(itfs[i])); - } - } - } catch (Exception e) { - throw new IllegalBindingException( - "Error during automatic creation of bindings from the model binding"); - } - } - } - } - } - - /** - * Unbinds the client interface whose name is given. - * In addition, auto unbind collection interfaces imported by a composite to - * the nested component bound to the collection interface. - */ - public void unbindFc(String clientItfName) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - - Interface clientItf = (Interface) getFcBoundableInterface(clientItfName); - InterfaceType clientItfType = (InterfaceType) clientItf.getFcItfType(); - - super.unbindFc(clientItfName); - - if (clientItfType.isFcCollectionItf()) { - ContentController cc; - try { - cc = MembraneHelper.getFcContentCtrl(compctrl); - } catch (RuntimeException e) { - return; - } - String sItfName = clientItfType.getFcItfName(); - Object sItf = cc.getFcInternalInterface(sItfName); - try { - Object[] itfs = - BindingControllerHelper.getFcClientItfsBoundTo((Interface)sItf).toArray(); - for (int i = 0; i < itfs.length; ++i) { - Interface cItf = (Interface)itfs[i]; - InterfaceType cItfType = (InterfaceType)cItf.getFcItfType(); - if (cItfType.isFcCollectionItf()) { - Component c = cItf.getFcItfOwner(); - BindingController bc = - (BindingController)c.getFcInterface("binding-controller"); - String s = - cItfType.getFcItfName() + - clientItfName.substring(sItfName.length()); - bc.unbindFc(s); - } - } - } catch (Exception e) { - throw new IllegalBindingException( - "Error during automatic destruction of bindings from the model binding"); - } - } - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingControllerImpl.java deleted file mode 100644 index d067457426d44fa6f3c7734d08eaefb7b7fdf6ca..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeBindingControllerImpl.java +++ /dev/null @@ -1,114 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerImpl; -import org.objectweb.fractal.aokell.lib.control.content.ContentControllerItf; -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -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.type.InterfaceType; - - -/** - * Implementation of the binding controller for composite components. - * - * @author Lionel Seinturier - */ -public class CompositeBindingControllerImpl - extends PrimitiveBindingControllerImpl - implements BindingController { // Needed for fractalrmi - - public CompositeBindingControllerImpl() { - super(); - } - - - // -------------------------------------------------------------- - // Implementation specific - // -------------------------------------------------------------- - - /** - * Test whether the given source interface can be bound to the given target - * interface. - * - * @throws IllegalBindingException if the binding is illegal - */ - protected void testLegalBinding( Interface srcItf, Object arg1 ) - throws IllegalBindingException, NoSuchInterfaceException { - - super.testLegalBinding(srcItf,arg1); - - Component compctrl = MembraneHelper.getFcCompCtrlImpl(this.compctrl); - Interface targetItf = (Interface) arg1; - Component target = targetItf.getFcItfOwner(); - - if( ! srcItf.isFcInternalItf() && - ContentControllerImpl.isFcContainedIn(true,target,compctrl) ) { - - throw new IllegalBindingException( - "Trying to bind a client interface owned by a composite "+ - "to a server interface of one of its sub-components: "+ - toString(srcItf,targetItf) ); - } - } - - protected Object[] getFcInterfaces() { - - ContentController cc = MembraneHelper.getFcContentCtrl(this.compctrl); - Object[] i1 = super.getFcInterfaces(); - Object[] i2 = cc.getFcInternalInterfaces(); - - Object[] all = new Object[ i1.length + i2.length ]; - System.arraycopy(i1,0,all,0,i1.length); - System.arraycopy(i2,0,all,i1.length,i2.length); - - return all; - } - - /** - * Register a new interface with the component controller. This method is - * used for registering new instances of a collection interface. - * - * @throws NoSuchInterfaceException - * if the interface is not a collection interface - */ - protected Interface registerFcInterface( String interfaceName ) - throws NoSuchInterfaceException { - - Interface extitf = super.registerFcInterface(interfaceName); - - ContentControllerItf cc = MembraneHelper.getFcContentCtrl(this.compctrl); - Interface intitf = cc.registerFcInterface(interfaceName); - - return - ( ((InterfaceType)extitf.getFcItfType()).isFcClientItf() ) ? - extitf : intitf ; - } - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeTemplateBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeTemplateBindingControllerImpl.java deleted file mode 100644 index 1702b96687ce84b1d6323624ef9134fd0ab9bfff..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/CompositeTemplateBindingControllerImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -/** - * Implementation of the binding controller for composite template components. - * - * @author Lionel Seinturier - */ -public class CompositeTemplateBindingControllerImpl - extends CompositeBindingControllerImpl { - - public CompositeTemplateBindingControllerImpl() { - super(); - } - - - // -------------------------------------------------------------- - // Implementation specific - // -------------------------------------------------------------- - - protected void testLifeCyleBeforeUnbinding( Component arg0 ) - throws IllegalLifeCycleException { - // Template components do not have a lifecycle interface - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingControllerImpl.java deleted file mode 100644 index a02d806cd5811c4265a8129642c387ca5acdd0fd..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/FlatBindingControllerImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.api.control.BindingController; - - -/** - * Implementation of the binding controller for flat components. - * - * @author Lionel Seinturier - */ -public class FlatBindingControllerImpl - extends AbstractBindingControllerImpl - implements BindingController { // Needed for fractalrmi - - public FlatBindingControllerImpl() { - super(); - } - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/FlatTemplateBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/FlatTemplateBindingControllerImpl.java deleted file mode 100644 index 5ed50285ce500de0d2e7bfe8a47f8b7b7a61868a..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/FlatTemplateBindingControllerImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -/** - * Implementation of the binding controller for flat template components. - * - * @author Lionel Seinturier - */ -public class FlatTemplateBindingControllerImpl - extends FlatBindingControllerImpl { - - public FlatTemplateBindingControllerImpl() { - super(); - } - - - // -------------------------------------------------------------- - // Implementation specific - // -------------------------------------------------------------- - - protected void testLifeCyleBeforeUnbinding( Component arg0 ) - throws IllegalLifeCycleException { - // Template components do not have a lifecycle interface - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveAutoBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveAutoBindingControllerImpl.java deleted file mode 100644 index 14c29b3a1f401bc01fc94a2f80b4fea40041dad9..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveAutoBindingControllerImpl.java +++ /dev/null @@ -1,185 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -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.util.BindingControllerHelper; - -/** - * Implementation of the binding controller for primitive components. This - * controller also implements the auto-binding feature for collection interfaces - * imported by a composite. - * - * @author Eric Bruneton - * @author Lionel Seinturier - */ -public class PrimitiveAutoBindingControllerImpl - extends PrimitiveBindingControllerImpl - implements BindingController { // Needed for fractalrmi - - public PrimitiveAutoBindingControllerImpl() { - super(); - } - - - // -------------------------------------------------------------- - // BindingController interface - // -------------------------------------------------------------- - - /** - * Binds the client interface whose name is given to a server interface. - * In addition, auto bind collection interfaces imported by a composite to - * the nested component bound to the collection interface. - */ - public void bindFc(String clientItfName, Object serverItf) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - - super.bindFc(clientItfName,serverItf); - - if( clientItfName.equals("component") ) { - // Do not perform any check for the interface "component" - return; - } - - Interface clientItf = (Interface) getFcBoundableInterface(clientItfName); - InterfaceType clientItfType = (InterfaceType) clientItf.getFcItfType(); - - if (clientItfType.isFcCollectionItf()) { - String sItfName = clientItfType.getFcItfName(); - ContentController cc; - try { - cc = MembraneHelper.getFcContentCtrl(compctrl); - } catch (RuntimeException e) { - cc = null; - } - if (cc != null && !clientItfName.equals(sItfName)) { - Object sItf = cc.getFcInternalInterface(sItfName); - Object itf = cc.getFcInternalInterface(clientItfName); - try { - Object[] itfs = - BindingControllerHelper.getFcClientItfsBoundTo((Interface)sItf).toArray(); - for (int i = 0; i < itfs.length; ++i) { - Interface cItf = (Interface)itfs[i]; - InterfaceType cItfType = (InterfaceType)cItf.getFcItfType(); - if (cItfType.isFcCollectionItf()) { - Component c = cItf.getFcItfOwner(); - BindingController bc = (BindingController) - c.getFcInterface("binding-controller"); - String s = - cItfType.getFcItfName() + - clientItfName.substring(sItfName.length()); - bc.bindFc(s, itf); - } - } - } catch (Exception e) { - throw new IllegalBindingException( - "Error during automatic creation of bindings from the model binding"); - } - } - if (clientItfName.equals(sItfName)) { - Interface sItf = (Interface)serverItf; - InterfaceType sItfType = (InterfaceType)sItf.getFcItfType(); - if (sItf.isFcInternalItf() && - sItfType.isFcCollectionItf() && - sItf.getFcItfName().equals(sItfType.getFcItfName())) - { - Component sComp = sItf.getFcItfOwner(); - try { - BindingController bc = - (BindingController)sComp.getFcInterface("binding-controller"); - cc = - (ContentController)sComp.getFcInterface("content-controller"); - String s = sItf.getFcItfName(); - String[] itfs = bc.listFc(); - for (int i = 0; i < itfs.length; ++i) { - if (itfs[i].length() > s.length() && itfs[i].startsWith(s)) { - super.bindFc( - clientItfName + itfs[i].substring(s.length()), - cc.getFcInternalInterface(itfs[i])); - } - } - } catch (Exception e) { - throw new IllegalBindingException( - "Error during automatic creation of bindings from the model binding"); - } - } - } - } - } - - /** - * Unbinds the client interface whose name is given. - * In addition, auto unbind collection interfaces imported by a composite to - * the nested component bound to the collection interface. - */ - public void unbindFc(String clientItfName) - throws NoSuchInterfaceException, IllegalBindingException, - IllegalLifeCycleException { - - Interface clientItf = (Interface) getFcBoundableInterface(clientItfName); - InterfaceType clientItfType = (InterfaceType) clientItf.getFcItfType(); - - super.unbindFc(clientItfName); - - if (clientItfType.isFcCollectionItf()) { - ContentController cc; - try { - cc = MembraneHelper.getFcContentCtrl(compctrl); - } catch (RuntimeException e) { - return; - } - String sItfName = clientItfType.getFcItfName(); - Object sItf = cc.getFcInternalInterface(sItfName); - try { - Object[] itfs = - BindingControllerHelper.getFcClientItfsBoundTo((Interface)sItf).toArray(); - for (int i = 0; i < itfs.length; ++i) { - Interface cItf = (Interface)itfs[i]; - InterfaceType cItfType = (InterfaceType)cItf.getFcItfType(); - if (cItfType.isFcCollectionItf()) { - Component c = cItf.getFcItfOwner(); - BindingController bc = - (BindingController)c.getFcInterface("binding-controller"); - String s = - cItfType.getFcItfName() + - clientItfName.substring(sItfName.length()); - bc.unbindFc(s); - } - } - } catch (Exception e) { - throw new IllegalBindingException( - "Error during automatic destruction of bindings from the model binding"); - } - } - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingControllerImpl.java deleted file mode 100644 index c0f07f1d52f69f0498eddfa3af2c029db7dd56d7..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveBindingControllerImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; - -import org.objectweb.fractal.aokell.lib.util.FractalHelper; -import org.objectweb.fractal.aokell.lib.util.MembraneHelper; -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.SuperController; - - -/** - * Implementation of the binding controller for primitive components. - * - * @author Lionel Seinturier - */ -public class PrimitiveBindingControllerImpl - extends AbstractBindingControllerImpl - implements BindingController { // Needed for fractalrmi - - public PrimitiveBindingControllerImpl() { - super(); - } - - - // -------------------------------------------------------------- - // Implementation specific - // -------------------------------------------------------------- - - /** - * Test whether the given source interface can be bound to the given target - * interface. - * - * @throws IllegalBindingException if the binding is illegal - */ - protected void testLegalBinding( Interface srcItf, Object arg1 ) - throws IllegalBindingException, NoSuchInterfaceException { - - super.testLegalBinding(srcItf,arg1); - - Interface targetItf = (Interface) arg1; - Component target = targetItf.getFcItfOwner(); - - // Test whether component are in a common super component - SuperController sc = MembraneHelper.getFcSuperCtrl(compctrl); - Component[] supers = sc.getFcSuperComponents(); - List l = new ArrayList(); - l.add( MembraneHelper.getFcCompCtrlImpl(compctrl) ); - l.addAll( Arrays.asList(supers) ); - - SuperController tsc = FractalHelper.getSuperController(target); - Component[] tsupers = tsc.getFcSuperComponents(); - List t = new ArrayList(); - t.add(target); - t.addAll( Arrays.asList(tsupers) ); - - for (Iterator iter = l.iterator(); iter.hasNext();) { - if( t.contains(iter.next()) ) { - return; - } - } - - throw new IllegalBindingException( - "No common super component for binding: "+ - toString(srcItf,targetItf) ); - } - -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveTemplateBindingControllerImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveTemplateBindingControllerImpl.java deleted file mode 100644 index 7b87fdea194233a6d19bfdafa2f72296204b1732..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/PrimitiveTemplateBindingControllerImpl.java +++ /dev/null @@ -1,50 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.binding; - -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.control.IllegalLifeCycleException; - -/** - * Implementation of the binding controller for primitive template components. - * - * @author Lionel Seinturier - */ -public class PrimitiveTemplateBindingControllerImpl - extends PrimitiveBindingControllerImpl { - - public PrimitiveTemplateBindingControllerImpl() { - super(); - } - - - // -------------------------------------------------------------- - // Implementation specific - // -------------------------------------------------------------- - - protected void testLifeCyleBeforeUnbinding( Component arg0 ) - throws IllegalLifeCycleException { - // Template components do not have a lifecycle interface - } -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/package.html b/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/package.html deleted file mode 100644 index 4a02dc07716c9be9f62df34f933b635952c2b73c..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/binding/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -

-This package contains the implementations of the -BindingController -interface for flat, primitive and composite components. -

- - - diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/component/ComponentDescItf.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/component/ComponentDescItf.java deleted file mode 100644 index e0eb7547dbaa47be49785fe38bc166baf54ac759..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/component/ComponentDescItf.java +++ /dev/null @@ -1,37 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.component; - - -/** - * Interface for retrieving the attributes which describe a component. - * - * @author Lionel Seinturier - */ -public interface ComponentDescItf { - - public Object getControllerDesc(); - - public Object getContentDesc(); -} diff --git a/aokell/src/org/objectweb/fractal/aokell/lib/control/component/ComponentImpl.java b/aokell/src/org/objectweb/fractal/aokell/lib/control/component/ComponentImpl.java deleted file mode 100644 index eb2c568caa8c1a569148d9ae98edd93365e76d0d..0000000000000000000000000000000000000000 --- a/aokell/src/org/objectweb/fractal/aokell/lib/control/component/ComponentImpl.java +++ /dev/null @@ -1,278 +0,0 @@ -/*** - * AOKell - * Copyright (C) 2005-2006 INRIA, France Telecom, USTL - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Contact: Lionel.Seinturier@lifl.fr - * - * Author: Lionel Seinturier - */ - -package org.objectweb.fractal.aokell.lib.control.component; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import org.objectweb.fractal.aokell.lib.InterfaceImpl; -import org.objectweb.fractal.aokell.lib.control.CloneCtrlException; -import org.objectweb.fractal.aokell.lib.control.Controller; -import org.objectweb.fractal.aokell.lib.interf.InterfaceManager; -import org.objectweb.fractal.aokell.lib.interf.PrimitiveExtItfManager; -import org.objectweb.fractal.api.Component; -import org.objectweb.fractal.api.Interface; -import org.objectweb.fractal.api.NoSuchInterfaceException; -import org.objectweb.fractal.api.Type; -import org.objectweb.fractal.api.type.InterfaceType; - - -/** - * Root class for implementations of the Component interface. - * This class contains common features shared by all classes implementing this - * interface. - * - * @author Lionel Seinturier - */ -public class ComponentImpl - - /* - * Do not directly implements Interface as this would lead to a behavior - * under fractal-explorer which is different from the one obtained with - * Julia. Extending InterfaceImpl is better. - */ - extends InterfaceImpl - implements ComponentItf, ComponentDescItf, Controller { - - public ComponentImpl() { - /* - * Can not call super as the 1st argument should be this (and this is - * forbidden when calling super). See below: Interface is overriden. - */ - im = new PrimitiveExtItfManager(); - } - - - // ------------------------------------------------------------------ - // Implementation of the Component interface - // ------------------------------------------------------------------ - - /** The interfaces managed by this component. */ - protected InterfaceManager im; - - /** - * Return the instance implementing the {@link Interface} corresponding to - * the given name. Whereas this is the case most of the time, it is not - * mandatory for the returned value to be of type {@link Interface}. - * - */ - public Object getFcInterface(String interfaceName) - throws NoSuchInterfaceException { - - try { - return im.getFcInterface(interfaceName); - } - catch( NoSuchInterfaceException nsie ) {} - - /* - * Components with a content (all primitives have a content, composites - * may have a content) implements the /content interface. - * The /content interface is not defined in the Fractal specifications - * but is Julia-specific. - */ - if( interfaceName.equals("/content") ) { - return contentPart; - } - - if( interfaceName.equals("/desc") ) { - return this; - } - - /* - * This was our last chance. If the interface has still not been found, - * throw NoSuchInterfaceException. - */ - throw new NoSuchInterfaceException(interfaceName); - } - - /** - * Return the array of {@link Interface} instances implemented by this - * component. Whereas this is the case most of the time, it is not - * mandatory for the returned values to be of type {@link Interface}. - */ - public Object[] getFcInterfaces() { - return im.getFcInterfaces(); - } - - public Type getFcType() { - return type; - } - - - // ------------------------------------------------------------------ - // Implementation of the ComponentDescItf interface - // ------------------------------------------------------------------ - - public Object getControllerDesc() { - return controllerDesc; - } - - public Object getContentDesc() { - return contentDesc; - } - - - // ------------------------------------------------------------------ - // Implementation of the ComponentItf interface - // ------------------------------------------------------------------ - - private Type type; - private Object controllerDesc; - private Object contentDesc; - private Object contentPart; - - public void initFc( - Type type, Object controllerDesc, Object contentDesc, - Object contentPart ) { - - this.type = type; - this.controllerDesc = controllerDesc; - this.contentDesc = contentDesc; - this.contentPart = contentPart; - - im.initFc(type,this,contentPart); - - /* - * Link the content with the current component controller. - * The content uses this reference in injected controller methods. - */ - if( contentPart instanceof ComponentSetterItf ) { - ((ComponentSetterItf)contentPart).setFcCompCtrl(this); - } - } - - - // - // Not all controllers implements Controller (hence Object) - private Map ctrls = new HashMap(); - - /** - * Return the array of control interfaces implemented by the component. - */ - public Object[] getFcControllers() { - Collection values = ctrls.values(); - return values.toArray(); - } - - /** - * Declare a new controller implemented by the component. - */ - public void addFcController( InterfaceType[] it, Object ctrl ) { - ctrls.put(it,ctrl); - im.registerFcControlInterface(it,ctrl); - } - - /** - * Register a new collection {@link Interface} instance. - * The given name must start with an existing collection interface name - * decalred in the component type. - * - * @param interfaceName the interface name (e.g. foo004) - * @throws NoSuchInterfaceException - * if there is no such collection interface - */ - public Interface registerFcInterface( String interfaceName ) -