diff --git a/Makefile b/Makefile index 17a239c6d6b0cba31dedd398823648d87df74b1d..ee730bfc1f402a49f2d26d1a27a8f481779d378a 100755 --- a/Makefile +++ b/Makefile @@ -243,9 +243,8 @@ $(STDRELEASE:.tgz=.tar): $(BASERELEASE:.tgz=.tar) @cp $(TTOOL_DOC)/README_nc $(TTOOL_TARGET)/nc #DOC - @$(MAKE) -C $(TTOOL_DOC_AVATARCODEGENERATION_DIR) - @cp $(TTOOL_DOC_AVATARCODEGENERATION_DIR)/codegeneration_documentation.pf $(TTOOL_TARGET)/doc/avatarcodegeneration_documentation.pdf - + @$(MAKE) -C $(TTOOL_DOC_AVATARCODEGENERATION_DIR) codegeneration_documentation + @cp $(TTOOL_DOC_AVATARCODEGENERATION_DIR)/codegeneration_documentation.pdf $(TTOOL_TARGET)/doc/avatarcodegeneration_documentation.pdf @$(MAKE) -C $(TTOOL_DOC_SOCLIB_USERGUIDE_DIR) user_guide @cp $(TTOOL_DOC_SOCLIB_USERGUIDE_DIR)/build/user_guide.pdf $(TTOOL_TARGET)/doc/prototyping_with_soclib_user_guide.pdf @$(MAKE) -C $(TTOOL_DOC_SOCLIB_INSTALLATIONGUIDE_DIR) installation_guide diff --git a/doc/codegeneration/.gitignore b/doc/codegeneration/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ce70c06ae5ec5fe2ec0cb1e69b749da054329b5a --- /dev/null +++ b/doc/codegeneration/.gitignore @@ -0,0 +1,4 @@ +/*.aux +/*.log +/*.out +/*.toc diff --git a/doc/codegeneration/codegeneration_documentation.tex b/doc/codegeneration/codegeneration_documentation.tex index b9e5edc341b7a9170b1dcc583d0cebee26e0209a..7ca8d92de68f3956ab87daff6004769b519e59ad 100644 --- a/doc/codegeneration/codegeneration_documentation.tex +++ b/doc/codegeneration/codegeneration_documentation.tex @@ -38,7 +38,7 @@ \includegraphics[width=0.2\textwidth]{figures/logotpt} \vspace{10 pt}\\ \Huge TTool \\ -\vspace{10 pt}\\ +\vspace{10 pt} \Large \url{ttool.telecom-paristech.fr} \vspace{20 pt}\\ \underline{\Large Code generation from Avatar Design Diagrams in TTool} diff --git a/jttool/src/main/java/DataNet.java b/jttool/src/main/java/DataNet.java index 93484ba1ac0bf4928fbda0fc19b751b00c91891f..413115419fc8542c610751d5273e2d72ddab32a0 100644 --- a/jttool/src/main/java/DataNet.java +++ b/jttool/src/main/java/DataNet.java @@ -1,3 +1,50 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + +package jttool; + +import java.io.*; +import java.net.*; + + /** * Class DataNet * To be used with the TTool Java code generator @@ -5,14 +52,7 @@ * Creation: 21/07/2005 * @version 1.1 21/07/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.io.*; -import java.net.*; - public class DataNet { public String host; diff --git a/jttool/src/main/java/DataTransferInterface.java b/jttool/src/main/java/DataTransferInterface.java index bd6ff5d5af85ac94833137d94ca6b51400d75f09..fd802dd31db359b1888a2d2aaac84ee1b54c9923 100755 --- a/jttool/src/main/java/DataTransferInterface.java +++ b/jttool/src/main/java/DataTransferInterface.java @@ -1,3 +1,47 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + + +package jttool; + /** * Class DataTransferInterface @@ -6,11 +50,7 @@ * Creation: 28/07/2005 * @version 1.1 28/07/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - public class DataTransferInterface { public TransferInterface ti; public String host; diff --git a/jttool/src/main/java/JGate.java b/jttool/src/main/java/JGate.java index ad7d45098a08a5f91d3560f0c74b3178513e663a..98c58ec43517535dcdcc8a29aa15beef0d8b9c89 100755 --- a/jttool/src/main/java/JGate.java +++ b/jttool/src/main/java/JGate.java @@ -1,39 +1,47 @@ -/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ -ludovic.apvrille AT enst.fr -This software is a computer program whose purpose is to allow the -edition of TURTLE analysis, design and deployment diagrams, to -allow the generation of RT-LOTOS or Java code from this diagram, -and at last to allow the analysis of formal validation traces -obtained from external tools, e.g. RTL from LAAS-CNRS and CADP -from INRIA Rhone-Alpes. -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. +package jttool; -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. /** * Class JGate @@ -42,11 +50,7 @@ knowledge of the CeCILL license and that you accept its terms. * Creation: 04/03/2005 * @version 1.1 04/03/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - public class JGate { private String name; diff --git a/jttool/src/main/java/JGroupSynchro.java b/jttool/src/main/java/JGroupSynchro.java index e4f68ee63c617d0b0f141700506ad1c40a352b71..d3e6984010080ff0cde2264d26f7b9d7f98604db 100755 --- a/jttool/src/main/java/JGroupSynchro.java +++ b/jttool/src/main/java/JGroupSynchro.java @@ -1,41 +1,48 @@ -/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ -ludovic.apvrille AT enst.fr -This software is a computer program whose purpose is to allow the -edition of TURTLE analysis, design and deployment diagrams, to -allow the generation of RT-LOTOS or Java code from this diagram, -and at last to allow the analysis of formal validation traces -obtained from external tools, e.g. RTL from LAAS-CNRS and CADP -from INRIA Rhone-Alpes. -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. +package jttool; -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. -/** /** * Class JGroupSynchro * To be used with the TTool Java code generator @@ -43,13 +50,7 @@ knowledge of the CeCILL license and that you accept its terms. * Creation: 02/01/2005 * @version 1.2 02/01/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - public class JGroupSynchro { public JGroupSynchro () {} diff --git a/jttool/src/main/java/JMasterGate.java b/jttool/src/main/java/JMasterGate.java index 76f4ed120840f9fbf617bde7efe47549855ada82..27df1ea79cfd8a44e1f7207992ef6bfc6b5e04c4 100755 --- a/jttool/src/main/java/JMasterGate.java +++ b/jttool/src/main/java/JMasterGate.java @@ -1,41 +1,48 @@ -/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - -ludovic.apvrille AT enst.fr - -This software is a computer program whose purpose is to allow the -edition of TURTLE analysis, design and deployment diagrams, to -allow the generation of RT-LOTOS or Java code from this diagram, -and at last to allow the analysis of formal validation traces -obtained from external tools, e.g. RTL from LAAS-CNRS and CADP -from INRIA Rhone-Alpes. - -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + + +package jttool; + -/** /** * Class JMasterGate * To be used with the TTool Java code generator @@ -43,13 +50,7 @@ knowledge of the CeCILL license and that you accept its terms. * Creation: 04/03/2005 * @version 1.2 31/01/2006 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - public class JMasterGate { diff --git a/jttool/src/main/java/JTToolThread.java b/jttool/src/main/java/JTToolThread.java index 868454121440402d91a675b5af742d228420a9a1..accb0ddc051ba23fa91cc7eec9daea3b5e874103 100755 --- a/jttool/src/main/java/JTToolThread.java +++ b/jttool/src/main/java/JTToolThread.java @@ -1,3 +1,49 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + +package jttool; + +import java.util.*; + + /** * Class JTToolThread * To be used with the TTool Java code generator @@ -5,21 +51,15 @@ * Creation: 16/03/2005 * @version 1.1 16/03/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - public abstract class JTToolThread extends Thread { private boolean monitor = false; private boolean hasToBePreempted = false; private boolean startingSequence = false; - protected LinkedList internalThreads; - protected LinkedList threadsThatCanPreemptMe; - private LinkedList toPreempt; + protected LinkedList<JTToolThread> internalThreads; + protected LinkedList<JTToolThread> threadsThatCanPreemptMe; + private LinkedList<JTToolThread> toPreempt; protected int t__state = 0; protected boolean t__go = true; @@ -27,9 +67,9 @@ public abstract class JTToolThread extends Thread { public JTToolThread() { - internalThreads = new LinkedList(); - threadsThatCanPreemptMe = new LinkedList(); - toPreempt = new LinkedList(); + internalThreads = new LinkedList<>(); + threadsThatCanPreemptMe = new LinkedList<>(); + toPreempt = new LinkedList<>(); } @@ -70,20 +110,14 @@ public abstract class JTToolThread extends Thread { } public void makeAllPreempt() { - ListIterator iterator = toPreempt.listIterator(); - while(iterator.hasNext()) { - ((JTToolThread)(iterator.next())).preemptAll(this); + for (JTToolThread t: this.toPreempt) { + t.preemptAll(this); } } public void preemptAll(JTToolThread jttt) { - //System.out.println("Preempt all"); - JTToolThread t; - ListIterator iterator = internalThreads.listIterator(); - - while(iterator.hasNext()) { - t = (JTToolThread)(iterator.next()); + for (JTToolThread t: this.internalThreads) { if (t != jttt) { t.preemptAll(this); } @@ -105,53 +139,51 @@ public abstract class JTToolThread extends Thread { } public void ending() { - ListIterator iterator = internalThreads.listIterator(); - while(iterator.hasNext()) { - try { - ((JTToolThread)(iterator.next())).join(); - } catch (InterruptedException ie) { - - } - } + for (JTToolThread t: this.internalThreads) { + try { + t.join(); + } catch (InterruptedException ie) { + + } + } - startingSequence(); + startingSequence(); } - + public final void run() { - try { - if (t__state == 0) { - startPreemptionTasks(); - } - runMe(); - startingSequence(); - } catch (PreemptionException pe) {} - + try { + if (t__state == 0) { + startPreemptionTasks(); + } + runMe(); + startingSequence(); + } catch (PreemptionException pe) {} + } - + public void startingSequence() { - //System.out.println("ending!"); - if (startingSequence) { - // kill all preemption tasks - preemptAllPreemptionTasks(); - startSequence(); - } + //System.out.println("ending!"); + if (startingSequence) { + // kill all preemption tasks + preemptAllPreemptionTasks(); + startSequence(); + } } public void startPreemptionTasks() {} public void setStartingSequence(boolean b) { - startingSequence = b; + startingSequence = b; } public void preemptAllPreemptionTasks() { - ListIterator iterator = threadsThatCanPreemptMe.listIterator(); - while(iterator.hasNext()) { - ((JTToolThread)(iterator.next())).preemptAll(this); - } + for (JTToolThread t: this.threadsThatCanPreemptMe) { + t.preemptAll(this); + } } public void setState(int state) { - t__state = state; + t__state = state; } public void startSequence() {} diff --git a/jttool/src/main/java/LibLogicalOperator.java b/jttool/src/main/java/LibLogicalOperator.java index 961cffd07760c50a661d375b7ea41645e229bee8..24008b361600ef88c63c35e1e15fd0c25d3b9ce4 100755 --- a/jttool/src/main/java/LibLogicalOperator.java +++ b/jttool/src/main/java/LibLogicalOperator.java @@ -1,3 +1,49 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + +package jttool; + +import java.util.*; + + /** * Class LibLogicalOperator * To be used with the TTool Java code generator @@ -5,13 +51,7 @@ * Creation: 10/03/2005 * @version 1.1 10/03/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - public class LibLogicalOperator { public static Random random = new Random(); diff --git a/jttool/src/main/java/LibTemporalOperator.java b/jttool/src/main/java/LibTemporalOperator.java index f4441a65871368ff99aacc76b4ee1158651fd07e..50c4b0767d20ea75e205a73d3d8e7abe02baa672 100755 --- a/jttool/src/main/java/LibTemporalOperator.java +++ b/jttool/src/main/java/LibTemporalOperator.java @@ -1,3 +1,49 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + +package jttool; + +import java.util.*; + + /** * Class LibTemporalOperator * To be used with the TTool Java code generator @@ -5,13 +51,7 @@ * Creation: 10/03/2005 * @version 1.1 10/03/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - public class LibTemporalOperator { public static Random random = new Random(); diff --git a/jttool/src/main/java/MasterSynchro.java b/jttool/src/main/java/MasterSynchro.java index a18068f53171da50d5db69fd2b3c166604a20b6e..d2518b9f7f99b9edc103c643344f2b39066cc550 100755 --- a/jttool/src/main/java/MasterSynchro.java +++ b/jttool/src/main/java/MasterSynchro.java @@ -1,26 +1,26 @@ -/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - * +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * * ludovic.apvrille AT enst.fr - * + * * This software is a computer program whose purpose is to allow the * edition of TURTLE analysis, design and deployment diagrams, to * allow the generation of RT-LOTOS or Java code from this diagram, * and at last to allow the analysis of formal validation traces * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP * from INRIA Rhone-Alpes. - * + * * This software is governed by the CeCILL license under French law and * abiding by the rules of distribution of free software. You can use, * modify and/ or redistribute the software under the terms of the CeCILL * license as circulated by CEA, CNRS and INRIA at the following URL * "http://www.cecill.info". - * + * * As a counterpart to the access to the source code and rights to copy, * modify and redistribute granted by the license, users are provided only * with a limited warranty and the software's author, the holder of the * economic rights, and the successive licensors have only limited * liability. - * + * * In this respect, the user's attention is drawn to the risks associated * with loading, using, modifying and/or developing or reproducing the * software by the user in light of its specific status of free software, @@ -31,34 +31,36 @@ * requirements in conditions enabling the security of their systems and/or * data to be ensured and, more generally, to use and operate it in the * same conditions as regards security. - * + * * The fact that you are presently reading this means that you have had * knowledge of the CeCILL license and that you accept its terms. - * - * /** - * /** + */ + + + + +package jttool; + +import java.util.*; + + +/** * Class MasterSynchro * To be used with the TTool Java code generator * For more information on TTool, see http://labsoc.comelec.enst.fr/turtle * Creation: 01/02/2006 * @version 1.3 06/03/2006 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - public class MasterSynchro { public static MasterSynchro master = new MasterSynchro(); - private LinkedList requested; + private LinkedList<SynchroSchemes> requested; private long time; public MasterSynchro() { - requested = new LinkedList(); + requested = new LinkedList<>(); } public SynchroSchemes synchro(SynchroSchemes synchros[], JTToolThread jttt) throws PreemptionException { @@ -173,8 +175,7 @@ public class MasterSynchro { } public void updateSynchros(SynchroSchemes[] synchros) { - ListIterator iterator; - SynchroSchemes sss0, sss1; + SynchroSchemes sss0; JMasterGate jmg; JGate jgate; @@ -209,9 +210,7 @@ public class MasterSynchro { return; } else { //System.out.println("Synchronized gate"); - iterator = requested.listIterator(); - while(iterator.hasNext()) { - sss1 = (SynchroSchemes)(iterator.next()); + for (SynchroSchemes sss1: this.requested) { if (synchroPossible(sss0, sss1)) { makeSynchro(sss0, sss1); return; @@ -251,13 +250,10 @@ public class MasterSynchro { } public void removeAllGroup(JGroupSynchro group) { - SynchroSchemes sss; - ListIterator iterator = requested.listIterator(); - LinkedList ll = new LinkedList(); + LinkedList<SynchroSchemes> ll = new LinkedList<>(); - while(iterator.hasNext()) { - sss = (SynchroSchemes)(iterator.next()); + for (SynchroSchemes sss: this.requested) { if (sss.group != group) { ll.add(sss); } @@ -267,26 +263,15 @@ public class MasterSynchro { } public void printRequested() { - SynchroSchemes sss; - ListIterator iterator = requested.listIterator(); - LinkedList ll = new LinkedList(); - System.out.print("Requested = "); - while(iterator.hasNext()) { - sss = (SynchroSchemes)(iterator.next()); + for (SynchroSchemes sss: this.requested) { System.out.print(sss.jgate.getName() + " "); } System.out.println(" "); } public void setSynchroDoneForGroup(SynchroSchemes sss0, SynchroSchemes sss1) { - SynchroSchemes sss; - ListIterator iterator = requested.listIterator(); - LinkedList ll = new LinkedList(); - - - while(iterator.hasNext()) { - sss = (SynchroSchemes)(iterator.next()); + for (SynchroSchemes sss: this.requested) { if ((sss.group == sss0.group) ||(sss.group == sss1.group)) { sss.synchroDone = true; } diff --git a/jttool/src/main/java/Network.java b/jttool/src/main/java/Network.java index 85bf2a5a15edb6c0122fd0a0507046bc1ca1e07c..782d8f9ba4051ee9fceaa6c24e8883c3c781e583 100755 --- a/jttool/src/main/java/Network.java +++ b/jttool/src/main/java/Network.java @@ -1,14 +1,45 @@ - -/** - * Class Network - * To be used with the TTool Java code generator - * For more information on TTool, see http://www.eurecom.fr/~apvrille/TURTLE - * Creation: 21/07/2005 - * @version 1.1 21/07/2005 - * @author Ludovic APVRILLE - * @see +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. */ + + + + package jttool; import java.net.*; @@ -17,6 +48,15 @@ import java.util.*; import java.rmi.Naming; import java.rmi.RemoteException; + +/** + * Class Network + * To be used with the TTool Java code generator + * For more information on TTool, see http://www.eurecom.fr/~apvrille/TURTLE + * Creation: 21/07/2005 + * @version 1.1 21/07/2005 + * @author Ludovic APVRILLE + */ public class Network { public static final int NO_PROTOCOL = 0; @@ -26,17 +66,17 @@ public class Network { public static final Network net = new Network(); - private LinkedList dataNet; - private LinkedList receiveUDPThreads; + private LinkedList<DataNet> dataNet; + private LinkedList<ReceiveUDPThread> receiveUDPThreads; - private LinkedList rmiserverobjs; - private LinkedList rmiclientobjs; + private LinkedList<Transfer> rmiserverobjs; + private LinkedList<DataTransferInterface> rmiclientobjs; public Network() { - dataNet = new LinkedList(); - receiveUDPThreads = new LinkedList(); - rmiserverobjs = new LinkedList(); - rmiclientobjs = new LinkedList(); + dataNet = new LinkedList<>(); + receiveUDPThreads = new LinkedList<>(); + rmiserverobjs = new LinkedList<>(); + rmiclientobjs = new LinkedList<>(); } public SynchroSchemes action(SynchroSchemes sss, int protocol, int localPort, int destPort, String localHost, String destHost) { @@ -98,39 +138,28 @@ public class Network { } - public synchronized DataNet notMatchCreate(LinkedList ll, int _localPort, int _destPort, String _destHost) { - DataNet data = null; - boolean found = false; - ListIterator iterator = dataNet.listIterator(); - while(iterator.hasNext()) { - data = (DataNet)(iterator.next()); + public synchronized DataNet notMatchCreate(LinkedList<DataNet> ll, int _localPort, int _destPort, String _destHost) { + for (DataNet data: this.dataNet) { if (data.match(_localPort, _destPort, _destHost)) { - found = true; - break; + return data; } } - if (!found) { - data = new DataNet(); - data.host = new String(_destHost); - data.localPort = _localPort; - data.destPort = _destPort; - data.createNet(); - if (data.socket == null) { - return null; - } - ll.add(data); - } + DataNet data = new DataNet(); + data.host = new String(_destHost); + data.localPort = _localPort; + data.destPort = _destPort; + data.createNet(); + if (data.socket == null) { + return null; + } + ll.add(data); return data; } public synchronized ReceiveUDPThread getCompatibleReceiveUDPThread(int localPort, int _destPort, String _destHost) { - ListIterator iterator = receiveUDPThreads.listIterator(); - ReceiveUDPThread rut; - - while(iterator.hasNext()) { - rut = (ReceiveUDPThread)(iterator.next()); + for (ReceiveUDPThread rut: this.receiveUDPThreads) { if (rut.localPort == localPort) { //System.out.println("Found already built rut"); return rut; @@ -140,7 +169,7 @@ public class Network { DataNet data = notMatchCreate(dataNet, localPort, _destPort, _destHost); - rut = new ReceiveUDPThread(); + ReceiveUDPThread rut = new ReceiveUDPThread(); receiveUDPThreads.add(rut); rut.localPort = localPort; rut.socket = data.socket; @@ -152,11 +181,7 @@ public class Network { } public synchronized Transfer getCompatibleTransfer(int localPort, String localHost) { - ListIterator iterator = rmiserverobjs.listIterator(); - Transfer tr; - - while(iterator.hasNext()) { - tr = (Transfer)(iterator.next()); + for (Transfer tr: this.rmiserverobjs) { if (tr.port == localPort) { //System.out.println("Found already built rut"); return tr; @@ -164,21 +189,18 @@ public class Network { } try { - tr = new Transfer(localHost, localPort); + Transfer tr = new Transfer(localHost, localPort); + rmiserverobjs.add(tr); + return tr; } catch (RemoteException re) { System.out.println("Exception in creating new Tranfer object: " + re.getMessage()); - return null; } - rmiserverobjs.add(tr); - return tr; + + return null; } public synchronized TransferInterface notMatchCreate(int destPort, String destHost) { - ListIterator iterator = rmiclientobjs.listIterator(); - DataTransferInterface dti; - - while(iterator.hasNext()) { - dti = (DataTransferInterface)(iterator.next()); + for (DataTransferInterface dti: this.rmiclientobjs) { if ((dti.port == destPort) && (destHost.compareTo(dti.host) ==0)) { return dti.ti; } @@ -196,7 +218,7 @@ public class Network { return null; } - dti = new DataTransferInterface(ti, destHost, destPort); + DataTransferInterface dti = new DataTransferInterface(ti, destHost, destPort); rmiclientobjs.add(dti); return ti; } diff --git a/jttool/src/main/java/PreemptionException.java b/jttool/src/main/java/PreemptionException.java index 7e7040e72a1dee978906ad8062bcc52d72e78e95..5473f8c4bac7cb8229bd3cb3841ac7930b972696 100755 --- a/jttool/src/main/java/PreemptionException.java +++ b/jttool/src/main/java/PreemptionException.java @@ -1,3 +1,47 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + + +package jttool; + /** * Class PreemptionException @@ -6,11 +50,7 @@ * Creation: 04/03/2005 * @version 1.1 04/03/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - public class PreemptionException extends Exception{ public PreemptionException() {} diff --git a/jttool/src/main/java/ReceiveUDPThread.java b/jttool/src/main/java/ReceiveUDPThread.java index d3985691f74c2191a00ff2be6208f5848b417706..8f4014e5ddbe6f1c78791fbcec473916cbf5efbf 100644 --- a/jttool/src/main/java/ReceiveUDPThread.java +++ b/jttool/src/main/java/ReceiveUDPThread.java @@ -1,19 +1,59 @@ -/** - * Class ReceiveUDPThread - * To be used with the TTool Java code generator - * For more information on TTool, see http://www.eurecom.fr/~apvrille/TURTLE - * Creation: 25/07/2005 - * @version 1.1 25/07/2005 - * @author Ludovic APVRILLE - * @see +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. */ + + + package jttool; import java.io.*; import java.net.*; import java.util.*; + +/** + * Class ReceiveUDPThread + * To be used with the TTool Java code generator + * For more information on TTool, see http://www.eurecom.fr/~apvrille/TURTLE + * Creation: 25/07/2005 + * @version 1.1 25/07/2005 + * @author Ludovic APVRILLE + */ public class ReceiveUDPThread implements Runnable { public int localPort; @@ -22,16 +62,16 @@ public class ReceiveUDPThread implements Runnable { private DatagramPacket dp; private byte[] buf; private int bufsize = 1500; - private LinkedList dps; - private LinkedList data; - private LinkedList requests; + private LinkedList<DatagramPacket> dps; + private LinkedList<SynchroSchemes> data; + private LinkedList<SynchroSchemes> requests; private int maxSize = 1500; private int nbReq = 0; public ReceiveUDPThread() { - dps = new LinkedList(); - data = new LinkedList(); - requests = new LinkedList(); + dps = new LinkedList<>(); + data = new LinkedList<>(); + requests = new LinkedList<>(); go = true; } @@ -125,15 +165,12 @@ public class ReceiveUDPThread implements Runnable { } public int hasCompatiblePacket(SynchroSchemes sss, int provPort, String provHost) { - DatagramPacket dp; SynchroSchemes tmps; boolean found = false; int index = 0; - ListIterator iterator = dps.listIterator(); - while(iterator.hasNext()) { - dp = (DatagramPacket)(iterator.next()); - tmps = (SynchroSchemes)(data.get(index)); + for (DatagramPacket dp: this.dps) { + tmps = data.get(index); if (isCompatible(dp, tmps, sss, provPort, provHost)) { found = true; break; @@ -155,7 +192,7 @@ public class ReceiveUDPThread implements Runnable { return null; } - SynchroSchemes tmps = (SynchroSchemes)(data.get(index)); + SynchroSchemes tmps = data.get(index); sss.completeSynchro(tmps); data.remove(index); @@ -197,11 +234,8 @@ public class ReceiveUDPThread implements Runnable { public boolean checkIfCanBeServed(SynchroSchemes sss) { System.out.println("Nb of requests in list: " + requests.size()); - SynchroSchemes tmps; - ListIterator iterator = requests.listIterator(); - while(iterator.hasNext()) { - tmps = (SynchroSchemes)(iterator.next()); + for (SynchroSchemes tmps: this.requests) { if (tmps.isCompatibleWith(sss)) { return true; } diff --git a/jttool/src/main/java/SynchroScheme.java b/jttool/src/main/java/SynchroScheme.java index cd9ae46aafb33e148627118d6d45d21c1e6b6e13..26c5e67465c2606086e144dddb879dd05b70d051 100755 --- a/jttool/src/main/java/SynchroScheme.java +++ b/jttool/src/main/java/SynchroScheme.java @@ -1,39 +1,49 @@ -/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ -ludovic.apvrille AT enst.fr -This software is a computer program whose purpose is to allow the -edition of TURTLE analysis, design and deployment diagrams, to -allow the generation of RT-LOTOS or Java code from this diagram, -and at last to allow the analysis of formal validation traces -obtained from external tools, e.g. RTL from LAAS-CNRS and CADP -from INRIA Rhone-Alpes. -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. +package jttool; + +import java.util.*; -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. /** * Class SynchroSchemes @@ -42,13 +52,7 @@ knowledge of the CeCILL license and that you accept its terms. * Creation: 07/03/2005 * @version 1.1 07/03/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - public class SynchroScheme { public boolean sending; public int valueNat; diff --git a/jttool/src/main/java/SynchroSchemes.java b/jttool/src/main/java/SynchroSchemes.java index 6a3d8a6ecc35ddf0d4110991a352f556cc20f1f1..e9b2e4236697261c9a1facfb8a2426bc0c4e8d3f 100755 --- a/jttool/src/main/java/SynchroSchemes.java +++ b/jttool/src/main/java/SynchroSchemes.java @@ -1,39 +1,49 @@ -/**Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille - -ludovic.apvrille AT enst.fr - -This software is a computer program whose purpose is to allow the -edition of TURTLE analysis, design and deployment diagrams, to -allow the generation of RT-LOTOS or Java code from this diagram, -and at last to allow the analysis of formal validation traces -obtained from external tools, e.g. RTL from LAAS-CNRS and CADP -from INRIA Rhone-Alpes. - -This software is governed by the CeCILL license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL license and that you accept its terms. +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + + +package jttool; + +import java.util.*; + /** * Class SynchroSchemes @@ -42,14 +52,8 @@ knowledge of the CeCILL license and that you accept its terms. * Creation: 07/03/2005 * @version 1.1 07/03/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.util.*; - -public class SynchroSchemes extends Vector{ +public class SynchroSchemes extends Vector<SynchroScheme>{ private boolean forceSynchro = false; public JGate jgate; public long minDelay = -1; @@ -103,7 +107,7 @@ public class SynchroSchemes extends Vector{ } public SynchroScheme synchroSchemeAt(int i) { - return ((SynchroScheme)(elementAt(i))); + return elementAt(i); } public void completeSynchro(SynchroSchemes sss) { diff --git a/jttool/src/main/java/Transfer.java b/jttool/src/main/java/Transfer.java index 13abddc6668ac3ec8fefee37ab5c98232f62c407..0f307be461ff5bf4ca85f40a3c2afb5e75951b36 100755 --- a/jttool/src/main/java/Transfer.java +++ b/jttool/src/main/java/Transfer.java @@ -1,28 +1,67 @@ - -/** - * Class Transfer - * To be used with the TTool Java code generator - * For more information on TTool, see http://www.eurecom.fr/~apvrille/TURTLE - * Creation: 28/07/2005 - * @version 1.1 28/07/2005 - * @author Ludovic APVRILLE - * @see +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. */ + + + + package jttool; import java.util.*; import java.rmi.Naming; import java.rmi.RemoteException; -import java.rmi.RMISecurityManager; import java.rmi.server.UnicastRemoteObject; + +/** + * Class Transfer + * To be used with the TTool Java code generator + * For more information on TTool, see http://www.eurecom.fr/~apvrille/TURTLE + * Creation: 28/07/2005 + * @version 1.1 28/07/2005 + * @author Ludovic APVRILLE + */ public class Transfer extends UnicastRemoteObject implements TransferInterface { public int port; public String hostname; - private LinkedList data; - private LinkedList requests; + private LinkedList<SynchroSchemes> data; + private LinkedList<SynchroSchemes> requests; private int maxSize = 1500; private int nbReq = 0; @@ -30,8 +69,8 @@ public class Transfer extends UnicastRemoteObject implements TransferInterface { super(); hostname = _hostname; port = _port; - data = new LinkedList(); - requests = new LinkedList(); + data = new LinkedList<>(); + requests = new LinkedList<>(); register(); @@ -39,8 +78,7 @@ public class Transfer extends UnicastRemoteObject implements TransferInterface { public void register() { if (System.getSecurityManager() == null) { - //System.setSecurityManager(new RMISecurityManager()); - System.setSecurityManager(new RMISecurityManager() { + System.setSecurityManager(new SecurityManager() { public void checkConnect (String host, int port){} public void checkConnect (String host, int port, Object context) {} }); @@ -84,13 +122,10 @@ public class Transfer extends UnicastRemoteObject implements TransferInterface { } public int hasCompatiblePacket(SynchroSchemes sss, int provPort, String provHost) { - SynchroSchemes tmps; boolean found = false; int index = 0; - ListIterator iterator = data.listIterator(); - while(iterator.hasNext()) { - tmps = (SynchroSchemes)(data.get(index)); + for (SynchroSchemes tmps: this.data) { if (isCompatible(tmps, sss, provPort, provHost)) { found = true; break; @@ -113,7 +148,7 @@ public class Transfer extends UnicastRemoteObject implements TransferInterface { return null; } - SynchroSchemes tmps = (SynchroSchemes)(data.get(index)); + SynchroSchemes tmps = data.get(index); sss.completeSynchro(tmps); data.remove(index); @@ -151,11 +186,8 @@ public class Transfer extends UnicastRemoteObject implements TransferInterface { public boolean checkIfCanBeServed(SynchroSchemes sss) { System.out.println("Nb of requests in list: " + requests.size()); - SynchroSchemes tmps; - ListIterator iterator = requests.listIterator(); - while(iterator.hasNext()) { - tmps = (SynchroSchemes)(iterator.next()); + for (SynchroSchemes tmps: this.requests) { if (tmps.isCompatibleWith(sss)) { return true; } diff --git a/jttool/src/main/java/TransferInterface.java b/jttool/src/main/java/TransferInterface.java index 1973a6f6cd59adc09f165b87f30111c1c78b3b8d..e751b95770e96ab9bb55ee4f7b184ef17085d1f6 100755 --- a/jttool/src/main/java/TransferInterface.java +++ b/jttool/src/main/java/TransferInterface.java @@ -1,3 +1,50 @@ +/* Copyright or (C) or Copr. GET / ENST, Telecom-Paris, Ludovic Apvrille + * + * ludovic.apvrille AT enst.fr + * + * This software is a computer program whose purpose is to allow the + * edition of TURTLE analysis, design and deployment diagrams, to + * allow the generation of RT-LOTOS or Java code from this diagram, + * and at last to allow the analysis of formal validation traces + * obtained from external tools, e.g. RTL from LAAS-CNRS and CADP + * from INRIA Rhone-Alpes. + * + * This software is governed by the CeCILL license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL license and that you accept its terms. + */ + + + + + +package jttool; + +import java.rmi.Remote; +import java.rmi.RemoteException; + /** * Class TransferInterface @@ -6,14 +53,7 @@ * Creation: 28/07/2005 * @version 1.1 28/07/2005 * @author Ludovic APVRILLE - * @see */ - -package jttool; - -import java.rmi.Remote; -import java.rmi.RemoteException; - public interface TransferInterface extends Remote { public void asynchronousSend(String s) throws RemoteException;