From e0ef616a2ed24e6f7751439ff2ff13432bb318e6 Mon Sep 17 00:00:00 2001 From: Oliver Libutzki Date: Tue, 3 Jun 2014 19:50:52 +0200 Subject: [PATCH] Runtime bundle refactoring Signed-off-by: Oliver Libutzki --- .../META-INF/MANIFEST.MF | 9 +++-- .../build.properties | 2 +- .../{fragment.xml => plugin.xml} | 7 ++-- .../META-INF/MANIFEST.MF | 6 ++-- .../META-INF/MANIFEST.MF | 9 +++-- .../build.properties | 2 +- .../{fragment.xml => plugin.xml} | 7 ++-- .../META-INF/MANIFEST.MF | 35 +++++++++++++++++-- .../build.properties | 2 +- .../{fragment.xml => plugin.xml} | 5 ++- .../internal/RuleModelRuntimeActivator.java} | 7 ++-- .../internal/engine/ExecuteRuleJob.java | 6 ++-- .../internal/engine/GuiceAwareJobFactory.java | 14 ++++---- .../internal/engine/RuleContextHelper.java | 4 +-- .../runtime/internal/engine/RuleEngine.java | 3 +- .../META-INF/MANIFEST.MF | 1 - .../META-INF/MANIFEST.MF | 22 ++++++++++-- .../build.properties | 2 +- .../{fragment.xml => plugin.xml} | 4 +-- .../internal/engine/ScriptEngineImpl.java | 12 +++---- .../META-INF/MANIFEST.MF | 9 +++-- .../build.properties | 2 +- .../{fragment.xml => plugin.xml} | 7 ++-- .../SitemapRuntimeInjectorProvider.java | 1 + .../feature.xml | 5 --- ....eclipse.smarthome.runtime.product.product | 5 +++ targetplatform/SmartHome Runtime.launch | 2 +- 27 files changed, 122 insertions(+), 68 deletions(-) rename bundles/model/org.eclipse.smarthome.model.item.runtime/{fragment.xml => plugin.xml} (93%) rename bundles/model/org.eclipse.smarthome.model.persistence.runtime/{fragment.xml => plugin.xml} (93%) rename bundles/model/org.eclipse.smarthome.model.rule.runtime/{fragment.xml => plugin.xml} (96%) rename bundles/model/{org.eclipse.smarthome.model.rule/src/org/eclipse/smarthome/model/rule/internal/RuleModelActivator.java => org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/RuleModelRuntimeActivator.java} (87%) rename bundles/model/org.eclipse.smarthome.model.script.runtime/{fragment.xml => plugin.xml} (96%) rename bundles/model/org.eclipse.smarthome.model.sitemap.runtime/{fragment.xml => plugin.xml} (93%) diff --git a/bundles/model/org.eclipse.smarthome.model.item.runtime/META-INF/MANIFEST.MF b/bundles/model/org.eclipse.smarthome.model.item.runtime/META-INF/MANIFEST.MF index 908b2039..c2aed54a 100644 --- a/bundles/model/org.eclipse.smarthome.model.item.runtime/META-INF/MANIFEST.MF +++ b/bundles/model/org.eclipse.smarthome.model.item.runtime/META-INF/MANIFEST.MF @@ -7,6 +7,9 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Service-Component: OSGI-INF/iteminjectorprovider.xml Bundle-ActivationPolicy: lazy Bundle-Vendor: Eclipse.org/SmartHome -Fragment-Host: org.eclipse.smarthome.model.item -Import-Package: org.eclipse.core.runtime, - org.eclipse.smarthome.model.core.guice +Import-Package: com.google.inject, + org.eclipse.core.runtime, + org.eclipse.smarthome.model.core.guice, + org.eclipse.xtext.resource, + org.eclipse.xtext.service +Require-Bundle: org.eclipse.smarthome.model.item diff --git a/bundles/model/org.eclipse.smarthome.model.item.runtime/build.properties b/bundles/model/org.eclipse.smarthome.model.item.runtime/build.properties index e3023e14..e9863e28 100644 --- a/bundles/model/org.eclipse.smarthome.model.item.runtime/build.properties +++ b/bundles/model/org.eclipse.smarthome.model.item.runtime/build.properties @@ -2,4 +2,4 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - fragment.xml + plugin.xml diff --git a/bundles/model/org.eclipse.smarthome.model.item.runtime/fragment.xml b/bundles/model/org.eclipse.smarthome.model.item.runtime/plugin.xml similarity index 93% rename from bundles/model/org.eclipse.smarthome.model.item.runtime/fragment.xml rename to bundles/model/org.eclipse.smarthome.model.item.runtime/plugin.xml index 21ee128b..a91671af 100644 --- a/bundles/model/org.eclipse.smarthome.model.item.runtime/fragment.xml +++ b/bundles/model/org.eclipse.smarthome.model.item.runtime/plugin.xml @@ -1,6 +1,7 @@ - - + + + - + diff --git a/bundles/model/org.eclipse.smarthome.model.item/META-INF/MANIFEST.MF b/bundles/model/org.eclipse.smarthome.model.item/META-INF/MANIFEST.MF index b60bfd45..9ec6a4bf 100644 --- a/bundles/model/org.eclipse.smarthome.model.item/META-INF/MANIFEST.MF +++ b/bundles/model/org.eclipse.smarthome.model.item/META-INF/MANIFEST.MF @@ -18,8 +18,7 @@ Require-Bundle: org.eclipse.xtext, org.antlr.runtime, org.eclipse.xtext.common.types Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.eclipse.smarthome.model, - org.eclipse.smarthome.model.formatting, +Export-Package: org.eclipse.smarthome.model.formatting, org.eclipse.smarthome.model.scoping, org.eclipse.smarthome.model.validation, org.eclipse.smarthome.model.services, @@ -29,7 +28,8 @@ Export-Package: org.eclipse.smarthome.model, org.eclipse.smarthome.model.parser.antlr, org.eclipse.smarthome.model.parser.antlr.internal, org.eclipse.smarthome.model.serializer, - org.eclipse.smarthome.model.generator + org.eclipse.smarthome.model.generator, + org.eclipse.smarthome.model Import-Package: org.apache.log4j, org.eclipse.smarthome.core.binding, org.eclipse.smarthome.core.items, diff --git a/bundles/model/org.eclipse.smarthome.model.persistence.runtime/META-INF/MANIFEST.MF b/bundles/model/org.eclipse.smarthome.model.persistence.runtime/META-INF/MANIFEST.MF index b9af700e..ea634a43 100644 --- a/bundles/model/org.eclipse.smarthome.model.persistence.runtime/META-INF/MANIFEST.MF +++ b/bundles/model/org.eclipse.smarthome.model.persistence.runtime/META-INF/MANIFEST.MF @@ -6,6 +6,9 @@ Bundle-Version: 0.7.0.qualifier Bundle-SymbolicName: org.eclipse.smarthome.model.persistence.runtime;singleton:=true Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy -Fragment-Host: org.eclipse.smarthome.model.persistence -Import-Package: org.eclipse.core.runtime, - org.eclipse.smarthome.model.core.guice +Import-Package: com.google.inject, + org.eclipse.core.runtime, + org.eclipse.smarthome.model.core.guice, + org.eclipse.smarthome.model.persistence, + org.eclipse.xtext.resource, + org.eclipse.xtext.service diff --git a/bundles/model/org.eclipse.smarthome.model.persistence.runtime/build.properties b/bundles/model/org.eclipse.smarthome.model.persistence.runtime/build.properties index e3023e14..e9863e28 100644 --- a/bundles/model/org.eclipse.smarthome.model.persistence.runtime/build.properties +++ b/bundles/model/org.eclipse.smarthome.model.persistence.runtime/build.properties @@ -2,4 +2,4 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - fragment.xml + plugin.xml diff --git a/bundles/model/org.eclipse.smarthome.model.persistence.runtime/fragment.xml b/bundles/model/org.eclipse.smarthome.model.persistence.runtime/plugin.xml similarity index 93% rename from bundles/model/org.eclipse.smarthome.model.persistence.runtime/fragment.xml rename to bundles/model/org.eclipse.smarthome.model.persistence.runtime/plugin.xml index ee51cca0..575da995 100644 --- a/bundles/model/org.eclipse.smarthome.model.persistence.runtime/fragment.xml +++ b/bundles/model/org.eclipse.smarthome.model.persistence.runtime/plugin.xml @@ -1,6 +1,7 @@ - - + + + - + diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/META-INF/MANIFEST.MF b/bundles/model/org.eclipse.smarthome.model.rule.runtime/META-INF/MANIFEST.MF index af91a81b..4d67d6a4 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/META-INF/MANIFEST.MF +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/META-INF/MANIFEST.MF @@ -7,6 +7,35 @@ Bundle-SymbolicName: org.eclipse.smarthome.model.rule.runtime;singleton:=true Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Bundle-ActivationPolicy: lazy Service-Component: OSGI-INF/ruleengine.xml -Fragment-Host: org.eclipse.smarthome.model.rule -Import-Package: org.eclipse.core.runtime, - org.eclipse.smarthome.model.core.guice +Import-Package: com.google.common.collect, + com.google.inject, + org.eclipse.core.runtime, + org.eclipse.emf.common.notify, + org.eclipse.emf.common.util, + org.eclipse.emf.ecore, + org.eclipse.emf.ecore.resource, + org.eclipse.emf.ecore.util, + org.eclipse.smarthome.core.events, + org.eclipse.smarthome.core.items, + org.eclipse.smarthome.core.scriptengine, + org.eclipse.smarthome.core.types, + org.eclipse.smarthome.model.core, + org.eclipse.smarthome.model.core.guice, + org.eclipse.smarthome.model.rule, + org.eclipse.smarthome.model.rule.jvmmodel, + org.eclipse.smarthome.model.rule.rules, + org.eclipse.xtext.naming, + org.eclipse.xtext.resource, + org.eclipse.xtext.xbase, + org.eclipse.xtext.xbase.interpreter, + org.eclipse.xtext.xbase.interpreter.impl, + org.osgi.framework, + org.osgi.service.event, + org.osgi.util.tracker, + org.quartz, + org.quartz.impl, + org.quartz.impl.matchers, + org.quartz.spi, + org.quartz.utils, + org.slf4j +Bundle-Activator: org.eclipse.smarthome.model.rule.runtime.internal.RuleModelRuntimeActivator diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/build.properties b/bundles/model/org.eclipse.smarthome.model.rule.runtime/build.properties index 91a7e835..948f0bdf 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/build.properties +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/build.properties @@ -3,4 +3,4 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ OSGI-INF/,\ - fragment.xml + plugin.xml diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/fragment.xml b/bundles/model/org.eclipse.smarthome.model.rule.runtime/plugin.xml similarity index 96% rename from bundles/model/org.eclipse.smarthome.model.rule.runtime/fragment.xml rename to bundles/model/org.eclipse.smarthome.model.rule.runtime/plugin.xml index 449117ba..0f230089 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/fragment.xml +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/plugin.xml @@ -1,6 +1,6 @@ - + - - + diff --git a/bundles/model/org.eclipse.smarthome.model.rule/src/org/eclipse/smarthome/model/rule/internal/RuleModelActivator.java b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/RuleModelRuntimeActivator.java similarity index 87% rename from bundles/model/org.eclipse.smarthome.model.rule/src/org/eclipse/smarthome/model/rule/internal/RuleModelActivator.java rename to bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/RuleModelRuntimeActivator.java index 8e2468c2..ab3fa82b 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule/src/org/eclipse/smarthome/model/rule/internal/RuleModelActivator.java +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/RuleModelRuntimeActivator.java @@ -5,11 +5,10 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ -package org.eclipse.smarthome.model.rule.internal; +package org.eclipse.smarthome.model.rule.runtime.internal; import org.eclipse.smarthome.core.scriptengine.ScriptEngine; import org.eclipse.smarthome.model.core.ModelRepository; -import org.eclipse.smarthome.model.rule.RulesStandaloneSetup; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.util.tracker.ServiceTracker; @@ -22,9 +21,9 @@ import org.slf4j.LoggerFactory; * * @author Kai Kreuzer - Initial contribution and API */ -public class RuleModelActivator implements BundleActivator { +public class RuleModelRuntimeActivator implements BundleActivator { - private final static Logger logger = LoggerFactory.getLogger(RuleModelActivator.class); + private final static Logger logger = LoggerFactory.getLogger(RuleModelRuntimeActivator.class); public static ServiceTracker modelRepositoryTracker; public static ServiceTracker scriptEngineTracker; diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/ExecuteRuleJob.java b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/ExecuteRuleJob.java index 6579b741..e59c7ee9 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/ExecuteRuleJob.java +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/ExecuteRuleJob.java @@ -12,9 +12,9 @@ import org.eclipse.smarthome.core.scriptengine.Script; import org.eclipse.smarthome.core.scriptengine.ScriptEngine; import org.eclipse.smarthome.core.scriptengine.ScriptExecutionException; import org.eclipse.smarthome.model.core.ModelRepository; -import org.eclipse.smarthome.model.rule.internal.RuleModelActivator; import org.eclipse.smarthome.model.rule.rules.Rule; import org.eclipse.smarthome.model.rule.rules.RuleModel; +import org.eclipse.smarthome.model.rule.runtime.internal.RuleModelRuntimeActivator; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; @@ -44,8 +44,8 @@ public class ExecuteRuleJob implements Job { String modelName = (String) context.getJobDetail().getJobDataMap().get(JOB_DATA_RULEMODEL); String ruleName = (String) context.getJobDetail().getJobDataMap().get(JOB_DATA_RULENAME); - ModelRepository modelRepository = RuleModelActivator.modelRepositoryTracker.getService(); - ScriptEngine scriptEngine = RuleModelActivator.scriptEngineTracker.getService(); + ModelRepository modelRepository = RuleModelRuntimeActivator.modelRepositoryTracker.getService(); + ScriptEngine scriptEngine = RuleModelRuntimeActivator.scriptEngineTracker.getService(); if(modelRepository!=null && scriptEngine!=null) { EObject model = modelRepository.getModel(modelName); diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/GuiceAwareJobFactory.java b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/GuiceAwareJobFactory.java index 05973c4c..85066f08 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/GuiceAwareJobFactory.java +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/GuiceAwareJobFactory.java @@ -1,13 +1,13 @@ package org.eclipse.smarthome.model.rule.runtime.internal.engine; -import org.quartz.Job; -import org.quartz.Scheduler; -import org.quartz.SchedulerException; -import org.quartz.spi.JobFactory; -import org.quartz.spi.TriggerFiredBundle; +import org.quartz.Job; +import org.quartz.Scheduler; +import org.quartz.SchedulerException; +import org.quartz.spi.JobFactory; +import org.quartz.spi.TriggerFiredBundle; -import com.google.inject.Inject; -import com.google.inject.Injector; +import com.google.inject.Inject; +import com.google.inject.Injector; public class GuiceAwareJobFactory implements JobFactory { diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleContextHelper.java b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleContextHelper.java index d70a34a0..68b723ec 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleContextHelper.java +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleContextHelper.java @@ -11,10 +11,10 @@ import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.ecore.util.EContentAdapter; import org.eclipse.smarthome.core.scriptengine.ScriptEngine; import org.eclipse.smarthome.core.scriptengine.ScriptExecutionException; -import org.eclipse.smarthome.model.rule.internal.RuleModelActivator; import org.eclipse.smarthome.model.rule.rules.Rule; import org.eclipse.smarthome.model.rule.rules.RuleModel; import org.eclipse.smarthome.model.rule.rules.VariableDeclaration; +import org.eclipse.smarthome.model.rule.runtime.internal.RuleModelRuntimeActivator; import org.eclipse.xtext.naming.QualifiedName; import org.eclipse.xtext.xbase.interpreter.IEvaluationContext; import org.slf4j.Logger; @@ -34,7 +34,7 @@ public class RuleContextHelper { private static final Logger logger = LoggerFactory.getLogger(RuleContextHelper.class); - private static ScriptEngine scriptEngine = RuleModelActivator.scriptEngineTracker.getService(); + private static ScriptEngine scriptEngine = RuleModelRuntimeActivator.scriptEngineTracker.getService(); /** * Retrieves the evaluation context (= set of variables) for a rule. The context is shared with all rules in the same model (= rule file). diff --git a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleEngine.java b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleEngine.java index f0a1aff8..4830cce6 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleEngine.java +++ b/bundles/model/org.eclipse.smarthome.model.rule.runtime/src/org/eclipse/smarthome/model/rule/runtime/internal/engine/RuleEngine.java @@ -69,9 +69,10 @@ public class RuleEngine implements EventHandler, ItemRegistryChangeListener, Sta private RuleTriggerManager triggerManager; - private Injector injector = RuleRuntimeInjectorProvider.getInjector(); + private Injector injector; public void activate() { + injector = RuleRuntimeInjectorProvider.getInjector(); triggerManager = injector.getInstance(RuleTriggerManager.class); if(!isEnabled()) { diff --git a/bundles/model/org.eclipse.smarthome.model.rule/META-INF/MANIFEST.MF b/bundles/model/org.eclipse.smarthome.model.rule/META-INF/MANIFEST.MF index 8619ecbc..3b84f266 100644 --- a/bundles/model/org.eclipse.smarthome.model.rule/META-INF/MANIFEST.MF +++ b/bundles/model/org.eclipse.smarthome.model.rule/META-INF/MANIFEST.MF @@ -58,4 +58,3 @@ Export-Package: org.eclipse.smarthome.model.rule, org.eclipse.smarthome.model.rule.formatting, org.eclipse.smarthome.model.rule.jvmmodel, org.eclipse.smarthome.model.rule.serializer -Bundle-Activator: org.eclipse.smarthome.model.rule.internal.RuleModelActivator diff --git a/bundles/model/org.eclipse.smarthome.model.script.runtime/META-INF/MANIFEST.MF b/bundles/model/org.eclipse.smarthome.model.script.runtime/META-INF/MANIFEST.MF index 169e3cb2..590c54bf 100644 --- a/bundles/model/org.eclipse.smarthome.model.script.runtime/META-INF/MANIFEST.MF +++ b/bundles/model/org.eclipse.smarthome.model.script.runtime/META-INF/MANIFEST.MF @@ -6,6 +6,22 @@ Bundle-Version: 0.7.0.qualifier Bundle-SymbolicName: org.eclipse.smarthome.model.script.runtime;singleton:=true Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Service-Component: OSGI-INF/scriptengine.xml -Fragment-Host: org.eclipse.smarthome.model.script -Import-Package: org.eclipse.core.runtime, - org.eclipse.smarthome.model.core.guice +Import-Package: com.google.common.base, + com.google.common.collect, + com.google.inject, + org.eclipse.core.runtime, + org.eclipse.emf.common.util, + org.eclipse.emf.ecore, + org.eclipse.emf.ecore.resource, + org.eclipse.emf.ecore.resource.impl, + org.eclipse.smarthome.core.scriptengine, + org.eclipse.smarthome.model.core.guice, + org.eclipse.smarthome.model.script, + org.eclipse.xtext.diagnostics, + org.eclipse.xtext.resource, + org.eclipse.xtext.service, + org.eclipse.xtext.util, + org.eclipse.xtext.validation, + org.eclipse.xtext.xbase, + org.eclipse.xtext.xbase.interpreter +Bundle-ActivationPolicy: lazy diff --git a/bundles/model/org.eclipse.smarthome.model.script.runtime/build.properties b/bundles/model/org.eclipse.smarthome.model.script.runtime/build.properties index 91a7e835..948f0bdf 100644 --- a/bundles/model/org.eclipse.smarthome.model.script.runtime/build.properties +++ b/bundles/model/org.eclipse.smarthome.model.script.runtime/build.properties @@ -3,4 +3,4 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ OSGI-INF/,\ - fragment.xml + plugin.xml diff --git a/bundles/model/org.eclipse.smarthome.model.script.runtime/fragment.xml b/bundles/model/org.eclipse.smarthome.model.script.runtime/plugin.xml similarity index 96% rename from bundles/model/org.eclipse.smarthome.model.script.runtime/fragment.xml rename to bundles/model/org.eclipse.smarthome.model.script.runtime/plugin.xml index a714f7c0..1cb57b33 100644 --- a/bundles/model/org.eclipse.smarthome.model.script.runtime/fragment.xml +++ b/bundles/model/org.eclipse.smarthome.model.script.runtime/plugin.xml @@ -1,6 +1,6 @@ - + - + diff --git a/bundles/model/org.eclipse.smarthome.model.script.runtime/src/org/eclipse/smarthome/model/script/runtime/internal/engine/ScriptEngineImpl.java b/bundles/model/org.eclipse.smarthome.model.script.runtime/src/org/eclipse/smarthome/model/script/runtime/internal/engine/ScriptEngineImpl.java index e0e96146..4fe4ba4c 100644 --- a/bundles/model/org.eclipse.smarthome.model.script.runtime/src/org/eclipse/smarthome/model/script/runtime/internal/engine/ScriptEngineImpl.java +++ b/bundles/model/org.eclipse.smarthome.model.script.runtime/src/org/eclipse/smarthome/model/script/runtime/internal/engine/ScriptEngineImpl.java @@ -7,11 +7,11 @@ */ package org.eclipse.smarthome.model.script.runtime.internal.engine; -import static com.google.common.collect.Iterables.filter; - import java.io.IOException; import java.util.List; +import static com.google.common.collect.Iterables.filter; + import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; @@ -47,18 +47,16 @@ public class ScriptEngineImpl implements ScriptEngine { protected XtextResourceSet resourceSet; - private Injector injector = ScriptRuntimeInjectorProvider.getInjector(); - public ScriptEngineImpl() {} public void activate() { - + } private XtextResourceSet getResourceSet() { if (resourceSet == null) { - resourceSet = injector.getInstance(XtextResourceSet.class); + resourceSet = ScriptRuntimeInjectorProvider.getInjector().getInstance(XtextResourceSet.class); resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE); } return resourceSet; @@ -80,7 +78,7 @@ public class ScriptEngineImpl implements ScriptEngine { * {@inheritDoc} */ public Script newScriptFromXExpression(XExpression expression) { - ScriptImpl script = injector.getInstance(ScriptImpl.class); + ScriptImpl script = ScriptRuntimeInjectorProvider.getInjector().getInstance(ScriptImpl.class); script.setXExpression(expression); return script; } diff --git a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/META-INF/MANIFEST.MF b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/META-INF/MANIFEST.MF index 0bd2f185..bbb62e5f 100644 --- a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/META-INF/MANIFEST.MF +++ b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/META-INF/MANIFEST.MF @@ -5,7 +5,10 @@ Bundle-Vendor: Eclipse.org/SmartHome Bundle-Version: 0.7.0.qualifier Bundle-SymbolicName: org.eclipse.smarthome.model.sitemap.runtime;singleton:=true Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Fragment-Host: org.eclipse.smarthome.model.sitemap -Import-Package: org.eclipse.core.runtime, - org.eclipse.smarthome.model.core.guice +Import-Package: com.google.inject, + org.eclipse.core.runtime, + org.eclipse.smarthome.model.core.guice, + org.eclipse.xtext.resource, + org.eclipse.xtext.service Bundle-ActivationPolicy: lazy +Require-Bundle: org.eclipse.smarthome.model.sitemap diff --git a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/build.properties b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/build.properties index e3023e14..e9863e28 100644 --- a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/build.properties +++ b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/build.properties @@ -2,4 +2,4 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - fragment.xml + plugin.xml diff --git a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/fragment.xml b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/plugin.xml similarity index 93% rename from bundles/model/org.eclipse.smarthome.model.sitemap.runtime/fragment.xml rename to bundles/model/org.eclipse.smarthome.model.sitemap.runtime/plugin.xml index d1ad241e..9e469b64 100644 --- a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/fragment.xml +++ b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/plugin.xml @@ -1,6 +1,7 @@ - - + + + - + diff --git a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/src/org/eclipse/smarthome/model/sitemap/runtime/internal/SitemapRuntimeInjectorProvider.java b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/src/org/eclipse/smarthome/model/sitemap/runtime/internal/SitemapRuntimeInjectorProvider.java index a55de196..cf9ba202 100644 --- a/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/src/org/eclipse/smarthome/model/sitemap/runtime/internal/SitemapRuntimeInjectorProvider.java +++ b/bundles/model/org.eclipse.smarthome.model.sitemap.runtime/src/org/eclipse/smarthome/model/sitemap/runtime/internal/SitemapRuntimeInjectorProvider.java @@ -5,6 +5,7 @@ import org.eclipse.smarthome.model.SitemapRuntimeModule; import com.google.inject.Guice; import com.google.inject.Injector; + public class SitemapRuntimeInjectorProvider { private static Injector injector; diff --git a/features/org.eclipse.smarthome.feature.runtime/feature.xml b/features/org.eclipse.smarthome.feature.runtime/feature.xml index bcff6ef5..5b06c430 100644 --- a/features/org.eclipse.smarthome.feature.runtime/feature.xml +++ b/features/org.eclipse.smarthome.feature.runtime/feature.xml @@ -225,7 +225,6 @@ download-size="0" install-size="0" version="0.0.0" - fragment="true" unpack="false"/> diff --git a/products/org.eclipse.smarthome.runtime.product/org.eclipse.smarthome.runtime.product.product b/products/org.eclipse.smarthome.runtime.product/org.eclipse.smarthome.runtime.product.product index ca2baa9b..81fcdf68 100644 --- a/products/org.eclipse.smarthome.runtime.product/org.eclipse.smarthome.runtime.product.product +++ b/products/org.eclipse.smarthome.runtime.product/org.eclipse.smarthome.runtime.product.product @@ -70,9 +70,14 @@ + + + + + diff --git a/targetplatform/SmartHome Runtime.launch b/targetplatform/SmartHome Runtime.launch index 9d91517d..be0bc4ba 100644 --- a/targetplatform/SmartHome Runtime.launch +++ b/targetplatform/SmartHome Runtime.launch @@ -23,7 +23,7 @@ - +