You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(28) |
Nov
(60) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(7) |
Feb
(23) |
Mar
(1) |
Apr
(12) |
May
|
Jun
(12) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <jsa...@us...> - 2008-10-28 13:52:48
|
Revision: 47 http://flexotask.svn.sourceforge.net/flexotask/?rev=47&view=rev Author: jsauerbach Date: 2008-10-28 13:52:46 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Add test case for highfreqread rewriting. Modified Paths: -------------- trunk/flexotask-devtest/src/base/RewriterTestCase.java trunk/flexotask-devtest/src/testall/AllRewriterTests.java Added Paths: ----------- trunk/flexotask-devtest/tst/rewriter/test2/ trunk/flexotask-devtest/tst/rewriter/test2/CheckFunctionTests.java Modified: trunk/flexotask-devtest/src/base/RewriterTestCase.java =================================================================== --- trunk/flexotask-devtest/src/base/RewriterTestCase.java 2008-10-28 13:51:53 UTC (rev 46) +++ trunk/flexotask-devtest/src/base/RewriterTestCase.java 2008-10-28 13:52:46 UTC (rev 47) @@ -15,16 +15,19 @@ import java.io.File; import java.io.FileOutputStream; +import java.io.IOException; import java.util.Iterator; import org.eclipse.core.runtime.NullProgressMonitor; +import com.ibm.realtime.flexotask.development.builder.BuildException; import com.ibm.realtime.flexotask.development.rewriting.CodeRewriteResult; import com.ibm.realtime.flexotask.development.rewriting.RewrittenClass; import com.ibm.realtime.flexotask.development.rewriting.TestCodeRewriter; import com.ibm.realtime.flexotask.development.validation.CodeAnalysisResult; import com.ibm.realtime.flexotask.template.FlexotaskStableMode; import com.ibm.realtime.flexotask.template.FlexotaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskValidationException; /** * Base class for doing testing of the code rewriter. @@ -33,31 +36,23 @@ /** The code rewriter used for the test */ protected TestCodeRewriter rewriter; - protected void setUp() { - super.setUp(); - File genFolder = new File("generated"); - //if (genFolder.exists() && !delDirectory(genFolder)) { - // fail("Could not empty output folder for generated files."); - //} - } - /** - * Deletes the contents of the directory provided, except the CVS directory - * @param dir - * @param delete - * @return + * Validate and perform rewriting for a template + * @param template the template + * @return the CodeRewriteResult + * @throws ClassNotFoundException + * @throws FlexotaskValidationException + * @throws BuildException + * @throws IOException */ - private boolean delDirectory(File dir) { - if (dir.exists() && dir.isDirectory()) { - String[] children = dir.list(); - for (int i=0; i < children.length; i++) { - boolean success = delDirectory(new File(dir, children[i])); - if (!success) { - return false; - } - } - } - return dir.delete(); + protected final CodeRewriteResult doRewriting(FlexotaskTemplate template) + throws ClassNotFoundException, FlexotaskValidationException, BuildException, IOException + { + CodeAnalysisResult result = doValidation(template); + rewriter = new TestCodeRewriter(context, result); + CodeRewriteResult res = rewriter.rewrite(new NullProgressMonitor()); + persistClasses(res); + return res; } /** @@ -65,56 +60,105 @@ * names are provided in the string array. * * @param classNames - * @return - * @throws Exception + * the class names + * @param mode + * the stable mode + * @return the CodeRewriteResult + * @throws FlexotaskValidationException + * @throws ClassNotFoundException + * @throws BuildException + * @throws IOException */ - protected final CodeRewriteResult doRewriting(String[] classNames, FlexotaskStableMode mode) - throws Exception { + protected final CodeRewriteResult doRewriting(String[] classNames, FlexotaskStableMode mode) + throws ClassNotFoundException, FlexotaskValidationException, BuildException, IOException + { CodeAnalysisResult result = doValidation(classNames, mode); rewriter = new TestCodeRewriter(context, result); - return rewriter.rewrite(new NullProgressMonitor()); + CodeRewriteResult res = rewriter.rewrite(new NullProgressMonitor()); + persistClasses(res); + return res; } - - protected final CodeRewriteResult doRewriting(FlexotaskTemplate template) - throws Exception { - CodeAnalysisResult result = doValidation(template); + + /** + * Do rewriting given a set of classes and a set of stable classes (manual stable mode implied) + * @param testClasses the test classes + * @param stableClasses the stable classes + * @return the CodeRewriteResult + * @throws ClassNotFoundException + * @throws FlexotaskValidationException + * @throws BuildException + * @throws IOException + */ + protected CodeRewriteResult doRewriting(String[] testClasses, String[] stableClasses) + throws ClassNotFoundException, FlexotaskValidationException, BuildException, IOException + { + CodeAnalysisResult result = doValidation(testClasses, stableClasses); rewriter = new TestCodeRewriter(context, result); CodeRewriteResult res = rewriter.rewrite(new NullProgressMonitor()); persistClasses(res); return res; } - + /** * Persist the rewritten classes into the 'generated' output directory - * @param result - * @throws Exception + * + * @param toPersist the CodeRewriteResult to persist + * @throws IOException if something goes wrong */ - protected void persistClasses(CodeRewriteResult result) throws Exception { + protected void persistClasses(CodeRewriteResult toPersist) throws IOException { File genFolder = new File("generated"); if (!genFolder.exists() && !genFolder.mkdir()) - throw new Exception("Output directory for generated files does not exist and could not be created."); + throw new IOException( + "Output directory for generated files does not exist and could not be created."); // loop through the rewritten classes and persist them - for (Iterator j = result.getRewrittenClasses().iterator(); j.hasNext(); ) { + for (Iterator j = toPersist.getRewrittenClasses().iterator(); j.hasNext();) { RewrittenClass rc = (RewrittenClass) j.next(); // create output path for rewritten class String packageName = rc.getJavaClassName(); - packageName = packageName.substring(0, packageName.lastIndexOf('.') > 0 ? packageName.lastIndexOf('.') : 0); - - File packagePath = new File(genFolder, packageName.replace('.', File.separatorChar)); + packageName = packageName.substring(0, + packageName.lastIndexOf('.') > 0 ? packageName.lastIndexOf('.') : 0); + File packagePath = new File(genFolder, packageName.replace('.', + File.separatorChar)); if (!packagePath.exists()) packagePath.mkdirs(); - String filename = rc.getJavaClassName() + ".class"; - int pathNameLength = (int) packageName.length() + (packageName.length() > 0 ? 1 : 0); + int pathNameLength = (int) packageName.length() + + (packageName.length() > 0 ? 1 : 0); filename = filename.substring(pathNameLength, filename.length()); - File f = new File(packagePath, filename); if (f.exists()) f.delete(); FileOutputStream baos = new FileOutputStream(f); - rc.writeToStream(baos); baos.flush(); } } + + protected void setUp() { + super.setUp(); + File genFolder = new File("generated"); + if (genFolder.exists() && !delDirectory(genFolder)) { + fail("Could not empty output folder for generated files."); + } + } + + /** + * Deletes the contents of the directory provided, except the CVS directory + * + * @param dir + * @param delete + * @return + */ + private boolean delDirectory(File dir) { + if (dir.exists() && dir.isDirectory()) { + String[] children = dir.list(); + for (int i = 0; i < children.length; i++) { + boolean success = delDirectory(new File(dir, children[i])); + if (!success) { + return false; + } + } + } + return dir.delete(); + } } Modified: trunk/flexotask-devtest/src/testall/AllRewriterTests.java =================================================================== --- trunk/flexotask-devtest/src/testall/AllRewriterTests.java 2008-10-28 13:51:53 UTC (rev 46) +++ trunk/flexotask-devtest/src/testall/AllRewriterTests.java 2008-10-28 13:52:46 UTC (rev 47) @@ -20,6 +20,7 @@ public static Test suite() { TestSuite suite = new TestSuite("All Rewriter Tests"); suite.addTestSuite(rewriter.test1.TestMyFlexotask.class); + suite.addTestSuite(rewriter.test2.CheckFunctionTests.class); return suite; } } Added: trunk/flexotask-devtest/tst/rewriter/test2/CheckFunctionTests.java =================================================================== --- trunk/flexotask-devtest/tst/rewriter/test2/CheckFunctionTests.java (rev 0) +++ trunk/flexotask-devtest/tst/rewriter/test2/CheckFunctionTests.java 2008-10-28 13:52:46 UTC (rev 47) @@ -0,0 +1,35 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package rewriter.test2; + +import highfreqread.Channel; +import highfreqread.HighFreqReader; +import highfreqread.State; +import base.RewriterTestCase; + +/** + * Development time checking of those tests in flexotask-functiontest that involve rewriting + */ +public class CheckFunctionTests extends RewriterTestCase { + private static String[] highfreqread = new String[] { HighFreqReader.class.getName() }; + private static String[] highfreqstable = new String[] { HighFreqReader.class.getName(), Channel.class.getName(), + Channel[].class.getName(), State.class.getName() }; + public void testHighFreqRead() { + try { + doRewriting(highfreqread, highfreqstable); + } catch (Exception e) { + fail(e.toString()); + } + } +} Property changes on: trunk/flexotask-devtest/tst/rewriter/test2/CheckFunctionTests.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-28 13:52:03
|
Revision: 46 http://flexotask.svn.sourceforge.net/flexotask/?rev=46&view=rev Author: jsauerbach Date: 2008-10-28 13:51:53 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Add HashMap.INT_KEY to safe statics. Modified Paths: -------------- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations 2008-10-28 13:51:00 UTC (rev 45) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations 2008-10-28 13:51:53 UTC (rev 46) @@ -18,6 +18,7 @@ full java.lang.String full java.util.HashSet PRESENT full java.util.HashMap NULL_KEY +full java.util.HashMap INT_KEY full sun.misc.FloatingDecimal infinity full sun.misc.FloatingDecimal notANumber full sun.misc.FloatingDecimal zero This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-28 13:51:04
|
Revision: 45 http://flexotask.svn.sourceforge.net/flexotask/?rev=45&view=rev Author: jsauerbach Date: 2008-10-28 13:51:00 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Get rid of AnalysisException clause that never actually happens to simplify catch clauses. Modified Paths: -------------- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/FieldViolation.java trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/builder/FlexotaskBuilder.java Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/FieldViolation.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/FieldViolation.java 2008-10-28 13:49:20 UTC (rev 44) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/FieldViolation.java 2008-10-28 13:51:00 UTC (rev 45) @@ -13,7 +13,6 @@ */ package com.ibm.realtime.flexotask.validation; -import com.ibm.realtime.analysis.AnalysisException; import com.ibm.realtime.analysis.FieldWrapper; /** @@ -45,9 +44,8 @@ * Returns the class in which the field violating the * type rules is declared. * @return the class object of the defining class. - * @throws AnalysisException */ - public Class getDefiningClass() throws AnalysisException { + public Class getDefiningClass() { return ((FieldWrapper) target).getDefiningClass(); } Modified: trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/builder/FlexotaskBuilder.java =================================================================== --- trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/builder/FlexotaskBuilder.java 2008-10-28 13:49:20 UTC (rev 44) +++ trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/builder/FlexotaskBuilder.java 2008-10-28 13:51:00 UTC (rev 45) @@ -213,17 +213,12 @@ IResourceStatus.INTERNAL_ERROR, ee.getMessage(), ee)); } } else { - try { - FieldViolation fv = (FieldViolation) entry; - IType type = jproj.findType(Utils.convertInnerclass(fv - .getDefiningClass().getName())); - IField ifield = type.getField(fv.getFieldName()); - reportTypeRuleViolation(fv.getDefiningClass(), entry, Utils - .getLineNumber(ifield)); - } catch (AnalysisException ee) { - throw new CoreException(new Status(IStatus.ERROR, BUILDER_ID, - IResourceStatus.INTERNAL_ERROR, ee.getMessage(), ee)); - } + FieldViolation fv = (FieldViolation) entry; + IType type = jproj.findType(Utils.convertInnerclass(fv + .getDefiningClass().getName())); + IField ifield = type.getField(fv.getFieldName()); + reportTypeRuleViolation(fv.getDefiningClass(), entry, Utils + .getLineNumber(ifield)); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-28 13:49:33
|
Revision: 44 http://flexotask.svn.sourceforge.net/flexotask/?rev=44&view=rev Author: jsauerbach Date: 2008-10-28 13:49:20 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Make the number of threads and runnables visible to the master runnable before requesting the coordination lock count so that it can more easily answer the question. Submitted by Jia Zou. Modified Paths: -------------- trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java 2008-10-27 16:15:09 UTC (rev 43) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java 2008-10-28 13:49:20 UTC (rev 44) @@ -350,16 +350,16 @@ if (nRunnables > 1) { System.arraycopy(otherRunnables,0, runnables,1, nRunnables-1); } + /* Ensure that the otherThreads and otherRunnables arrays are pre-initialized so that they will be cloned */ + if (nRunnables > 1) { + toClone.otherRunnables = new FlexotaskSchedulerRunnable[nRunnables-1]; + toClone.otherThreads = new Thread[nRunnables-1]; + } /* Create the requested number of locks (at least one) to be pinned by the factory */ Object[] theLocks = new Object[toClone.getThreadCoordinationLockCount() + 1]; for (int i = 0; i < theLocks.length; i++) { theLocks[i] = new Object(); } - /* Ensure that the otherThreads and otherRunnables arrays are pre-initialized so that they will be cloned */ - if (nRunnables > 1) { - toClone.otherRunnables = new FlexotaskSchedulerRunnable[nRunnables-1]; - toClone.otherThreads = new Thread[nRunnables-1]; - } /* Run the thread factory to obtain threads and clone the runnables */ Thread[] allThreads = threadFactory.createThreads(runnables, theLocks); /* Stow the slave threads and cloned runnables in their rightful place in the cloned master runnable */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-27 16:15:15
|
Revision: 43 http://flexotask.svn.sourceforge.net/flexotask/?rev=43&view=rev Author: jsauerbach Date: 2008-10-27 16:15:09 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Enter intial code set into repository Added Paths: ----------- trunk/flexotask-devtest/.classpath trunk/flexotask-devtest/.project trunk/flexotask-devtest/.settings/ trunk/flexotask-devtest/.settings/org.eclipse.jdt.core.prefs trunk/flexotask-devtest/.settings/org.eclipse.jdt.ui.prefs trunk/flexotask-devtest/META-INF/ trunk/flexotask-devtest/META-INF/MANIFEST.MF trunk/flexotask-devtest/build.properties trunk/flexotask-devtest/launch/ trunk/flexotask-devtest/launch/Run devtime validator test suite.launch trunk/flexotask-devtest/launch/Run rewriter test suite.launch trunk/flexotask-devtest/src/ trunk/flexotask-devtest/src/base/ trunk/flexotask-devtest/src/base/DevtimeCheckerTestCase.java trunk/flexotask-devtest/src/base/RewriterTestCase.java trunk/flexotask-devtest/src/com/ trunk/flexotask-devtest/src/com/ibm/ trunk/flexotask-devtest/src/com/ibm/realtime/ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/rewriting/ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/rewriting/TestCodeRewriter.java trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/validation/ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/validation/TestDevtimeCodeValidator.java trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/system/ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/system/TestCodeValidator.java trunk/flexotask-devtest/src/testall/ trunk/flexotask-devtest/src/testall/AllDevtimeCheckerTests.java trunk/flexotask-devtest/src/testall/AllRewriterTests.java trunk/flexotask-devtest/src/testall/AllTests.java trunk/flexotask-devtest/tst/ trunk/flexotask-devtest/tst/devtime/ trunk/flexotask-devtest/tst/devtime/test1/ trunk/flexotask-devtest/tst/devtime/test1/IllegalStable.java trunk/flexotask-devtest/tst/devtime/test1/MyFlexotask.java trunk/flexotask-devtest/tst/devtime/test1/MyFlexotaskWithIllegalStable.java trunk/flexotask-devtest/tst/devtime/test1/MyStable.java trunk/flexotask-devtest/tst/devtime/test1/TestMyFlexotask.java trunk/flexotask-devtest/tst/devtime/test2/ trunk/flexotask-devtest/tst/devtime/test2/CheckFunctionTests.java trunk/flexotask-devtest/tst/devtime/test3/ trunk/flexotask-devtest/tst/devtime/test3/DevTimeStaticDiagnostic.java trunk/flexotask-devtest/tst/rewriter/ trunk/flexotask-devtest/tst/rewriter/test1/ trunk/flexotask-devtest/tst/rewriter/test1/MyFlexotask.java trunk/flexotask-devtest/tst/rewriter/test1/TestMyFlexotask.java Added: trunk/flexotask-devtest/.classpath =================================================================== --- trunk/flexotask-devtest/.classpath (rev 0) +++ trunk/flexotask-devtest/.classpath 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="binbase" path="src"/> + <classpathentry kind="src" output="bintst" path="tst"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/> + <classpathentry combineaccessrules="false" kind="src" path="/flexotask"/> + <classpathentry combineaccessrules="false" kind="src" path="/flexotask-development"/> + <classpathentry combineaccessrules="false" kind="src" path="/realtime-analysis"/> + <classpathentry combineaccessrules="false" kind="src" path="/flexotask-functiontest"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/flexotask-devtest/.project =================================================================== --- trunk/flexotask-devtest/.project (rev 0) +++ trunk/flexotask-devtest/.project 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>flexotask-devtest</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.pde.PluginNature</nature> + </natures> +</projectDescription> Added: trunk/flexotask-devtest/.settings/org.eclipse.jdt.core.prefs =================================================================== --- trunk/flexotask-devtest/.settings/org.eclipse.jdt.core.prefs (rev 0) +++ trunk/flexotask-devtest/.settings/org.eclipse.jdt.core.prefs 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,313 @@ +#Tue Oct 21 15:50:21 EDT 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=ignore +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore +org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore +org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=80 +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=80 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=0 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=false +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=2 +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false Added: trunk/flexotask-devtest/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/flexotask-devtest/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/flexotask-devtest/.settings/org.eclipse.jdt.ui.prefs 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,10 @@ +#Mon Oct 27 11:37:47 EDT 2008 +eclipse.preferences.version=1 +formatter_profile=_IBM +formatter_settings_version=10 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.javadoc=false +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> Added: trunk/flexotask-devtest/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask-devtest/META-INF/MANIFEST.MF (rev 0) +++ trunk/flexotask-devtest/META-INF/MANIFEST.MF 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Flexotask_unittest Plug-in +Bundle-SymbolicName: flexotask_devtest +Bundle-Version: 1.0.0 +Require-Bundle: org.eclipse.core.runtime Added: trunk/flexotask-devtest/build.properties =================================================================== --- trunk/flexotask-devtest/build.properties (rev 0) +++ trunk/flexotask-devtest/build.properties 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,4 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + . Property changes on: trunk/flexotask-devtest/build.properties ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-devtest/launch/Run devtime validator test suite.launch =================================================================== --- trunk/flexotask-devtest/launch/Run devtime validator test suite.launch (rev 0) +++ trunk/flexotask-devtest/launch/Run devtime validator test suite.launch 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/flexotask-unittest/src/testall/AllDevtimeCheckerTests.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="testall.AllDevtimeCheckerTests"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="flexotask-devtest"/> +</launchConfiguration> Added: trunk/flexotask-devtest/launch/Run rewriter test suite.launch =================================================================== --- trunk/flexotask-devtest/launch/Run rewriter test suite.launch (rev 0) +++ trunk/flexotask-devtest/launch/Run rewriter test suite.launch 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/flexotask-unittest/src/testall/AllRewriterTests.java"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="testall.AllRewriterTests"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="flexotask-devtest"/> +</launchConfiguration> Added: trunk/flexotask-devtest/src/base/DevtimeCheckerTestCase.java =================================================================== --- trunk/flexotask-devtest/src/base/DevtimeCheckerTestCase.java (rev 0) +++ trunk/flexotask-devtest/src/base/DevtimeCheckerTestCase.java 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,160 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package base; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import junit.framework.TestCase; + +import org.eclipse.core.runtime.NullProgressMonitor; + +import com.ibm.realtime.flexotask.AtomicException; +import com.ibm.realtime.flexotask.AtomicFlexotask; +import com.ibm.realtime.flexotask.ExternalMethods; +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.Stable; +import com.ibm.realtime.flexotask.development.validation.CodeAnalysisResult; +import com.ibm.realtime.flexotask.development.validation.TestDevtimeCodeValidator; +import com.ibm.realtime.flexotask.template.FlexotaskStableMode; +import com.ibm.realtime.flexotask.template.FlexotaskTaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskValidationException; +import com.ibm.realtime.flexotask.validation.ValidationContext; + +/** + * Base test class for doing testing of the development time checker + */ +public abstract class DevtimeCheckerTestCase extends TestCase { + /** The context used by the validator */ + protected ValidationContext context; + /** The validator used for the devtime checking */ + protected TestDevtimeCodeValidator validator; + /** The original context classloader */ + protected ClassLoader originalClassLoader; + + public DevtimeCheckerTestCase() { + } + + /** + * Configure the classloader and instantiate new devtime validator. + */ + protected void setUp() { + originalClassLoader = Thread.currentThread().getContextClassLoader(); + ClassLoader cl = originalClassLoader; + if (cl == null) cl = ClassLoader.getSystemClassLoader(); + context = new ValidationContext(cl, Stable.class, + Flexotask.class, AtomicFlexotask.class, AtomicException.class, + ExternalMethods.class); + } + + /** + * Causes for teardown and setup to occur + */ + protected void reset() { + tearDown(); + setUp(); + } + + protected void tearDown() { + Thread.currentThread().setContextClassLoader(originalClassLoader); + context = null; + validator = null; + } + + /** + * Returns a set of class objects, representing the class objects of the + * classes having the names provided in the array. + * @param classNames names as an array of strings + * @return names as a Set of classes + * @throws ClassNotFoundException + */ + private Set getFlexotaskClasses(String[] classNames) throws ClassNotFoundException { + Set flexotaskClasses = new HashSet(); + for (int i = 0; i < classNames.length; i++) { + flexotaskClasses.add(context.getClassLoader().loadClass(classNames[i])); + } + return flexotaskClasses; + } + + /** + * Get the flexotask classes named in a template + * @param template the template + * @return the set of classes named therein + * @throws ClassNotFoundException + */ + private Set getFlexotaskClasses(FlexotaskTemplate template) throws ClassNotFoundException { + Set flexotaskClasses = new HashSet(); + for (Iterator j = template.getTasks().iterator(); j.hasNext(); ) { + FlexotaskTaskTemplate taskTmpl = (FlexotaskTaskTemplate) j.next(); + System.out.println("file: " + context); + System.out.println("file: " + context.getClassLoader()); + Class clazz = context.getClassLoader().loadClass(taskTmpl.getImplementationClass()); + flexotaskClasses.add(clazz); + } + return flexotaskClasses; + } + + /** + * Do validation on a set of class names and a set of stable classes, using manual mode + * @param classNames the class names + * @param manualStableClasses the stable classes + * @return a CodeAnalysisResult + * @throws ClassNotFoundException + * @throws FlexotaskValidationException + */ + protected final CodeAnalysisResult doValidation(String[] classNames, String[] manualStableClasses) + throws ClassNotFoundException, FlexotaskValidationException + { + Set flexotaskClasses = getFlexotaskClasses(classNames); + validator = new TestDevtimeCodeValidator(context); + validator.setStableMode(FlexotaskStableMode.MANUAL); + validator.setStableClasses(manualStableClasses); + return validator.validate(new NullProgressMonitor(), flexotaskClasses); + } + + /** + * Do validation on a set of class names using a particular stable mode. If the mode is manual, the manual + * class list is the same as the class names + * @param classNames the class names + * @param mode the stable mode + * @return a CodeAnalysisResult + * @throws ClassNotFoundException + * @throws FlexotaskValidationException + */ + protected final CodeAnalysisResult doValidation(String[] classNames, FlexotaskStableMode mode) + throws ClassNotFoundException, FlexotaskValidationException + { + Set flexotaskClasses = getFlexotaskClasses(classNames); + validator = new TestDevtimeCodeValidator(context); + validator.setStableMode(mode); + if (mode == FlexotaskStableMode.MANUAL) + validator.setStableClasses(classNames); + return validator.validate(new NullProgressMonitor(), flexotaskClasses); + } + + /** + * Do validation on a template + * @param template the template to validate + * @return a CodeAnalysisResult + * @throws ClassNotFoundException + * @throws FlexotaskValidationException + */ + protected final CodeAnalysisResult doValidation(FlexotaskTemplate template) throws ClassNotFoundException, FlexotaskValidationException { + Set flexotaskClasses = getFlexotaskClasses(template); + validator = new TestDevtimeCodeValidator(context, template); + return validator.validate(new NullProgressMonitor(), flexotaskClasses); + } +} Property changes on: trunk/flexotask-devtest/src/base/DevtimeCheckerTestCase.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-devtest/src/base/RewriterTestCase.java =================================================================== --- trunk/flexotask-devtest/src/base/RewriterTestCase.java (rev 0) +++ trunk/flexotask-devtest/src/base/RewriterTestCase.java 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,120 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package base; + +import java.io.File; +import java.io.FileOutputStream; +import java.util.Iterator; + +import org.eclipse.core.runtime.NullProgressMonitor; + +import com.ibm.realtime.flexotask.development.rewriting.CodeRewriteResult; +import com.ibm.realtime.flexotask.development.rewriting.RewrittenClass; +import com.ibm.realtime.flexotask.development.rewriting.TestCodeRewriter; +import com.ibm.realtime.flexotask.development.validation.CodeAnalysisResult; +import com.ibm.realtime.flexotask.template.FlexotaskStableMode; +import com.ibm.realtime.flexotask.template.FlexotaskTemplate; + +/** + * Base class for doing testing of the code rewriter. + */ +public abstract class RewriterTestCase extends DevtimeCheckerTestCase { + /** The code rewriter used for the test */ + protected TestCodeRewriter rewriter; + + protected void setUp() { + super.setUp(); + File genFolder = new File("generated"); + //if (genFolder.exists() && !delDirectory(genFolder)) { + // fail("Could not empty output folder for generated files."); + //} + } + + /** + * Deletes the contents of the directory provided, except the CVS directory + * @param dir + * @param delete + * @return + */ + private boolean delDirectory(File dir) { + if (dir.exists() && dir.isDirectory()) { + String[] children = dir.list(); + for (int i=0; i < children.length; i++) { + boolean success = delDirectory(new File(dir, children[i])); + if (!success) { + return false; + } + } + } + return dir.delete(); + } + + /** + * Do rewriting following a validation based on the flexotask classes, whose + * names are provided in the string array. + * + * @param classNames + * @return + * @throws Exception + */ + protected final CodeRewriteResult doRewriting(String[] classNames, FlexotaskStableMode mode) + throws Exception { + CodeAnalysisResult result = doValidation(classNames, mode); + rewriter = new TestCodeRewriter(context, result); + return rewriter.rewrite(new NullProgressMonitor()); + } + + protected final CodeRewriteResult doRewriting(FlexotaskTemplate template) + throws Exception { + CodeAnalysisResult result = doValidation(template); + rewriter = new TestCodeRewriter(context, result); + CodeRewriteResult res = rewriter.rewrite(new NullProgressMonitor()); + persistClasses(res); + return res; + } + + /** + * Persist the rewritten classes into the 'generated' output directory + * @param result + * @throws Exception + */ + protected void persistClasses(CodeRewriteResult result) throws Exception { + File genFolder = new File("generated"); + if (!genFolder.exists() && !genFolder.mkdir()) + throw new Exception("Output directory for generated files does not exist and could not be created."); + // loop through the rewritten classes and persist them + for (Iterator j = result.getRewrittenClasses().iterator(); j.hasNext(); ) { + RewrittenClass rc = (RewrittenClass) j.next(); + // create output path for rewritten class + String packageName = rc.getJavaClassName(); + packageName = packageName.substring(0, packageName.lastIndexOf('.') > 0 ? packageName.lastIndexOf('.') : 0); + + File packagePath = new File(genFolder, packageName.replace('.', File.separatorChar)); + if (!packagePath.exists()) + packagePath.mkdirs(); + + String filename = rc.getJavaClassName() + ".class"; + int pathNameLength = (int) packageName.length() + (packageName.length() > 0 ? 1 : 0); + filename = filename.substring(pathNameLength, filename.length()); + + File f = new File(packagePath, filename); + if (f.exists()) + f.delete(); + FileOutputStream baos = new FileOutputStream(f); + + rc.writeToStream(baos); + baos.flush(); + } + } +} Property changes on: trunk/flexotask-devtest/src/base/RewriterTestCase.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/rewriting/TestCodeRewriter.java =================================================================== --- trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/rewriting/TestCodeRewriter.java (rev 0) +++ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/rewriting/TestCodeRewriter.java 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,44 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.development.rewriting; + +import com.ibm.realtime.flexotask.development.builder.BuildException; +import com.ibm.realtime.flexotask.development.validation.CodeAnalysisResult; +import com.ibm.realtime.flexotask.validation.ValidationContext; + +/** + * Extends the rewriter to enable checking of internal state. + */ +public class TestCodeRewriter extends CodeRewriter { + /** The validation context used for the rewriting */ + private ValidationContext context; + + public TestCodeRewriter(ValidationContext context, + CodeAnalysisResult analysisResult) throws BuildException { + super(context, analysisResult); + this.context = context; + } + + /** + * Returns true if the list of generated guard classes contains a guard class + * for the class having the provided name, otherwise false. + * @param className + * @return + * @throws Exception + */ + public boolean hasGuardForClass(String className) throws Exception { + Class c = context.getClassLoader().loadClass(className); + return guardClasses.containsKey(c); + } +} Property changes on: trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/rewriting/TestCodeRewriter.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/validation/TestDevtimeCodeValidator.java =================================================================== --- trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/validation/TestDevtimeCodeValidator.java (rev 0) +++ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/validation/TestDevtimeCodeValidator.java 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,70 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.development.validation; + +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.runtime.IProgressMonitor; + +import com.ibm.realtime.flexotask.template.FlexotaskStableMode; +import com.ibm.realtime.flexotask.template.FlexotaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskValidationException; +import com.ibm.realtime.flexotask.validation.ValidationContext; + +/** + * Extends the devtime code validator to enable checking of internal state. + */ +public class TestDevtimeCodeValidator extends DevtimeCodeValidator { + public TestDevtimeCodeValidator(ValidationContext context) { + super(context); + } + + public TestDevtimeCodeValidator(ValidationContext context, FlexotaskTemplate template) + throws FlexotaskValidationException { + super(context, template); + } + + public CodeAnalysisResult validate(IProgressMonitor monitor, + Set flexotaskClasses) throws FlexotaskValidationException { + return super.validate(monitor, flexotaskClasses); + } + + public void setStableMode(FlexotaskStableMode sm) { + stableMode = sm; + } + + /** + * Returns true if the class with the provided class name is contained in the + * provided set, otherwise false. Used to test if devtime checker has found + * the expected classes and put them into the right categories. + * @param set + * @param className + * @return + * @throws Exception + */ + public boolean isClassContainedInSet(Set set, String className) + throws Exception { + Class c = context.getClassLoader().loadClass(className); + return set.contains(c); + } + + public void setStableClasses(String[] classNames) throws ClassNotFoundException { + Set sClasses = new HashSet(); + for (int i = 0; i < classNames.length; i++) { + sClasses.add(Class.forName(classNames[i])); + } + this.stableClasses = sClasses; + } +} Property changes on: trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/development/validation/TestDevtimeCodeValidator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/system/TestCodeValidator.java =================================================================== --- trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/system/TestCodeValidator.java (rev 0) +++ trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/system/TestCodeValidator.java 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,43 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.system; + +import java.util.Map; + +import com.ibm.realtime.flexotask.distribution.FlexotaskDistributer; +import com.ibm.realtime.flexotask.template.FlexotaskStableMode; +import com.ibm.realtime.flexotask.template.FlexotaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskValidationException; + +/** + * Extends the inittime code validator to enable checking of internal state. + */ +public class TestCodeValidator extends CodeValidator { + public TestCodeValidator(FlexotaskTemplate template) + throws FlexotaskValidationException { + super(template); + } + + public Object[] validate(Map initializationMap) throws FlexotaskValidationException { + return super.validate(initializationMap, new FlexotaskDistributer.LocalTimerService()); + } + + /** + * Used to set the stable mode, when checking orphan flexotasks + * @param mode the stable mode + */ + public void setStableMode(FlexotaskStableMode mode) { + stableMode = mode; + } +} Property changes on: trunk/flexotask-devtest/src/com/ibm/realtime/flexotask/system/TestCodeValidator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-devtest/src/testall/AllDevtimeCheckerTests.java =================================================================== --- trunk/flexotask-devtest/src/testall/AllDevtimeCheckerTests.java (rev 0) +++ trunk/flexotask-devtest/src/testall/AllDevtimeCheckerTests.java 2008-10-27 16:15:09 UTC (rev 43) @@ -0,0 +1,27 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexota... [truncated message content] |
From: <jsa...@us...> - 2008-10-27 16:12:55
|
Revision: 42 http://flexotask.svn.sourceforge.net/flexotask/?rev=42&view=rev Author: jsauerbach Date: 2008-10-27 16:12:42 +0000 (Mon, 27 Oct 2008) Log Message: ----------- Initial import. Added Paths: ----------- trunk/flexotask-devtest/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-26 15:13:39
|
Revision: 41 http://flexotask.svn.sourceforge.net/flexotask/?rev=41&view=rev Author: jsauerbach Date: 2008-10-26 15:13:36 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Fix version number on dependency Modified Paths: -------------- trunk/flexotask-tuningfork-feature/feature.xml Modified: trunk/flexotask-tuningfork-feature/feature.xml =================================================================== --- trunk/flexotask-tuningfork-feature/feature.xml 2008-10-26 15:13:22 UTC (rev 40) +++ trunk/flexotask-tuningfork-feature/feature.xml 2008-10-26 15:13:36 UTC (rev 41) @@ -32,7 +32,7 @@ <import plugin="com.ibm.realtime.flexotask"/> <import plugin="com.ibm.tuningfork.traceGeneration.vianative"/> <import plugin="com.ibm.realtime.analysis"/> - <import feature="com.ibm.realtime.flexotask.feature" version="1.1.0"/> + <import feature="com.ibm.realtime.flexotask.feature" version="2.0.0" match="greaterOrEqual"/> <import plugin="com.ibm.realtime.flexotask.editor"/> <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.jdt.core"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-26 15:13:26
|
Revision: 40 http://flexotask.svn.sourceforge.net/flexotask/?rev=40&view=rev Author: jsauerbach Date: 2008-10-26 15:13:22 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Fix typo that caused runtime provider zip to be omitted Modified Paths: -------------- trunk/flexotask-editor/build.properties Modified: trunk/flexotask-editor/build.properties =================================================================== --- trunk/flexotask-editor/build.properties 2008-10-26 15:12:56 UTC (rev 39) +++ trunk/flexotask-editor/build.properties 2008-10-26 15:13:22 UTC (rev 40) @@ -3,7 +3,7 @@ task16.gif,\ flexotaskEditor.jar,\ doc.zip,\ - flexotask-toc.xml \ + flexotask-toc.xml, \ openRuntimeProvider.zip source.flexotaskEditor.jar = src/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-26 15:13:00
|
Revision: 39 http://flexotask.svn.sourceforge.net/flexotask/?rev=39&view=rev Author: jsauerbach Date: 2008-10-26 15:12:56 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Fix bug that caused exports from zip sources to be truncated to one byte. Improve usefulness of progress monitor somewhat. Modified Paths: -------------- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java Modified: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java =================================================================== --- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java 2008-10-26 11:00:40 UTC (rev 38) +++ trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java 2008-10-26 15:12:56 UTC (rev 39) @@ -103,7 +103,6 @@ return false; } } - final Shell shell = getShell(); final boolean isDirectory = page.isDirectory(); WorkspaceModifyOperation op = new WorkspaceModifyOperation() { protected void execute(IProgressMonitor monitor) throws CoreException, @@ -113,7 +112,7 @@ if (destination.exists()) { if (!deleteDestination(destination)) { monitor.worked(100); - MessageDialog.openError(shell, "Could not delete", destination.getAbsolutePath() + " could not be deleted"); + MessageDialog.openError(getShell(), "Could not delete", destination.getAbsolutePath() + " could not be deleted"); return; } } @@ -121,13 +120,13 @@ if (monitor.isCanceled()) { return; } - exportRuntime(shell, destination, isDirectory, monitor); + exportRuntime(getShell(), destination, isDirectory, monitor); } }; try { - getContainer().run(false, true, op); + getContainer().run(true, true, op); } catch (Throwable e) { - handleException(shell, e); + handleException(getShell(), e); } return true; } @@ -178,7 +177,7 @@ //MessageDialog.openInformation(shell, "", "Processing runtime provider: " + runtimeProvider.getClass().getName()); ZipFile contribution = new ZipFile(runtimeProvider.contribute()); if (contribution != null) { - output = transferZipFile(contribution, controller, output); + output = transferZipFile(contribution, controller, output, monitor); } if (monitor.isCanceled()) { return false; @@ -187,6 +186,7 @@ } /* Add the standard contributions from the analysis and flexotask plugins */ //MessageDialog.openInformation(shell, "", "Adding standard java libraries"); + monitor.subTask("flexotask.jar"); output = transferFile(getBestAvailableJar(FlexotaskClasspathInitializer.FLEXOTASK_PLUGIN, "flexotask.jar"), controller, output, "lib/flexotask.jar"); if (monitor.isCanceled()) { @@ -194,6 +194,7 @@ } monitor.worked(units); //MessageDialog.openInformation(shell, "", "flexotask.jar added"); + monitor.subTask("realtimeAnalysis.jar"); output = transferFile(getBestAvailableJar(FlexotaskClasspathInitializer.ANALYSIS_PLUGIN, "realtimeAnalysis.jar"), controller, output, "lib/realtimeAnalysis.jar"); if (monitor.isCanceled()) { @@ -225,6 +226,7 @@ throw new IllegalStateException("Unexpected classpath entry type during export: " + classpathEntry); } //MessageDialog.openInformation(shell, "", "transferring " + toTransfer.getAbsolutePath() + " to " + transferName); + monitor.subTask(transferName); output = transferFile(toTransfer, controller, output, "lib/ext/" + transferName); if (monitor.isCanceled()) { return false; @@ -333,12 +335,13 @@ ExportController controller, OutputStream output, String targetName) throws IOException, CoreException { InputStream input = new FileInputStream(file); - return transferStream(input, controller, output, targetName, 0); + return transferStream(input, input.available(), controller, output, targetName, 0); } /** * Transfer an input stream to the destination * @param input the input stream to transfer + * @param length the length of the input stream * @param controller the ExportController for the destination * @param output the OutputStream from the previous export step or null if this is the first step * @param targetName the name that the logical file should have in the destination @@ -347,12 +350,11 @@ * @throws IOException * @throws CoreException */ - private static OutputStream transferStream(InputStream input, - ExportController controller, OutputStream output, String targetName, int mode) - throws IOException, CoreException + private static OutputStream transferStream(InputStream input, int length, ExportController controller, + OutputStream output, String targetName, int mode) throws IOException, CoreException { output = controller.getOutputStream(output, targetName, mode); - int remaining = input.available(); + int remaining = length; byte[] buffer; if (remaining > BUFFER_THRESHHOLD) { buffer = new byte[BUFFER_THRESHHOLD]; @@ -374,12 +376,13 @@ * @param zipFile the zip file to transfer * @param controller the ExportController for the destination * @param output the OutputStream from the previous export step or null if this is the first step + * @param monitor progress monitor on which to report subtasks * @return the last OutputStream that was used for this export step * @throws IOException * @throws CoreException */ - private static OutputStream transferZipFile(ZipFile zipFile, - ExportController controller, OutputStream output) throws IOException, CoreException + private static OutputStream transferZipFile(ZipFile zipFile, ExportController controller, + OutputStream output, IProgressMonitor monitor) throws IOException, CoreException { Enumeration<?> entries = zipFile.getEntries(); while (entries.hasMoreElements()) { @@ -387,9 +390,10 @@ if (entry.isDirectory()) { continue; } + monitor.subTask(entry.getName()); int mode = entry.getUnixMode(); InputStream input = zipFile.getInputStream(entry); - output = transferStream(input, controller, output, entry.getName(), mode); + output = transferStream(input, (int) entry.getSize(), controller, output, entry.getName(), mode); } return output; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-26 11:26:23
|
Revision: 36 http://flexotask.svn.sourceforge.net/flexotask/?rev=36&view=rev Author: jsauerbach Date: 2008-10-26 10:54:47 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Initial import. Added Paths: ----------- trunk/flexotask-functiontest/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-26 11:05:01
|
Revision: 38 http://flexotask.svn.sourceforge.net/flexotask/?rev=38&view=rev Author: jsauerbach Date: 2008-10-26 11:00:40 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Add RuntimeProvider interface and an OpenRuntimeProvider to include the open source natives. There will be at least an IBM runtime provider to provide the WebSphere Real Time J9 natives but this will not be distributed via sourceforge. Modified Paths: -------------- trunk/flexotask-editor/META-INF/MANIFEST.MF trunk/flexotask-editor/build.properties trunk/flexotask-editor/plugin.xml trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/EEditPlugin.java trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/FlexotaskClasspathInitializer.java Added Paths: ----------- trunk/flexotask-editor/openRuntime-build.xml trunk/flexotask-editor/schema/RuntimeProvider.exsd trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/OpenRuntimeProvider.java trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizardPage.java trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeProvider.java Modified: trunk/flexotask-editor/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask-editor/META-INF/MANIFEST.MF 2008-10-26 10:58:00 UTC (rev 37) +++ trunk/flexotask-editor/META-INF/MANIFEST.MF 2008-10-26 11:00:40 UTC (rev 38) @@ -24,5 +24,7 @@ org.eclipse.jdt.ui, org.eclipse.jdt.core, org.eclipse.ant.core, - org.eclipse.pde.core + org.eclipse.pde.core, + org.apache.ant, + org.eclipse.core.filesystem Eclipse-LazyStart: true Modified: trunk/flexotask-editor/build.properties =================================================================== --- trunk/flexotask-editor/build.properties 2008-10-26 10:58:00 UTC (rev 37) +++ trunk/flexotask-editor/build.properties 2008-10-26 11:00:40 UTC (rev 38) @@ -3,7 +3,8 @@ task16.gif,\ flexotaskEditor.jar,\ doc.zip,\ - flexotask-toc.xml + flexotask-toc.xml \ + openRuntimeProvider.zip source.flexotaskEditor.jar = src/ Added: trunk/flexotask-editor/openRuntime-build.xml =================================================================== --- trunk/flexotask-editor/openRuntime-build.xml (rev 0) +++ trunk/flexotask-editor/openRuntime-build.xml 2008-10-26 11:00:40 UTC (rev 38) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project default="build-runtime"> + <!-- To rebuild the standard openRuntimeProvider.zip, you must have a directory + (mounted from a linux machine, unless this is a linux machine) where the following can be found: + flexotask/native/libflexotaskUtil.so + JavaTraceGenerationLibrary/native/libTuningForkNativeTraceSupport.so + JavaTraceGenerationViaNative/native/libTuningForkNativeBridge.so + The name of that directory must be in the ant property open-runtime-directory --> + <target name="build-runtime"> + <fail message="open-runtime-directory property not specified" unless="open-runtime-directory"/> + <property name="flexotask-util" value="libflexotaskUtil.so"/> + <property name="full-flexotask-util" value="${open-runtime-directory}/flexotask/native/${flexotask-util}"/> + <property name="tf-std" value="libTuningForkNativeTraceSupport.so"/> + <property name="full-tf-std" value="${open-runtime-directory}/JavaTraceGenerationLibrary/native/${tf-std}"/> + <property name="tf-native" value="libTuningForkNativeBridge.so"/> + <property name="full-tf-native" value="${open-runtime-directory}/JavaTraceGenerationViaNative/native/${tf-native}"/> + <fail message="${flexotask-util} so not found"> + <condition><not><available file="${full-flexotask-util}"/></not></condition> + </fail> + <fail message="${tf-std} not found"> + <condition><not><available file="${full-tf-std}"/></not></condition> + </fail> + <fail message="${tf-native} not found"> + <condition><not><available file="${full-tf-native}"/></not></condition> + </fail> + <delete file="openRuntimeProvider.zip"/> + <zip destfile="openRuntimeProvider.zip"> + <zipfileset filemode="775" file="${full-flexotask-util}" fullpath="bin/common/${flexotask-util}"/> + <zipfileset filemode="775" file="${full-tf-std}" fullpath="bin/common/${tf-std}"/> + <zipfileset filemode="775" file="${full-flexotask-util}" fullpath="bin/common/${tf-native}"/> + </zip> + </target> +</project> \ No newline at end of file Property changes on: trunk/flexotask-editor/openRuntime-build.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Modified: trunk/flexotask-editor/plugin.xml =================================================================== --- trunk/flexotask-editor/plugin.xml 2008-10-26 10:58:00 UTC (rev 37) +++ trunk/flexotask-editor/plugin.xml 2008-10-26 11:00:40 UTC (rev 38) @@ -3,6 +3,7 @@ <plugin> <extension-point id="TimingGrammar" name="Timing Grammar Provider" schema="schema/TimingGrammar.exsd"/> <extension-point id="Libraries" name="Additional Libraries for Flexotask Classpath Container" schema="schema/Libraries.exsd"/> + <extension-point id="RuntimeProvider" name="Runtime Binary Files Provider" schema="schema/RuntimeProvider.exsd"/> <extension point="org.eclipse.ui.editors"> <editor name="Flexotask Editor" @@ -70,4 +71,24 @@ class="com.ibm.realtime.flexotask.editor.timing.simple.SimpleMultiModeGrammarProvider" kind="simple (multi-mode)"/> </extension> + <extension + point="org.eclipse.ui.exportWizards"> + <category + id="com.ibm.realtime.flexotask" + name="Flexotask"> + </category> + <wizard + category="com.ibm.realtime.flexotask" + class="com.ibm.realtime.flexotask.editor.dialogs.RuntimeExportWizard" + icon="task16.gif" + id="com.ibm.realtime.flexotask.exportRuntime" + name="Flexotask Runtime"> + </wizard> + </extension> + <extension + point="com.ibm.realtime.flexotask.editor.RuntimeProvider"> + <handler + class="com.ibm.realtime.flexotask.editor.dialogs.OpenRuntimeProvider"> + </handler> + </extension> </plugin> Added: trunk/flexotask-editor/schema/RuntimeProvider.exsd =================================================================== --- trunk/flexotask-editor/schema/RuntimeProvider.exsd (rev 0) +++ trunk/flexotask-editor/schema/RuntimeProvider.exsd 2008-10-26 11:00:40 UTC (rev 38) @@ -0,0 +1,105 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="com.ibm.realtime.flexotask.editor"> +<annotation> + <appInfo> + <meta.schema plugin="com.ibm.realtime.flexotask.editor" id="RuntimeProvider" name="Runtime Binary Files Provider"/> + </appInfo> + <documentation> + [Enter description of this extension point.] + </documentation> + </annotation> + + <element name="extension"> + <complexType> + <sequence> + <element ref="handler"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appInfo> + <meta.attribute translatable="true"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="handler"> + <complexType> + <attribute name="class" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appInfo> + <meta.attribute kind="java" basedOn=":com.ibm.realtime.flexotask.editor.dialogs.RuntimeProvider"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appInfo> + <meta.section type="since"/> + </appInfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="examples"/> + </appInfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="apiInfo"/> + </appInfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="implementation"/> + </appInfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="copyright"/> + </appInfo> + <documentation> + + </documentation> + </annotation> + +</schema> Modified: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/EEditPlugin.java =================================================================== --- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/EEditPlugin.java 2008-10-26 10:58:00 UTC (rev 37) +++ trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/EEditPlugin.java 2008-10-26 11:00:40 UTC (rev 38) @@ -16,14 +16,14 @@ /******************************************************************************* * GEF Examples * Copyright (c) 2004, 2005 Elias Volanakis and others. -\xA0* All rights reserved. This program and the accompanying materials -\xA0* are made available under the terms of the Eclipse Public License v1.0 -\xA0* which accompanies this distribution, and is available at -\xA0* http://www.eclipse.org/legal/epl-v10.html -\xA0* -\xA0* Contributors: -\xA0*\xA0\xA0\xA0\xA0Elias Volanakis - initial API and implementation -\xA0*******************************************************************************/ + \xA0* All rights reserved. This program and the accompanying materials + \xA0* are made available under the terms of the Eclipse Public License v1.0 + \xA0* which accompanies this distribution, and is available at + \xA0* http://www.eclipse.org/legal/epl-v10.html + \xA0* + \xA0* Contributors: + \xA0*\xA0\xA0\xA0\xA0Elias Volanakis - initial API and implementation + \xA0*******************************************************************************/ package com.ibm.realtime.flexotask.editor; import org.eclipse.ui.plugin.AbstractUIPlugin; @@ -34,28 +34,34 @@ * This instance can be shared between all extensions in the plugin. Information * shared between extensions can be persisted by using the PreferenceStore. * </p> + * * @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore() * @author Elias Volanakis */ -public class EEditPlugin extends AbstractUIPlugin { +public class EEditPlugin extends AbstractUIPlugin +{ + /** ID of this plugin */ + public final static String ID = "com.ibm.realtime.flexotask.editor"; -/** Single plugin instance. */ -private static EEditPlugin singleton; + /** Single plugin instance. */ + private static EEditPlugin singleton; -/** - * Returns the shared plugin instance. - */ -public static EEditPlugin getDefault() { - return singleton; -} + /** + * Returns the shared plugin instance. + */ + public static EEditPlugin getDefault() + { + return singleton; + } -/** - * The constructor. - */ -public EEditPlugin() { - if (singleton == null) { - singleton = this; - } -} + /** + * The constructor. + */ + public EEditPlugin() + { + if (singleton == null) { + singleton = this; + } + } } Modified: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/FlexotaskClasspathInitializer.java =================================================================== --- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/FlexotaskClasspathInitializer.java 2008-10-26 10:58:00 UTC (rev 37) +++ trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/FlexotaskClasspathInitializer.java 2008-10-26 11:00:40 UTC (rev 38) @@ -54,9 +54,12 @@ /** The id of the flexotask generic plugin and hence its bundle */ public final static String FLEXOTASK_GENERIC_PLUGIN = "com.ibm.realtime.flexotask.generic"; + /** File that is used as the debugging assistance file (built by all flexotask projects that may be put in a classpath container) */ + public static final String DEBUG_FILE = "debug.zip"; + /** The local file name suffix to use for source attachments, when present */ private final static String SRC_NAME = "src.zip"; - + /** Special flag to allow the mechanism for running under a debugger itself to be debugged */ private static final boolean DEBUG_DEBUGGING = Boolean.valueOf(System.getProperty("FLEXOTASK_DEBUG_DEBUGGING")); @@ -125,7 +128,7 @@ */ File possibleProj = new File(altLocation); if (possibleProj.isDirectory()) { - File possibleZip = new File(possibleProj, "debug.zip"); + File possibleZip = new File(possibleProj, DEBUG_FILE); if (possibleZip.exists() && possibleZip.isFile()) { IPath zip = new Path(possibleZip.getAbsolutePath()); accumulator.add(JavaCore.newLibraryEntry(zip, zip, null)); Added: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/OpenRuntimeProvider.java =================================================================== --- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/OpenRuntimeProvider.java (rev 0) +++ trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/OpenRuntimeProvider.java 2008-10-26 11:00:40 UTC (rev 38) @@ -0,0 +1,48 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.editor.dialogs; + +import java.io.File; +import java.io.IOException; +import java.net.URL; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Platform; +import org.osgi.framework.Bundle; + +import com.ibm.realtime.flexotask.editor.EEditPlugin; + +/** + * RuntimeProvider providing just the things that are available in open source. + */ +public class OpenRuntimeProvider implements RuntimeProvider +{ + /* (non-Javadoc) + * @see com.ibm.realtime.flexotask.editor.dialogs.RuntimeProvider#contribute() + */ + public String contribute() + { + Bundle bundle = Platform.getBundle(EEditPlugin.ID); + URL entryURL = bundle.getEntry("/"); + try { + entryURL = FileLocator.toFileURL(entryURL); + File zipFile = new File(entryURL.getPath(), "openRuntimeProvider.zip").getAbsoluteFile(); + if (zipFile.exists()) { + return zipFile.getAbsolutePath(); + } + } catch (IOException e) { + } + return null; + } +} Property changes on: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/OpenRuntimeProvider.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java =================================================================== --- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java (rev 0) +++ trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java 2008-10-26 11:00:40 UTC (rev 38) @@ -0,0 +1,493 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.editor.dialogs; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; + +import org.apache.tools.zip.ZipEntry; +import org.apache.tools.zip.ZipFile; +import org.apache.tools.zip.ZipOutputStream; +import org.eclipse.core.filesystem.EFS; +import org.eclipse.core.filesystem.IFileInfo; +import org.eclipse.core.filesystem.IFileStore; +import org.eclipse.core.filesystem.IFileSystem; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IExtensionRegistry; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; +import org.eclipse.jdt.core.IClasspathEntry; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IExportWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.actions.WorkspaceModifyOperation; + +import com.ibm.realtime.flexotask.editor.EEditPlugin; +import com.ibm.realtime.flexotask.editor.FlexotaskClasspathInitializer; +import com.ibm.realtime.flexotask.editor.model.GlobalTiming; + +/** + * Export a Flexotask Runtime based contributed libraries, including a special NativeRuntime provider + */ +public class RuntimeExportWizard extends Wizard implements IExportWizard +{ + /** The array of RuntimeProviders configured in this Eclipse instance */ + private static RuntimeProvider[] runtimeProviders; + + /** The extension-point id for RuntimeProviders */ + private static final String RUNTIME_PROVIDER_EXTENSION = "com.ibm.realtime.flexotask.editor.RuntimeProvider"; + + /** Maximum size of a data transfer buffer */ + private static final int BUFFER_THRESHHOLD = 1024 * 1024; + + /** The one page of this wizard */ + RuntimeExportWizardPage page; + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.Wizard#addPages() + */ + public void addPages() + { + page = new RuntimeExportWizardPage(); + addPage(page); + } + + /* (non-Javadoc) + * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) + */ + public void init(IWorkbench workbench, IStructuredSelection selection) { + setNeedsProgressMonitor(true); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.wizard.Wizard#performFinish() + */ + public boolean performFinish() + { + final File destination = page.getDestination(); + page.saveSettings(); + if (destination.exists()) { + if (!page.shouldOverwrite() && !MessageDialog.openConfirm(getShell(), + "Should overwrite?", destination.getAbsolutePath() + " exists. Replace with new contents?")) { + return false; + } + } + final Shell shell = getShell(); + final boolean isDirectory = page.isDirectory(); + WorkspaceModifyOperation op = new WorkspaceModifyOperation() { + protected void execute(IProgressMonitor monitor) throws CoreException, + InvocationTargetException, InterruptedException + { + monitor.beginTask("Exporting Runtime", 100); + if (destination.exists()) { + if (!deleteDestination(destination)) { + monitor.worked(100); + MessageDialog.openError(shell, "Could not delete", destination.getAbsolutePath() + " could not be deleted"); + return; + } + } + monitor.worked(10); + if (monitor.isCanceled()) { + return; + } + exportRuntime(shell, destination, isDirectory, monitor); + } + }; + try { + getContainer().run(false, true, op); + } catch (Throwable e) { + handleException(shell, e); + } + return true; + } + + /** + * Remove a destination file or directory if possible + * @param destination the file or directory to remove + * @return true if removal was successful, false on error + */ + private boolean deleteDestination(File destination) { + if (!destination.canWrite()) { + return false; + } + if (destination.isFile()) { + return destination.delete(); + } + File[] children = destination.listFiles(); + for (int i = 0; i < children.length; i++) { + if (!deleteDestination(children[i])) { + return false; + } + } + return destination.delete(); + } + + /** + * Export a runtime for use in a real-time VM. At entry the destination is guaranteed not to exist + * @param shell the shell to use for any error messages or prompts + * @param destination the destination of the export + * @param isDirectory true if the export should be to a directory, false if to a zip file + * @param monitor the progress monitor to report progress + * @return true iff the export was successful, false otherwise (diagnostic will have been issued) + */ + public static boolean exportRuntime(Shell shell, File destination, boolean isDirectory, IProgressMonitor monitor) { + OutputStream output = null; + //MessageDialog.openInformation(shell, "", "Export started"); + /* Try block catches all stray exceptions, particularly IOExceptions */ + try { + ExportController controller = isDirectory ? new DirectoryExportController(destination) : new ZipFileExportController(destination); + /* Compute work units per operation on the assumption that there are a total of 90 */ + RuntimeProvider[] providers = getRuntimeProviders(); + List<IClasspathEntry> accumulator = new ArrayList<IClasspathEntry>(); + GlobalTiming.addToClasspath(accumulator); + int units = providers.length + accumulator.size() + 2; + units = (int) (90.0 / units); + /* Add contributions of all runtime providers */ + for (RuntimeProvider runtimeProvider : providers) { + //MessageDialog.openInformation(shell, "", "Processing runtime provider: " + runtimeProvider.getClass().getName()); + ZipFile contribution = new ZipFile(runtimeProvider.contribute()); + if (contribution != null) { + output = transferZipFile(contribution, controller, output); + } + if (monitor.isCanceled()) { + return false; + } + monitor.worked(units); + } + /* Add the standard contributions from the analysis and flexotask plugins */ + //MessageDialog.openInformation(shell, "", "Adding standard java libraries"); + output = transferFile(getBestAvailableJar(FlexotaskClasspathInitializer.FLEXOTASK_PLUGIN, "flexotask.jar"), + controller, output, "lib/flexotask.jar"); + if (monitor.isCanceled()) { + return false; + } + monitor.worked(units); + //MessageDialog.openInformation(shell, "", "flexotask.jar added"); + output = transferFile(getBestAvailableJar(FlexotaskClasspathInitializer.ANALYSIS_PLUGIN, "realtimeAnalysis.jar"), + controller, output, "lib/realtimeAnalysis.jar"); + if (monitor.isCanceled()) { + return false; + } + monitor.worked(units); + //MessageDialog.openInformation(shell, "", "realtimeAnalysis.jar added"); + /* Add optional libraries identified by library providers */ + //MessageDialog.openInformation(shell, "", "Adding optional libraries"); + for (IClasspathEntry classpathEntry : accumulator) { + File toTransfer; + String transferName; + IPath path = classpathEntry.getPath(); + switch (classpathEntry.getEntryKind()) { + case IClasspathEntry.CPE_LIBRARY: + transferName = path.lastSegment(); + if (FlexotaskClasspathInitializer.DEBUG_FILE.equals(transferName)) { + transferName = path.removeLastSegments(1).lastSegment() + ".jar"; + } + toTransfer = new File(path.toString()); + break; + case IClasspathEntry.CPE_PROJECT: + transferName = path.lastSegment() + ".jar"; + IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(classpathEntry.getPath().toString()); + File location = project.getLocation().toFile(); + toTransfer = new File(location, FlexotaskClasspathInitializer.DEBUG_FILE); + break; + default: + throw new IllegalStateException("Unexpected classpath entry type during export: " + classpathEntry); + } + //MessageDialog.openInformation(shell, "", "transferring " + toTransfer.getAbsolutePath() + " to " + transferName); + output = transferFile(toTransfer, controller, output, "lib/ext/" + transferName); + if (monitor.isCanceled()) { + return false; + } + monitor.worked(units); + } + output.close(); + //MessageDialog.openInformation(shell, "", "Export complete"); + return true; + } catch (Throwable e) { + handleException(shell, e); + return false; + } + } + + /** + * Find the best available copy of a standard jar for a plugin, either from the plugin itself, or from the "debug.zip" of its + * project + * @param pluginID the ID of the plugin + * @param jarToFind the name of the jar to find there + * @return the best available copy of jar + * @throws CoreException if thrown by the addPluginClasspath utility + * @throws IllegalStateException if no suitable copy could be found + */ + private static File getBestAvailableJar(String pluginID, String jarToFind) throws CoreException + { + List<IClasspathEntry> accumulator = new ArrayList<IClasspathEntry>(); + FlexotaskClasspathInitializer.addPluginClasspath(accumulator, pluginID); + for (IClasspathEntry classpathEntry : accumulator) { + switch (classpathEntry.getEntryKind()) { + case IClasspathEntry.CPE_LIBRARY: + IPath path = classpathEntry.getPath(); + if (jarToFind.equals(path.lastSegment()) || FlexotaskClasspathInitializer.DEBUG_FILE.equals(path.lastSegment())) { + return path.toFile(); + } + break; + case IClasspathEntry.CPE_PROJECT: + IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(classpathEntry.getPath().toString()); + File location = project.getLocation().toFile(); + return new File(location, FlexotaskClasspathInitializer.DEBUG_FILE); + } + } + throw new IllegalStateException("No usable copy of " + jarToFind + " was found"); + } + + /** + * Utility to find all the RuntimeProviders in the system + * @return an array containing all the RuntimeProviders in the system + */ + private static RuntimeProvider[] getRuntimeProviders() { + if (runtimeProviders == null) { + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint extensionPoint = registry.getExtensionPoint(RUNTIME_PROVIDER_EXTENSION); + if (extensionPoint == null) { + runtimeProviders = new RuntimeProvider[0]; + } else { + IConfigurationElement points[] = extensionPoint.getConfigurationElements(); + List<RuntimeProvider> runtimeList = new ArrayList<RuntimeProvider>(); + for (int i = 0; i < points.length; i++) { + IConfigurationElement point = points[i]; + RuntimeProvider rtp; + try { + rtp = (RuntimeProvider) point.createExecutableExtension("class"); + runtimeList.add(rtp); + } catch (CoreException e) { + } + } + runtimeProviders = (RuntimeProvider[]) runtimeList.toArray(new RuntimeProvider[runtimeList.size()]); + } + } + return runtimeProviders; + } + + /** + * Handle an exception that occurs in this operation + * @param shell the shell to use + * @param exception the exception that occurred + */ + private static void handleException(final Shell shell, Throwable exception) + { + if (exception instanceof InvocationTargetException) { + exception = ((InvocationTargetException) exception).getTargetException(); + } + IStatus status = null; + if (exception instanceof CoreException) { + status = ((CoreException) exception).getStatus(); + } + if (status == null) { + status = new Status(Status.ERROR, EEditPlugin.ID, exception.getMessage(), exception); + } + ResourcesPlugin.getPlugin().getLog().log(status); + ErrorDialog.openError(shell, "Error during export", status.getMessage(), status); + } + + /** + * Transfer a file to the destination + * @param file the file to transfer + * @param controller the ExportController for the destination + * @param output the OutputStream from the previous export step or null if this is the first step + * @param targetName the name that the logical file should have in the destination + * @return the OutputStream that was used for this export step + * @throws IOException + * @throws CoreException + */ + private static OutputStream transferFile(File file, + ExportController controller, OutputStream output, String targetName) throws IOException, CoreException + { + InputStream input = new FileInputStream(file); + return transferStream(input, controller, output, targetName, 0); + } + + /** + * Transfer an input stream to the destination + * @param input the input stream to transfer + * @param controller the ExportController for the destination + * @param output the OutputStream from the previous export step or null if this is the first step + * @param targetName the name that the logical file should have in the destination + * @param mode the unix mode for the output if non-zero, ignored if zero + * @return the OutputStream that was used for this export step + * @throws IOException + * @throws CoreException + */ + private static OutputStream transferStream(InputStream input, + ExportController controller, OutputStream output, String targetName, int mode) + throws IOException, CoreException + { + output = controller.getOutputStream(output, targetName, mode); + int remaining = input.available(); + byte[] buffer; + if (remaining > BUFFER_THRESHHOLD) { + buffer = new byte[BUFFER_THRESHHOLD]; + } else { + buffer = new byte[remaining]; + } + while (remaining > 0) { + int toRead = remaining > buffer.length ? buffer.length : remaining; + int amount = input.read(buffer, 0, toRead); + output.write(buffer, 0, amount); + remaining -= amount; + } + input.close(); + return output; + } + + /** + * Transfer the contents of a zip file (file by file) to the destination + * @param zipFile the zip file to transfer + * @param controller the ExportController for the destination + * @param output the OutputStream from the previous export step or null if this is the first step + * @return the last OutputStream that was used for this export step + * @throws IOException + * @throws CoreException + */ + private static OutputStream transferZipFile(ZipFile zipFile, + ExportController controller, OutputStream output) throws IOException, CoreException + { + Enumeration<?> entries = zipFile.getEntries(); + while (entries.hasMoreElements()) { + ZipEntry entry = (ZipEntry) entries.nextElement(); + if (entry.isDirectory()) { + continue; + } + int mode = entry.getUnixMode(); + InputStream input = zipFile.getInputStream(entry); + output = transferStream(input, controller, output, entry.getName(), mode); + } + return output; + } + + /** + * An ExportController implementation for the case where the output is a directory containing files + * and subdirectories + */ + private static final class DirectoryExportController implements ExportController { + /** The base directory */ + private File baseDirectory; + + /** The local file system */ + private static final IFileSystem fileSystem = EFS.getLocalFileSystem(); + + /** The currently open IFileStore iff the executable bit should be set, otherwise null */ + private IFileStore currentlyOpen; + + /** + * Create a new DirectoryExportController + * @param baseDirectory the base directory of the export area + */ + DirectoryExportController(File baseDirectory) { + this.baseDirectory = baseDirectory; + baseDirectory.mkdir(); + } + + /* (non-Javadoc) + * @see com.ibm.realtime.flexotask.editor.dialogs.RuntimeExportWizard.ExportController#getOutputStream(java.io.OutputStream, java.lang.String, int) + */ + public OutputStream getOutputStream(OutputStream former, String newFile, int mode) throws IOException, CoreException + { + if (former != null) { + former.close(); + if (currentlyOpen != null) { + /* Note: this only works if you are running on a unix system ... on windows it does nothing */ + IFileInfo info = EFS.createFileInfo(); + info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true); + currentlyOpen.putInfo(info, EFS.SET_ATTRIBUTES, null); + } + } + File toCreate = new File(baseDirectory, newFile); + toCreate.getParentFile().mkdirs(); + IFileStore target = fileSystem.fromLocalFile(toCreate); + OutputStream ans = target.openOutputStream(0, null); + currentlyOpen = ((mode & 0111) != 0) ? target : null; + return ans; + } + } + + /** + * An interface to hide the difference between zipfile and directory/file output + */ + private static interface ExportController { + /** + * Get the output stream for exporting a logical file (which either becomes a file or a + * entry in a zip file) + * @param former the former OutputStream or null if this is the first file to be exported + * @param newFile the path name of the new logical file to be added + * @param mode unix mode if non-zero, ignored if zero + * @return a new (or perhaps the same) OutputStream, positioned to accept the new logical file + * @throws IOException on I/O errors detected by non-Eclipse components + * @throws CoreException on errors detected by Eclipse components + */ + OutputStream getOutputStream(OutputStream former, String newFile, int mode) throws IOException, CoreException; + } + + /** + * An ExportController implementation for the case where the output is a zip file + */ + private static final class ZipFileExportController implements ExportController { + private ZipOutputStream output; + + /** + * Create a new ZipFileExportController + * @param zipFile the file to create (does not yet exist) + * @throws FileNotFoundException + */ + public ZipFileExportController(File zipFile) throws FileNotFoundException { + output = new ZipOutputStream(new FileOutputStream(zipFile)); + } + + /* (non-Javadoc) + * @see com.ibm.realtime.flexotask.editor.dialogs.RuntimeExportWizard.ExportController#getOutputStream(java.io.OutputStream, java.lang.String, int) + */ + public OutputStream getOutputStream(OutputStream former, String newFile, int mode) + throws IOException + { + if (former != null) { + assert former == output; + output.closeEntry(); + } + ZipEntry newEntry = new ZipEntry("flexotask-runtime/" + newFile); + if (mode != 0) { + newEntry.setUnixMode(mode); + } + output.putNextEntry(newEntry); + return output; + } + } +} Property changes on: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizard.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizardPage.java =================================================================== --- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizardPage.java (rev 0) +++ trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizardPage.java 2008-10-26 11:00:40 UTC (rev 38) @@ -0,0 +1,336 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.editor.dialogs; + +import java.io.File; + +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.DirectoryDialog; +import org.eclipse.swt.widgets.FileDialog; + +import com.ibm.realtime.flexotask.editor.EEditPlugin; + +/** + * The single page making up the runtime export wizard. Some of the GUI logic in this page is based + * on ExportDestinationTab from the PDE + */ +class RuntimeExportWizardPage extends WizardPage +{ + /** Section key for dialog settings related to this wizard */ + private static final String RUNTIME_EXPORT_KEY = "RuntimeExportSection"; + + /** Key for the switch indicating whether we last exported to a directory or na archive */ + private static final String EXPORT_DIRECTORY = "exportDirectory"; + + /** Key for the directory destination last exporte to */ + private static final String DESTINATION = "destination"; + + /** Key for the file archive last exporte to */ + private static final String ZIPFILENAME = "zipFileName"; + + /** Key indicating that overwriting the destination is desired */ + private static final String OVERWRITE = "overwrite"; + + /** Extension for zip files */ + private static final String ZIP_EXTENSION = ".zip"; + + /** The Radio button to choose the directory option */ + private Button chooseDirectory; + + /** The Combo for selecting the directory name */ + private Combo directoryName; + + /** Browse button for filling in the directory name */ + private Button browseDirectory; + + /** The Radio button to choose the archive file option */ + private Button chooseArchiveFile; + + /** The Combo for selecting the archive file name */ + private Combo archiveFileName; + + /** Browse button for filling in the archive file name */ + private Button browseFile; + + /** Checkbox indicating that the user wants the destination to be overwritten without prompting */ + private Button overwrite; + + /** + * Create a new RuntimeExportWizardPage + */ + RuntimeExportWizardPage() + { + super("FlexotaskRuntime"); + setTitle("Export Flexotask Runtime"); + setDescription("Export a Flexotask runtime for a real-time VM using existing plugins and flexotask PDE projects"); + } + + /* (non-Javadoc) + * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) + */ + public void createControl(Composite parent) + { + initializeDialogUnits(parent); + Composite control = new Composite(parent, SWT.NONE); + control.setLayout(new GridLayout(2, false)); + control.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + IDialogSettings settings = getSettings(); + String toDirectory = settings.get(EXPORT_DIRECTORY); + boolean useDirectory = toDirectory == null || "true".equals(toDirectory); //$NON-NLS-1$ + + chooseDirectory = new Button(control, SWT.RADIO); + chooseDirectory.setText("Directory:"); + GridData gd = new GridData(); + gd.horizontalSpan = 2; + chooseDirectory.setLayoutData(gd); + chooseDirectory.setSelection(useDirectory); + + directoryName = new Combo(control, SWT.BORDER); + gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalIndent = 15; + directoryName.setLayoutData(gd); + initializeCombo(settings, DESTINATION, directoryName); + directoryName.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + evaluateCompleteness(); + } + }); + + + browseDirectory = new Button(control, SWT.PUSH); + browseDirectory.setText("Browse"); + browseDirectory.setLayoutData(new GridData()); + browseDirectory.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + chooseDestination(); + } + }); + + chooseArchiveFile = new Button(control, SWT.RADIO); + chooseArchiveFile.setText("Archive file:"); + gd = new GridData(); + gd.horizontalSpan = 2; + chooseArchiveFile.setLayoutData(gd); + chooseArchiveFile.setSelection(!useDirectory); + chooseArchiveFile.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + toggleDestinationGroup(!chooseArchiveFile.getSelection()); + evaluateCompleteness(); + } + }); + + archiveFileName = new Combo(control, SWT.BORDER); + gd = new GridData(GridData.FILL_HORIZONTAL); + gd.horizontalIndent = 15; + archiveFileName.setLayoutData(gd); + initializeCombo(settings, ZIPFILENAME, archiveFileName); + archiveFileName.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + evaluateCompleteness(); + } + }); + + browseFile = new Button(control, SWT.PUSH); + browseFile.setText("Browse"); + browseFile.setLayoutData(new GridData()); + browseFile.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + chooseFile(archiveFileName, "*" + ZIP_EXTENSION); + } + }); + + overwrite = new Button(control, SWT.CHECK); + overwrite.setText("Overwrite without prompting"); + overwrite.setLayoutData(new GridData()); + overwrite.setSelection(settings.getBoolean(OVERWRITE)); + overwrite.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + evaluateCompleteness(); + } + }); + + toggleDestinationGroup(useDirectory); + Dialog.applyDialogFont(control); + setControl(control); + evaluateCompleteness(); + } + + /** + * @return the chosen destination as a java.io.File + */ + File getDestination() { + if (chooseArchiveFile.getSelection()) { + return new File(archiveFileName.getText()); + } else { + return new File(directoryName.getText()); + } + } + + /** + * @return true iff a directory was chosen, false if a file + */ + boolean isDirectory() { + return chooseDirectory.getSelection(); + } + + /** + * Save the dialog settings + */ + void saveSettings() { + IDialogSettings settings = getSettings(); + settings.put(EXPORT_DIRECTORY, chooseDirectory.getSelection()); + settings.put(OVERWRITE, overwrite.getSelection()); + saveCombo(settings, DESTINATION, directoryName); + saveCombo(settings, ZIPFILENAME, archiveFileName); + } + + /** + * @return indication of whether the destination should be overwritten + */ + boolean shouldOverwrite() { + return overwrite.getSelection(); + } + + /** + * Run a dialog to choose a destination directory + */ + private void chooseDestination() { + DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SAVE); + String path = directoryName.getText(); + if (path.trim().length() == 0) + path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString(); + dialog.setFilterPath(path); + dialog.setText("Destination Directory"); + dialog.setMessage("Set a destination directory for the runtime export operation"); + String res = dialog.open(); + if (res != null) { + if (directoryName.indexOf(res) == -1) + directoryName.add(res, 0); + directoryName.setText(res); + } + } + + /** + * Run a dialog to choose a file + * @param combo the Combo in which to place the file + * @param filter the filter to use in choosing the file + */ + private void chooseFile(Combo combo, String filter) { + FileDialog dialog = new FileDialog(getShell(), SWT.SAVE); + String path = combo.getText(); + if (path.trim().length() == 0) + path = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString(); + dialog.setFileName(path); + dialog.setFilterExtensions(new String[] { filter }); + String res = dialog.open(); + if (res != null) { + if (combo.indexOf(res) == -1) + combo.add(res, 0); + combo.setText(res); + } + } + + /** + * Determine whether the page is complete enough for Finish button to be enabled + * Display any error messages that need displaying + */ + private void evaluateCompleteness() + { + setMessage(null); + String error = null; + if (chooseArchiveFile.getSelection() && archiveFileName.getText().trim().length() == 0) { + error = "Archive file name not specified"; + } + if (chooseDirectory.getSelection() && directoryName.getText().trim().length() == 0) { + error = "Destination directory not specified"; + } + setErrorMessage(error); + setPageComplete(error == null); + } + + /** + * Retrieve dialog settings after ensuring they are present + */ + private IDialogSettings getSettings() { + IDialogSettings settings = getDialogSettings(); + if (settings == null) { + settings = EEditPlugin.getDefault().getDialogSettings().getSection(RUNTIME_EXPORT_KEY); + if (settings == null) { + settings = EEditPlugin.getDefault().getDialogSettings().addNewSection(RUNTIME_EXPORT_KEY); + } + Wizard wizard = (Wizard) getWizard(); + wizard.setDialogSettings(settings); + } + return settings; + } + + /** + * Initialize a combo from the dialog settings, up to six items + * @param settings the dialog settings + * @param key the key to look up + * @param combo the combo to initialize + */ + private void initializeCombo(IDialogSettings settings, String key, Combo combo) { + for (int i = 0; i < 6; i++) { + String curr = settings.get(key + String.valueOf(i)); + if (curr != null && combo.indexOf(curr) == -1) { + combo.add(curr); + } + } + if (combo.getItemCount() > 0) + combo.setText(combo.getItem(0)); + } + + /** + * Save the history from a Combo + * @param settings the IDialogSettings to which the settings should be saved + * @param key the key to use for this Combo + * @param combo the Combo + */ + private void saveCombo(IDialogSettings settings, String key, Combo combo) { + if (combo.getText().trim().length() > 0) { + settings.put(key + String.valueOf(0), combo.getText().trim()); + String[] items = combo.getItems(); + int nEntries = Math.min(items.length, 5); + for (int i = 0; i < nEntries; i++) { + settings.put(key + String.valueOf(i + 1), items[i].trim()); + } + } + } + + /** + * Enable either the directory input or the file input, never both + * @param useDirectory directory input is requested + */ + private void toggleDestinationGroup(boolean useDirectory) { + archiveFileName.setEnabled(!useDirectory); + browseFile.setEnabled(!useDirectory); + directoryName.setEnabled(useDirectory); + browseDirectory.setEnabled(useDirectory); + } +} Property changes on: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeExportWizardPage.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeProvider.java =================================================================== --- trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeProvider.java (rev 0) +++ trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeProvider.java 2008-10-26 11:00:40 UTC (rev 38) @@ -0,0 +1,28 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.editor.dialogs; + + +/** + * Interface to be implemented by runtime providers. These contribute native libraries and + * proprietary Java libraries to the runtime. The contribution always takes the form of + * a ZipFile. + */ +public interface RuntimeProvider +{ + /** + * @return this provider's contribution to the runtime as the absolute path name of a zip archive + */ + public String contribute(); +} Property changes on: trunk/flexotask-editor/src/com/ibm/realtime/flexotask/editor/dialogs/RuntimeProvider.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-26 10:59:24
|
Revision: 37 http://flexotask.svn.sourceforge.net/flexotask/?rev=37&view=rev Author: jsauerbach Date: 2008-10-26 10:58:00 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Initial import into repository Added Paths: ----------- trunk/flexotask-functiontest/.classpath trunk/flexotask-functiontest/.externalToolBuilders/ trunk/flexotask-functiontest/.externalToolBuilders/Build Flexotask Template Generators.launch trunk/flexotask-functiontest/.project trunk/flexotask-functiontest/.settings/ trunk/flexotask-functiontest/.settings/org.eclipse.jdt.ui.prefs trunk/flexotask-functiontest/export.manifest trunk/flexotask-functiontest/export.xml trunk/flexotask-functiontest/generators.xml trunk/flexotask-functiontest/launch/ trunk/flexotask-functiontest/launch/Export Flexotask Function Test for Runtime.launch trunk/flexotask-functiontest/launch/Run Flexotask Function Test Under Eclipse.launch trunk/flexotask-functiontest/src/ trunk/flexotask-functiontest/src/alltests/ trunk/flexotask-functiontest/src/alltests/Testcases.java trunk/flexotask-functiontest/src/communicating/ trunk/flexotask-functiontest/src/communicating/Example.ftg trunk/flexotask-functiontest/src/communicating/InputHandler.java trunk/flexotask-functiontest/src/communicating/Main.java trunk/flexotask-functiontest/src/communicating/OutputHandler.java trunk/flexotask-functiontest/src/communicating/T1.java trunk/flexotask-functiontest/src/communicating/T2.java trunk/flexotask-functiontest/src/communicating/T3.java trunk/flexotask-functiontest/src/highfreqread/ trunk/flexotask-functiontest/src/highfreqread/Channel.java trunk/flexotask-functiontest/src/highfreqread/HighFreqReader.java trunk/flexotask-functiontest/src/highfreqread/HighFreqReaderIntf.java trunk/flexotask-functiontest/src/highfreqread/Main.java trunk/flexotask-functiontest/src/highfreqread/MemoryAllocator.java trunk/flexotask-functiontest/src/highfreqread/State.java trunk/flexotask-functiontest/src/lctes2007/ trunk/flexotask-functiontest/src/lctes2007/Actuator.java trunk/flexotask-functiontest/src/lctes2007/Compute.java trunk/flexotask-functiontest/src/lctes2007/Example.ftg trunk/flexotask-functiontest/src/lctes2007/Generator.java trunk/flexotask-functiontest/src/lctes2007/Main.java trunk/flexotask-functiontest/src/lctes2007/Sensor.java trunk/flexotask-functiontest/src/modes/ trunk/flexotask-functiontest/src/modes/DownCounter.java trunk/flexotask-functiontest/src/modes/Equals.java trunk/flexotask-functiontest/src/modes/Example.ftg trunk/flexotask-functiontest/src/modes/Generator.java trunk/flexotask-functiontest/src/modes/Main.java trunk/flexotask-functiontest/src/modes/Report.java trunk/flexotask-functiontest/src/modes/UpCounter.java trunk/flexotask-functiontest/src/types/ trunk/flexotask-functiontest/src/types/DataSink.java trunk/flexotask-functiontest/src/types/DataSource.java trunk/flexotask-functiontest/src/types/Main.java Property Changed: ---------------- trunk/flexotask-functiontest/ Property changes on: trunk/flexotask-functiontest ___________________________________________________________________ Added: svn:ignore + generated *.jar Added: trunk/flexotask-functiontest/.classpath =================================================================== --- trunk/flexotask-functiontest/.classpath (rev 0) +++ trunk/flexotask-functiontest/.classpath 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="con" path="com.ibm.realtime.flexotask.editor.classpath/1.0"/> + <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/flexotask-functiontest/.externalToolBuilders/Build Flexotask Template Generators.launch =================================================================== --- trunk/flexotask-functiontest/.externalToolBuilders/Build Flexotask Template Generators.launch (rev 0) +++ trunk/flexotask-functiontest/.externalToolBuilders/Build Flexotask Template Generators.launch 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType"> +<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/> +<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/flexotask-functiontest/generators.xml"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/> +<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> +<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="flexotask-functiontest"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/flexotask-functiontest/generators.xml}"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value=""/> +<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/flexotask-functiontest}"/> +</launchConfiguration> Added: trunk/flexotask-functiontest/.project =================================================================== --- trunk/flexotask-functiontest/.project (rev 0) +++ trunk/flexotask-functiontest/.project 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>flexotask-functiontest</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> + <triggers>full,incremental,</triggers> + <arguments> + <dictionary> + <key>LaunchConfigHandle</key> + <value><project>/.externalToolBuilders/Build Flexotask Template Generators.launch</value> + </dictionary> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>FlexotaskBuilder.builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>FlexotaskBuilder.nature</nature> + </natures> +</projectDescription> Added: trunk/flexotask-functiontest/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/flexotask-functiontest/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/flexotask-functiontest/.settings/org.eclipse.jdt.ui.prefs 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,3 @@ +#Wed Oct 22 15:27:15 EDT 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> Added: trunk/flexotask-functiontest/export.manifest =================================================================== --- trunk/flexotask-functiontest/export.manifest (rev 0) +++ trunk/flexotask-functiontest/export.manifest 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Main-Class: alltests.Testcases +Class-Path: junit.jar Added: trunk/flexotask-functiontest/export.xml =================================================================== --- trunk/flexotask-functiontest/export.xml (rev 0) +++ trunk/flexotask-functiontest/export.xml 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,13 @@ +<project default="jars"> + <target name="clean"> + <delete file="flexotaskFunctionTest.jar"/> + </target> + <target name="jars" depends="clean"> + <jar destfile="flexotaskFunctionTest.jar" manifest="export.manifest"> + <fileset dir="generated"/> + </jar> + <jar destfile="flexotaskFunctionTest.jar" update="yes" duplicate="preserve"> + <fileset dir="bin"/> + </jar> + </target> +</project> \ No newline at end of file Property changes on: trunk/flexotask-functiontest/export.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/flexotask-functiontest/generators.xml =================================================================== --- trunk/flexotask-functiontest/generators.xml (rev 0) +++ trunk/flexotask-functiontest/generators.xml 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,24 @@ +<project default="graphs"> + <target name="graphs"> + <java classname="com.ibm.realtime.flexotask.tools.FlexotaskXMLParser" + dir="${basedir}/src/lctes2007/" fork="yes"> + <classpath> + <pathelement path="${flexotask.library}"/> + </classpath> + <arg value="Example.ftg"/> + <arg value="Generator"/> + <arg value="lctes2007"/> + </java> + <java classname="com.ibm.realtime.flexotask.tools.FlexotaskXMLParser" + dir="${basedir}/src/modes/" fork="yes"> + <classpath> + <pathelement path="${flexotask.library}"/> + </classpath> + <arg value="Example.ftg"/> + <arg value="Generator"/> + <arg value="modes"/> + </java> + <eclipse.convertPath fileSystemPath="${basedir}" property="resourcePath"/> + <eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/> + </target> +</project> \ No newline at end of file Property changes on: trunk/flexotask-functiontest/generators.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/flexotask-functiontest/launch/Export Flexotask Function Test for Runtime.launch =================================================================== --- trunk/flexotask-functiontest/launch/Export Flexotask Function Test for Runtime.launch (rev 0) +++ trunk/flexotask-functiontest/launch/Export Flexotask Function Test for Runtime.launch 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> +<launchConfiguration type="org.eclipse.ant.AntLaunchConfigurationType"> +<stringAttribute key="bad_container_name" value="\flexotask-functiontest\launc"/> +<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/flexotask-functiontest/export.xml"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="1"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="flexotask-functiontest"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_NAME" value="IBM-J9"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_INSTALL_TYPE_ID" value="org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/flexotask-functiontest/export.xml}"/> +<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/> +</launchConfiguration> Added: trunk/flexotask-functiontest/launch/Run Flexotask Function Test Under Eclipse.launch =================================================================== --- trunk/flexotask-functiontest/launch/Run Flexotask Function Test Under Eclipse.launch (rev 0) +++ trunk/flexotask-functiontest/launch/Run Flexotask Function Test Under Eclipse.launch 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<launchConfiguration type="org.eclipse.jdt.junit.launchconfig"> +<stringAttribute key="bad_container_name" value="\flexotask-functiontest\launc"/> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> +<listEntry value="/flexotask-functiontest"/> +</listAttribute> +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> +<listEntry value="4"/> +</listAttribute> +<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> +<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=flexotask-functiontest"/> +<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/> +<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/> +<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/> +<listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> +<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="flexotask-functiontest" path="1" type="4"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/flexotask-functiontest/generated" path="3" type="2"/> "/> +<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento exportedEntriesOnly="false" project="flexotask-functiontest"/> </runtimeClasspathEntry> "/> +</listAttribute> +<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> +<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/> +<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="flexotask-functiontest"/> +</launchConfiguration> Added: trunk/flexotask-functiontest/src/alltests/Testcases.java =================================================================== --- trunk/flexotask-functiontest/src/alltests/Testcases.java (rev 0) +++ trunk/flexotask-functiontest/src/alltests/Testcases.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,102 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package alltests; + +import java.io.IOException; + +import javax.xml.parsers.ParserConfigurationException; + +import org.junit.Test; +import org.junit.internal.runners.TextListener; +import org.junit.runner.Description; +import org.junit.runner.JUnitCore; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; +import org.xml.sax.SAXException; + +import com.ibm.realtime.flexotask.template.FlexotaskValidationException; + +/** + * Testcases for the Flexible Task Graphs System + */ +public class Testcases +{ + /* TODO these tests only fail by crashing or throwing exceptions: more self-checking is needed */ + @Test + public void testCommunicating() throws FlexotaskValidationException, + SAXException, IOException, ParserConfigurationException + { + communicating.Main.main(new String[0]); + } + + @Test + public void testHighfreqread() throws FlexotaskValidationException, + InterruptedException, IOException + { + highfreqread.Main.main(new String[] { "500" }); + } + + @Test + public void testLctes2007() throws FlexotaskValidationException, + InterruptedException + { + lctes2007.Main.main(new String[0]); + } + + @Test + public void testModes() throws FlexotaskValidationException, + InterruptedException + { + modes.Main.main(new String[0]); + } + + @Test + public void testTypes() throws SAXException, IOException, + ParserConfigurationException, FlexotaskValidationException, + InterruptedException + { + types.Main.main(new String[0]); + } + + /** + * Method to test in a non-eclipse environment (e.g. a realtime VM) + */ + public static void main(String[] args) { + RunListener listener = new BatchRunListener(); + JUnitCore runner = new JUnitCore(); + runner.addListener(listener); + runner.run(Testcases.class); + } + + /** + * A RunListener for batch mode operation + */ + private static class BatchRunListener extends TextListener + { + public void testFailure(Failure failure) + { + System.err.println("Test failed: " + failure.getTestHeader() + ". More details later."); + } + + public void testIgnored(Description description) + { + System.err.println("Test ignored: " + description); + } + + public void testStarted(Description description) + { + System.err.println("Starting test: " + description); + } + } +} Property changes on: trunk/flexotask-functiontest/src/alltests/Testcases.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/communicating/Example.ftg =================================================================== --- trunk/flexotask-functiontest/src/communicating/Example.ftg (rev 0) +++ trunk/flexotask-functiontest/src/communicating/Example.ftg 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,33 @@ +<FlexotaskTemplate> + <TimingProvider kind='simple' parser='com.ibm.realtime.flexotask.timing.simple.SimpleTimingDataParser' graphics='100 60 344 59' period='50'/> + <Task id='T3' implementation='communicating.T3' graphics='60 60 468 188'> + <Input id='in' type='java.lang.Integer'/> + <Output id='out' type='java.lang.Integer'/> + <Timing offsets='40'/> + </Task> + <Task id='T2' implementation='communicating.T2' graphics='60 60 326 188'> + <Input id='in' type='java.lang.Integer'/> + <Output id='out' type='java.lang.Integer'/> + <Timing offsets='30'/> + </Task> + <Task id='T1' implementation='communicating.T1' graphics='60 60 176 188'> + <Input id='in' type='java.lang.Integer'/> + <Output id='out' type='java.lang.Integer'/> + <Timing offsets='10'/> + </Task> + <Task id='Input' implementation='communicating.InputHandler' isolation='weak' graphics='60 60 41 188'> + <Output id='out0' type='java.lang.Integer'/> + </Task> + <Task id='Output' implementation='communicating.OutputHandler' isolation='weak' graphics='60 60 614 188'> + <Input id='in0' type='java.lang.Integer'/> + <Timing offsets='50'/> + </Task> + <Connection id='T1_T2' source='T1' target='T2'> + </Connection> + <Connection id='T3_Output' source='T3' target='Output'> + </Connection> + <Connection id='T2_T3' source='T2' target='T3'> + </Connection> + <Connection id='Input_T1' source='Input' target='T1'> + </Connection> +</FlexotaskTemplate> Added: trunk/flexotask-functiontest/src/communicating/InputHandler.java =================================================================== --- trunk/flexotask-functiontest/src/communicating/InputHandler.java (rev 0) +++ trunk/flexotask-functiontest/src/communicating/InputHandler.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,34 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package communicating; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; + +public class InputHandler implements Flexotask +{ + public int[] valueBuffer; + private FlexotaskOutputPort<Integer> out0; + public void execute() + { + out0.setValue(valueBuffer[0]); + } + @SuppressWarnings("unchecked") + public void initialize(FlexotaskInputPort[] inputPorts, FlexotaskOutputPort[] outputPorts, Object parameter) + { + out0 = outputPorts[0]; + valueBuffer = (int[]) parameter; + } +} Property changes on: trunk/flexotask-functiontest/src/communicating/InputHandler.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/communicating/Main.java =================================================================== --- trunk/flexotask-functiontest/src/communicating/Main.java (rev 0) +++ trunk/flexotask-functiontest/src/communicating/Main.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,79 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package communicating; + +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import javax.xml.parsers.ParserConfigurationException; + +import org.xml.sax.SAXException; + +import com.ibm.realtime.flexotask.FlexotaskGraph; +import com.ibm.realtime.flexotask.FlexotaskRunner; +import com.ibm.realtime.flexotask.template.FlexotaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskValidationException; +import com.ibm.realtime.flexotask.tools.FlexotaskXMLParser; + +public class Main { + public static void main(String[] args) throws FlexotaskValidationException, SAXException, IOException, + ParserConfigurationException + { + // create the communication buffers + int[] sensor = new int[] {0}; + int[] actuator = new int[] {-1}; + + // build the graph + InputStream in = Main.class.getResourceAsStream("Example.ftg"); + FlexotaskTemplate spec = FlexotaskXMLParser.parseStream(in); + Map<String,Object> parameters = new HashMap<String,Object>(); + parameters.put("Input", sensor); + parameters.put("Output", actuator); + FlexotaskGraph graph = spec.validate("TTScheduler", parameters); + + //retrieve the Runner + FlexotaskRunner runner = graph.getRunner(); + + for (int i = 0; i < 3; i++) { + /* Do start/run/stop sequence three times. */ + /* Start the graph running */ + System.err.println("Starting graph"); + runner.start(); + try { + // sleep for at least one period so actuator value will be available + Thread.sleep(100); + } catch (InterruptedException e1) {} + + for (int j = 1; j < 100; j++) { + System.err.println("Feeding " + j); + sensor[0] = j; + System.err.print("Reading "); + System.err.println(actuator[0]); + try { + Thread.sleep(50); + } catch (InterruptedException e) {} + } + System.err.println("Stopping graph"); + runner.stop(); + try { + // Let the pause be noticed + Thread.sleep(1000); + } catch (InterruptedException e1) {} + } + System.err.println("Shutting down"); + runner.shutdown(); + } +} Property changes on: trunk/flexotask-functiontest/src/communicating/Main.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/communicating/OutputHandler.java =================================================================== --- trunk/flexotask-functiontest/src/communicating/OutputHandler.java (rev 0) +++ trunk/flexotask-functiontest/src/communicating/OutputHandler.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,34 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package communicating; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; + +public class OutputHandler implements Flexotask +{ + public int[] valueBuffer; + private FlexotaskInputPort<Integer> in0; + public void execute() + { + valueBuffer[0] = in0.getValue(); + } + @SuppressWarnings("unchecked") + public void initialize(FlexotaskInputPort[] inputPorts, FlexotaskOutputPort[] outputPorts, Object parameter) + { + in0 = inputPorts[0]; + valueBuffer = (int[]) parameter; + } +} Property changes on: trunk/flexotask-functiontest/src/communicating/OutputHandler.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/communicating/T1.java =================================================================== --- trunk/flexotask-functiontest/src/communicating/T1.java (rev 0) +++ trunk/flexotask-functiontest/src/communicating/T1.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,37 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package communicating; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; + +public class T1 implements Flexotask { + private FlexotaskInputPort<Integer> in; + private FlexotaskOutputPort<Integer> out; + + public void execute() + { + int val = in.getValue(); + out.setValue(val + 1); + } + + @SuppressWarnings("unchecked") + public void initialize(FlexotaskInputPort[] inputPorts, FlexotaskOutputPort[] outputPorts, Object parameter) + { + in = inputPorts[0]; + out = outputPorts[0]; + out.setValue(new Integer(0)); + } +} Property changes on: trunk/flexotask-functiontest/src/communicating/T1.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/communicating/T2.java =================================================================== --- trunk/flexotask-functiontest/src/communicating/T2.java (rev 0) +++ trunk/flexotask-functiontest/src/communicating/T2.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,37 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package communicating; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; + +public class T2 implements Flexotask { + private FlexotaskInputPort<Integer> in; + private FlexotaskOutputPort<Integer> out; + + public void execute() + { + int val = in.getValue(); + out.setValue(2 * val); + } + + @SuppressWarnings("unchecked") + public void initialize(FlexotaskInputPort[] inputPorts, FlexotaskOutputPort[] outputPorts, Object parameter) + { + in = inputPorts[0]; + out = outputPorts[0]; + out.setValue(new Integer(0)); + } +} Property changes on: trunk/flexotask-functiontest/src/communicating/T2.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/communicating/T3.java =================================================================== --- trunk/flexotask-functiontest/src/communicating/T3.java (rev 0) +++ trunk/flexotask-functiontest/src/communicating/T3.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,37 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package communicating; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; + +public class T3 implements Flexotask { + private FlexotaskInputPort<Integer> in; + private FlexotaskOutputPort<Integer> out; + + public void execute() + { + int val = in.getValue(); + out.setValue(val - 1); + } + + @SuppressWarnings("unchecked") + public void initialize(FlexotaskInputPort[] inputPorts, FlexotaskOutputPort[] outputPorts, Object parameter) + { + in = inputPorts[0]; + out = outputPorts[0]; + out.setValue(new Integer(0)); + } +} Property changes on: trunk/flexotask-functiontest/src/communicating/T3.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/highfreqread/Channel.java =================================================================== --- trunk/flexotask-functiontest/src/highfreqread/Channel.java (rev 0) +++ trunk/flexotask-functiontest/src/highfreqread/Channel.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,23 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package highfreqread; + +public class Channel +{ + public short value; + public short read() + { + return value; + } +} Property changes on: trunk/flexotask-functiontest/src/highfreqread/Channel.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/highfreqread/HighFreqReader.java =================================================================== --- trunk/flexotask-functiontest/src/highfreqread/HighFreqReader.java (rev 0) +++ trunk/flexotask-functiontest/src/highfreqread/HighFreqReader.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,64 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package highfreqread; + +import java.util.ArrayList; +import java.util.List; + +import com.ibm.realtime.flexotask.AtomicException; +import com.ibm.realtime.flexotask.AtomicFlexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; +import com.ibm.realtime.flexotask.util.ESystem; + +public class HighFreqReader extends AtomicFlexotask implements HighFreqReaderIntf +{ + private static final boolean DEBUG = false; + private State state; + int idx; + public void execute() + { + List<Short> data = new ArrayList<Short>(); + for(int i=0;i<state.size();i++) { + data.add(state.current.read()); + } + state.update(data); + if (DEBUG) { + ESystem.err.println("Updated"); + idx++; + ESystem.err.println("Incremented"); + idx = idx % state.size(); + ESystem.err.println("Wrapped"); + Channel[] channels = state.channels; + ESystem.err.println("Got channels"); + Channel current = channels[idx]; + ESystem.err.println("Got current"); + state.current = current; + ESystem.err.println("Execution complete"); + } else { + state.current = state.channels[idx++ % state.size()]; + } + } + @SuppressWarnings("unchecked") + public void initialize(FlexotaskInputPort[] inputPorts, + FlexotaskOutputPort[] outputPorts, Object parameter) + { + int size = ((Integer) parameter); + state = new State(size); + } + public void update(short value) throws AtomicException + { + state.current.value = value; + } +} Property changes on: trunk/flexotask-functiontest/src/highfreqread/HighFreqReader.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/highfreqread/HighFreqReaderIntf.java =================================================================== --- trunk/flexotask-functiontest/src/highfreqread/HighFreqReaderIntf.java (rev 0) +++ trunk/flexotask-functiontest/src/highfreqread/HighFreqReaderIntf.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,21 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package highfreqread; + +import com.ibm.realtime.flexotask.AtomicException; +import com.ibm.realtime.flexotask.ExternalMethods; + +public interface HighFreqReaderIntf extends ExternalMethods { + public void update(short value) throws AtomicException; +} Property changes on: trunk/flexotask-functiontest/src/highfreqread/HighFreqReaderIntf.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/highfreqread/Main.java =================================================================== --- trunk/flexotask-functiontest/src/highfreqread/Main.java (rev 0) +++ trunk/flexotask-functiontest/src/highfreqread/Main.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,136 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package highfreqread; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.junit.Test; + +import com.ibm.realtime.flexotask.AtomicException; +import com.ibm.realtime.flexotask.FlexotaskGraph; +import com.ibm.realtime.flexotask.system.FlexotaskValidator; +import com.ibm.realtime.flexotask.template.FlexotaskStableMode; +import com.ibm.realtime.flexotask.template.FlexotaskTaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskTemplate; +import com.ibm.realtime.flexotask.template.FlexotaskValidationException; +import com.ibm.realtime.flexotask.timing.simple.Period; +import com.ibm.realtime.flexotask.timing.simple.SimpleTimingAnnotation; +import com.ibm.realtime.flexotask.tracing.InterarrivalTracer; +import com.ibm.realtime.flexotask.tracing.IntervalStatistics; +import com.ibm.realtime.flexotask.tracing.TaskByNameTracerFactory; +import com.ibm.realtime.flexotask.tuningfork.TFTracerFactory; + +public class Main +{ + public static void main(String[] args) + throws FlexotaskValidationException, InterruptedException, IOException + { + /* 1st argument is period in microseconds, no default */ + int period; + if (args.length > 0) { + period = Integer.parseInt(args[0]); + } else { + System.err.println("Syntax: <pgm> period [ othreadsleep [ duration ] ]"); + System.err.println("Also system properties ALLOCATION_RATE, COMMUNICATE, and DISABLE_SAFE_POINT_DEFERRAL"); + throw new IllegalArgumentException(); + } + /* 2nd argument is o-thread sleep interval in milliseconds, default is 20 */ + int oThreadSleep = 20; + if (args.length > 1) { + oThreadSleep = Integer.parseInt(args[1]); + } + /* 3rd argument is length of run in seconds, default is 20 */ + int runlength = 20; + if (args.length > 2) { + runlength = Integer.parseInt(args[2]); + } + + /* Make the graph specification */ + FlexotaskTemplate spec = new FlexotaskTemplate(); + spec.setTimingData(new Period(period*1000)); + FlexotaskTaskTemplate task = new FlexotaskTaskTemplate(); + task.setImplementationClass(HighFreqReader.class.getName()); + task.setName("Test"); + task.setTimingData(new SimpleTimingAnnotation(new long[]{0})); + spec.getTasks().add(task); + spec.setStableMode(FlexotaskStableMode.MANUAL); + Set<String> stable = spec.getStableClasses(); + stable.add(HighFreqReader.class.getName()); + stable.add(Channel.class.getName()); + stable.add(Channel[].class.getName()); + stable.add(State.class.getName()); + + /* Determine if TF tracing is requested and enable it (only tracing to port is supported) */ + String tracing = System.getProperty("TF_TRACE"); + if (tracing != null && tracing.length() > 0) { + int port = Integer.parseInt(tracing); + FlexotaskValidator.setTracer(new TFTracerFactory(port)); + } else { + /* Use interarrival tracer instead */ + int reportAt = (int)((long) runlength * 1000 * 1000 / period); + int jitter = period / 20; + long[] range = {period - jitter, period + jitter}; + IntervalStatistics stats = new IntervalStatistics("Test", reportAt, new long[][]{range}); + InterarrivalTracer tracer = new InterarrivalTracer(stats, stats); + TaskByNameTracerFactory factory = new TaskByNameTracerFactory(1, false); + factory.addTask("Test", tracer); + FlexotaskValidator.setTracer(factory); + } + + /* Start competing allocation thread to cause frequent GCs */ + String alloc = System.getProperty("ALLOCATION_RATE"); + if (alloc != null && alloc.length() > 0) { + int rate = Integer.parseInt(alloc); + MemoryAllocator.setupMemoryAllocation(rate * 1024); + } + + /* Determine if the the o-thread will attempt communication, default is yes */ + boolean communicate = Boolean.valueOf(System.getProperty("COMMUNICATE", "true")).booleanValue(); + + System.gc(); + + /* Make the graph */ + Map<String,Object> parameters = new HashMap<String,Object>(); + parameters.put("Test", new Integer(4)); + FlexotaskGraph graph = spec.validate("TTScheduler", parameters); + + /* Run the highfreqread */ + graph.getRunner().start(); + HighFreqReaderIntf guard = (HighFreqReaderIntf) graph.getGuardObject("Test"); + + System.err.println("Graph started"); + int sleepsPerSecond = 1000 / oThreadSleep; + for (int i = 0; i < runlength * 1000 / oThreadSleep; i++) { + Thread.sleep(oThreadSleep); + if (communicate) { + try { + guard.update((short) i); + } catch (AtomicException e) { + System.err.println("Transaction " + i + " aborted"); + } catch (Exception e) { + e.printStackTrace(); + } + } + if (i % sleepsPerSecond == 0) { + System.err.println(i + (communicate ? " updates" : " waits")); + } + } + System.err.println("Destroying graph"); + graph.destroy(); + System.err.println("Done"); + } +} Property changes on: trunk/flexotask-functiontest/src/highfreqread/Main.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/highfreqread/MemoryAllocator.java =================================================================== --- trunk/flexotask-functiontest/src/highfreqread/MemoryAllocator.java (rev 0) +++ trunk/flexotask-functiontest/src/highfreqread/MemoryAllocator.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,349 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package highfreqread; + +/** + * A class that allows to allocate memory for simulating regular memory + * consumption. This can serve to activate the gc. + * + * @author florian + */ +public class MemoryAllocator { + + /** + * debugging flag + */ + public static boolean DEBUG_ALLOCATETHREAD = false; + + /** + * the allocation rate in bytes/second + */ + private int allocationRate; + + /** + * The size of each created object, in bytes + */ + private int allocateObjectSize = 48; + + /** + * Number of objects whose reference is kept in an array + */ + private int referenceObjectCount = 150000; + + /** + * The thread instance + */ + private AllocateThread thread; + + /** + * total number of allocated objects + */ + private int totalAllocatedObjects = 0; + + private int currentRetention = 0; + + public static MemoryAllocator staticAllocator; + + public static void setupMemoryAllocation(int allocationRate) { + staticAllocator = new MemoryAllocator(allocationRate); + staticAllocator.setEnabled(true); + + } + + /** + * Create a disabled MemoryAllocator instance + */ + public MemoryAllocator(int allocationRate) { + this.allocationRate = allocationRate; + } + + /** + * trigger the thread's change() method + */ + private synchronized void change() { + if (thread != null) { + thread.change(); + } + } + + /** + * Enable the memory allocator. If enable is true, the allocate thread is + * created and it will start allocating memory. + * + * @param enable if true, start the allocator, otherwise stop it and remove + * the thread + */ + public synchronized void setEnabled(boolean enable) { + if (isEnabled() != enable) { + if (enable) { + thread = new AllocateThread(); + } else { + thread.stopAllocator(); + thread = null; + totalAllocatedObjects = 0; + currentRetention = 0; + } + } + } + + /** + * @return true if the allocator is running + */ + public synchronized boolean isEnabled() { + return (thread != null); + } + + /** + * @return the allocateObjectSize in bytes + */ + public int getAllocateObjectSize() { + return allocateObjectSize; + } + + /** + * @param allocateObjectSize the allocateObjectSize to set in bytes + */ + public void setAllocateObjectSize(int allocateObjectSize) { + this.allocateObjectSize = allocateObjectSize; + change(); + } + + /** + * @return the allocationRate in bytes/second + */ + public int getAllocationRate() { + return allocationRate; + } + + /** + * @param allocationRate the allocationRate to set in bytes/second + */ + public void setAllocationRate(int allocationRate) { + this.allocationRate = allocationRate; + change(); + } + + /** + * @return number of objects kept in an array + */ + public int getReferenceObjectCount() { + return referenceObjectCount; + } + + /** + * @param referenceObjectCount the referenceObjectCount to set + */ + public void setReferenceObjectCount(int referenceObjectCount) { + this.referenceObjectCount = referenceObjectCount; + change(); + } + + // status + + /** + * @return how many bytes currently held by the retention array + */ + public int getCurrentRetentionSize() { + return currentRetention; + } + + /** + * @return the total number of allocated objects + */ + public int getTotalAllocatedObjects() { + return totalAllocatedObjects; + } + + /** + * The actual allocator thread. + */ + private class AllocateThread extends Thread { + + /** + * The number of bytes allocated in total + */ + private long totalAllocated = 0; + + /** + * flag to notify the thread to stop + */ + private volatile boolean stopped = false; + + /** + * the array to hold a reference to the last allocated objects + */ + private Object[] allocateArray = null; + + /* + * the next write index in allocateArray + */ + private int arrayIndex = 0; + + /** + * The start time of allocating with one parameter set + */ + private long checkpointMillis; + + /** + * the number of bytes allocated since the checkpoint + */ + private long allocatedSinceCheckpoint; + + /** + * Create and start the maintenance thread + */ + public AllocateThread() { + super("Allocator Thread"); + setDaemon(true); + change(); + start(); + } + + /** + * Stops and wait for the end of the execution of this thread. + */ + public void stopAllocator() { + synchronized (this) { + stopped = true; + this.notifyAll(); + } + if (isAlive()) { + try { + this.join(2000); + } catch (InterruptedException ie) { + } + } + } + + private synchronized void recalcCurrentRetention() { + currentRetention = 0; + if (allocateArray != null) { + for (int i = 0; i < allocateArray.length; i++) { + Object o = allocateArray[i]; + if (o != null) { + currentRetention += ((byte[]) o).length; + } + } + } + } + + /** + * Called to re-setup the internal runtime variables + */ + public synchronized void change() { + if (allocateArray == null + || allocateArray.length != referenceObjectCount) { + // create new array + Object[] newArray = new Object[referenceObjectCount]; + if (allocateArray != null) { + System.arraycopy(allocateArray, 0, newArray, 0, Math.min( + referenceObjectCount, allocateArray.length)); + } + allocateArray = newArray; + recalcCurrentRetention(); + } + // reset the checkpoint + checkpointMillis = System.currentTimeMillis(); + allocatedSinceCheckpoint = 0; + } + + /** + * allocate the specified number of bytes on the rcd.rtsj.heap. + */ + private synchronized void allocate(int bytes) { + Object newObject = new byte[bytes]; + if (arrayIndex >= allocateArray.length) { + arrayIndex = 0; + } + totalAllocated += bytes; + allocatedSinceCheckpoint += bytes; + totalAllocatedObjects++; + + if (allocateArray != null && arrayIndex < allocateArray.length) { + currentRetention += bytes; + if (allocateArray[arrayIndex] != null) { + currentRetention -= ((byte[]) allocateArray[arrayIndex]).length; + } + allocateArray[arrayIndex++] = newObject; + } + } + + /** + * in a loop, allocate the objects + */ + public void run() { + while (!stopped) { + try { + synchronized (this) { + long elapsedSinceCheckpoint = (System.currentTimeMillis()) + - checkpointMillis; + long shouldHaveAllocated = (long) (((double) allocationRate) * (elapsedSinceCheckpoint / 1000.0)); + // number of bytes that should be allocated now is + // the difference of shouldHaveAllocated and allocatedSinceCheckpoint + // we only allocate in chunks of allocateObjectSize + while ((shouldHaveAllocated - allocatedSinceCheckpoint) >= allocateObjectSize) { + allocate(allocateObjectSize); + } + this.wait(10); + } + } catch (Throwable t) { + System.err.println("Error in allocation thread: " + t); + t.printStackTrace(); + } + } + } + + } + + public String toString() { + return "Allocator: " + getFriendlyByteSize(getAllocationRate()) + + "/s with " + getFriendlyByteSize(getAllocateObjectSize()) + + " objects; " + getFriendlyByteSize(getCurrentRetentionSize()) + + " in use (maximum " + getFriendlyByteSize(getReferenceObjectCount() * getAllocateObjectSize()) + + ")"; + } + + /** + * @return a string with the byte size with a suitable unit, bytes, KB, etc. + */ + public static String getFriendlyByteSize(long bytes) { + long threshold = 2 << 10; + if (bytes < 4*threshold) { + return Long.toString(bytes)+" bytes"; + } + threshold = threshold << 10; + if (bytes < 4*threshold) { + return format2(bytes / 1024.0)+" KB"; + } + threshold = threshold << 10; + if (bytes < 4*threshold) { + return format2(bytes / (1024.0*1024.0))+" MB"; + } + threshold = threshold << 10; + if (bytes < 4*threshold) { + return format2(bytes / (1024.0*1024.0*1024.0))+" GB"; + } + return format2(bytes / (1024.0*1024.0*1024.0*1024.0))+" TB"; + } + + /** + * Format a floating point number with 2 decimals. + * + * @param d the number to convert to string + * @return the string with the number d with 3 decimals. + */ + public static final String format2(double d) { + return "" + (Math.rint(d * 100.0) / 100.0); + } +} Property changes on: trunk/flexotask-functiontest/src/highfreqread/MemoryAllocator.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/highfreqread/State.java =================================================================== --- trunk/flexotask-functiontest/src/highfreqread/State.java (rev 0) +++ trunk/flexotask-functiontest/src/highfreqread/State.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,38 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package highfreqread; + +import java.util.List; + +public class State +{ + public Channel current; + public Channel[] channels; + public State(int size) + { + channels = new Channel[size]; + for (int i = 0; i < channels.length; i++) { + channels[i] = new Channel(); + } + current = channels[0]; + } + public void update(List<Short> v) + { + // Toy + } + public int size() + { + return channels.length; + } +} Property changes on: trunk/flexotask-functiontest/src/highfreqread/State.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/flexotask-functiontest/src/lctes2007/Actuator.java =================================================================== --- trunk/flexotask-functiontest/src/lctes2007/Actuator.java (rev 0) +++ trunk/flexotask-functiontest/src/lctes2007/Actuator.java 2008-10-26 10:58:00 UTC (rev 37) @@ -0,0 +1,36 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package lctes2007; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; +import com.ibm.realtime.flexotask.util.ESystem; + +public class Actuator implements Flexotask +{ + + private FlexotaskInputPort<java.lang.Double> in0; + + @SuppressWarnings("unchecked") + public void initialize(FlexotaskInputPort[] inputs, FlexotaskOutputPort[] outputs, Object parameter) + { + in0 = inputs[0]; + } + + public void execute() + { + ESystem.out.println(in0.getValue().doubleValue()); + } +} Property changes on: trunk/flexotask-functiontest/src/lctes2007/Actuator.java ______________________________________... [truncated message content] |
From: <jsa...@us...> - 2008-10-23 16:15:37
|
Revision: 35 http://flexotask.svn.sourceforge.net/flexotask/?rev=35&view=rev Author: jsauerbach Date: 2008-10-23 16:15:34 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Update to version 2.0.0. Modified Paths: -------------- trunk/flexotask/META-INF/MANIFEST.MF trunk/flexotask-development/META-INF/MANIFEST.MF trunk/flexotask-editor/META-INF/MANIFEST.MF trunk/flexotask-features/feature.xml trunk/flexotask-generic/META-INF/MANIFEST.MF trunk/flexotask-tuningfork/META-INF/MANIFEST.MF trunk/realtime-analysis/META-INF/MANIFEST.MF Modified: trunk/flexotask/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask/META-INF/MANIFEST.MF 2008-10-23 16:15:09 UTC (rev 34) +++ trunk/flexotask/META-INF/MANIFEST.MF 2008-10-23 16:15:34 UTC (rev 35) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Flexotask Support Bundle-SymbolicName: com.ibm.realtime.flexotask -Bundle-Version: 1.1.0 +Bundle-Version: 2.0.0 Bundle-ClassPath: flexotask.jar Bundle-Vendor: IBM Research Export-Package: com.ibm.realtime.flexotask, Modified: trunk/flexotask-development/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask-development/META-INF/MANIFEST.MF 2008-10-23 16:15:09 UTC (rev 34) +++ trunk/flexotask-development/META-INF/MANIFEST.MF 2008-10-23 16:15:34 UTC (rev 35) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Flexotask Development Time Type Checker Plug-in Bundle-SymbolicName: com.ibm.realtime.flexotask.development;singleton:=true -Bundle-Version: 1.1.0 +Bundle-Version: 2.0.0 Bundle-ClassPath: flexotaskdev.jar Bundle-Activator: com.ibm.realtime.flexotask.development.builder.Activator Bundle-Vendor: IBM Research Modified: trunk/flexotask-editor/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask-editor/META-INF/MANIFEST.MF 2008-10-23 16:15:09 UTC (rev 34) +++ trunk/flexotask-editor/META-INF/MANIFEST.MF 2008-10-23 16:15:34 UTC (rev 35) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Flexotask Graphical Editor Bundle-SymbolicName: com.ibm.realtime.flexotask.editor; singleton:=true -Bundle-Version: 1.1.0 +Bundle-Version: 2.0.0 Bundle-ClassPath: flexotaskEditor.jar Bundle-Activator: com.ibm.realtime.flexotask.editor.EEditPlugin Bundle-Vendor: IBM Research Modified: trunk/flexotask-features/feature.xml =================================================================== --- trunk/flexotask-features/feature.xml 2008-10-23 16:15:09 UTC (rev 34) +++ trunk/flexotask-features/feature.xml 2008-10-23 16:15:34 UTC (rev 35) @@ -1,80 +1,80 @@ -<?xml version="1.0" encoding="UTF-8"?> -<feature - id="com.ibm.realtime.flexotask.feature" - label="Flexible Task Graphs Feature" - version="1.1.0" - provider-name="IBM Research"> - - <description> - Core Features of the Flexible Task Graphs System - </description> - - <copyright> +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="com.ibm.realtime.flexotask.feature" + label="Flexible Task Graphs Feature" + version="2.0.0" + provider-name="IBM Research"> + + <description> + Core Features of the Flexible Task Graphs System + </description> + + <copyright> Copyright (c) 2006 - 2008 IBM Corporation. -All rights reserved. - </copyright> - - <license> +All rights reserved. + </copyright> + + <license> This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at -http://www.eclipse.org/legal/epl-v10.html - </license> - - <url> - <update label="Flexible Task Graphs" url="http://flexotask.sourceforge.net/update-site"/> - </url> - - <requires> - <import plugin="com.ibm.realtime.analysis"/> - <import plugin="com.ibm.realtime.flexotask.generic"/> - <import plugin="com.ibm.realtime.flexotask"/> - <import plugin="org.eclipse.gef" version="3.2.0" match="compatible"/> - <import plugin="org.eclipse.ui" version="3.2.0" match="compatible"/> - <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> - <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/> - <import plugin="org.eclipse.ui.views" version="3.2.0" match="compatible"/> - <import plugin="org.eclipse.ui.ide" version="3.2.0" match="compatible"/> - <import plugin="org.eclipse.jdt.ui"/> - <import plugin="org.eclipse.jdt.core"/> - <import plugin="org.eclipse.ant.core"/> - <import plugin="org.eclipse.pde.core"/> - <import plugin="org.eclipse.ui.console"/> - <import plugin="com.ibm.realtime.flexotask.editor"/> - <import plugin="org.eclipse.jdt.launching"/> - <import feature="org.eclipse.pde" version="3.3.2.R33x_r20071022-7N7M4CYWLBCz-yHkMIuHN"/> - <import feature="org.eclipse.gef" version="3.3.1.v20070814"/> - </requires> - - <plugin - id="com.ibm.realtime.analysis" - download-size="0" - install-size="0" - version="1.1.0"/> - - <plugin - id="com.ibm.realtime.flexotask" - download-size="0" - install-size="0" - version="1.1.0"/> - - <plugin - id="com.ibm.realtime.flexotask.editor" - download-size="0" - install-size="0" - version="1.1.0"/> - - <plugin - id="com.ibm.realtime.flexotask.generic" - download-size="0" - install-size="0" - version="1.1.0"/> - - <plugin - id="com.ibm.realtime.flexotask.development" - download-size="0" - install-size="0" - version="1.1.0"/> - -</feature> +http://www.eclipse.org/legal/epl-v10.html + </license> + + <url> + <update label="Flexible Task Graphs" url="http://flexotask.sourceforge.net/update-site"/> + </url> + + <requires> + <import plugin="com.ibm.realtime.analysis"/> + <import plugin="com.ibm.realtime.flexotask.generic"/> + <import plugin="com.ibm.realtime.flexotask"/> + <import plugin="org.eclipse.gef" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.ui" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.core.runtime" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.core.resources" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.ui.views" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.ui.ide" version="3.2.0" match="compatible"/> + <import plugin="org.eclipse.jdt.ui"/> + <import plugin="org.eclipse.jdt.core"/> + <import plugin="org.eclipse.ant.core"/> + <import plugin="org.eclipse.pde.core"/> + <import plugin="org.eclipse.ui.console"/> + <import plugin="com.ibm.realtime.flexotask.editor"/> + <import plugin="org.eclipse.jdt.launching"/> + <import feature="org.eclipse.pde" version="3.3.2.R33x_r20071022-7N7M4CYWLBCz-yHkMIuHN"/> + <import feature="org.eclipse.gef" version="3.3.1.v20070814"/> + </requires> + + <plugin + id="com.ibm.realtime.analysis" + download-size="0" + install-size="0" + version="2.0.0"/> + + <plugin + id="com.ibm.realtime.flexotask" + download-size="0" + install-size="0" + version="2.0.0"/> + + <plugin + id="com.ibm.realtime.flexotask.editor" + download-size="0" + install-size="0" + version="2.0.0"/> + + <plugin + id="com.ibm.realtime.flexotask.generic" + download-size="0" + install-size="0" + version="2.0.0"/> + + <plugin + id="com.ibm.realtime.flexotask.development" + download-size="0" + install-size="0" + version="2.0.0"/> + +</feature> Modified: trunk/flexotask-generic/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask-generic/META-INF/MANIFEST.MF 2008-10-23 16:15:09 UTC (rev 34) +++ trunk/flexotask-generic/META-INF/MANIFEST.MF 2008-10-23 16:15:34 UTC (rev 35) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Generic Types extension for Flexotask Bundle-SymbolicName: com.ibm.realtime.flexotask.generic -Bundle-Version: 1.1.0 +Bundle-Version: 2.0.0 Bundle-Vendor: IBM Research Require-Bundle: com.ibm.realtime.flexotask Export-Package: com.ibm.realtime.flexotask, Modified: trunk/flexotask-tuningfork/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask-tuningfork/META-INF/MANIFEST.MF 2008-10-23 16:15:09 UTC (rev 34) +++ trunk/flexotask-tuningfork/META-INF/MANIFEST.MF 2008-10-23 16:15:34 UTC (rev 35) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Flexotask Tuningfork Support Bundle-SymbolicName: com.ibm.realtime.flexotask.tuningfork;singleton:=true -Bundle-Version: 1.1.0 +Bundle-Version: 2.0.0 Export-Package: com.ibm.realtime.flexotask.tuningfork Require-Bundle: com.ibm.realtime.flexotask, com.ibm.tuningfork.traceGeneration, Modified: trunk/realtime-analysis/META-INF/MANIFEST.MF =================================================================== --- trunk/realtime-analysis/META-INF/MANIFEST.MF 2008-10-23 16:15:09 UTC (rev 34) +++ trunk/realtime-analysis/META-INF/MANIFEST.MF 2008-10-23 16:15:34 UTC (rev 35) @@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: Realtime Analysis Plug-in Bundle-SymbolicName: com.ibm.realtime.analysis -Bundle-Version: 1.1.0 +Bundle-Version: 2.0.0 Bundle-Vendor: IBM Research Bundle-ClassPath: realtimeAnalysis.jar, bcel-5.2.jar This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-23 16:15:14
|
Revision: 34 http://flexotask.svn.sourceforge.net/flexotask/?rev=34&view=rev Author: jsauerbach Date: 2008-10-23 16:15:09 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Update to version 2.0.0. Modified Paths: -------------- trunk/flexotask-tuningfork-feature/feature.xml Modified: trunk/flexotask-tuningfork-feature/feature.xml =================================================================== --- trunk/flexotask-tuningfork-feature/feature.xml 2008-10-23 15:51:56 UTC (rev 33) +++ trunk/flexotask-tuningfork-feature/feature.xml 2008-10-23 16:15:09 UTC (rev 34) @@ -1,61 +1,61 @@ -<?xml version="1.0" encoding="UTF-8"?> -<feature - id="com.ibm.realtime.flexotask.tuningfork" - label="Flexotask Tuningfork Tracing" - version="1.1.0" - provider-name="IBM Research"> - - <description> +<?xml version="1.0" encoding="UTF-8"?> +<feature + id="com.ibm.realtime.flexotask.tuningfork" + label="Flexotask Tuningfork Tracing" + version="2.0.0" + provider-name="IBM Research"> + + <description> Uses the JavaTraceGenerationViaNative capability of TuningFork -to provide a tracing capability for Flexotask schedulers. - </description> - - <copyright> +to provide a tracing capability for Flexotask schedulers. + </description> + + <copyright> Copyright (c) 2006 - 2008 IBM Corporation. -All rights reserved. - </copyright> - - <license> +All rights reserved. + </copyright> + + <license> This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at -http://www.eclipse.org/legal/epl-v10.html - </license> - - <url> - <update label="Flexible Task Graphs" url="http://flexotask.sourceforge.net/update-site"/> - </url> - - <requires> - <import plugin="com.ibm.tuningfork.traceGeneration"/> - <import plugin="com.ibm.realtime.flexotask"/> - <import plugin="com.ibm.tuningfork.traceGeneration.vianative"/> - <import plugin="com.ibm.realtime.analysis"/> - <import feature="com.ibm.realtime.flexotask.feature" version="1.1.0"/> - <import plugin="com.ibm.realtime.flexotask.editor"/> - <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.jdt.core"/> - </requires> - - <plugin - id="com.ibm.tuningfork.traceGeneration" - download-size="0" - install-size="0" - version="1.2.0" - unpack="false"/> - - <plugin - id="com.ibm.tuningfork.traceGeneration.vianative" - download-size="0" - install-size="0" - version="1.2.0" - unpack="false"/> - - <plugin - id="com.ibm.realtime.flexotask.tuningfork" - download-size="0" - install-size="0" - version="1.1.0"/> - -</feature> +http://www.eclipse.org/legal/epl-v10.html + </license> + + <url> + <update label="Flexible Task Graphs" url="http://flexotask.sourceforge.net/update-site"/> + </url> + + <requires> + <import plugin="com.ibm.tuningfork.traceGeneration"/> + <import plugin="com.ibm.realtime.flexotask"/> + <import plugin="com.ibm.tuningfork.traceGeneration.vianative"/> + <import plugin="com.ibm.realtime.analysis"/> + <import feature="com.ibm.realtime.flexotask.feature" version="1.1.0"/> + <import plugin="com.ibm.realtime.flexotask.editor"/> + <import plugin="org.eclipse.core.runtime"/> + <import plugin="org.eclipse.jdt.core"/> + </requires> + + <plugin + id="com.ibm.tuningfork.traceGeneration" + download-size="0" + install-size="0" + version="2.0.0" + unpack="false"/> + + <plugin + id="com.ibm.tuningfork.traceGeneration.vianative" + download-size="0" + install-size="0" + version="2.0.0" + unpack="false"/> + + <plugin + id="com.ibm.realtime.flexotask.tuningfork" + download-size="0" + install-size="0" + version="2.0.0"/> + +</feature> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-23 15:51:59
|
Revision: 33 http://flexotask.svn.sourceforge.net/flexotask/?rev=33&view=rev Author: jsauerbach Date: 2008-10-23 15:51:56 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Add Short cache to the list of safely immutable classes. Modified Paths: -------------- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations 2008-10-23 15:51:28 UTC (rev 32) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/immutability-declarations 2008-10-23 15:51:56 UTC (rev 33) @@ -1,34 +1,35 @@ ref java.lang.Throwable cause ref java.lang.Throwable stackTrace full java.lang.Integer$IntegerCache cache +full java.lang.Short$ShortCache cache full java.lang.Integer digits full java.lang.Integer sizeTable full java.lang.Integer DigitOnes -full java.lang.Integer DigitTens +full java.lang.Integer DigitTens full java.lang.Class -full java.lang.AbstractStringBuilder sizeTable -full java.lang.Math aT -full java.lang.Math atanhi -full java.lang.Math atanlo -full java.lang.Math npio2_hw -full java.lang.Math two_over_pi -full java.lang.Math init_jk -full java.lang.Math PIo2 +full java.lang.AbstractStringBuilder sizeTable +full java.lang.Math aT +full java.lang.Math atanhi +full java.lang.Math atanlo +full java.lang.Math npio2_hw +full java.lang.Math two_over_pi +full java.lang.Math init_jk +full java.lang.Math PIo2 full java.lang.String -full java.util.HashSet PRESENT -full java.util.HashMap NULL_KEY -full sun.misc.FloatingDecimal infinity -full sun.misc.FloatingDecimal notANumber -full sun.misc.FloatingDecimal zero -full sun.misc.FloatingDecimal long5pow -full sun.misc.FloatingDecimal n5bits -full sun.misc.FloatingDecimal small5pow -full sun.misc.FloatingDecimal b5p -full sun.misc.FloatingDecimal big5pow -full sun.misc.FloatingDecimal perThreadBuffer -full com.ibm.realtime.flexotask.util.ESystem out -full com.ibm.realtime.flexotask.util.ESystem err -ref com.ibm.realtime.flexotask.util.AbstractImmutableArray array -full com.ibm.realtime.flexotask.util.NativeIO registry -full com.ibm.oti.util.NumberConverter TEN_TO_THE -full com.ibm.oti.util.Msg bundle +full java.util.HashSet PRESENT +full java.util.HashMap NULL_KEY +full sun.misc.FloatingDecimal infinity +full sun.misc.FloatingDecimal notANumber +full sun.misc.FloatingDecimal zero +full sun.misc.FloatingDecimal long5pow +full sun.misc.FloatingDecimal n5bits +full sun.misc.FloatingDecimal small5pow +full sun.misc.FloatingDecimal b5p +full sun.misc.FloatingDecimal big5pow +full sun.misc.FloatingDecimal perThreadBuffer +full com.ibm.realtime.flexotask.util.ESystem out +full com.ibm.realtime.flexotask.util.ESystem err +ref com.ibm.realtime.flexotask.util.AbstractImmutableArray array +full com.ibm.realtime.flexotask.util.NativeIO registry +full com.ibm.oti.util.NumberConverter TEN_TO_THE +full com.ibm.oti.util.Msg bundle This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-23 15:51:38
|
Revision: 32 http://flexotask.svn.sourceforge.net/flexotask/?rev=32&view=rev Author: jsauerbach Date: 2008-10-23 15:51:28 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Fix various bugs that caused the new flexotask-functiontest to crash or misbehave. Modified Paths: -------------- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java 2008-10-23 15:49:07 UTC (rev 31) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java 2008-10-23 15:51:28 UTC (rev 32) @@ -41,6 +41,9 @@ /** The objects that were pinned to run this graph */ private Object[] pinned; + + /** The classes that were marked stable in this graph */ + private Class[] stable; /** * Non-public constructor @@ -48,17 +51,18 @@ * @param guards a map from task names to guards for all atomic Flexotasks in the graph * @param pinned objects that were pinned to run this graph */ - FlexotaskGraphImpl(FlexotaskDistributer distributer, Map guards, Object[] pinned) + FlexotaskGraphImpl(FlexotaskDistributer distributer, Map guards, Object[] pinned, Class[] stable) { this.distributer = distributer; this.guards = guards; this.pinned = pinned; + this.stable = stable; FlexotaskSystemSupport.checkSecurity(this, "FlexotaskGraph"); distributer.instantiated(); } /** - * Destroy the FlexotaskTemplate and free all of its resources + * Destroy the FlexotaskGraph and free all of its resources */ public void destroy() { @@ -71,15 +75,28 @@ this.runner = null; } runner.shutdown(); - distributer.destroyed(); + if (distributer != null) { + distributer.destroyed(); + } distributer = null; - exception = null; for (Iterator iterator = guards.values().iterator(); iterator.hasNext();) { AtomicFlexotaskGuard guard = (AtomicFlexotaskGuard) iterator.next(); guard.setDelegate(null); } - FlexotaskObjectPinner.unpinObjects(pinned); + if (pinned != null) { + FlexotaskObjectPinner.unpinObjects(pinned); + } pinned = null; + /* The following is probably temporary, implying that graphs using stable/transient cannot run + * concurrently, which is the case in the underlying VM at the moment. + */ + if (stable != null) { + for (int i = 0; i < stable.length; i++) { + FlexotaskSystemSupport.setStable(stable[i], false); + } + } + stable = null; + FlexotaskSystemSupport.setTransientPolicy(false); // TODO add code to recover memory spaces belonging to FlexotaskControllers } @@ -103,7 +120,7 @@ } /** - * Get the FlexotaskRunner for this FlexotaskTemplate. An FlexotaskRunner controls the + * Get the FlexotaskRunner for this FlexotaskGraph. An FlexotaskRunner controls the * execution of the graph to the extent the scheduler grants such control * @return the runner supplied by the FlexotaskScheduler */ Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java 2008-10-23 15:49:07 UTC (rev 31) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java 2008-10-23 15:51:28 UTC (rev 32) @@ -67,7 +67,7 @@ /* Ensure this method is called at most once per graph lifetime */ if (threadsCreated) { throw new IllegalStateException("Flexotask scheduler attempted to create more than one set " + - "of threads for an FlexotaskTemplate"); + "of threads for a FlexotaskGraph"); } threadsCreated = true; tracerFactory.startThreadCreation(); @@ -139,7 +139,7 @@ * Make a new SchedulerWrapper * @param target the actual scheduler runnable to be wrapped by this wrapper * @param threadContext the context object to use for tracing - * @param graph the FlexotaskTemplate of which this thread is a member + * @param graph the FlexotaskGraph of which this thread is a member */ SchedulerWrapper(Runnable target, ThreadContext threadContext, FlexotaskGraphImpl graph) { @@ -161,8 +161,11 @@ } finally { FlexotaskSystemSupport.becomeFlexotaskThread(false); FlexotaskSystemSupport.runOnPublicHeap(); + if (t != null) { + t = (Throwable) FlexotaskSystemSupport.deepClone(t, null); + } + graph.destroy(); graph.setException(t); - graph.destroy(); //System.err.println("!!!Scheduler thread terminated!!!"); if (t == null) { //System.err.println("Apparently, termination was normal"); Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-23 15:49:07 UTC (rev 31) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-23 15:51:28 UTC (rev 32) @@ -22,7 +22,6 @@ import java.util.Map; import java.util.Set; -import com.ibm.realtime.flexotask.AtomicException; import com.ibm.realtime.flexotask.AtomicFlexotask; import com.ibm.realtime.flexotask.Flexotask; import com.ibm.realtime.flexotask.FlexotaskGraph; @@ -38,7 +37,6 @@ import com.ibm.realtime.flexotask.distribution.FlexotaskTimerService; import com.ibm.realtime.flexotask.scheduling.ConnectionDriver; import com.ibm.realtime.flexotask.scheduling.FlexotaskController; -import com.ibm.realtime.flexotask.scheduling.FlexotaskPredicateController; import com.ibm.realtime.flexotask.scheduling.FlexotaskScheduler; import com.ibm.realtime.flexotask.scheduling.FlexotaskSchedulerRegistry; import com.ibm.realtime.flexotask.scheduling.FlexotaskSchedulingData; @@ -54,6 +52,7 @@ import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; import com.ibm.realtime.flexotask.tracing.FlexotaskTracer; import com.ibm.realtime.flexotask.tracing.FlexotaskTracerFactory; +import com.ibm.realtime.flexotask.util.NanoTime; import com.ibm.realtime.flexotask.validation.AtomicFlexotaskGuard; import com.ibm.realtime.flexotask.vm.FlexotaskRoot; import com.ibm.realtime.flexotask.vm.FlexotaskVMBridge; @@ -71,27 +70,35 @@ /** The classloader to be used to resolve classes needed by the validator */ private static ClassLoader cl = ClassLoader.getSystemClassLoader(); - /* The following ensures that all classes whose instances are used invariably during the - * "flexotask heap" phase of task instantiation are fully initialized, including the assignment of - * their name strings. Otherwise, their name strings could end up allocated in the Flexotask heap. + /* The following ensures that all classes that might have been overlooked by the + * validator during its validation phase because they are part of the system and not + * the application but that might end up being used indirectly by the application are + * also fully initialized. This does not include classes that are used by schedulers, + * tracers: for now, schedulers and tracers are responsible for making their own classes + * live. + * Important: after changing the set of classes that might be involved in this issuse this + * list must be udated! + * TODO this procedure is very fragile ... let's try to do something better. */ static { - /* Invariant classes */ - FlexotaskCommunicator.class.getName(); - FlexotaskChannel.class.getName(); - FlexotaskCommunicatorTemplate.class.getName(); - FlexotaskController.class.getName(); - FlexotaskInputPort.class.getName(); + FlexotaskRoot.class.getName(); FlexotaskInputPort[].class.getName(); - FlexotaskOutputPort.class.getName(); + FlexotaskInputPortImpl.class.getName(); FlexotaskOutputPort[].class.getName(); - FlexotaskPredicateController.class.getName(); - FlexotaskPredicateTemplate.class.getName(); + FlexotaskOutputPortImpl.class.getName(); + Flexotask.class.getName(); FlexotaskValidationException.class.getName(); - FlexotaskRoot.class.getName(); + AtomicFlexotask.class.getName(); TransactionalOperations.class.getName(); - AtomicException.class.getName(); - ExecutionAbortedException.class.getName(); + TimeAware.class.getName(); + PortBuffer.class.getName(); + FlexotaskTracer.class.getName(); + FlexotaskTaskTracer.class.getName(); + FlexotaskTracer.NullTracer.class.getName(); + FlexotaskPredicateTemplate.class.getName(); + FlexotaskController.class.getName(); + FlexotaskControllerImpl.class.getName(); + NanoTime.class.getName(); } /** @@ -196,6 +203,8 @@ /* Pin any objects that must be pinned. */ verbosePinObjects(toPin, "heap objects found during validation"); + /* Transfer stable/transient information to runtime */ + Class[] stable = initStableTransient(specification); /* Instantiate the graph */ tracerFactory.startInstantiation(); Map instantiationMap; @@ -235,7 +244,7 @@ toPin = allPinned; } /* Create the graph */ - FlexotaskGraphImpl ans = new FlexotaskGraphImpl(distributer, guards, toPin); + FlexotaskGraphImpl ans = new FlexotaskGraphImpl(distributer, guards, toPin, stable); /* Schedule the graph */ tracerFactory.startScheduling(); FlexotaskThreadFactory factory = new FlexotaskThreadFactoryImpl(timer, tracerFactory, ans); @@ -266,7 +275,7 @@ } /** - * Check an FlexotaskTemplate for internal consistency. A consistent specification + * Check a FlexotaskTemplate for internal consistency. A consistent specification * is one that would be valid if all the code of all the Flexotasks proves to be valid. * <p>The following consistency rules are enforced (bear in mind that graph inputs and * outputs and communicators are also tasks at this level). @@ -432,9 +441,6 @@ private static Map instantiate(FlexotaskTemplate specification, Map heapSizes, Map initializationMap, FlexotaskTimer timer) throws FlexotaskValidationException { - /* Transfer stable/transient information to runtime */ - initStableTransient(specification); - Map byRefConnMap = new HashMap(); /** Map the between task name and a list of the names of its output ports that are by-reference */ for (Iterator iter = specification.getConnections().iterator(); iter.hasNext();) { @@ -488,23 +494,36 @@ /** * Initialize the stable/transient information in the runtime * @param template the template to use for this information + * @return the array of stable classes for recovery at termination or null if the default + * policy is used * @throws FlexotaskValidationException * @throws ClassNotFoundException */ - private static void initStableTransient(FlexotaskTemplate template) throws FlexotaskValidationException + private static Class[] initStableTransient(FlexotaskTemplate template) throws FlexotaskValidationException { if (template.getStableMode() == FlexotaskStableMode.DEFAULT) { - return; + FlexotaskSystemSupport.setTransientPolicy(false); + return null; } Set stableClasses = template.getStableClasses(); + Class[] ans = new Class[stableClasses.size()]; try { + int index = 0; for (Iterator iterator = stableClasses.iterator(); iterator.hasNext();) { - FlexotaskSystemSupport.setStable(CodeValidator.resolveClass((String) iterator.next(), cl), true); + Class aClass = CodeValidator.resolveClass((String) iterator.next(), cl); + FlexotaskSystemSupport.setStable(aClass, true); + ans[index++] = aClass; } } catch (ClassNotFoundException e) { + for (int i = 0; i < ans.length; i++) { + if (ans[i] != null) { + FlexotaskSystemSupport.setStable(ans[i], false); + } + } throw new FlexotaskValidationException("Could not find declared stable class: " + e.getMessage()); } FlexotaskSystemSupport.setTransientPolicy(true); + return ans; } /** @@ -641,22 +660,28 @@ * location. Restore the memory space before doing the collect so that the collect isn't * confused with a synchronous GC. */ + flexotask = null; // Kill this: it is unsafe to use after GC! FlexotaskSystemSupport.runOnPublicHeap(); //System.err.println("About to garbage collect initial heap of " + task.getName()); FlexotaskSystemSupport.collectHeap(root); + //System.err.println("Collected " + task.getName()); /* Create the proper kind of controller for this task. */ FlexotaskTaskTracer tracer = tracerFactory.newTaskTracer(task.getName()); + //System.err.println("Created tracer for " + task.getName()); if (task instanceof FlexotaskPredicateTemplate) { return new FlexotaskPredicateControllerImpl(root, task.getName(), tracer); - } else if (flexotask instanceof AtomicFlexotask){ + } + //System.err.println("Testing for AtomicFlexotask: " + task.getName()); + if (root.getTask() instanceof AtomicFlexotask) { + /* Call root.getTask() ... don't use flexotask variable from before because the object + * may have moved! */ return new AtomicFlexotaskController(root, task.getName(), tracer); - } - else { + } else { return new FlexotaskControllerImpl(root, task.getName(), tracer); } } finally { /* TODO: clean up for errors that occur after memory space has been created but before - * instantiation is complete. But, to do this, we also need a clean FlexotaskTemplate + * instantiation is complete. But, to do this, we also need a clean FlexotaskGraph * tear-down story, even for the normal case, which is not yet in place. */ FlexotaskSystemSupport.runOnPublicHeap(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-23 15:49:15
|
Revision: 31 http://flexotask.svn.sourceforge.net/flexotask/?rev=31&view=rev Author: jsauerbach Date: 2008-10-23 15:49:07 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Fix class names that got broken when classes moved. Modified Paths: -------------- trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/CodeRewriter.java trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/InstructionUtils.java Modified: trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/CodeRewriter.java =================================================================== --- trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/CodeRewriter.java 2008-10-23 15:45:52 UTC (rev 30) +++ trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/CodeRewriter.java 2008-10-23 15:49:07 UTC (rev 31) @@ -487,7 +487,7 @@ final int idxRuntimeExceptionClass = toAnalyzeGen.getConstantPool().addClass("java.lang.RuntimeException"); final int idxErrorClass = toAnalyzeGen.getConstantPool().addClass("java.lang.Error"); final int idxObjectClass = toAnalyzeGen.getConstantPool().addClass("java.lang.Object"); - final int idxEAExceptionClass = toAnalyzeGen.getConstantPool().addClass("com.ibm.realtime.flexotask.ExecutionAbortedException"); + final int idxEAExceptionClass = toAnalyzeGen.getConstantPool().addClass("com.ibm.realtime.flexotask.system.ExecutionAbortedException"); final int idxAExceptionClass = toAnalyzeGen.getConstantPool().addClass("com.ibm.realtime.flexotask.AtomicException"); final int idxISExceptionClass = toAnalyzeGen.getConstantPool().addClass("java.lang.IllegalStateException"); // add necessary methods to CP @@ -533,7 +533,7 @@ ilEpilog.append(new ATHROW()); // throw 'AtomicException' // add exception handler for ExecutionAbortedException - toAnalyzeGen.addExceptionHandler(ihEpilogStart, ihEpilogExceptionHndlStart.getPrev(), ihEpilogExceptionHndlStart, new ObjectType("com.ibm.realtime.flexotask.ExecutionAbortedException")); + toAnalyzeGen.addExceptionHandler(ihEpilogStart, ihEpilogExceptionHndlStart.getPrev(), ihEpilogExceptionHndlStart, new ObjectType("com.ibm.realtime.flexotask.system.ExecutionAbortedException")); // EPILOG end Modified: trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/InstructionUtils.java =================================================================== --- trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/InstructionUtils.java 2008-10-23 15:45:52 UTC (rev 30) +++ trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/InstructionUtils.java 2008-10-23 15:49:07 UTC (rev 31) @@ -24,7 +24,7 @@ */ class InstructionUtils implements OpcodeConstants { - private static final String TXN_OPERATIONS = "com.ibm.realtime.flexotask.TransactionalOperations"; + private static final String TXN_OPERATIONS = "com.ibm.realtime.flexotask.system.TransactionalOperations"; static InstructionList getSubroutineJumpForReturnInstruction(ReturnInstruction ins, InstructionHandle ihSubroutine, int localVarIdx) { InstructionList ilJsr = new InstructionList(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-23 15:45:56
|
Revision: 30 http://flexotask.svn.sourceforge.net/flexotask/?rev=30&view=rev Author: jsauerbach Date: 2008-10-23 15:45:52 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Fix systematic confusion in comments between FlexotaskGraph and FlexotaskTemplate, probably resulting from previous mass edit. Modified Paths: -------------- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributerFactory.java trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributionContext.java trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/DelegatingFlexotaskRunner.java trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskScheduler.java trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskThreadFactory.java Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributerFactory.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributerFactory.java 2008-10-23 15:43:02 UTC (rev 29) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributerFactory.java 2008-10-23 15:45:52 UTC (rev 30) @@ -16,7 +16,7 @@ import com.ibm.realtime.flexotask.template.FlexotaskValidationException; /** - * A representation of a system for distributing FlexotaskTemplates across process boundaries. + * A representation of a system for distributing FlexotaskGraphs across process boundaries. * FlexotaskDistributerFactories are named and registered with the FlexotaskDistributerRegistry. */ public interface FlexotaskDistributerFactory Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributionContext.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributionContext.java 2008-10-23 15:43:02 UTC (rev 29) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributionContext.java 2008-10-23 15:45:52 UTC (rev 30) @@ -16,7 +16,7 @@ /** * An interface implemented by exotask graph distribution systems. In addition to reporting the * system type required by the graph, objects implementing this interface typically encapsulate - * state needed to give the present (single process) FlexotaskTemplate a larger context + * state needed to give the present (single process) FlexotaskGraph a larger context * as part of a distributed exotask graph specification. */ public interface FlexotaskDistributionContext Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/DelegatingFlexotaskRunner.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/DelegatingFlexotaskRunner.java 2008-10-23 15:43:02 UTC (rev 29) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/DelegatingFlexotaskRunner.java 2008-10-23 15:45:52 UTC (rev 30) @@ -16,8 +16,8 @@ import com.ibm.realtime.flexotask.FlexotaskRunner; /** - * An FlexotaskRunner to be exposed outside the FlexotaskTemplate for the case where the scheduler's - * FlexotaskRunner is also one of its Runnables and is hence inside the FlexotaskTemplate. For + * An FlexotaskRunner to be exposed outside the FlexotaskGraph for the case where the scheduler's + * FlexotaskRunner is also one of its Runnables and is hence inside the FlexotaskGraph. For * example, FlexotaskSingleThreadRunner uses this class to provide the necessary isolation. * When the graph is shut down, the connection between this runner and the real runner is severed. */ Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskScheduler.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskScheduler.java 2008-10-23 15:43:02 UTC (rev 29) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskScheduler.java 2008-10-23 15:45:52 UTC (rev 30) @@ -21,7 +21,7 @@ /** * An FlexotaskScheduler is responsible for actually running all the Runnables in an - * FlexotaskTemplate. Only the Scheduler has access to these Runnables. No code outside the Flexotask + * FlexotaskGraph. Only the Scheduler has access to these Runnables. No code outside the Flexotask * system will be able to access them. * <p>A scheduler must be registered, and it will be rejected if it does not come from the * boot classpath (this check may be relaxed eventually to encompass other trusted code sources). Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java 2008-10-23 15:43:02 UTC (rev 29) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSingleThreadRunner.java 2008-10-23 15:45:52 UTC (rev 30) @@ -182,7 +182,7 @@ waitForOwnership(); if (threadState == THREAD_SHUT_DOWN) { throw new IllegalStateException( - "Trying to start a dead FlexotaskTemplate"); + "Trying to start a dead FlexotaskGraph"); } requestState = REQUEST_START; lock.notifyAll(); @@ -321,7 +321,7 @@ /** * Convenient version of cloneAndStartThread when there are no slave threads * @param toClone the FlexotaskSingleThreadRunner (extended) that is to be cloned and started - * @param threadFactory the FlexotaskThreadFactory for the current FlexotaskTemplate + * @param threadFactory the FlexotaskThreadFactory for the current FlexotaskGraph * @return the FlexotaskRunner object that the scheduler should return to the validator */ public static FlexotaskRunner cloneAndStartThread(FlexotaskSingleThreadRunner toClone, FlexotaskThreadFactory threadFactory) @@ -336,7 +336,7 @@ * runnable ("the master thread"). The slave threads are not started automatically; it is up to the * master thread to manage them. * @param toClone the FlexotaskSingleThreadRunner (extended) that is to be cloned and started - * @param threadFactory the FlexotaskThreadFactory for the current FlexotaskTemplate + * @param threadFactory the FlexotaskThreadFactory for the current FlexotaskGraph * @param otherRunnables the FlexotaskSchedulerRunnables for the other threads to be created (if any); null or the empty array if none * @return the FlexotaskRunner object that the scheduler should return to the validator */ Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskThreadFactory.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskThreadFactory.java 2008-10-23 15:43:02 UTC (rev 29) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskThreadFactory.java 2008-10-23 15:45:52 UTC (rev 30) @@ -29,7 +29,7 @@ public void addPropertyToTrace(String name, String value); /** - * Create the scheduler heap and the set of scheduler threads for this FlexotaskTemplate + * Create the scheduler heap and the set of scheduler threads for this FlexotaskGraph * @param runnables the array of FlexotaskSchedulerRunnables (at least one) that the Scheduler will * use. A successful execution of the method causes every member of the array to be replaced * with a clone that resides in the scheduler's memory space. @@ -37,7 +37,7 @@ * heap and will be pinned there. * @return an array of Threads of the same length as the argument * @exception IllegalStateException if this method is called more than once in the lifetime - * of this FlexotaskThreadFactory, whose lifetime is that of the FlexotaskTemplate. + * of this FlexotaskThreadFactory, whose lifetime is that of the FlexotaskGraph. */ public Thread[] createThreads(FlexotaskSchedulerRunnable[] runnables, Object[] locks); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-23 15:43:31
|
Revision: 29 http://flexotask.svn.sourceforge.net/flexotask/?rev=29&view=rev Author: jsauerbach Date: 2008-10-23 15:43:02 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Ensure correct file header is used by default. Modified Paths: -------------- trunk/flexotask-development/.settings/org.eclipse.jdt.ui.prefs Added Paths: ----------- trunk/flexotask-editor/.settings/ trunk/flexotask-editor/.settings/org.eclipse.jdt.ui.prefs trunk/flexotask-generic/.settings/org.eclipse.jdt.ui.prefs trunk/flexotask-tuningfork/.settings/org.eclipse.jdt.ui.prefs trunk/realtime-analysis/.settings/org.eclipse.jdt.ui.prefs Modified: trunk/flexotask-development/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/flexotask-development/.settings/org.eclipse.jdt.ui.prefs 2008-10-22 10:27:41 UTC (rev 28) +++ trunk/flexotask-development/.settings/org.eclipse.jdt.ui.prefs 2008-10-23 15:43:02 UTC (rev 29) @@ -8,4 +8,4 @@ org.eclipse.jdt.ui.javadoc=false org.eclipse.jdt.ui.keywordthis=false org.eclipse.jdt.ui.overrideannotation=true -org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> Added: trunk/flexotask-editor/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/flexotask-editor/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/flexotask-editor/.settings/org.eclipse.jdt.ui.prefs 2008-10-23 15:43:02 UTC (rev 29) @@ -0,0 +1,3 @@ +#Wed Oct 22 15:32:07 EDT 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> Added: trunk/flexotask-generic/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/flexotask-generic/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/flexotask-generic/.settings/org.eclipse.jdt.ui.prefs 2008-10-23 15:43:02 UTC (rev 29) @@ -0,0 +1,3 @@ +#Wed Oct 22 15:33:51 EDT 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> Added: trunk/flexotask-tuningfork/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/flexotask-tuningfork/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/flexotask-tuningfork/.settings/org.eclipse.jdt.ui.prefs 2008-10-23 15:43:02 UTC (rev 29) @@ -0,0 +1,3 @@ +#Wed Oct 22 15:34:36 EDT 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> Added: trunk/realtime-analysis/.settings/org.eclipse.jdt.ui.prefs =================================================================== --- trunk/realtime-analysis/.settings/org.eclipse.jdt.ui.prefs (rev 0) +++ trunk/realtime-analysis/.settings/org.eclipse.jdt.ui.prefs 2008-10-23 15:43:02 UTC (rev 29) @@ -0,0 +1,3 @@ +#Wed Oct 22 15:32:57 EDT 2008 +eclipse.preferences.version=1 +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/** */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\r\n * This file is part of Flexible Task Graphs\r\n * (http\://sourceforge.net/projects/flexotasks)\r\n *\r\n * Copyright (c) 2006 - 2008 IBM Corporation.\r\n * All rights reserved. This program and the accompanying materials\r\n * are made available under the terms of the Eclipse Public License v1.0\r\n * which accompanies this distribution, and is available at\r\n * http\://www.eclipse.org/legal/epl-v10.html\r\n *\r\n * Contributors\:\r\n * IBM Corporation - initial API and implementation\r\n */\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-22 10:27:47
|
Revision: 28 http://flexotask.svn.sourceforge.net/flexotask/?rev=28&view=rev Author: jsauerbach Date: 2008-10-22 10:27:41 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Split FlexotaskTimer into a portion that can be made visible to TimeAware Flexotasks (adding the TimeAware interface) and a portion that is only for the scheduler's use. Note that we don't actually check that Flexotasks don't cast their timer and call nanosleep (which should be illegal) but for that matter we don't currently forbid Thread.sleep() either ... both should be checked. Modified Paths: -------------- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributer.java trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSchedulerRunnable.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java Added Paths: ----------- trunk/flexotask/src/com/ibm/realtime/flexotask/FlexotaskTimer.java trunk/flexotask/src/com/ibm/realtime/flexotask/TimeAware.java trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimerService.java Removed Paths: ------------- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimer.java Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/FlexotaskTimer.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimer.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/FlexotaskTimer.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/FlexotaskTimer.java 2008-10-22 10:27:41 UTC (rev 28) @@ -0,0 +1,28 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask; + + +/** + * Interface to be implemented either by the system or by a distributer component to provide time + * information to the scheduler and to TimeAware Flexotasks (see {@link TimeAware}). + */ +public interface FlexotaskTimer +{ + /** + * Provide an arbitrary-origin high-precision time + * @return a time in nanoseconds from an arbitrary origin + */ + public long nanoTime(); +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/FlexotaskTimer.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Added: trunk/flexotask/src/com/ibm/realtime/flexotask/TimeAware.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/TimeAware.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/TimeAware.java 2008-10-22 10:27:41 UTC (rev 28) @@ -0,0 +1,30 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask; + +import com.ibm.realtime.flexotask.util.NanoTime; + + +/** + * An interface to be additionally implemented by a Flexotask that wants to be aware of real time on the same timescale as the scheduler. + * This timescale will be the same as that given by the {@link NanoTime} utility + * such a clock provided by a distributer. + */ +public interface TimeAware { + /** + * This method will be called once during Flexotask initialization (after initialize is called) + * @param timer the FlexotaskTimer to be used to get timestamp + */ + public void setTimer(FlexotaskTimer timer); +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/TimeAware.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributer.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributer.java 2008-10-21 20:23:28 UTC (rev 27) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskDistributer.java 2008-10-22 10:27:41 UTC (rev 28) @@ -19,7 +19,7 @@ /** * Distributers must extend this class to achieve distribution across machines. - * <p>An FlexotaskTemplate that is distributed across multiple processes will have a distributer to + * <p>A Flexotask graph that is distributed across multiple processes will have a distributer to * handle communication and clock synchronization. A registered FlexotaskDistributerFactory will * create FlexotaskDistributer for the graph given an FlexotaskDistributionContext. FlexotaskDistributer * implementations must inherit from this one. It implements degenerate behavior suitable @@ -41,12 +41,12 @@ } /** - * Get an FlexotaskTimer for scheduler threads to use - * @return an FlexotaskTimer suitable for this distribution paradigm + * Get a FlexotaskTimerService for scheduler threads to use + * @return a FlexotaskTimerService suitable for this distribution paradigm */ - public FlexotaskTimer getTimer() + public FlexotaskTimerService getTimerService() { - return new TrivialTimer(); + return new LocalTimerService(); } /** @@ -77,9 +77,9 @@ } /** - * A Trivial timer class + * A FlexotaskTimerService that just uses local time */ - public static class TrivialTimer implements FlexotaskTimer + public static class LocalTimerService implements FlexotaskTimerService { // @see com.ibm.realtime.flexotask.distribution.FlexotaskTimer#nanoTime() public long nanoTime() Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimer.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimer.java 2008-10-21 20:23:28 UTC (rev 27) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimer.java 2008-10-22 10:27:41 UTC (rev 28) @@ -1,34 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.distribution; - -/** - * Interface to be implemented by distributers to provide a global clock to all exotasks in a - * distributed graph - */ -public interface FlexotaskTimer -{ - /** - * Provide an arbitrary-origin high-precision time - * @return a time in nanoseconds from an arbitrary origin - */ - public long nanoTime(); - - /** - * Sleep the calling thread (a Flexotask scheduler thread) until a specified time in the - * nanoTime scale - * @param deadline the time in nanoseconds at which to wake up (same time scale as nanoTime) - */ - public void nanosleep(long deadline); -} Added: trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimerService.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimerService.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimerService.java 2008-10-22 10:27:41 UTC (rev 28) @@ -0,0 +1,33 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.distribution; + +import com.ibm.realtime.flexotask.FlexotaskTimer; +import com.ibm.realtime.flexotask.distribution.FlexotaskDistributer.LocalTimerService; + +/** + * A distributer may implement this service, which allows it to establish a distributed timescale. + * Both the nanoTime method (of the superinterface {@link FlexotaskTimer}) and the nanosleep method + * of this interface should be implemented, and they must be consistent with each other. A distributer + * may also use the default {@link LocalTimerService} provided by the base distributer implementation, which + * uses the local machine clock. + */ +public interface FlexotaskTimerService extends FlexotaskTimer { + /** + * Sleep the calling thread (a Flexotask scheduler thread) until a specified time in the + * nanoTime scale + * @param deadline the time in nanoseconds at which to wake up (same time scale as nanoTime) + */ + public void nanosleep(long deadline); +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/distribution/FlexotaskTimerService.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSchedulerRunnable.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSchedulerRunnable.java 2008-10-21 20:23:28 UTC (rev 27) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/scheduling/FlexotaskSchedulerRunnable.java 2008-10-22 10:27:41 UTC (rev 28) @@ -13,21 +13,21 @@ */ package com.ibm.realtime.flexotask.scheduling; -import com.ibm.realtime.flexotask.distribution.FlexotaskTimer; +import com.ibm.realtime.flexotask.distribution.FlexotaskTimerService; /** * Class that every scheduler thread must extend to form its runnable */ public abstract class FlexotaskSchedulerRunnable implements Runnable { - /** The FlexotaskTimer to use for this Runnable */ - private FlexotaskTimer timer; + /** The FlexotaskTimerService to use for this Runnable */ + private FlexotaskTimerService timer; /** - * Set the timer. Called exactly once from the thread factory + * Set the timer service. Called exactly once from the thread factory * @param timer the new timer to set */ - public void setTimer(FlexotaskTimer timer) + public void setTimerService(FlexotaskTimerService timer) { this.timer = timer; } Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java 2008-10-21 20:23:28 UTC (rev 27) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java 2008-10-22 10:27:41 UTC (rev 28) @@ -30,6 +30,7 @@ import com.ibm.realtime.flexotask.Flexotask; import com.ibm.realtime.flexotask.FlexotaskInputPort; import com.ibm.realtime.flexotask.FlexotaskOutputPort; +import com.ibm.realtime.flexotask.FlexotaskTimer; import com.ibm.realtime.flexotask.Stable; import com.ibm.realtime.flexotask.template.FlexotaskStableMode; import com.ibm.realtime.flexotask.template.FlexotaskTaskTemplate; @@ -197,10 +198,11 @@ * Instance method to perform validation. Called from FlexotaskValidator * @param initializationMap the Map from task names to Objects being passed to flexotask initialize methods * as parameters + * @param timer the FlexotaskTimer to be used by the graph (treated like a by-ref parameter) * @return an array of objects that must be pinned on the global heap * @throws FlexotaskValidationException if there is any error in the specification */ - Object[] validate(Map initializationMap) throws FlexotaskValidationException + Object[] validate(Map initializationMap, FlexotaskTimer timer) throws FlexotaskValidationException { /* Enter try block to catch various exceptions */ try { @@ -223,6 +225,8 @@ } } } + /* Process the timer similarly to a by-ref parameter */ + processObjectOnHeap(timer, null, new HeapCheckContext(null, timer.getClass().getName()), CHECK_REF_IMMUTABLE); /* Prime liveClasses with all of the classes that are specified as flexotask implementations. * And, prime the methods to be analyzed with the <init>, initialize and execute methods of each task class. */ Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java 2008-10-21 20:23:28 UTC (rev 27) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskThreadFactoryImpl.java 2008-10-22 10:27:41 UTC (rev 28) @@ -13,8 +13,7 @@ */ package com.ibm.realtime.flexotask.system; -import com.ibm.realtime.flexotask.distribution.FlexotaskDistributer; -import com.ibm.realtime.flexotask.distribution.FlexotaskTimer; +import com.ibm.realtime.flexotask.distribution.FlexotaskTimerService; import com.ibm.realtime.flexotask.scheduling.FlexotaskSchedulerRunnable; import com.ibm.realtime.flexotask.scheduling.FlexotaskThreadFactory; import com.ibm.realtime.flexotask.tracing.FlexotaskTracerFactory; @@ -29,8 +28,8 @@ */ private boolean threadsCreated; - /** The distributer for this graph */ - private FlexotaskDistributer distributer; + /** The pinned timer service object for this graph */ + private FlexotaskTimerService timer; /** The tracer factory for this graph */ private FlexotaskTracerFactory tracerFactory; @@ -40,14 +39,14 @@ /** * Can only be constructed by the validator - * @param distributer the distributer for the graph, used to create a timer when the time comes + * @param timer the pinned FlexotaskTimerService for the graph * @param tracerFactory the tracer factory for the graph, used to bind created threads to the * tracing system - * @param graph the FlexotaskTemplate to which this Threadfactory belongs + * @param graph the FlexotaskGraphImpl to which this Threadfactory belongs */ - FlexotaskThreadFactoryImpl(FlexotaskDistributer distributer, FlexotaskTracerFactory tracerFactory, FlexotaskGraphImpl graph) + FlexotaskThreadFactoryImpl(FlexotaskTimerService timer, FlexotaskTracerFactory tracerFactory, FlexotaskGraphImpl graph) { - this.distributer = distributer; + this.timer = timer; this.tracerFactory = tracerFactory; this.graph = graph; } @@ -77,7 +76,6 @@ * is a fragile solution; can we do better?). */ tracerFactory.newThreadContext().getClass().getName(); - distributer.getTimer().getClass().getName(); SchedulerWrapper.class.getName(); /* Create the FlexotaskScheduler's memory space */ @@ -86,11 +84,6 @@ throw new IllegalStateException("Unable to create scheduler memory space"); } - /* Create the timer in the FlexotaskScheduler's memory space, making it first so that it - * doesn't move (TODO this is a fragile solution; can we do better?). - */ - FlexotaskTimer timer = distributer.getTimer(); - /* Clone the runnables into the scheduler's memory space. Because the target memory space * has been labelled as a scheduler memory space, the deepClone function will selectively * suppress the cloning of any object that is already in an Flexotask memory space. This enables @@ -115,7 +108,7 @@ Thread[] ans = new Thread[runnables.length]; for (int i = 0; i < ans.length; i++) { FlexotaskSchedulerRunnable runnable = clonedRunnables[i]; - runnable.setTimer(timer); + runnable.setTimerService(timer); runnable.setSchedulerLocks(locks); ans[i] = new Thread(new SchedulerWrapper(runnable, tracerFactory.newThreadContext(), graph)); runnables[i] = runnable; Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-21 20:23:28 UTC (rev 27) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-22 10:27:41 UTC (rev 28) @@ -29,10 +29,13 @@ import com.ibm.realtime.flexotask.FlexotaskInputPort; import com.ibm.realtime.flexotask.FlexotaskOutputPort; import com.ibm.realtime.flexotask.FlexotaskRunner; +import com.ibm.realtime.flexotask.FlexotaskTimer; +import com.ibm.realtime.flexotask.TimeAware; import com.ibm.realtime.flexotask.distribution.FlexotaskChannel; import com.ibm.realtime.flexotask.distribution.FlexotaskDistributer; import com.ibm.realtime.flexotask.distribution.FlexotaskDistributerRegistry; import com.ibm.realtime.flexotask.distribution.FlexotaskDistributionContext; +import com.ibm.realtime.flexotask.distribution.FlexotaskTimerService; import com.ibm.realtime.flexotask.scheduling.ConnectionDriver; import com.ibm.realtime.flexotask.scheduling.FlexotaskController; import com.ibm.realtime.flexotask.scheduling.FlexotaskPredicateController; @@ -155,6 +158,7 @@ tracerFactory.startValidation(); Object[] toPin; Map heapSizes; + FlexotaskTimerService timer; try { /* Check graph for consistency (no dangling pieces) */ checkConsistency(specification); @@ -172,8 +176,14 @@ initializationMap.put(element.getName(), channel); } } + /* Create the timer so that it can be checked and pinned along with the the by-ref + * parameters. Note: the timer is checked for ref-immutability but not for allocations, + * which, if present, can crash the scheduler. TODO should be checking timers (and + * scheduler runnables for that matter) for allocations? + */ + timer = distributer.getTimerService(); /* Check code of all flexotasks in the graph for safety (do not violate isolation rules) */ - toPin = new CodeValidator(specification).validate(initializationMap); + toPin = new CodeValidator(specification).validate(initializationMap, timer); /* Consult scheduler to ensure the graph is schedulable */ if (!scheduler.isSchedulable(specification, schedulingData)) { throw new FlexotaskValidationException("Specification rejected by the scheduler: " + @@ -190,7 +200,7 @@ tracerFactory.startInstantiation(); Map instantiationMap; try { - instantiationMap = instantiate(specification, heapSizes, initializationMap); + instantiationMap = instantiate(specification, heapSizes, initializationMap, timer); } finally { tracerFactory.endInstantiation(); } @@ -228,7 +238,7 @@ FlexotaskGraphImpl ans = new FlexotaskGraphImpl(distributer, guards, toPin); /* Schedule the graph */ tracerFactory.startScheduling(); - FlexotaskThreadFactory factory = new FlexotaskThreadFactoryImpl(distributer, tracerFactory, ans); + FlexotaskThreadFactory factory = new FlexotaskThreadFactoryImpl(timer, tracerFactory, ans); FlexotaskRunner runner; try { //initializationMap used to transfer the file descriptors into the scheduler. @@ -419,7 +429,8 @@ * @return an instantiation map to give to the scheduler * @exception FlexotaskValidationException if instantiation cannot be achieved due to some error */ - private static Map instantiate(FlexotaskTemplate specification, Map heapSizes, Map initializationMap) throws FlexotaskValidationException + private static Map instantiate(FlexotaskTemplate specification, Map heapSizes, Map initializationMap, FlexotaskTimer timer) + throws FlexotaskValidationException { /* Transfer stable/transient information to runtime */ initStableTransient(specification); @@ -441,7 +452,7 @@ for (Iterator iter = specification.getTasks().iterator(); iter.hasNext();) { FlexotaskTaskTemplate task = (FlexotaskTaskTemplate) iter.next(); Object parameter = initializationMap.get(task.getName()); - taskMap.put(task, instantiateTask(task, (long[]) heapSizes.get(task), parameter, byRefConnMap)); + taskMap.put(task, instantiateTask(task, (long[]) heapSizes.get(task), parameter, byRefConnMap, timer)); } /* Process all the connections, instantiating all ConnectionDrivers. */ @@ -502,15 +513,16 @@ * @param heapSizes the initial and maximum heap sizes for the task as a long[2] or null to indicate * use of the defaults * @param parameter the parameter to pass the Flexotask's initialize method - * @param byRefConnMap the between task name and a list of the names of its output ports that + * @param byRefConnMap the map between task name and a list of the names of its output ports that * are by-reference. + * @param timer the FlexotaskTimer for this graph, to be used if the flexotask is time-aware * @return an FlexotaskController for the task and its ports. This is used both to complete * instantation (the ConnectionDrivers use the ports) and to serve as a runtime controller * for the Flexotask and its private heap * @throws FlexotaskValidationException if anything goes wrong */ - private static FlexotaskController instantiateTask(FlexotaskTaskTemplate task, long[] heapSizes, Object parameter, Map byRefConnMap) - throws FlexotaskValidationException + private static FlexotaskController instantiateTask(FlexotaskTaskTemplate task, long[] heapSizes, Object parameter, Map byRefConnMap, + FlexotaskTimer timer) throws FlexotaskValidationException { /* Apply the default value to the parameter, except for communicators, for whom the default parameter is * interpreted as the port initial value */ @@ -586,23 +598,33 @@ isByRef = (byRefOutputPorts.contains(task.getOutputPortNames()[i])); outputPorts[i] = new FlexotaskOutputPortImpl(outputPortClasses[i], task.getOutputPortBuffering()[i], isByRef); } + Flexotask flexotask; try { /* Instantiate the Flexotask and store it in the root */ - root.setTask((Flexotask) implClass.newInstance()); + flexotask = (Flexotask) implClass.newInstance(); + root.setTask(flexotask); } catch (Exception e) { throw new FlexotaskValidationException("Could not instantiate Runnable of class " + implClass.getName() + " for task " + task.getName(), e); } /* If the Flexotask is atomic, initialize the transactional system with its fields */ - if (root.getTask() instanceof AtomicFlexotask) { - TransactionalOperations.registerFields(((AtomicFlexotask) root.getTask()).getReachableFieldTable()); + if (flexotask instanceof AtomicFlexotask) { + TransactionalOperations.registerFields(((AtomicFlexotask) flexotask).getReachableFieldTable()); } + /* If the Flexotask is time-aware, set its timer */ + if (flexotask instanceof TimeAware) { + ((TimeAware) flexotask).setTimer(timer); + } /* If the Flexotask is strongly isolated, clone its parameter */ if (!task.isWeaklyIsolated()) { parameter = FlexotaskSystemSupport.deepClone(parameter, null); } /* Initialize the Flexotask */ - root.getTask().initialize(root.getInputPorts(), root.getOutputPorts(), parameter); + flexotask.initialize(root.getInputPorts(), root.getOutputPorts(), parameter); + /* If the Flexotask is time-aware, set its timer */ + if (flexotask instanceof TimeAware) { + ((TimeAware) flexotask).setTimer(timer); + } /* Initialize the ports iff communicator */ if (portInitValue != null) { portInitValue = FlexotaskSystemSupport.deepClone(portInitValue, null); @@ -626,7 +648,7 @@ FlexotaskTaskTracer tracer = tracerFactory.newTaskTracer(task.getName()); if (task instanceof FlexotaskPredicateTemplate) { return new FlexotaskPredicateControllerImpl(root, task.getName(), tracer); - } else if (root.getTask() instanceof AtomicFlexotask){ + } else if (flexotask instanceof AtomicFlexotask){ return new AtomicFlexotaskController(root, task.getName(), tracer); } else { Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java 2008-10-21 20:23:28 UTC (rev 27) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java 2008-10-22 10:27:41 UTC (rev 28) @@ -737,11 +737,17 @@ protected void heapCheckError(FieldWrapper wrapper, int checkLevel, HeapCheckContext context) { String shouldbe = (checkLevel == CHECK_IMMUTABLE) ? "immutable" : "reference-immutable"; if (wrapper == null) { - addTypeRuleViolation(Severity.ERROR, "Parameter of class " + context.parameterClassName + " passed to Flexotask " + context.flexotaskName - + " should be " + shouldbe + " but is not"); + if (context.flexotaskName != null) { + addTypeRuleViolation(Severity.ERROR, "Parameter of class " + context.parameterClassName + " passed to Flexotask " + + context.flexotaskName + " should be " + shouldbe + " but is not"); + } else { + addTypeRuleViolation(Severity.ERROR, "FlexotaskTimer of class " + context.parameterClassName + " provided by the distributer " + + " should be " + shouldbe + " but is not"); + } } else { StringBuilder builder = new StringBuilder("Field ").append(wrapper).append(" should be ").append(shouldbe); - builder.append(" but is not.\n It is reachable because static field ").append(context.field).append(" is read in ").append(context.method); + builder.append(" but is not.\n It is reachable because static field ").append(context.field).append(" is read in ") + .append(context.method); getCallChain(builder, context.method); addFieldDeclarationViolation(Severity.ERROR, wrapper, builder.toString()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jsa...@us...> - 2008-10-21 20:23:38
|
Revision: 27 http://flexotask.svn.sourceforge.net/flexotask/?rev=27&view=rev Author: jsauerbach Date: 2008-10-21 20:23:28 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Remove remaining special case accesses to the flexotask.system package, replacing with alternative mechanisms and stop exporting that package. Modified Paths: -------------- trunk/flexotask/META-INF/MANIFEST.MF trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/builder/FlexotaskBuilder.java trunk/flexotask-development/src/com/ibm/realtime/flexotask/development/rewriting/CodeRewriter.java trunk/flexotask-tuningfork/src/com/ibm/realtime/flexotask/tuningfork/TFTracerFactory.java Added Paths: ----------- trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java trunk/flexotask/src/com/ibm/realtime/flexotask/vm/ trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskVMBridge.java Removed Paths: ------------- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java Modified: trunk/flexotask/META-INF/MANIFEST.MF =================================================================== --- trunk/flexotask/META-INF/MANIFEST.MF 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/META-INF/MANIFEST.MF 2008-10-21 20:23:28 UTC (rev 27) @@ -10,7 +10,6 @@ com.ibm.realtime.flexotask.distribution, com.ibm.realtime.flexotask.scheduling, com.ibm.realtime.flexotask.scheduling.simple, - com.ibm.realtime.flexotask.system, com.ibm.realtime.flexotask.template, com.ibm.realtime.flexotask.timing, com.ibm.realtime.flexotask.timing.simple, @@ -18,5 +17,6 @@ com.ibm.realtime.flexotask.tracing, com.ibm.realtime.flexotask.util, com.ibm.realtime.flexotask.validation, + com.ibm.realtime.flexotask.vm, com.ibm.realtime.xrts Require-Bundle: com.ibm.realtime.analysis Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicConnectionDriver.java 2008-10-21 20:23:28 UTC (rev 27) @@ -32,7 +32,7 @@ FlexotaskControllerImpl outputTask, FlexotaskConnectionMode mode, FlexotaskTracer tracer) { super(input, inputTask, output, outputTask, mode, tracer); - lockObject = (AtomicFlexotask) outputTask.root.task; + lockObject = (AtomicFlexotask) outputTask.root.getTask(); } /* (non-Javadoc) Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskController.java 2008-10-21 20:23:28 UTC (rev 27) @@ -14,6 +14,7 @@ package com.ibm.realtime.flexotask.system; import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; /** * A specialization of the normal FlexotaskController for use with transactional @@ -33,7 +34,7 @@ */ public boolean collect() { - AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.task; + AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.getTask(); boolean ans = false; synchronized (ttask.lock) { ttask.schedulerEntry(); @@ -50,7 +51,7 @@ */ public void run() { - AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.task; + AtomicFlexotaskBase ttask = (AtomicFlexotaskBase) root.getTask(); synchronized (ttask.lock) { ttask.schedulerEntry(); super.run(); Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,31 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.flexotask.AtomicFlexotask; - -/** - * Interface that must be implemented by all objects that will function as public interfaces to - * AtomicFlexotasks. The actual guard object remains on the external heap (pinned) and points to the - * AtomicFlexotask delegate. - */ -public interface AtomicFlexotaskGuard -{ - /** - * Method to store the AtomicFlexotask "delegate" for which this guard object is a guard. The - * delegate pointer must not be leaked. This is checked (conservatively) during validation. - * @param delegate the delegate or null (during termination) - */ - public void setDelegate(AtomicFlexotask delegate); -} Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/CodeValidator.java 2008-10-21 20:23:28 UTC (rev 27) @@ -40,6 +40,7 @@ import com.ibm.realtime.flexotask.validation.TypeRuleViolationException; import com.ibm.realtime.flexotask.validation.ValidationContext; import com.ibm.realtime.flexotask.validation.TypeRuleViolation.Severity; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; /** * This class validates the code of the flexotasks of a graph. The current version is quite imprecise, Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/ConnectionDriverImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,6 +13,8 @@ */ package com.ibm.realtime.flexotask.system; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; import com.ibm.realtime.flexotask.scheduling.ConnectionDriver; import com.ibm.realtime.flexotask.template.FlexotaskConnectionMode; import com.ibm.realtime.flexotask.tracing.FlexotaskTracer; @@ -167,14 +169,16 @@ { int inIndex = -1; int outIndex = -1; - for (int i = 0; i < inputTask.root.outputPorts.length; i++) { - if (inputTask.root.outputPorts[i] == input) { + FlexotaskOutputPort[] outputPorts = inputTask.root.getOutputPorts(); + for (int i = 0; i < outputPorts.length; i++) { + if (outputPorts[i] == input) { inIndex = i; break; } } - for (int i = 0; i < outputTask.root.inputPorts.length; i++) { - if (outputTask.root.inputPorts[i] == output) { + FlexotaskInputPort[] inputPorts = inputTask.root.getInputPorts(); + for (int i = 0; i < inputPorts.length; i++) { + if (inputPorts[i] == output) { outIndex = i; break; } Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskControllerImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -15,6 +15,7 @@ import com.ibm.realtime.flexotask.scheduling.FlexotaskController; import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; class FlexotaskControllerImpl implements FlexotaskController { /** The flexotask root for this flexotask */ @@ -73,7 +74,7 @@ if (oldSpace == 0L) { throw new IllegalStateException(taskName); } - root.task.execute(); + root.getTask().execute(); FlexotaskSystemSupport.resetTransient(); } finally { if (oldSpace != 0L) { Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskGraphImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -20,6 +20,7 @@ import com.ibm.realtime.flexotask.FlexotaskGraph; import com.ibm.realtime.flexotask.FlexotaskRunner; import com.ibm.realtime.flexotask.distribution.FlexotaskDistributer; +import com.ibm.realtime.flexotask.validation.AtomicFlexotaskGuard; /** * Contains the system's implementation of the FlexotaskGraph interface Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskPredicateControllerImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -16,6 +16,7 @@ import com.ibm.realtime.flexotask.FlexotaskPredicate; import com.ibm.realtime.flexotask.scheduling.FlexotaskPredicateController; import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; /** * Implementation of FlexotaskPredicateController @@ -34,6 +35,6 @@ */ public boolean isTrue() { - return ((FlexotaskPredicate) root.task).isTrue(); + return ((FlexotaskPredicate) root.getTask()).isTrue(); } } Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,39 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.flexotask.Flexotask; -import com.ibm.realtime.flexotask.FlexotaskInputPort; -import com.ibm.realtime.flexotask.FlexotaskOutputPort; - -/** - * The root memory object in every flexotask: keeps the task and ports live and makes them accessible - * to the FlexotaskController objects used by the scheduler. - */ -public final class FlexotaskRoot -{ - /** The input ports of 'task'. */ - FlexotaskInputPort[] inputPorts; - - /** The output ports of 'task'. */ - FlexotaskOutputPort[] outputPorts; - - /** The task */ - Flexotask task; - - /** In a flexotask VM with RTSJ support, the MemoryArea representing this Flexotask memory space. - * Otherwise, null. Declared 'Object' to avoid static dependence on an RTSJ library. - */ - public Object memoryArea; -} Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskSystemSupport.java 2008-10-21 20:23:28 UTC (rev 27) @@ -24,6 +24,8 @@ import com.ibm.realtime.flexotask.FlexotaskOutputPort; import com.ibm.realtime.flexotask.cloning.CloningSupport; import com.ibm.realtime.flexotask.util.ESystem; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; +import com.ibm.realtime.flexotask.vm.FlexotaskVMBridge; /* * (c) Copyright IBM Corp. 2006 - 2008 All Rights Reserved @@ -34,12 +36,6 @@ * be used by schedulers and other system-aware components. */ public class FlexotaskSystemSupport { - /** Indicator passed to createMemorySpace to indicate a "normal" flexotask space */ - public static final int NORMAL_MEMORY = 0; - - /** Indicator passed to createMemorySpace to indicate the scheduler heap */ - public static final int SCHEDULER_MEMORY = 1; - /** * Default size of flexotask heap (initial and maximum) in bytes (for compatibility with past versions of * flexotask support). @@ -189,9 +185,9 @@ * @param type the primitive type that is the element type of the array. Must be one of the primitive * classes int.class, boolean.class, etc. * @param size the number of elements in the array - * @param target the StableArray objects whose array field will receive the result + * @param target the StableArrayImpl object whose array field will receive the result */ - static void allocateStablePrimitiveArray(Class type, int size, StableArray target) + static void allocateStablePrimitiveArray(Class type, int size, StableArrayImpl target) { checkSecurity(target, "StableArray"); if (vmBridge != null) { @@ -235,7 +231,7 @@ */ static long createMemorySpace(boolean scheduler) { - return createMemorySpace(scheduler ? SCHEDULER_MEMORY : NORMAL_MEMORY, DEFAULT_HEAP_SIZE, DEFAULT_HEAP_SIZE); + return createMemorySpace(scheduler ? FlexotaskVMBridge.SCHEDULER_MEMORY : FlexotaskVMBridge.NORMAL_MEMORY, DEFAULT_HEAP_SIZE, DEFAULT_HEAP_SIZE); } /** Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskVMBridge.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,149 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.analysis.Service; -import com.ibm.realtime.flexotask.util.Notifier; - -/** - * Define the methods that bridge between the Flexotask Java support and the underlying support that must - * be present in the VM. The development-time VM need not contain an implementation, since the functions - * will then be simulated. However, to achieve realtime behavior an implementation must be provided. - */ -public interface FlexotaskVMBridge extends Service.Implementation { - /** @see FlexotaskSystemSupport#allocateStablePrimitiveArray(Class, int, StableArray) */ - Object allocateStablePrimitiveArray(Class type, int size); - /** @see FlexotaskSystemSupport#becomeFlexotaskThread(boolean) */ - void becomeFlexotaskThread(boolean state); - /** @see FlexotaskSystemSupport#collectHeap(FlexotaskRoot) */ - void collectHeap(FlexotaskRoot heapToCollect); - /** @see TransactionalOperations#commit() */ - void commitTransaction(); - /** @see FlexotaskSystemSupport#createMemorySpace(int, long, long) */ - long createMemorySpace(int type, long initialSize, long maxSize); - /** @see FlexotaskSystemSupport#deepClone(Object, Object) */ - Object deepClone(Object toClone, Object source); - /** @see TransactionalOperations#commit() */ - boolean getBooleanArrayElement(boolean[] object, int index); - /** @see TransactionalOperations#getBooleanArrayElement(boolean[], int) */ - boolean getBooleanField(Object object, int index); - /** @see TransactionalOperations#getBooleanField(Object, int) */ - byte getByteArrayElement(byte[] object, int index); - /** @see TransactionalOperations#getByteArrayElement(byte[], int) */ - byte getByteField(Object object, int index); - /** @see TransactionalOperations#getByteField(Object, int) */ - char getCharArrayElement(char[] object, int index); - /** @see TransactionalOperations#getCharArrayElement(char[], int) */ - char getCharField(Object object, int index); - /** @see TransactionalOperations#getCharField(Object, int) */ - double getDoubleArrayElement(double[] object, int index); - /** @see TransactionalOperations#getDoubleArrayElement(double[], int) */ - double getDoubleField(Object object, int index); - /** @see TransactionalOperations#getDoubleField(Object, int) */ - int getFieldOffset(Class clazz, String fieldName, String signature); - /** @see TransactionalOperations#getFloatArrayElement(float[], int) */ - float getFloatArrayElement(float[] object, int index); - /** @see TransactionalOperations#getFloatField(Object, int) */ - float getFloatField(Object object, int index); - /** @see FlexotaskSystemSupport#getHeapSize(Object) */ - long getHeapSize(Object target); - /** @see TransactionalOperations#getIntArrayElement(int[], int) */ - int getIntArrayElement(int[] object, int index); - /** @see TransactionalOperations#getIntField(Object, int) */ - int getIntField(Object object, int index); - /** @see TransactionalOperations#getLongArrayElement(long[], int) */ - long getLongArrayElement(long[] object, int index); - /** @see TransactionalOperations#getLongField(Object, int) */ - long getLongField(Object object, int index); - /** @see FlexotaskSystemSupport#getObjectMonitor(Notifier) */ - long getMonitor(Object object); - /** @see TransactionalOperations#getReferenceArrayElement(Object[], int) */ - Object getReferenceArrayElement(Object[] object, int index); - /** @see TransactionalOperations#getReferenceField(Object, int) */ - Object getReferenceField(Object object, int index); - /** @see TransactionalOperations#getShortArrayElement(short[], int) */ - short getShortArrayElement(short[] object, int index); - /** @see TransactionalOperations#getShortField(Object, int) */ - short getShortField(Object object, int index); - /** @see FlexotaskSystemSupport#isFlexotaskMemorySpace() */ - boolean isFlexotaskMemorySpace(); - /** @see FlexotaskSystemSupport#isOnPrivateHeap(Object) */ - boolean isOnPrivateHeap(Object value); - /** @see FlexotaskSystemSupport#nanosleep(long) */ - void nanosleep(long nextDeadline); - /** @see FlexotaskSystemSupport#nanoTime() */ - long nanoTime(); - /** @see FlexotaskSystemSupport#notifyIfWaiting(Notifier) */ - void notifyIfWaiting(long monitor); - /** @see FlexotaskSystemSupport#pin(Object[]) */ - boolean pin(Object[] toPin); - /** @see TransactionalOperations#registerFields(com.ibm.realtime.analysis.FieldWrapper[]) */ - void registerFieldOffsets(int[] offsets); - /** @see FlexotaskSystemSupport#resetTransient() */ - void resetTransient(); - /** @see FlexotaskSystemSupport#restoreMemorySpace(long) */ - void restoreMemorySpace(long spaceToRestore); - /** @see FlexotaskSystemSupport#runOnPublicHeap() */ - long runOnPublicHeap(); - /** @see TransactionalOperations#setBooleanArrayElement(boolean[], int, boolean) */ - void setBooleanArrayElement(boolean[] object, int index, boolean value); - /** @see TransactionalOperations#setBooleanField(Object, boolean, int) */ - void setBooleanField(Object object, boolean value, int fieldIndex); - /** @see TransactionalOperations#setByteArrayElement(byte[], int, byte) */ - void setByteArrayElement(byte[] object, int index, byte value); - /** @see TransactionalOperations#setByteField(Object, byte, int) */ - void setByteField(Object object, byte value, int fieldIndex); - /** @see TransactionalOperations#setCharArrayElement(char[], int, char) */ - void setCharArrayElement(char[] object, int index, char value); - /** @see TransactionalOperations#setCharField(Object, char, int) */ - void setCharField(Object object, char value, int fieldIndex); - /** @see TransactionalOperations#setDoubleArrayElement(double[], int, double) */ - void setDoubleArrayElement(double[] object, int index, double value); - /** @see TransactionalOperations#setDoubleField(Object, double, int) */ - void setDoubleField(Object object, double value, int fieldIndex); - /** @see FlexotaskSystemSupport#setFlexotaskRoot(FlexotaskRoot) */ - void setFlexotaskRoot(FlexotaskRoot toSet); - /** @see TransactionalOperations#setFloatArrayElement(float[], int, float) */ - void setFloatArrayElement(float[] object, int index, float value); - /** @see TransactionalOperations#setFloatField(Object, float, int) */ - void setFloatField(Object object, float value, int fieldIndex); - /** @see TransactionalOperations#setIntArrayElement(int[], int, int) */ - void setIntArrayElement(int[] object, int index, int value); - /** @see TransactionalOperations#setIntField(Object, int, int) */ - void setIntField(Object object, int value, int fieldIndex); - /** @see TransactionalOperations#setLongArrayElement(long[], int, long) */ - void setLongArrayElement(long[] object, int index, long value); - /** @see TransactionalOperations#setLongField(Object, long, int) */ - void setLongField(Object object, long value, int fieldIndex); - /** @see FlexotaskSystemSupport#setOThreadShouldAbort() */ - void setOThreadShouldAbort(); - /** @see TransactionalOperations#setReferenceArrayElement(Object[], int, Object) */ - void setReferenceArrayElement(Object[] object, int index, Object value); - /** @see TransactionalOperations#setReferenceField(Object, Object, int) */ - void setReferenceField(Object object, Object value, int fieldIndex); - /** @see TransactionalOperations#setShortArrayElement(short[], int, short) */ - void setShortArrayElement(short[] object, int index, short value); - /** @see TransactionalOperations#setShortField(Object, short, int) */ - void setShortField(Object object, short value, int fieldIndex); - /** @see FlexotaskSystemSupport#setStable(Class, boolean) */ - void setStable(Class clazz, boolean isStable); - /** @see FlexotaskSystemSupport#setTransientPolicy(boolean) */ - void setTransientPolicy(boolean status); - /** @see TransactionalOperations#startTransaction(Object) */ - long startTransaction(Object target); - /** @see FlexotaskSystemSupport#switchMemorySpace(Object) */ - long switchMemorySpace(Object target); - /** @see FlexotaskSystemSupport#unpin(Object[]) */ - void unpin(Object[] objects); -} Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskValidator.java 2008-10-21 20:23:28 UTC (rev 27) @@ -51,6 +51,9 @@ import com.ibm.realtime.flexotask.tracing.FlexotaskTaskTracer; import com.ibm.realtime.flexotask.tracing.FlexotaskTracer; import com.ibm.realtime.flexotask.tracing.FlexotaskTracerFactory; +import com.ibm.realtime.flexotask.validation.AtomicFlexotaskGuard; +import com.ibm.realtime.flexotask.vm.FlexotaskRoot; +import com.ibm.realtime.flexotask.vm.FlexotaskVMBridge; /** * Not part of the external interface. Invoked via @@ -203,7 +206,7 @@ try { Class guardClass = CodeValidator.resolveClass(task.getGuard(), cl); AtomicFlexotaskGuard guard = (AtomicFlexotaskGuard) guardClass.newInstance(); - AtomicFlexotaskBase atomicTask = (AtomicFlexotaskBase) ((FlexotaskControllerImpl) controller).root.task; + AtomicFlexotaskBase atomicTask = (AtomicFlexotaskBase) ((FlexotaskControllerImpl) controller).root.getTask(); guard.setDelegate((AtomicFlexotask) atomicTask); atomicTask.lock = guard; guards.put(task.getName(), guard); @@ -448,10 +451,10 @@ FlexotaskTracer tracer = tracerFactory.newConnectionTracer(conn.getName()); FlexotaskTaskTemplate source = conn.getInput(); FlexotaskControllerImpl sourceController = (FlexotaskControllerImpl) taskMap.get(source); - FlexotaskOutputPortImpl sourcePort = (FlexotaskOutputPortImpl) sourceController.root.outputPorts[conn.getOutputPortToRead()]; + FlexotaskOutputPortImpl sourcePort = (FlexotaskOutputPortImpl) sourceController.root.getOutputPorts()[conn.getOutputPortToRead()]; FlexotaskTaskTemplate target = conn.getOutput(); FlexotaskControllerImpl targetController = (FlexotaskControllerImpl) taskMap.get(target); - FlexotaskInputPortImpl targetPort = (FlexotaskInputPortImpl) targetController.root.inputPorts[conn.getInputPortToWrite()]; + FlexotaskInputPortImpl targetPort = (FlexotaskInputPortImpl) targetController.root.getInputPorts()[conn.getInputPortToWrite()]; FlexotaskConnectionMode mode = conn.getConnectionMode(); ConnectionDriver driver; if (targetController instanceof AtomicFlexotaskController) { @@ -542,7 +545,7 @@ oldSpace = FlexotaskSystemSupport.createMemorySpace(false); } else { - oldSpace = FlexotaskSystemSupport.createMemorySpace(FlexotaskSystemSupport.NORMAL_MEMORY, heapSizes[0], heapSizes[1]); + oldSpace = FlexotaskSystemSupport.createMemorySpace(FlexotaskVMBridge.NORMAL_MEMORY, heapSizes[0], heapSizes[1]); } if (oldSpace == 0L) { throw new FlexotaskValidationException("Unable to instantiate private heap for " + @@ -566,46 +569,48 @@ /* Create FlexotaskRoot */ FlexotaskRoot root = new FlexotaskRoot(); /* Create input port array */ - root.inputPorts = new FlexotaskInputPort[numInputPorts]; + FlexotaskInputPort[] inputPorts = new FlexotaskInputPort[numInputPorts]; + root.setInputPorts(inputPorts); /* Create input ports */ - for (int i = 0; i < root.inputPorts.length; i++) { - root.inputPorts[i] = new FlexotaskInputPortImpl(task.getInputPortBuffering()[i]); + for (int i = 0; i < inputPorts.length; i++) { + inputPorts[i] = new FlexotaskInputPortImpl(task.getInputPortBuffering()[i]); } /* Create output port array */ - root.outputPorts = new FlexotaskOutputPort[outputPortClasses.length]; + FlexotaskOutputPort[] outputPorts = new FlexotaskOutputPort[outputPortClasses.length]; + root.setOutputPorts(outputPorts); /* Create output ports */ - for (int i = 0; i < root.outputPorts.length; i++) { + for (int i = 0; i < outputPorts.length; i++) { boolean isByRef = false; List byRefOutputPorts = (List) byRefConnMap.get(task.getName()); if (byRefOutputPorts != null) isByRef = (byRefOutputPorts.contains(task.getOutputPortNames()[i])); - root.outputPorts[i] = new FlexotaskOutputPortImpl(outputPortClasses[i], task.getOutputPortBuffering()[i], isByRef); + outputPorts[i] = new FlexotaskOutputPortImpl(outputPortClasses[i], task.getOutputPortBuffering()[i], isByRef); } try { /* Instantiate the Flexotask and store it in the root */ - root.task = (Flexotask) implClass.newInstance(); + root.setTask((Flexotask) implClass.newInstance()); } catch (Exception e) { throw new FlexotaskValidationException("Could not instantiate Runnable of class " + implClass.getName() + " for task " + task.getName(), e); } /* If the Flexotask is atomic, initialize the transactional system with its fields */ - if (root.task instanceof AtomicFlexotask) { - TransactionalOperations.registerFields(((AtomicFlexotask) root.task).getReachableFieldTable()); + if (root.getTask() instanceof AtomicFlexotask) { + TransactionalOperations.registerFields(((AtomicFlexotask) root.getTask()).getReachableFieldTable()); } /* If the Flexotask is strongly isolated, clone its parameter */ if (!task.isWeaklyIsolated()) { parameter = FlexotaskSystemSupport.deepClone(parameter, null); } /* Initialize the Flexotask */ - root.task.initialize(root.inputPorts, root.outputPorts, parameter); + root.getTask().initialize(root.getInputPorts(), root.getOutputPorts(), parameter); /* Initialize the ports iff communicator */ if (portInitValue != null) { portInitValue = FlexotaskSystemSupport.deepClone(portInitValue, null); - if (root.inputPorts.length > 0) { - ((FlexotaskInputPortImpl) root.inputPorts[0]).setValue(portInitValue); + if (root.getInputPorts().length > 0) { + ((FlexotaskInputPortImpl) root.getInputPorts()[0]).setValue(portInitValue); } - if (root.outputPorts.length > 0) { - root.outputPorts[0].setValue(portInitValue); + if (root.getOutputPorts().length > 0) { + root.getOutputPorts()[0].setValue(portInitValue); } } /* Identify the FlexotaskController as the root for GC in this memory space */ @@ -621,7 +626,7 @@ FlexotaskTaskTracer tracer = tracerFactory.newTaskTracer(task.getName()); if (task instanceof FlexotaskPredicateTemplate) { return new FlexotaskPredicateControllerImpl(root, task.getName(), tracer); - } else if (root.task instanceof AtomicFlexotask){ + } else if (root.getTask() instanceof AtomicFlexotask){ return new AtomicFlexotaskController(root, task.getName(), tracer); } else { Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,22 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -/** - * Class used for the type of a dummy parameter added to the method signature - * of privatized methods. - */ -public class Privatized { - private Privatized() {} -} Deleted: trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -1,75 +0,0 @@ -/* - * This file is part of Flexible Task Graphs - * (http://sourceforge.net/projects/flexotasks) - * - * Copyright (c) 2006 - 2008 IBM Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - */ -package com.ibm.realtime.flexotask.system; - -import com.ibm.realtime.flexotask.Stable; - - -/** - * Special abstract class that indicates to the type checker that this is a stable array - */ -public abstract class StableArray implements Stable -{ - /** The encapsulated array (not accessible outside this package) */ - Object array; - - /** The length of the array */ - public final int length; - - /** - * Create a new encapsulated array. Subclasses must be loaded from a secure classpath - * @param type the element type of the array (a primitive class like int.class) - * @param size the size of the array - */ - protected StableArray(Class type, int size) - { - FlexotaskSystemSupport.allocateStablePrimitiveArray(type, size, this); - length = size; - } - - /** - * Provide access to the array from subclasses - * @return the encapsulated array - */ - protected Object getArray() - { - return array; - } - - /** - * Perform arraycopy into this array - * @param source the source array (must match this array in type) - * @param sourceOffset offset in source where to start - * @param targetOffset offset in target where to start - * @param length number of bytes to copy - * @throws ArrayIndexOutOfBoundsException like System.arraycopy - */ - public void copyIn(Object source, int sourceOffset, int targetOffset, int length) - { - System.arraycopy(source,sourceOffset, array,targetOffset, length); - } - - /** - * Perform arraycopy from this array - * @param sourceOffset offset in source where to start - * @param target the target array (must match this array in type) - * @param targetOffset offset in target where to start - * @param length number of bytes to copy - * @throws ArrayIndexOutOfBoundsException like System.arraycopy - */ - public void copyOut(int sourceOffset, Object target, int targetOffset, int length) - { - System.arraycopy(array,sourceOffset, target,targetOffset, length); - } -} Added: trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,69 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.system; + + +public abstract class StableArrayImpl { + /** The encapsulated array (not accessible outside this package) */ + Object array; + + /** The length of the array */ + public final int length; + + /** + * Create a new encapsulated array. Subclasses must be loaded from a secure classpath + * @param type the element type of the array (a primitive class like int.class) + * @param size the size of the array + */ + protected StableArrayImpl(Class type, int size) + { + FlexotaskSystemSupport.allocateStablePrimitiveArray(type, size, this); + length = size; + } + + /** + * Provide access to the array from subclasses + * @return the encapsulated array + */ + protected Object getArray() + { + return array; + } + + /** + * Perform arraycopy into this array + * @param source the source array (must match this array in type) + * @param sourceOffset offset in source where to start + * @param targetOffset offset in target where to start + * @param length number of bytes to copy + * @throws ArrayIndexOutOfBoundsException like System.arraycopy + */ + public void copyIn(Object source, int sourceOffset, int targetOffset, int length) + { + System.arraycopy(source,sourceOffset, array,targetOffset, length); + } + + /** + * Perform arraycopy from this array + * @param sourceOffset offset in source where to start + * @param target the target array (must match this array in type) + * @param targetOffset offset in target where to start + * @param length number of bytes to copy + * @throws ArrayIndexOutOfBoundsException like System.arraycopy + */ + public void copyOut(int sourceOffset, Object target, int targetOffset, int length) + { + System.arraycopy(array,sourceOffset, target,targetOffset, length); + } +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArrayImpl.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/system/TransactionalOperations.java 2008-10-21 20:23:28 UTC (rev 27) @@ -17,6 +17,7 @@ import java.lang.reflect.Field; import com.ibm.realtime.analysis.FieldWrapper; +import com.ibm.realtime.flexotask.vm.FlexotaskVMBridge; /** * Provides invokestatic targets for the byte code rewriter for the following opcodes: Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/InterarrivalTracer.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,6 +13,8 @@ */ package com.ibm.realtime.flexotask.tracing; +import com.ibm.realtime.flexotask.util.NanoTime; + /** * An FlexotaskTracer that measures interarrival between the same or a different task * Uses an ancillary IntervalStatistics class @@ -40,7 +42,7 @@ */ public void startRun() { - long time = TracingSupport.nanoTime() / 1000; + long time = NanoTime.nanoTime() / 1000; ends.end(time); starts.start(time); } Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TaskByNameTracerFactory.java 2008-10-21 20:23:28 UTC (rev 27) @@ -14,6 +14,7 @@ package com.ibm.realtime.flexotask.tracing; import com.ibm.realtime.flexotask.util.ESystem; +import com.ibm.realtime.flexotask.util.NanoTime; /** * A specialized Tracer factory that just supplies a given FlexotaskTaskTracer for a set of specific @@ -86,7 +87,7 @@ { if (verboseInitialization) { ESystem.err.print("Instantiation time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - intervalStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - intervalStart); ESystem.err.println("usec"); } } @@ -98,7 +99,7 @@ { if (verboseInitialization) { ESystem.err.print("Scheduling time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - intervalStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - intervalStart); ESystem.err.println("usec"); } } @@ -110,7 +111,7 @@ { if (verboseInitialization) { ESystem.err.print("Thread creation time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - threadStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - threadStart); ESystem.err.println("usec"); } } @@ -122,7 +123,7 @@ { if (verboseInitialization) { ESystem.err.print("Validation time: "); - ESystem.err.print(TracingSupport.nanoTime()/1000 - intervalStart); + ESystem.err.print(NanoTime.nanoTime()/1000 - intervalStart); ESystem.err.println("usec"); } } @@ -146,7 +147,7 @@ public void startInstantiation() { if (verboseInitialization) { - intervalStart = TracingSupport.nanoTime() / 1000; + intervalStart = NanoTime.nanoTime() / 1000; } } @@ -156,7 +157,7 @@ public void startScheduling() { if (verboseInitialization) { - intervalStart = TracingSupport.nanoTime() / 1000; + intervalStart = NanoTime.nanoTime() / 1000; } } @@ -166,14 +167,14 @@ public void startThreadCreation() { if (verboseInitialization) { - threadStart = TracingSupport.nanoTime() / 1000; + threadStart = NanoTime.nanoTime() / 1000; } } public void startValidation() { if (verboseInitialization) { - intervalStart = TracingSupport.nanoTime() / 1000; + intervalStart = NanoTime.nanoTime() / 1000; } } } Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/tracing/TracingSupport.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,25 +13,15 @@ */ package com.ibm.realtime.flexotask.tracing; -import com.ibm.realtime.flexotask.system.FlexotaskSystemSupport; import com.ibm.realtime.flexotask.system.FlexotaskValidator; /** - * Contains utility method used by tracers and the setTracing method that establishes the tracing - * factory for this process. + * Contains the setTracing method that establishes the tracing factory for this process. */ public class TracingSupport { private TracingSupport() {} + /** - * Get the nanoTime (using System.nanoTime if available, otherwise via FlexotaskVMBridge natives, - * if available, otherwise approximating with millisecond time) - * @return the time in nanoseconds since an arbitrary origin - */ - public static long nanoTime() { - return FlexotaskSystemSupport.nanoTime(); - } - - /** * Set the tracer factory to be used in subsequently instantiated graphs. The factory and the * objects it creates must obey the rules for tracers so as not to perturb execution * @param tracerFactory the FlexotaskTracerFactory to be used. As a bow to security concerns, Added: trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,41 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.util; + +import com.ibm.realtime.flexotask.system.FlexotaskSystemSupport; + +/** + * Provides static methods that provide up to nanotime resolution for time-telling and sleeping depending + * on the underlying OS. Note that Timer.nanoTime() and System.nanoTime() are equivalent on a Java5 system + * but use of these functions is preferable since they will work on a pre-Java5 system. + */ +public class NanoTime { + private NanoTime() {} /* not instantiable */ + /** + * Get an arbitrary-origin clock at nanotime resolution + * @return the time in nanoseconds since an arbitrary origin + */ + public static long nanoTime() { + return FlexotaskSystemSupport.nanoTime(); + } + + /** + * Sleep until an absolute time in the future, using the same time scale as nanoTime(). + * @param nextDeadline a time in the future at which this thread should wake up (note <em>very well</em> + * and then <em>note again</em> that this argument is an absolute time and <em>not</em> an interval!) + */ + public static void nanosleep(long nextDeadline) { + FlexotaskSystemSupport.nanosleep(nextDeadline); + } +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/util/NanoTime.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableBooleanArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a boolean[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableByteArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a bytean[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableCharArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a char[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableDoubleArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a double[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableFloatArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a float[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableIntArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a int[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableLongArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a long[] to reside in stable storage in cases when primitive arrays are not allowed there Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/util/StableShortArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -13,7 +13,7 @@ */ package com.ibm.realtime.flexotask.util; -import com.ibm.realtime.flexotask.system.StableArray; +import com.ibm.realtime.flexotask.validation.StableArray; /** * Encapsulates a short[] to reside in stable storage in cases when primitive arrays are not allowed there Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/AtomicFlexotaskGuard.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,31 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.validation; + +import com.ibm.realtime.flexotask.AtomicFlexotask; + +/** + * Interface that must be implemented by all objects that will function as public interfaces to + * AtomicFlexotasks. The actual guard object remains on the external heap (pinned) and points to the + * AtomicFlexotask delegate. + */ +public interface AtomicFlexotaskGuard +{ + /** + * Method to store the AtomicFlexotask "delegate" for which this guard object is a guard. The + * delegate pointer must not be leaked. This is checked (conservatively) during validation. + * @param delegate the delegate or null (during termination) + */ + public void setDelegate(AtomicFlexotask delegate); +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/AtomicFlexotaskGuard.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Modified: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java 2008-10-21 14:33:42 UTC (rev 26) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/CommonCodeValidator.java 2008-10-21 20:23:28 UTC (rev 27) @@ -41,7 +41,6 @@ import com.ibm.realtime.flexotask.FlexotaskInputPort; import com.ibm.realtime.flexotask.FlexotaskOutputPort; import com.ibm.realtime.flexotask.system.FlexotaskSystemSupport; -import com.ibm.realtime.flexotask.system.StableArray; import com.ibm.realtime.flexotask.system.TransactionalOperations; import com.ibm.realtime.flexotask.template.FlexotaskStableMode; import com.ibm.realtime.flexotask.template.FlexotaskTaskTemplate; Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/Privatized.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,22 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.validation; + +/** + * Class used for the type of a dummy parameter added to the method signature + * of privatized methods. + */ +public class Privatized { + private Privatized() {} +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/Privatized.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/StableArray.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,27 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.validation; + +import com.ibm.realtime.flexotask.Stable; +import com.ibm.realtime.flexotask.system.StableArrayImpl; + +/** + * Special abstract class that indicates to the type checker that this is a stable array + */ +public abstract class StableArray extends StableArrayImpl implements Stable { + + protected StableArray(Class type, int size) { + super(type, size); + } +} Property changes on: trunk/flexotask/src/com/ibm/realtime/flexotask/validation/StableArray.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + native Copied: trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java (from rev 6, trunk/flexotask/src/com/ibm/realtime/flexotask/system/FlexotaskRoot.java) =================================================================== --- trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java (rev 0) +++ trunk/flexotask/src/com/ibm/realtime/flexotask/vm/FlexotaskRoot.java 2008-10-21 20:23:28 UTC (rev 27) @@ -0,0 +1,99 @@ +/* + * This file is part of Flexible Task Graphs + * (http://sourceforge.net/projects/flexotasks) + * + * Copyright (c) 2006 - 2008 IBM Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + */ +package com.ibm.realtime.flexotask.vm; + +import com.ibm.realtime.flexotask.Flexotask; +import com.ibm.realtime.flexotask.FlexotaskInputPort; +import com.ibm.realtime.flexotask.FlexotaskOutputPort; + +/** + * The root memory object in every flexotask: keeps the task and ports live and makes them accessible + * to the FlexotaskController objects used by the scheduler. + */ +public final class FlexotaskRoot +{ + /** The input ports of 'task'. */ + private FlexotaskInputPort[] inputPorts; + + /** The output ports of 'task'. */ + private FlexotaskOutputPort[] outputPorts; + + /** The task */ + private Flexotask task; + + /** In a flexotask VM with RTSJ support, the MemoryArea representing this Flexotask memory space. + * Otherwise, n... [truncated message content] |
From: <jsa...@us...> - 2008-10-21 14:33:51
|
Revision: 26 http://flexotask.svn.sourceforge.net/flexotask/?rev=26&view=rev Author: jsauerbach Date: 2008-10-21 14:33:42 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Update web page to reflect presence of code and instructions, also link to project page. Modified Paths: -------------- trunk/flexotask-htdocs/index.html Modified: trunk/flexotask-htdocs/index.html =================================================================== --- trunk/flexotask-htdocs/index.html 2008-10-21 01:00:08 UTC (rev 25) +++ trunk/flexotask-htdocs/index.html 2008-10-21 14:33:42 UTC (rev 26) @@ -10,21 +10,31 @@ <h1 style="text-align: center; color: #ff0000">Flexible Task Graphs</h1> </center> -<p>This site will soon provide the source to the non-JVM-dependent +<p>This site provides the source to the non-JVM-dependent parts of the Flexible Task Graphs system as described in the paper <a href="http://portal.acm.org/citation.cfm?id=1375659">Flexible task graphs: a unified restricted thread programming model for java</a> by Joshua Auerbach, David F. Bacon, Rachid Guerraoui, Jesper Honig Spring, and Jan Vitek, published in LCTES 2008. -<p>We are preparing to populate the source repository. Code will -begin appearing soon and we expect to complete the initial check-in by -November 1, 2008. A more convenient installation package delivered -via the Eclipse update mechanism will follow. +<p>See also <a href="http://sourceforge.net/projects/flexotask">our +sourceforge project page</a>. -<p>During this formative period, please direct any questions about -this project to <a href="mailto:jsa...@us...">Joshua Auerbach</a>. +<p>The source repository has been populated on an initial basis, but we +do not yet provide a prepackaged build for convenient installation. Those +especially interested in getting started with the code are referred to +<a href="http://flexotask.wiki.sourceforge.net/gettingStartedForNow"> +our preliminary "getting started" page</a>. If you prefer to wait for +the prepackaged build and want to be kept informed of progress, +subscribe to <a +href="https://lists.sourceforge.net/lists/listinfo/flexotask-users"> +the flexotask-users mailing list</a>. Subscribers to that list will +also be able to send email to it. +<p>During this formative period, please also feel free to direct questions +about this project to <a +href="mailto:jsa...@us...">Joshua Auerbach</a>. + <br><hr><br> <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=242572&type=3" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |