From 290b1ffdee69940d87f696bfb51e833f7adc9de1 Mon Sep 17 00:00:00 2001
From: Florian Hoelzl <hoelzl@fortiss.org>
Date: Fri, 24 Jun 2011 08:50:40 +0000
Subject: [PATCH] some cleanup model constraint service implementation

---
 org.fortiss.tooling.kernel/trunk/plugin.xml   |   8 ++
 .../trunk/schema/modelConstraintChecker.exsd  |  89 +++++++++++++++
 .../trunk/schema/modelStorageProvider.exsd    | 102 ++++++++++++++++++
 .../kernel/ToolingKernelActivator.java        |   2 +-
 .../kernel/base/EObjectAware2ServiceBase.java |   2 +-
 .../kernel/base/EObjectAwareServiceBase.java  |   2 +-
 .../kernel/interfaces/IConstraintChecker.java |  40 +++++++
 .../interfaces/IConstraintViolation.java      |  60 +++++++++++
 .../ITopLevelElementChangeListener.java       |   2 +-
 .../kernel/internal/CommandStackService.java  |   3 +-
 .../kernel/internal/CompositorService.java    |   2 +-
 .../kernel/internal/ConstraintService.java    |  22 +++-
 .../kernel/internal/PersistencyService.java   |  44 ++++++--
 .../kernel/internal/PrototypeService.java     |   3 +-
 .../storage/eclipse/AutoUndoCommandStack.java |   4 +-
 .../eclipse/EMFTransactionalCommand.java      |   4 +-
 .../EclipseResourceStorageProvider.java       |   2 +-
 .../storage/eclipse/ModelContext.java         |   4 +-
 .../kernel/services/IConstraintService.java   |  17 ++-
 .../kernel/util/ExtensionPointUtils.java      |   4 +-
 .../tooling/kernel/util/LoggingUtils.java     |   4 +-
 21 files changed, 389 insertions(+), 31 deletions(-)
 create mode 100644 org.fortiss.tooling.kernel/trunk/schema/modelConstraintChecker.exsd
 create mode 100644 org.fortiss.tooling.kernel/trunk/schema/modelStorageProvider.exsd
 create mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintChecker.java
 create mode 100644 org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintViolation.java

diff --git a/org.fortiss.tooling.kernel/trunk/plugin.xml b/org.fortiss.tooling.kernel/trunk/plugin.xml
index 9c7fe0c4f..2bd864864 100644
--- a/org.fortiss.tooling.kernel/trunk/plugin.xml
+++ b/org.fortiss.tooling.kernel/trunk/plugin.xml
@@ -4,6 +4,8 @@
    <extension-point id="modelPrototypeProvider" name="Model Prototype Provider" schema="schema/modelPrototypeProvider.exsd"/>
    <extension-point id="modelElementCompositor" name="Model Element Compositor" schema="schema/modelElementCompositor.exsd"/>
    <extension-point id="modelElementConnector" name="Model Element Connector" schema="schema/modelElementConnector.exsd"/>
+   <extension-point id="modelStorageProvider" name="Model Storage Provider" schema="schema/modelStorageProvider.exsd"/>
+   <extension-point id="modelConstraintChecker" name="Model Constraint Checker" schema="schema/modelConstraintChecker.exsd"/>
    <extension
          point="org.eclipse.emf.ecore.generated_package">
       <package
@@ -12,4 +14,10 @@
             uri="http://www.fortiss.org/tooling/kernel">
       </package>
    </extension>
+   <extension
+         point="org.fortiss.tooling.kernel.modelStorageProvider">
+      <modelStorageProvider
+            provider="org.fortiss.tooling.kernel.internal.storage.eclipse.EclipseResourceStorageProvider">
+      </modelStorageProvider>
+   </extension>
 </plugin>
diff --git a/org.fortiss.tooling.kernel/trunk/schema/modelConstraintChecker.exsd b/org.fortiss.tooling.kernel/trunk/schema/modelConstraintChecker.exsd
new file mode 100644
index 000000000..bebe29d78
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/schema/modelConstraintChecker.exsd
@@ -0,0 +1,89 @@
+<?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="modelConstraintChecker" name="Model Constraint Checker"/>
+      </appinfo>
+      <documentation>
+         Registers a constraint checker for model elements.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+         </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="modelConstraintChecker" type="string">
+   </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/schema/modelStorageProvider.exsd b/org.fortiss.tooling.kernel/trunk/schema/modelStorageProvider.exsd
new file mode 100644
index 000000000..3737d3d6b
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/schema/modelStorageProvider.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="modelStorageProvider" name="Model Storage Provider"/>
+      </appinfo>
+      <documentation>
+         Extension mechanism for model storage providers, i.e. alternative persistency implementations.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="modelStorageProvider" 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="modelStorageProvider">
+      <complexType>
+         <attribute name="provider" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.fortiss.tooling.kernel.interfaces.IStorageProvider"/>
+               </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/ToolingKernelActivator.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java
index de4c7d506..865a47f0c 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/ToolingKernelActivator.java
@@ -27,7 +27,7 @@ import org.osgi.framework.BundleContext;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 1D717C45E4E5E6DB57569062F7E741A1
+ * @ConQAT.Rating YELLOW Hash: 157BFA58493859794739A4C9E55B0EFF
  */
 public class ToolingKernelActivator extends Plugin {
 
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAware2ServiceBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAware2ServiceBase.java
index b246f3ede..80a78184a 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAware2ServiceBase.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAware2ServiceBase.java
@@ -39,7 +39,7 @@ import org.osgi.framework.Bundle;
  * @author hoelzlf
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: F6B36995BE099A30EA854295563C109E
+ * @ConQAT.Rating YELLOW Hash: 5A12CD400F90CECAC6B1246227D363AB
  */
 public abstract class EObjectAware2ServiceBase<T extends IEObjectAware2<? extends EObject, ? extends EObject>> {
 
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAwareServiceBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAwareServiceBase.java
index 65480377b..ad3b22236 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAwareServiceBase.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/base/EObjectAwareServiceBase.java
@@ -39,7 +39,7 @@ import org.osgi.framework.Bundle;
  * @author hoelzlf
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: C72B82111F8713B4BB4A10B239274A71
+ * @ConQAT.Rating YELLOW Hash: 8A8E5E88AC4F8FE9D3213D12B500F959
  */
 public abstract class EObjectAwareServiceBase<T extends IEObjectAware<? extends EObject>> {
 
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintChecker.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintChecker.java
new file mode 100644
index 000000000..23245c0eb
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintChecker.java
@@ -0,0 +1,40 @@
+/*--------------------------------------------------------------------------+
+$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.interfaces;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * Interface for constraint checker implementations.
+ * 
+ * @author hoelzlf
+ * @author $Author$
+ * @version $Rev$
+ * @ConQAT.Rating YELLOW Hash: B26440F1029C58D8B881C889F3D87A95
+ */
+public interface IConstraintChecker {
+
+	/**
+	 * Determines whether the constraint checker is applicable to the given
+	 * model element.
+	 */
+	boolean isApplicable(EObject modelElement);
+
+	/** Applies the constraint checker to the given model element. */
+	IConstraintViolation apply(EObject modelElement);
+}
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintViolation.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintViolation.java
new file mode 100644
index 000000000..a0ac476a6
--- /dev/null
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/IConstraintViolation.java
@@ -0,0 +1,60 @@
+/*--------------------------------------------------------------------------+
+$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.interfaces;
+
+/**
+ * This interface describes a constraint violation produced by some constraint
+ * checker. A constraint violation has a severity, an explanation and possibly a
+ * quick fix.
+ * 
+ * @author hoelzlf
+ * @author $Author$
+ * @version $Rev$
+ * @ConQAT.Rating YELLOW Hash: BAED4776E8F47E7A6D42A7D38A68FAA6
+ */
+public interface IConstraintViolation {
+
+	/** Returns the severity of the constraint violation. */
+	ESeverity getSeverity();
+
+	/** Returns the explanation of the constraint violation. */
+	String getExplanation();
+
+	/** Returns the quick fix handler for this constraint violation. */
+	IQuickFixHandler getQuickFixHandler();
+
+	/** Enumeration of severity classes. */
+	public static enum ESeverity {
+		/** Fatal error severity. */
+		FATAL,
+		/** Normal error severity. */
+		ERROR,
+		/** Warning severity. */
+		WARNING,
+		/** Information severity. */
+		INFO,
+		/** Debug severity. */
+		DEBUG
+	}
+
+	/** Interface for quick fix handlers. */
+	public static interface IQuickFixHandler {
+		/** Applies the quick fix. */
+		void applyQuickFix();
+	}
+}
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ITopLevelElementChangeListener.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ITopLevelElementChangeListener.java
index 82f747e0a..f567e0101 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ITopLevelElementChangeListener.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/interfaces/ITopLevelElementChangeListener.java
@@ -24,7 +24,7 @@ package org.fortiss.tooling.kernel.interfaces;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 0F7CAD896981964CEB0159F2AB9CC40E
+ * @ConQAT.Rating YELLOW Hash: 47E5580127F52AD1A331B4E01D385128
  */
 public interface ITopLevelElementChangeListener {
 
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 ee60e0103..25692baf8 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
@@ -32,9 +32,8 @@ import org.fortiss.tooling.kernel.util.LoggingUtils;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: C5B41AC6A5B1092D032C36ADEEFB3B57
+ * @ConQAT.Rating YELLOW Hash: 24589AA882EB757183F8EB940CF778D0
  */
-// TODO (FH): move to UI
 public class CommandStackService implements ICommandStackService {
 	/** {@inheritDoc} */
 	@Override
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java
index 34bca1d2e..25378ba5b 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/CompositorService.java
@@ -32,7 +32,7 @@ import org.fortiss.tooling.kernel.services.IPrototypeService.Prototype;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: EF4D271497C017EB740CCF869DCEB319
+ * @ConQAT.Rating YELLOW Hash: 1AB8E5D4937CE2C77649035548CA11DF
  */
 public final class CompositorService extends
 		EObjectAwareServiceBase<ICompositor<EObject>> implements
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java
index ce3473831..0281ecf60 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintService.java
@@ -17,6 +17,11 @@ $Id$
 +--------------------------------------------------------------------------*/
 package org.fortiss.tooling.kernel.internal;
 
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.fortiss.tooling.kernel.interfaces.IConstraintChecker;
+import org.fortiss.tooling.kernel.interfaces.IConstraintViolation;
 import org.fortiss.tooling.kernel.services.IConstraintService;
 
 /**
@@ -28,5 +33,20 @@ import org.fortiss.tooling.kernel.services.IConstraintService;
  * @ConQAT.Rating RED Hash: 9E0D8411A1525AA3989DED2C0DC7A033
  */
 public class ConstraintService implements IConstraintService {
-	// TODO (FH): implement
+
+	/** {@inheritDoc} */
+	@Override
+	public List<IConstraintViolation> performAllConstraintChecks(
+			EObject modelElement) {
+		// TODO
+		return null;
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	public List<IConstraintChecker> getAllConstraintCheckers(
+			EObject modelElement) {
+		// TODO
+		return null;
+	}
 }
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 d5006d4ea..16e336a79 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
@@ -25,13 +25,17 @@ import java.util.Map;
 
 import org.conqat.lib.commons.collections.CollectionUtils;
 import org.conqat.lib.commons.collections.UnmodifiableList;
+import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.emf.ecore.EObject;
+import org.fortiss.tooling.kernel.ToolingKernelActivator;
 import org.fortiss.tooling.kernel.interfaces.IStorageProvider;
 import org.fortiss.tooling.kernel.interfaces.ITopLevelElementChangeListener;
 import org.fortiss.tooling.kernel.interfaces.ITopLevelElementContext;
-import org.fortiss.tooling.kernel.internal.storage.eclipse.EclipseResourceStorageProvider;
 import org.fortiss.tooling.kernel.services.IPersistencyService;
+import org.fortiss.tooling.kernel.util.ExtensionPointUtils;
+import org.fortiss.tooling.kernel.util.LoggingUtils;
+import org.osgi.framework.Bundle;
 
 /**
  * This class implements the {@link IPersistencyService} interface.
@@ -39,10 +43,19 @@ import org.fortiss.tooling.kernel.services.IPersistencyService;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating RED Hash: 91A0548CFEB392918C83B0159A4638EC
+ * @ConQAT.Rating YELLOW Hash: 152A73FE81A28D789914ECBD143F1DFF
  */
 public class PersistencyService implements IPersistencyService {
 
+	/** The prototype provider extension point ID. */
+	private static final String EXTENSION_POINT_NAME = "org.fortiss.tooling.kernel.modelPrototypeProvider";
+
+	/** The prototype provider configuration element name. */
+	private static final String CONFIGURATION_ELEMENT_NAME = "modelPrototypeProvider";
+
+	/** Stores the registered storage providers. */
+	private final List<IStorageProvider> storageProviderList = new ArrayList<IStorageProvider>();
+
 	/** Stores the top-level element contexts. */
 	private final List<ITopLevelElementContext> contextCache = new LinkedList<ITopLevelElementContext>();
 
@@ -54,13 +67,7 @@ public class PersistencyService implements IPersistencyService {
 
 	/** Constructor. */
 	public PersistencyService() {
-		// TODO (FH): replace with extension mechanism
-		IStorageProvider provider = new EclipseResourceStorageProvider();
-		for (ITopLevelElementContext context : provider
-				.getTopLevelElementContexts()) {
-			contextCache.add(context);
-			storageProviderCache.put(context, provider);
-		}
+		setupStorageProviders();
 	}
 
 	/** {@inheritDoc} */
@@ -172,4 +179,23 @@ public class PersistencyService implements IPersistencyService {
 		}
 		return null;
 	}
+
+	/** Initializes the storage provider list from plugin extensions. */
+	private void setupStorageProviders() {
+		for (IConfigurationElement ce : ExtensionPointUtils
+				.getConfigurationElements(EXTENSION_POINT_NAME,
+						CONFIGURATION_ELEMENT_NAME)) {
+			Bundle bundle = ExtensionPointUtils.getBundle(ce);
+			try {
+				Class<?> handlerClass = ExtensionPointUtils.loadClass(
+						ce.getAttribute("provider"), bundle);
+				IStorageProvider provider = (IStorageProvider) handlerClass
+						.getConstructor().newInstance();
+				storageProviderList.add(provider);
+			} catch (Exception ex) {
+				LoggingUtils.error(ToolingKernelActivator.getDefault(),
+						ex.getMessage(), ex);
+			}
+		}
+	}
 }
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java
index d4ccf6db6..0e7daf3e7 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/PrototypeService.java
@@ -39,9 +39,8 @@ import org.osgi.framework.Bundle;
  * @author hoelzl
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 31E49A6AD1B4A03E4CFEC3BB584284B5
+ * @ConQAT.Rating YELLOW Hash: 3E2A2A18E224F7675FC2BE992D4DD80C
  */
-// TODO (FH): move to UI
 public class PrototypeService implements IPrototypeService {
 
 	/** The prototype provider extension point ID. */
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/AutoUndoCommandStack.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/AutoUndoCommandStack.java
index ecae33285..95321aeac 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/AutoUndoCommandStack.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/AutoUndoCommandStack.java
@@ -31,10 +31,10 @@ import org.eclipse.emf.transaction.TransactionalEditingDomain;
  * all calls to its command stack. However all commands which are executed are
  * wrapped in an AutoUndoCommand first.
  * 
- * @author hummelb
+ * @author hummel
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 036C23278E8F4B717FDC253E34F9B21A
+ * @ConQAT.Rating YELLOW Hash: AFB8CA71F5FD955F7EFC6113A7A59A0F
  */
 public class AutoUndoCommandStack implements TransactionalCommandStack {
 
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EMFTransactionalCommand.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EMFTransactionalCommand.java
index 0fbb72ac6..f0433f174 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EMFTransactionalCommand.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EMFTransactionalCommand.java
@@ -36,10 +36,10 @@ import org.fortiss.tooling.kernel.util.LoggingUtils;
  * a transaction. As a bonus the undo and redo methods are based on the
  * transaction of the execute call (i.e. are coming for free).
  * 
- * @author hummelb
+ * @author hummel
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: E0EA5F25BB104FFF25B992C00F7E04FD
+ * @ConQAT.Rating YELLOW Hash: 1F16376712579A2350052EF8560C1861
  */
 public class EMFTransactionalCommand implements Command {
 
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java
index 11bbd93d5..ae01f4856 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageProvider.java
@@ -47,7 +47,7 @@ import org.fortiss.tooling.kernel.util.LoggingUtils;
  * @author hoelzlf
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 350FE8BC692DF5B142EE95493B393B3B
+ * @ConQAT.Rating YELLOW Hash: E8F12BF14037AEDE9A02AE20B99271A6
  */
 public class EclipseResourceStorageProvider implements IResourceChangeListener,
 		IResourceDeltaVisitor, IStorageProvider {
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java
index fecedefb8..87260939a 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/ModelContext.java
@@ -54,10 +54,10 @@ import org.fortiss.tooling.kernel.util.LoggingUtils;
  * The model context provides additional commands and hooks for a model.
  * Additionally an editing domain is provided.
  * 
- * @author hummelb
+ * @author hummel
  * @author $Author$
  * @version $Rev$
- * @ConQAT.Rating YELLOW Hash: 0E450BA9320FFE2D8F9BCED63B3AAE90
+ * @ConQAT.Rating YELLOW Hash: 8EED08FDCAC443A797F6BE7F17F747B1
  */
 class ModelContext implements ITopLevelElementContext {
 
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConstraintService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConstraintService.java
index 213d9e2d7..42bf4cc24 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConstraintService.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/services/IConstraintService.java
@@ -17,6 +17,11 @@ $Id$
 +--------------------------------------------------------------------------*/
 package org.fortiss.tooling.kernel.services;
 
+import java.util.List;
+
+import org.eclipse.emf.ecore.EObject;
+import org.fortiss.tooling.kernel.interfaces.IConstraintChecker;
+import org.fortiss.tooling.kernel.interfaces.IConstraintViolation;
 import org.fortiss.tooling.kernel.internal.ConstraintService;
 
 /**
@@ -33,5 +38,15 @@ public interface IConstraintService {
 	/** Returns the singleton instance of the service. */
 	public static final IConstraintService INSTANCE = new ConstraintService();
 
-	// TODO (FH): define
+	/**
+	 * Performs all constraint checks on the given model element and returns the
+	 * check results.
+	 */
+	List<IConstraintViolation> performAllConstraintChecks(EObject modelElement);
+
+	/**
+	 * Returns the list of registered constraint checkers for the given model
+	 * element.
+	 */
+	List<IConstraintChecker> getAllConstraintCheckers(EObject modelElement);
 }
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/ExtensionPointUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/ExtensionPointUtils.java
index 8f3c2c633..743dcf8a7 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/ExtensionPointUtils.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/ExtensionPointUtils.java
@@ -36,10 +36,10 @@ import org.osgi.framework.Bundle;
  * implementation. It re-packaged with the kernel to avoid any dependency to
  * eclipse.ui packages. See http://www.conqat.org for the original version.
  * 
- * @author hummelb
+ * @author hummel
  * @author $Author$
  * @version $Rev$
- * @levd.rating GREEN Hash: 3A6C32DF7541A73EFF1BBA7204FFB23D
+ * @ConQAT.Rating YELLOW Hash: 05174A663568D6A53F98A21704CDBCA5
  */
 public class ExtensionPointUtils {
 
diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/LoggingUtils.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/LoggingUtils.java
index 72c3b23b5..74fd46168 100644
--- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/LoggingUtils.java
+++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/util/LoggingUtils.java
@@ -28,11 +28,11 @@ import org.eclipse.core.runtime.Status;
  * implementation. It re-packaged with the kernel to avoid any dependency to
  * eclipse.ui packages. See http://www.conqat.org for the original version.
  * 
- * @author hummelb
+ * @author hummel
  * @author schwitze
  * @author $Author$
  * @version $Rev$
- * @levd.rating GREEN Hash: AA5D7661DFC5CC4BF4D59C1A84E5D471
+ * @ConQAT.Rating YELLOW Hash: 27FE1FF60B7FF5F94B1619BE297E4036
  */
 public class LoggingUtils {
 
-- 
GitLab