-
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.
Signed-off-by: Michal Kit <kit@d3s.mff.cuni.cz>
- Loading branch information
Michal Kit
committed
Sep 4, 2012
1 parent
549eab8
commit a5914f8
Showing
79 changed files
with
1,308 additions
and
248 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>MigrationEnsembleOSGI</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.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
7 changes: 7 additions & 0 deletions
7
EXAMPLE-OSGi/MigrationEnsembleOSGI/.settings/org.eclipse.jdt.core.prefs
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,7 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.7 |
4 changes: 4 additions & 0 deletions
4
EXAMPLE-OSGi/MigrationEnsembleOSGI/.settings/org.eclipse.pde.core.prefs
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,4 @@ | ||
eclipse.preferences.version=1 | ||
pluginProject.equinox=false | ||
pluginProject.extensions=false | ||
resolve.requirebundle=false |
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,14 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: MigrationEnsembleOSGI | ||
Bundle-SymbolicName: MigrationEnsembleOSGI | ||
Bundle-Version: 1.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Service-Component: OSGI-INF/MigrationEnsembleOSGI.xml | ||
Bundle-ClassPath: . | ||
Import-Package: cz.cuni.mff.d3s.deeco.annotations, | ||
cz.cuni.mff.d3s.deeco.ensemble, | ||
cz.cuni.mff.d3s.deeco.knowledge, | ||
cz.cuni.mff.d3s.deeco.provider, | ||
cz.cuni.mff.d3s.deeco.provider.sde | ||
Bundle-ActivationPolicy: lazy |
9 changes: 9 additions & 0 deletions
9
EXAMPLE-OSGi/MigrationEnsembleOSGI/OSGI-INF/MigrationEnsembleOSGI.xml
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,9 @@ | ||
<?xml version="1.0"?> | ||
<component name="MigrationEnsembleOSGI"> | ||
<implementation class="cz.cuni.mff.d3s.deeco.provider.sde.OSGiBundleDEECoObjectProvider"/> | ||
<service> | ||
<provide interface="cz.cuni.mff.d3s.deeco.provider.AbstractDEECoObjectProvider"/> | ||
</service> | ||
<property name="ensembles" | ||
value="cz.cuni.mff.d3s.deeco.demo.cloud.MigrationEnsemble"/> | ||
</component> |
Binary file added
BIN
+2.35 KB
...E-OSGi/MigrationEnsembleOSGI/bin/cz/cuni/mff/d3s/deeco/demo/cloud/MigrationEnsemble.class
Binary file not shown.
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,6 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/ | ||
jars.compile.order = . |
54 changes: 54 additions & 0 deletions
54
...LE-OSGi/MigrationEnsembleOSGI/src/cz/cuni/mff/d3s/deeco/demo/cloud/MigrationEnsemble.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,54 @@ | ||
/******************************************************************************* | ||
* Copyright 2012 Charles University in Prague | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
******************************************************************************/ | ||
package cz.cuni.mff.d3s.deeco.demo.cloud; | ||
|
||
import cz.cuni.mff.d3s.deeco.annotations.DEECoEnsemble; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoEnsembleMapper; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoEnsembleMembership; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoIn; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoOut; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoPeriodicScheduling; | ||
import cz.cuni.mff.d3s.deeco.ensemble.Ensemble; | ||
import cz.cuni.mff.d3s.deeco.knowledge.OutWrapper; | ||
|
||
/** | ||
* Sample ensemble class. | ||
* | ||
* @author Michal Kit | ||
* | ||
*/ | ||
@DEECoEnsemble | ||
@DEECoPeriodicScheduling(3000) | ||
public class MigrationEnsemble extends Ensemble { | ||
|
||
@DEECoEnsembleMembership | ||
public static boolean membership( | ||
@DEECoIn("member.id") String mId, | ||
@DEECoIn("member.loadRatio") Float mLoadRatio, | ||
@DEECoIn("member.maxLoadRatio") Float mMaxLoadRatio, | ||
@DEECoIn("coord.id") String cId, | ||
@DEECoIn("coord.loadRatio") Float cLoadRatio, | ||
@DEECoIn("coord.maxLoadRatio") Float cMaxLoadRatio) { | ||
return !mId.equals(cId) && mLoadRatio > mMaxLoadRatio && cLoadRatio < cMaxLoadRatio; | ||
} | ||
|
||
@DEECoEnsembleMapper | ||
public static void map(@DEECoOut("member.targetNode") OutWrapper<String> mTargetNode, | ||
@DEECoIn("coord.id") String cId) { | ||
System.out.println("Move application to " + cId); | ||
mTargetNode.item = cId; | ||
} | ||
} |
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>NodeAOSGI</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.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
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,7 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.7 |
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,4 @@ | ||
eclipse.preferences.version=1 | ||
pluginProject.equinox=false | ||
pluginProject.extensions=false | ||
resolve.requirebundle=false |
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,13 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: NodeAOSGI | ||
Bundle-SymbolicName: NodeAOSGI | ||
Bundle-Version: 1.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Service-Component: OSGI-INF/NodeAOSGI.xml | ||
Bundle-ClassPath: . | ||
Import-Package: cz.cuni.mff.d3s.deeco.annotations, | ||
cz.cuni.mff.d3s.deeco.knowledge, | ||
cz.cuni.mff.d3s.deeco.provider, | ||
cz.cuni.mff.d3s.deeco.provider.sde | ||
Bundle-ActivationPolicy: lazy |
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,9 @@ | ||
<?xml version="1.0"?> | ||
<component name="NodeAOSGI"> | ||
<implementation class="cz.cuni.mff.d3s.deeco.provider.sde.OSGiBundleDEECoObjectProvider"/> | ||
<service> | ||
<provide interface="cz.cuni.mff.d3s.deeco.provider.AbstractDEECoObjectProvider"/> | ||
</service> | ||
<property name="components" | ||
value="cz.cuni.mff.d3s.deeco.demo.cloud.NodeA"/> | ||
</component> |
Binary file added
BIN
+2.11 KB
EXAMPLE-OSGi/NodeAOSGI/bin/cz/cuni/mff/d3s/deeco/demo/cloud/NodeA.class
Binary file not shown.
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,6 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/ | ||
jars.compile.order = . |
53 changes: 53 additions & 0 deletions
53
EXAMPLE-OSGi/NodeAOSGI/src/cz/cuni/mff/d3s/deeco/demo/cloud/NodeA.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,53 @@ | ||
/******************************************************************************* | ||
* Copyright 2012 Charles University in Prague | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
******************************************************************************/ | ||
package cz.cuni.mff.d3s.deeco.demo.cloud; | ||
|
||
import java.util.Random; | ||
|
||
import cz.cuni.mff.d3s.deeco.annotations.DEECoComponent; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoInitialize; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoOut; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoPeriodicScheduling; | ||
import cz.cuni.mff.d3s.deeco.annotations.DEECoProcess; | ||
import cz.cuni.mff.d3s.deeco.knowledge.ComponentKnowledge; | ||
import cz.cuni.mff.d3s.deeco.knowledge.OutWrapper; | ||
|
||
@DEECoComponent | ||
public class NodeA extends ComponentKnowledge { | ||
|
||
public Float loadRatio; | ||
public Float maxLoadRatio; | ||
public Integer networkId; | ||
public String targetNode; | ||
|
||
@DEECoInitialize | ||
public static ComponentKnowledge getInitialKnowledge() { | ||
NodeA k = new NodeA(); | ||
k.id = "NodeA"; | ||
k.loadRatio = 0.0f; | ||
k.maxLoadRatio = 0.5f; | ||
k.networkId = 1; | ||
k.targetNode = null; | ||
return k; | ||
} | ||
|
||
@DEECoProcess | ||
@DEECoPeriodicScheduling(6000) | ||
public static void process(@DEECoOut("loadRatio") OutWrapper<Float> loadRatio) { | ||
loadRatio.item = new Random().nextFloat(); | ||
System.out.println("Node A new load ratio: " + loadRatio.item); | ||
} | ||
} |
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>NodeBOSGI</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.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
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,7 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.7 |
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,4 @@ | ||
eclipse.preferences.version=1 | ||
pluginProject.equinox=false | ||
pluginProject.extensions=false | ||
resolve.requirebundle=false |
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,13 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: NodeBOSGI | ||
Bundle-SymbolicName: NodeBOSGI | ||
Bundle-Version: 1.0.0.qualifier | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7 | ||
Service-Component: OSGI-INF/NodeBOSGI.xml | ||
Bundle-ClassPath: . | ||
Import-Package: cz.cuni.mff.d3s.deeco.annotations, | ||
cz.cuni.mff.d3s.deeco.knowledge, | ||
cz.cuni.mff.d3s.deeco.provider, | ||
cz.cuni.mff.d3s.deeco.provider.sde | ||
Bundle-ActivationPolicy: lazy |
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,9 @@ | ||
<?xml version="1.0"?> | ||
<component name="NodeBOSGI"> | ||
<implementation class="cz.cuni.mff.d3s.deeco.provider.sde.OSGiBundleDEECoObjectProvider"/> | ||
<service> | ||
<provide interface="cz.cuni.mff.d3s.deeco.provider.AbstractDEECoObjectProvider"/> | ||
</service> | ||
<property name="components" | ||
value="cz.cuni.mff.d3s.deeco.demo.cloud.NodeB"/> | ||
</component> |
Binary file added
BIN
+2.11 KB
EXAMPLE-OSGi/NodeBOSGI/bin/cz/cuni/mff/d3s/deeco/demo/cloud/NodeB.class
Binary file not shown.
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,6 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/ | ||
jars.compile.order = . |
Oops, something went wrong.