-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjustments to the jpf part, and small changes to the runtime model. Also, a new ecorediag is introduced to present the architecture for situations implementation.
- Loading branch information
Michał Kit
committed
Sep 2, 2013
1 parent
21a6feb
commit 00b3218
Showing
43 changed files
with
670 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
jdeeco-core-model/model-refactoring/AdaptationArchitecture.ecore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="adaptationarchitecture" nsURI="http://adaptationarchitecture/1.0" | ||
nsPrefix="adaptationarchitecture"> | ||
<eAnnotations source="Michal you are so very cool"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="Oracle"> | ||
<eOperations name="isToBeScheduled"> | ||
<eParameters name="job" eType="#//Job"/> | ||
</eOperations> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="solver" lowerBound="1" | ||
eType="#//SATSolver"/> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="irms" upperBound="-1" eType="#//Invariant"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="SATSolver" abstract="true"> | ||
<eOperations name="solve"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="Runtime" instanceClassName="cz.cuni.mff.d3s.deeco.runtime.Runtime"> | ||
<eOperations name="run" lowerBound="1"/> | ||
<eOperations name="shutdown" lowerBound="1"/> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="oracle" lowerBound="1" | ||
eType="#//Oracle" containment="true"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="Scheduler"> | ||
<eOperations name="schedule"> | ||
<eParameters name="job" eType="#//Job"/> | ||
</eOperations> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="oracle" lowerBound="1" | ||
eType="#//Oracle"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="Job" instanceClassName="cz.cuni.mff.d3s.deeco.scheduling.Job"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="SAT4JSolver" eSuperTypes="#//SATSolver"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="IRMPrimitive" interface="true"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="Invariant" eSuperTypes="#//IRMPrimitive"> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="components" lowerBound="1" | ||
upperBound="-1" eType="#//Component"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="O"/> | ||
<eClassifiers xsi:type="ecore:EEnum" name="EEnum0"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="Operation" eSuperTypes="#//IRMPrimitive"> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="children" lowerBound="2" | ||
upperBound="-1" eType="#//IRMPrimitive"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="Assumption" eSuperTypes="#//Invariant #//Evaluable"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="ProcessInvariant" eSuperTypes="#//Invariant #//Evaluable"> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="componentProcess" lowerBound="1" | ||
eType="#//ComponentProcess"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="ExchangeInvariant" eSuperTypes="#//Invariant #//Evaluable"> | ||
<eStructuralFeatures xsi:type="ecore:EReference" name="ensemble" lowerBound="1" | ||
eType="#//Ensemble"/> | ||
</eClassifiers> | ||
<eClassifiers xsi:type="ecore:EClass" name="ComponentProcess" instanceClassName="cz.cuni.mff.d3s.deeco.runtime.model.ComponentProcess" | ||
eSuperTypes="#//ProcessInvariant"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="Ensemble" instanceClassName="cz.cuni.mff.d3s.deeco.runtime.model.Ensemble" | ||
eSuperTypes="#//ExchangeInvariant"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="Evaluable" interface="true"/> | ||
<eClassifiers xsi:type="ecore:EClass" name="Component" instanceClassName="cz.cuni.mff.d3s.deeco.runtime.model.Component"/> | ||
</ecore:EPackage> |
459 changes: 459 additions & 0 deletions
459
jdeeco-core-model/model-refactoring/AdaptationArchitecture.ecorediag
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
jdeeco-core/src/cz/cuni/mff/d3s/deeco/processor/ConditionParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cz.cuni.mff.d3s.deeco.processor; | ||
|
||
import static cz.cuni.mff.d3s.deeco.processor.AnnotationHelper.getAnnotatedMethods; | ||
import static cz.cuni.mff.d3s.deeco.processor.ParserHelper.getParameterList; | ||
|
||
import java.lang.reflect.Method; | ||
import java.util.LinkedList; | ||
import java.util.List; | ||
|
||
import cz.cuni.mff.d3s.deeco.annotations.Condition; | ||
import cz.cuni.mff.d3s.deeco.exceptions.ComponentEnsembleParseException; | ||
import cz.cuni.mff.d3s.deeco.path.grammar.ParseException; | ||
import cz.cuni.mff.d3s.deeco.runtime.model.BooleanCondition; | ||
import cz.cuni.mff.d3s.deeco.runtime.model.Parameter; | ||
|
||
public class ConditionParser { | ||
|
||
public static List<BooleanCondition> parseBooleanConditions(Class<?> c) { | ||
assert (c != null); | ||
List<BooleanCondition> result = new LinkedList<>(); | ||
List<Parameter> parameters; | ||
for (Method m : getAnnotatedMethods(c, Condition.class)) { | ||
if (m == null) { | ||
continue; | ||
} | ||
if (!m.getReturnType().isAssignableFrom(boolean.class)) { | ||
continue; | ||
} | ||
try { | ||
parameters = getParameterList(m); | ||
} catch (ParseException pe) { | ||
continue; | ||
} catch (ComponentEnsembleParseException cepe) { | ||
continue; | ||
} | ||
result.add(new BooleanCondition(parameters, m)); | ||
} | ||
return result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<invariant> | ||
<description>Emergency measures are taken</description> | ||
<operation>OR</operation> | ||
</invariant> |
Oops, something went wrong.