From efaac8794d839ce2cbc0c4d2d8c042c4076df9d2 Mon Sep 17 00:00:00 2001 From: Florian Hoelzl <hoelzl@fortiss.org> Date: Fri, 22 Jul 2011 09:26:53 +0000 Subject: [PATCH] removed conqat dependency => conqat is repackaged in org.fortiss.tooling.common and org.fortiss.tooling.common.ui --- .../trunk/META-INF/MANIFEST.MF | 5 +- .../kernel/ui/internal/ActionService.java | 2 +- .../kernel/ui/internal/MarkerService.java | 2 +- .../kernel/ui/internal/NavigatorService.java | 2 +- .../trunk/META-INF/MANIFEST.MF | 5 +- org.fortiss.tooling.kernel/trunk/plugin.xml | 1 + .../trunk/schema/executionTarget.exsd | 102 ++++++++++++++++++ .../kernel/extension/IExecutionTarget.java | 47 ++++++++ .../data/TransformationProviderChain.java | 3 +- .../ChainTransformationFailedException.java | 8 +- .../exception/ExecutionFailedException.java | 54 ++++++++++ .../kernel/extension/exception/package.html | 8 ++ .../kernel/internal/CommandStackService.java | 6 +- .../kernel/internal/ExecutionService.java | 67 +++++++++++- .../kernel/internal/PersistencyService.java | 7 +- .../kernel/service/IExecutionService.java | 32 ++++-- .../kernel/service/IPersistencyService.java | 4 +- .../service/base/ObjectAware2ServiceBase.java | 4 +- .../listener/IPersistencyServiceListener.java | 2 +- .../{ => service}/listener/package.html | 0 20 files changed, 329 insertions(+), 32 deletions(-) create mode 100644 org.fortiss.tooling.kernel/trunk/schema/executionTarget.exsd create mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IExecutionTarget.java rename org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/{data => exception}/ChainTransformationFailedException.java (89%) create mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/ExecutionFailedException.java create mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/package.html rename org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/{ => service}/listener/IPersistencyServiceListener.java (97%) rename org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/{ => service}/listener/package.html (100%) diff --git a/org.fortiss.tooling.kernel.ui/trunk/META-INF/MANIFEST.MF b/org.fortiss.tooling.kernel.ui/trunk/META-INF/MANIFEST.MF index c85296808..63cc664fd 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/META-INF/MANIFEST.MF +++ b/org.fortiss.tooling.kernel.ui/trunk/META-INF/MANIFEST.MF @@ -4,13 +4,12 @@ Bundle-Name: Fortiss Tooling Kernel User Interface Bundle-SymbolicName: org.fortiss.tooling.kernel.ui;singleton:=true Bundle-Version: 1.0.0.qualifier Bundle-Activator: org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator -Require-Bundle: org.eclipse.ui;visibility:=reexport, +Require-Bundle: org.fortiss.tooling.common.ui;bundle-version="1.0.0";visibility:=reexport, + org.eclipse.ui;visibility:=reexport, org.eclipse.core.runtime;visibility:=reexport, org.fortiss.tooling.kernel;bundle-version="0.0.1";visibility:=reexport, org.eclipse.core.resources;bundle-version="3.6.1";visibility:=reexport, org.eclipse.gef;bundle-version="3.6.2";visibility:=reexport, - org.conqat.ide.commons.gef;bundle-version="2.7.0";visibility:=reexport, - org.conqat.ide.commons.ui;bundle-version="2.7.0";visibility:=reexport, org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.100";visibility:=reexport, org.eclipse.jface.databinding;bundle-version="1.4.0";visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java index d018f73af..5ca093147 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ActionService.java @@ -27,10 +27,10 @@ import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.ActionFactory; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; -import org.fortiss.tooling.kernel.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.service.ICommandStackService; import org.fortiss.tooling.kernel.service.IElementCompositorService; import org.fortiss.tooling.kernel.service.IPersistencyService; +import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.ui.extension.base.EObjectActionBase; import org.fortiss.tooling.kernel.ui.service.IActionService; import org.fortiss.tooling.kernel.ui.util.EObjectSelectionUtils; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java index 6843123e0..e437adb0b 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/MarkerService.java @@ -40,9 +40,9 @@ import org.eclipse.ui.progress.UIJob; import org.fortiss.tooling.kernel.extension.data.IConstraintViolation; import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; -import org.fortiss.tooling.kernel.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.service.IConstraintCheckerService; import org.fortiss.tooling.kernel.service.IPersistencyService; +import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.ui.ESharedImages; import org.fortiss.tooling.kernel.ui.service.IMarkerService; diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java index 132e4ab4c..ce296bddc 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/NavigatorService.java @@ -34,8 +34,8 @@ import org.eclipse.jface.viewers.ISelection; import org.eclipse.ui.Saveable; import org.fortiss.tooling.kernel.ToolingKernelActivator; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; -import org.fortiss.tooling.kernel.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.service.IPersistencyService; +import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.ui.internal.views.NavigatorViewPart; import org.fortiss.tooling.kernel.ui.service.INavigatorService; import org.fortiss.tooling.kernel.ui.util.EObjectSelectionUtils; diff --git a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF index 7d6e1cdda..d96f4aa47 100644 --- a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF +++ b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF @@ -5,7 +5,7 @@ Bundle-SymbolicName: org.fortiss.tooling.kernel;singleton:=true Bundle-Version: 0.0.1.qualifier Bundle-Activator: org.fortiss.tooling.kernel.ToolingKernelActivator Bundle-Vendor: fortiss -Require-Bundle: org.conqat.ide.commons;bundle-version="2.7.0";visibility:=reexport, +Require-Bundle: org.fortiss.tooling.common;bundle-version="1.0.0";visibility:=reexport, org.eclipse.core.runtime;visibility:=reexport, org.eclipse.core.databinding;visibility:=reexport, org.eclipse.emf.ecore;bundle-version="2.6.1";visibility:=reexport, @@ -17,7 +17,7 @@ Export-Package: org.fortiss.tooling.kernel;uses:="org.eclipse.core.runtime,org.o org.fortiss.tooling.kernel.extension, org.fortiss.tooling.kernel.extension.base, org.fortiss.tooling.kernel.extension.data, - org.fortiss.tooling.kernel.listener, + org.fortiss.tooling.kernel.extension.exception, org.fortiss.tooling.kernel.model;uses:="org.eclipse.emf.ecore", org.fortiss.tooling.kernel.model.impl;uses:="org.fortiss.tooling.kernel.model", org.fortiss.tooling.kernel.model.util; @@ -31,4 +31,5 @@ Export-Package: org.fortiss.tooling.kernel;uses:="org.eclipse.core.runtime,org.o org.fortiss.tooling.kernel.interfaces, org.conqat.lib.commons.collections", org.fortiss.tooling.kernel.service.base, + org.fortiss.tooling.kernel.service.listener, org.fortiss.tooling.kernel.util;uses:="org.eclipse.emf.ecore,org.eclipse.core.resources" diff --git a/org.fortiss.tooling.kernel/trunk/plugin.xml b/org.fortiss.tooling.kernel/trunk/plugin.xml index 41935a1b2..cee2d0f22 100644 --- a/org.fortiss.tooling.kernel/trunk/plugin.xml +++ b/org.fortiss.tooling.kernel/trunk/plugin.xml @@ -8,6 +8,7 @@ <extension-point id="eclipseResourceStorageLocationProvider" name="Eclipse Resource Storage Location Provider" schema="schema/eclipseResourceStorageLocationProvider.exsd"/> <extension-point id="modelConnectionCompositor" name="Model Connection Compositor" schema="schema/modelConnectionCompositor.exsd"/> <extension-point id="transformationProvider" name="Transformation Provider" schema="schema/transformationProvider.exsd"/> + <extension-point id="executionTarget" name="Execution Target" schema="schema/executionTarget.exsd"/> <extension point="org.eclipse.emf.ecore.generated_package"> <package diff --git a/org.fortiss.tooling.kernel/trunk/schema/executionTarget.exsd b/org.fortiss.tooling.kernel/trunk/schema/executionTarget.exsd new file mode 100644 index 000000000..90b557bde --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/schema/executionTarget.exsd @@ -0,0 +1,102 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.fortiss.tooling.kernel" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appinfo> + <meta.schema plugin="org.fortiss.tooling.kernel" id="executionTarget" name="Execution Target"/> + </appinfo> + <documentation> + Registers execution targets. + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appinfo> + <meta.element /> + </appinfo> + </annotation> + <complexType> + <sequence> + <element ref="executionTarget" minOccurs="1" maxOccurs="unbounded"/> + </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="executionTarget"> + <complexType> + <attribute name="target" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + <appinfo> + <meta.attribute kind="java" basedOn=":org.fortiss.tooling.kernel.extension.IExecutionTarget"/> + </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> + + +</schema> diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IExecutionTarget.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IExecutionTarget.java new file mode 100644 index 000000000..31753ba52 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IExecutionTarget.java @@ -0,0 +1,47 @@ +/*--------------------------------------------------------------------------+ +$Id$ +| | +| Copyright 2011 ForTISS GmbH | +| | +| 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 org.fortiss.tooling.kernel.extension; + +import org.fortiss.tooling.kernel.service.IExecutionService; + +/** + * An {@link IExecutionTarget} extension provides execution target like + * simulators or code generators. + * <P> + * Execution targets are handled by {@link IExecutionService}. + * + * @author hoelzl + * @author $Author$ + * @version $Rev$ + * @ConQAT.Rating YELLOW Hash: BA5239272BF9469A9F133870FBA364A3 + */ +public interface IExecutionTarget { + + /** Returns the name of the execution target. */ + String getName(); + + /** Returns the class of the input handled by this target. */ + Class<? extends Object> getExecutableElementClass(); + + /** + * Executes the given executable element. The provided element is guaranteed + * to be an instance of the class returned by + * {@link #getExecutableElementClass()}. + */ + Object execute(Object executable); +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TransformationProviderChain.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TransformationProviderChain.java index 88a7a3215..498aa13b4 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TransformationProviderChain.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TransformationProviderChain.java @@ -22,6 +22,7 @@ import java.util.List; import org.eclipse.core.runtime.Assert; import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.exception.ChainTransformationFailedException; /** * A transformation provider chain consists of a list of transformation @@ -31,7 +32,7 @@ import org.fortiss.tooling.kernel.extension.ITransformationProvider; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: BAD4BF78ACE465A9367F2CF955764E46 + * @ConQAT.Rating YELLOW Hash: 9545B134A0637471B278802119F8F2B3 */ public final class TransformationProviderChain { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/ChainTransformationFailedException.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/ChainTransformationFailedException.java similarity index 89% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/ChainTransformationFailedException.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/ChainTransformationFailedException.java index a5bb13ccb..056c92c13 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/ChainTransformationFailedException.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/ChainTransformationFailedException.java @@ -15,11 +15,13 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.extension.data; +package org.fortiss.tooling.kernel.extension.exception; import java.util.List; import org.fortiss.tooling.kernel.extension.ITransformationProvider; +import org.fortiss.tooling.kernel.extension.data.ITransformationContext; +import org.fortiss.tooling.kernel.extension.data.TransformationProviderChain; /** * An exception thrown by @@ -31,7 +33,7 @@ import org.fortiss.tooling.kernel.extension.ITransformationProvider; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 392552053F397DDAE8C27683ED51547D + * @ConQAT.Rating YELLOW Hash: 80F4B122B58134340E3FF51243C43664 */ public final class ChainTransformationFailedException extends Exception { @@ -45,7 +47,7 @@ public final class ChainTransformationFailedException extends Exception { private final List<Object> successfulResults; /** Constructor. */ - /* package */ChainTransformationFailedException( + public ChainTransformationFailedException( TransformationProviderChain chain, ITransformationProvider failedProvider, List<Object> successfulResults) { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/ExecutionFailedException.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/ExecutionFailedException.java new file mode 100644 index 000000000..ff5b384da --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/ExecutionFailedException.java @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------+ +$Id$ +| | +| Copyright 2011 ForTISS GmbH | +| | +| 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 org.fortiss.tooling.kernel.extension.exception; + +import org.fortiss.tooling.kernel.extension.IExecutionTarget; + +/** + * Exception class for informing about failures during target execution. + * + * @author hoelzl + * @author $Author$ + * @version $Rev$ + * @ConQAT.Rating YELLOW Hash: 43D42AC76FC2B4B8DBD08AC0906B2982 + */ +public class ExecutionFailedException extends Exception { + + /** Stores the failing execution target provider. */ + private final IExecutionTarget executionTarget; + + /** Stores the failed target input. */ + private final Object targetInput; + + /** Constructor. */ + public ExecutionFailedException(IExecutionTarget target, + Object input) { + this.executionTarget = target; + this.targetInput = input; + } + + /** Returns the execution target, which failed. */ + public IExecutionTarget getExecutionTarget() { + return executionTarget; + } + + /** Returns the execution input, which might have caused the failure. */ + public Object getTargetInput() { + return targetInput; + } +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/package.html b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/package.html new file mode 100644 index 000000000..d7e750f28 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/exception/package.html @@ -0,0 +1,8 @@ +<!-- + $Id$ + @version $Rev$ + @ConQAT.Rating YELLOW Hash: C93760009EA4D5F2F25954D7D798DDEF +--> +<body> +Exception classes for failure reporting between the kernel and extensions. +</body> diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java index 3de71e568..77b2cc712 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CommandStackService.java @@ -64,16 +64,14 @@ public class CommandStackService implements ICommandStackService { /** {@inheritDoc} */ @Override public void undo(EObject target) { - IPersistencyService.INSTANCE.getTopLevelElementFor(target) - .undo(); + IPersistencyService.INSTANCE.getTopLevelElementFor(target).undo(); } /** {@inheritDoc} */ @Override public void redo(EObject target) { - IPersistencyService.INSTANCE.getTopLevelElementFor(target) - .redo(); + IPersistencyService.INSTANCE.getTopLevelElementFor(target).redo(); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java index b50616a5a..99749f99a 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ExecutionService.java @@ -17,7 +17,17 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.core.runtime.IConfigurationElement; +import org.fortiss.tooling.kernel.ToolingKernelActivator; +import org.fortiss.tooling.kernel.extension.IExecutionTarget; +import org.fortiss.tooling.kernel.model.ExecutionConfiguration; import org.fortiss.tooling.kernel.service.IExecutionService; +import org.fortiss.tooling.kernel.util.ExtensionPointUtils; +import org.fortiss.tooling.kernel.util.LoggingUtils; +import org.osgi.framework.Bundle; /** * This class implements the {@link IExecutionService} interface. @@ -28,5 +38,60 @@ import org.fortiss.tooling.kernel.service.IExecutionService; * @ConQAT.Rating RED Hash: 988B0F9A9FAC0A752EE12CC8EC96F278 */ public class ExecutionService implements IExecutionService { - // TODO (FH): implement + + /** The execution target extension point ID. */ + private static final String EXTENSION_POINT_NAME = "org.fortiss.tooling.kernel.executionTarget"; + + /** The execution target configuration element name. */ + private static final String CONFIGURATION_ELEMENT_NAME = "executionTarget"; + + /** Stores the registered execution targets. */ + private final List<IExecutionTarget> executionTargetList = new ArrayList<IExecutionTarget>(); + + /** Constructor. */ + public ExecutionService() { + setupExecutionTargets(); + } + + /** {@inheritDoc} */ + @Override + public List<IExecutionTarget> getExecutionTargets() { + // TODO Auto-generated method stub + return null; + } + + /** {@inheritDoc} */ + @Override + public List<IExecutionTarget> getExecutionTargets( + ExecutionConfiguration config) { + // TODO Auto-generated method stub + return null; + } + + /** {@inheritDoc} */ + @Override + public Object prepareExecutable(ExecutionConfiguration config, + IExecutionTarget target) { + // TODO Auto-generated method stub + return null; + } + + /** Initializes the targets from plugin extensions. */ + private void setupExecutionTargets() { + for (IConfigurationElement ce : ExtensionPointUtils + .getConfigurationElements(EXTENSION_POINT_NAME, + CONFIGURATION_ELEMENT_NAME)) { + Bundle bundle = ExtensionPointUtils.getBundle(ce); + try { + Class<?> handlerClass = ExtensionPointUtils.loadClass( + ce.getAttribute("target"), bundle); + IExecutionTarget target = (IExecutionTarget) handlerClass + .getConstructor().newInstance(); + executionTargetList.add(target); + } catch (Exception ex) { + LoggingUtils.error(ToolingKernelActivator.getDefault(), + ex.getMessage(), ex); + } + } + } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java index 589b2a204..6f2f2b070 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PersistencyService.java @@ -36,8 +36,8 @@ import org.eclipse.emf.ecore.EObject; import org.fortiss.tooling.kernel.ToolingKernelActivator; import org.fortiss.tooling.kernel.extension.IStorageProvider; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; -import org.fortiss.tooling.kernel.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.service.IPersistencyService; +import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener; import org.fortiss.tooling.kernel.util.ExtensionPointUtils; import org.fortiss.tooling.kernel.util.LoggingUtils; import org.osgi.framework.Bundle; @@ -49,7 +49,7 @@ import org.osgi.framework.Bundle; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 0FAB59FD372CC7E5E5D6A06279A0A1FC + * @ConQAT.Rating YELLOW Hash: D990B7A14F3358172566E65FBE67D526 */ public class PersistencyService implements IPersistencyService { @@ -237,8 +237,7 @@ public class PersistencyService implements IPersistencyService { /** Initializes the top-level element contexts. */ private void initializeTopLevelElementContexts() { for (IStorageProvider provider : storageProviderList) { - for (ITopLevelElement context : provider - .getTopLevelElements()) { + for (ITopLevelElement context : provider.getTopLevelElements()) { contextCache.add(context); storageProviderCache.put(context, provider); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IExecutionService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IExecutionService.java index dd8a1aff1..59dd77b7f 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IExecutionService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IExecutionService.java @@ -17,7 +17,12 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.service; +import java.util.List; + +import org.fortiss.tooling.kernel.extension.IExecutionTarget; import org.fortiss.tooling.kernel.internal.ExecutionService; +import org.fortiss.tooling.kernel.model.ExecutionConfiguration; +import org.fortiss.tooling.kernel.model.ExecutionConfigurationPart; import org.fortiss.tooling.kernel.model.IIdLabeled; /** @@ -32,20 +37,35 @@ import org.fortiss.tooling.kernel.model.IIdLabeled; * <P> * An execution configuration in its simplest form references an * {@link IIdLabeled} model element. However, an execution configuration can - * also contain additional information for the execution. Here, a typical - * example would be a set of parameters provided to some transformation, which - * takes part in the creation of the executable object (e.g a test case - * generator may be parameterized to use different methods of test generation). + * also contain additional information for the execution, e.g, sub-classes of + * {@link ExecutionConfigurationPart}. A typical example would be a set of + * parameters provided to some transformation, which takes part in the creation + * of the executable object (e.g a test case generator may be parameterized to + * use different methods of test generation). * * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating RED Hash: 8FBE97007A2577BD7574F799F2903C9D + * @ConQAT.Rating YELLOW Hash: DACCA24CC9BAEED36C5A914573250003 */ public interface IExecutionService { /** Returns the singleton instance of the execution service. */ public static final IExecutionService INSTANCE = new ExecutionService(); - // TODO (FH): define + /** Returns the list of registered execution targets. */ + List<IExecutionTarget> getExecutionTargets(); + + /** + * Returns the list of possbile execution targets using the given execution + * configuration. + */ + List<IExecutionTarget> getExecutionTargets(ExecutionConfiguration config); + + /** + * Prepares an executable object using the given + * {@link ExecutionConfiguration}. + */ + Object prepareExecutable(ExecutionConfiguration config, + IExecutionTarget target); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java index 22beae95c..c13b6bf2e 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPersistencyService.java @@ -24,7 +24,7 @@ import org.eclipse.emf.ecore.EObject; import org.fortiss.tooling.kernel.extension.IStorageProvider; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.internal.PersistencyService; -import org.fortiss.tooling.kernel.listener.IPersistencyServiceListener; +import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener; /** * The persistency service provides the transparent access to the different @@ -41,7 +41,7 @@ import org.fortiss.tooling.kernel.listener.IPersistencyServiceListener; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: A92BFADC445DE98F5FD8C093A00E6587 + * @ConQAT.Rating YELLOW Hash: 2AB0B956F1EE43A8F5DBCAEC8AD7FF36 */ public interface IPersistencyService { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/base/ObjectAware2ServiceBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/base/ObjectAware2ServiceBase.java index 158255fd2..b10694b5b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/base/ObjectAware2ServiceBase.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/base/ObjectAware2ServiceBase.java @@ -50,8 +50,8 @@ import org.osgi.framework.Bundle; * <UL> * <LI>{@link #getSourceAttribute()} to provide a source attribute ID, * <LI>{@link #getTargetAttribute()} to provide a target attribute ID, - * <LI>{@link #getClassConfigurationElement()} to provide a element - * class configuration element, + * <LI>{@link #getClassConfigurationElement()} to provide a element class + * configuration element, * <LI>{@link #getClassAttribute()} to provide a element class attribute. * <LI> {@link #requiresUniqueHandler()} should return true if each combination * of source and target class must not have more than one handler. The default diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/listener/IPersistencyServiceListener.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/IPersistencyServiceListener.java similarity index 97% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/listener/IPersistencyServiceListener.java rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/IPersistencyServiceListener.java index 73d243654..02a0d407d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/listener/IPersistencyServiceListener.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/IPersistencyServiceListener.java @@ -15,7 +15,7 @@ $Id$ | See the License for the specific language governing permissions and | | limitations under the License. | +--------------------------------------------------------------------------*/ -package org.fortiss.tooling.kernel.listener; +package org.fortiss.tooling.kernel.service.listener; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/listener/package.html b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/package.html similarity index 100% rename from org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/listener/package.html rename to org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/package.html -- GitLab