diff --git a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java index 6483782098914fe9460d8c0b511c01d4373a5f19..0ffe1d2159164b44c0109a5c965624dd8fdd5548 100644 --- a/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java +++ b/org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/annotation/AnnotationValueService.java @@ -32,7 +32,7 @@ import org.fortiss.tooling.base.annotation.valueprovider.IAnnotationValueProvide import org.fortiss.tooling.base.model.element.IAnnotatedSpecification; import org.fortiss.tooling.base.model.element.IModelElement; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; import org.fortiss.tooling.kernel.utils.EcoreUtils; @@ -71,7 +71,7 @@ public class AnnotationValueService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java index 1b7a3bcb96e3befed79d000f73bcf017c67d702b..956e2ae700577fd8b03c5716518a0f8b95b47ac0 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/AllocationEditPartFactoryService.java @@ -26,7 +26,7 @@ import org.eclipse.gef.EditPart; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; import org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator; import org.fortiss.tooling.kernel.ui.extension.IAllocationEditPartFactory; @@ -59,7 +59,7 @@ public class AllocationEditPartFactoryService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** Registers the given editpart factory with the service. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java index 54ed421d78070a6df4fd7ec0263c813bbe458c7e..875ea74fc148af4e3aa6834ab7693595aea3a436 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ConstraintVerificationUIService.java @@ -14,13 +14,13 @@ import org.eclipse.emf.ecore.util.EContentAdapter; import org.fortiss.tooling.kernel.ToolingKernelActivator; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.model.constraints.ConstrainedWithChecksum; import org.fortiss.tooling.kernel.model.constraints.ConstraintsPackage; import org.fortiss.tooling.kernel.model.constraints.IConstrained; import org.fortiss.tooling.kernel.model.constraints.IConstraint; import org.fortiss.tooling.kernel.model.constraints.IConstraintVerificationStatus; import org.fortiss.tooling.kernel.service.IConstraintVerificationService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; import org.fortiss.tooling.kernel.ui.extension.IConstraintVerifierUI; @@ -46,7 +46,7 @@ public final class ConstraintVerificationUIService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** Registers the verifier UI part with the service. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java index 4314dd9bfe1f18ded33f44f8344adeb0b4027370..8398751a2c5267e8e8fe83f055ad3f14661de57f 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ContextMenuService.java @@ -35,7 +35,7 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ITutorialService; import org.fortiss.tooling.kernel.ui.extension.IContextMenuContributor; import org.fortiss.tooling.kernel.ui.extension.IContextMenuMultiSelectionContributor; @@ -80,7 +80,7 @@ public class ContextMenuService implements IContextMenuService, IIntrospectiveKe /** Starts the service. */ public void startService() { setupProviders(); - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** Registers the given contributor with the service. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java index 7ef31d4ffd10d75922aec8c41df9e9a8606e490b..52be5aed1d027820453fd4eea864eaa36e68d4ea 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/EditPartFactoryService.java @@ -26,7 +26,7 @@ import org.eclipse.gef.EditPart; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; import org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator; import org.fortiss.tooling.kernel.ui.extension.IEditPartFactory; @@ -58,7 +58,7 @@ public class EditPartFactoryService extends EObjectAwareServiceBase<IEditPartFac /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** Registers the given editpart factory with the service. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java index 82afe69135a54dd03c669b39ef5a82c155a5ff53..d0215ba3c89869a59e39c1f87286e4b28391aa11 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelEditorBindingService.java @@ -41,10 +41,10 @@ import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.model.ILibraryElement; import org.fortiss.tooling.kernel.model.ILibraryElementReference; import org.fortiss.tooling.kernel.service.ICommandStackService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ILibraryService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; @@ -92,7 +92,7 @@ public class ModelEditorBindingService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** Registers the given editor binding with the service. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java index 65f3957acb730190c0e7aeffa4582fa187c5e710..633ab34dcc906b6c065ce369d01abedce7f5273d 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/ModelElementHandlerService.java @@ -28,7 +28,7 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler; import org.fortiss.tooling.kernel.ui.internal.introspection.items.ModelElementHandlerServiceIntrospectionDetailsItem; @@ -62,7 +62,7 @@ public class ModelElementHandlerService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** Registers the given handler with the service. */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java index 4a2d07b3d8fb3e78657c45d2af0d163c5557a9e6..c9882879ca0f78de34d88a07681ee762d1cf4bab 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/TutorialUIService.java @@ -33,7 +33,7 @@ import org.fortiss.tooling.kernel.extension.data.TutorialStepBase; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ITutorialService; import org.fortiss.tooling.kernel.ui.ToolingKernelUIActivator; import org.fortiss.tooling.kernel.ui.extension.ITutorialStepUI; @@ -68,7 +68,7 @@ public final class TutorialUIService implements ITutorialUIService, ITutorialUIW /** Starts the service. */ public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService.getInstance().registerService(this); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java index 63b6f0687b5096c01aa98791a216b51510beeb4b..f76142e52399ab4473f6b925d5ae0f8ec3b53235 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/internal/introspection/KISSViewerContentProvider.java @@ -24,6 +24,7 @@ import org.eclipse.jface.viewers.Viewer; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; /** * Content provider for the {@link KISSViewPart}. @@ -57,11 +58,11 @@ public class KISSViewerContentProvider implements ITreeContentProvider { /** {@inheritDoc} */ @Override public Object getParent(Object element) { - if(element == KernelIntrospectionSystemService.getInstance()) { + if(element == IKernelIntrospectionSystemService.getInstance()) { return KernelIntrospectionSystemService.class; } if(element instanceof IIntrospectiveKernelService) { - return KernelIntrospectionSystemService.getInstance(); + return IKernelIntrospectionSystemService.getInstance(); } return null; } @@ -70,7 +71,7 @@ public class KISSViewerContentProvider implements ITreeContentProvider { @Override public Object[] getElements(Object inputElement) { if(inputElement == KernelIntrospectionSystemService.class) { - return new Object[] {KernelIntrospectionSystemService.getInstance()}; + return new Object[] {IKernelIntrospectionSystemService.getInstance()}; } return getChildren(inputElement); } diff --git a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF index 11080af33951656589917464eaf21b5516676674..63186ae49992c8571ae8bf93954a2417d7844f21 100644 --- a/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF +++ b/org.fortiss.tooling.kernel/trunk/META-INF/MANIFEST.MF @@ -37,4 +37,5 @@ Service-Component: OSGI-INF/CommandStackService.xml, OSGI-INF/EclipseResourceSto OSGI-INF/ElementCompositorService.xml, OSGI-INF/LibraryService.xml, OSGI-INF/ConstraintVerificationService.xml, OSGI-INF/LoggingService.xml, OSGI-INF/TransformationService.xml, OSGI-INF/PersistencyService.xml, - OSGI-INF/PrototypeService.xml, OSGI-INF/TutorialService.xml, OSGI-INF/MigrationService.xml + OSGI-INF/PrototypeService.xml, OSGI-INF/TutorialService.xml, OSGI-INF/MigrationService.xml, + OSGI-INF/KernelIntrospectionSystemService.xml diff --git a/org.fortiss.tooling.kernel/trunk/OSGI-INF/EclipseResourceStorageService.xml b/org.fortiss.tooling.kernel/trunk/OSGI-INF/EclipseResourceStorageService.xml index 4998760d8019a06fca9a14fa60a98e9388ef2ac1..70d0be5591aedcfbb5948e8f4cac199835d699c7 100644 --- a/org.fortiss.tooling.kernel/trunk/OSGI-INF/EclipseResourceStorageService.xml +++ b/org.fortiss.tooling.kernel/trunk/OSGI-INF/EclipseResourceStorageService.xml @@ -2,9 +2,9 @@ <!-- $Id: pom.xml 16107 2016-03-07 11:50:15Z hoelzl $ @version $Rev: 16107 $ - @ConQAT.Rating YELLOW Hash: EABB1847CA7CB06C0DD31FFC845400D6 + @ConQAT.Rating YELLOW Hash: 981E1C9C8932BA3E3FDC1D3F70BF3FD8 --> -<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" name="org.fortiss.tooling.kernel.service.EclipseResourceStorageService"> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.fortiss.tooling.kernel.service.EclipseResourceStorageService"> <implementation class="org.fortiss.tooling.kernel.internal.storage.eclipse.EclipseResourceStorageService"/> <service> <provide interface="org.fortiss.tooling.kernel.service.IEclipseResourceStorageService"/> diff --git a/org.fortiss.tooling.kernel/trunk/OSGI-INF/KernelIntrospectionSystemService.xml b/org.fortiss.tooling.kernel/trunk/OSGI-INF/KernelIntrospectionSystemService.xml new file mode 100644 index 0000000000000000000000000000000000000000..8d5edb2cdc63d6656cf601821d70987bb15c9be0 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/OSGI-INF/KernelIntrospectionSystemService.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id: pom.xml 16107 2016-03-07 11:50:15Z hoelzl $ + @version $Rev: 16107 $ + @ConQAT.Rating YELLOW Hash: 497B4D5148CA96A0F117437D6426327B +--> +<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.fortiss.tooling.kernel.service.KernelIntrospectionSystemService"> + <implementation class="org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService"/> + <service> + <provide interface="org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService"/> + </service> +</scr:component> diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java index 763c0c2453092ff9815676a602e3fb1f273f7c9e..b7b48d83af9eeadc19b216714b209be155ec3ec5 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/constraint/IdConsistencyChecker.java @@ -17,6 +17,8 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.constraint; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import static org.fortiss.tooling.kernel.constraint.ConstraintMessage.createConsistencyIdViolation; import static org.fortiss.tooling.kernel.utils.EcoreUtils.getChildrenWithType; @@ -49,7 +51,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; * @author barner * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 667D66B65C288165751C6307F3CEF57A + * @ConQAT.Rating YELLOW Hash: D981336B22328780F0871CBF5629871E */ public class IdConsistencyChecker extends ConstraintCheckerBase<EObject> { @@ -59,8 +61,10 @@ public class IdConsistencyChecker extends ConstraintCheckerBase<EObject> { ArrayList<IdConsistencyConstraintViolation<IIdLabeled>> result = new ArrayList<IdConsistencyConstraintViolation<IIdLabeled>>(); - ITopLevelElement topLevelElement = - IPersistencyService.getInstance().getTopLevelElementFor(rootObject); + IPersistencyService ps = getService(IPersistencyService.class); + ITopLevelElement topLevelElement = ps.getTopLevelElementFor(rootObject); + ungetService(IPersistencyService.class); + if(topLevelElement != null) { for(IIdLabeled current : getChildrenWithType(rootObject, IIdLabeled.class)) { String persistedId = topLevelElement.getId(current); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IConstraintVerifier.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IConstraintVerifier.java index 55bd38c210735f5de45ba5b7bd9e61dcaed8cf11..ef24b7fd5174ca3634dffb7ffd4ac3c1325aedd2 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IConstraintVerifier.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IConstraintVerifier.java @@ -22,34 +22,34 @@ import java.util.List; import org.eclipse.emf.ecore.EObject; import org.fortiss.tooling.kernel.model.constraints.IConstraint; import org.fortiss.tooling.kernel.model.constraints.IConstraintVerificationStatus; +import org.fortiss.tooling.kernel.service.IConstraintVerificationService; import org.fortiss.tooling.kernel.service.IConstraintVerificationService.IFix; import org.fortiss.tooling.kernel.service.base.IEObjectAware; /** - * Interface for constraint verifiers. + * Interface for constraint verifiers used by {@link IConstraintVerificationService}. * * @author aravantinos * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: D40AD45314A7AE62E3D828BD48630CD7 + * @ConQAT.Rating YELLOW Hash: 6CB960DB7263BB104C485D049A370ADE */ public interface IConstraintVerifier<T extends IConstraint> extends IEObjectAware<T> { - /** Verify the given constraint. */ - public void verify(T constraint); + void verify(T constraint); /** * @param obj * Alters <code>obj</code> so that the contained items which should not be considered * when computing the checksum have been removed. */ - public void removeConstraintIrrelevantContent(EObject obj); + void removeConstraintIrrelevantContent(EObject obj); /** * Returns a list of possible automatic fixes for the (constraint of the) given status. * A status should be candidate to fixing if it is anything but successful or outdated. */ - public List<IFix> fixes(IConstraintVerificationStatus status); + List<IFix> fixes(IConstraintVerificationStatus status); /** * The following features deal with the usage of constraints to drive the process. @@ -58,8 +58,8 @@ public interface IConstraintVerifier<T extends IConstraint> extends IEObjectAwar */ /** Gets a general description for the constraint type. */ - public String getDescription(); + String getDescription(); /** True if this constraint shall be displayed as a development process constraint. */ - public boolean isUsableForDevelopmentProcess(); + boolean isUsableForDevelopmentProcess(); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IEclipseResourceStorageLocationProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IEclipseResourceStorageLocationProvider.java index 904bd94ca2d059693723dbbba373a405008ab19b..8c88e89676dc56b23d77ad06846ce4da25519e39 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IEclipseResourceStorageLocationProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/IEclipseResourceStorageLocationProvider.java @@ -35,10 +35,9 @@ import org.fortiss.tooling.kernel.service.IEclipseResourceStorageService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 71927EF9BC0DABEA01729368E9D823B9 + * @ConQAT.Rating YELLOW Hash: A4117AF322348E55D713E6A84B585DAB */ public interface IEclipseResourceStorageLocationProvider { - /** * Returns whether the given {@link IFile} should be considered as a model * file (only files with an extension are given to this location provider). diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialProvider.java index 1e577f7cf673983e0062943479d635ca5c64e595..5dc3f18d5a89fcfb19bb04ea0a5d843101810aec 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialProvider.java @@ -19,19 +19,20 @@ package org.fortiss.tooling.kernel.extension; import org.eclipse.emf.ecore.EObject; import org.fortiss.tooling.kernel.extension.data.TutorialCompositeStep; +import org.fortiss.tooling.kernel.service.ITutorialService; /** - * A tutorial provider provides all data about a single tutorial to the kernel infrastructure. + * A tutorial provider provides all data about a single tutorial to the {@link ITutorialService}. * * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: A12895076898865DA4ECB2D51F736E9D */ public interface ITutorialProvider { /** Returns the definition element of this tutorial. */ - public TutorialCompositeStep getDefinition(); + TutorialCompositeStep getDefinition(); /** Returns the root element of this tutorial. */ - public EObject getRootElement(); + EObject getRootElement(); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStep.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStep.java index cf01abddb015d193d6fbda69c6ad15e5da9f70ff..cb505838d917053e5f2ab5ca3fb8ce41c7030294 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStep.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStep.java @@ -25,15 +25,15 @@ import org.fortiss.tooling.kernel.extension.data.TutorialCompositeStep; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 5F9EFBDF510CF80215D1C1610925CACB */ public interface ITutorialStep { /** Returns the title of this tutorial step. */ - public String getTitle(); + String getTitle(); /** Returns description. */ - public String getUrl(); + String getUrl(); /** Returns the parent. */ - public TutorialCompositeStep getParent(); + TutorialCompositeStep getParent(); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStepCompletionChecker.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStepCompletionChecker.java index 736a3177d1604d6e46b4f87db6234f2f5fca5b6f..779f20b009dff9de26b5fb50e0ec44154658e2b5 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStepCompletionChecker.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialStepCompletionChecker.java @@ -20,15 +20,14 @@ package org.fortiss.tooling.kernel.extension; import org.eclipse.emf.ecore.EObject; /** - * Instances of this class provide completion checkers for - * tutorial steps. + * Instances of this class provide completion checkers for tutorial steps. * * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: EAEDEA29BB0A00351A3047D54A1FFA0F */ public interface ITutorialStepCompletionChecker { /** Returns whether the completion condition is fulfilled for the given tutorial model. */ - public boolean isTutorialStepComplete(EObject model); + boolean isTutorialStepComplete(EObject model); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialWhitelistProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialWhitelistProvider.java index 05211bb349d81effce29a070a1338943d8dc098f..125cbdc09227e2e738d9871e924bf31b372493f7 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialWhitelistProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/ITutorialWhitelistProvider.java @@ -26,14 +26,13 @@ import org.fortiss.tooling.kernel.extension.data.Prototype; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 04AFC7CF6BA661282BEE153C4617D4B7 */ public interface ITutorialWhitelistProvider { - /** * Returns whether the given prototype is active in this tutorial. Note that active * prototypes may still be filtered by other methods of whitelist providers, in particular those * related to the UI services. */ - public boolean prototypeActive(Prototype prototype); + boolean prototypeActive(Prototype prototype); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/LogMessageHandler.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/LogMessageHandler.java index e8fd88d52bd998f3e592b6c2adb294a10dccc0a1..cd94e92eeb7f2727e4023e669d56d8c2863ebe6b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/LogMessageHandler.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/LogMessageHandler.java @@ -19,16 +19,18 @@ package org.fortiss.tooling.kernel.extension; import org.fortiss.tooling.kernel.extension.data.ILogMessageContext; import org.fortiss.tooling.kernel.extension.data.LogMessage; +import org.fortiss.tooling.kernel.internal.LoggingService; import org.fortiss.tooling.kernel.service.base.IObjectAware; /** - * The UIMessageService provides registration and access to MessageHandlers that are used to display - * messages emitted from model plugins to the user. A MessageHandler knows how to present the given - * Message to the user, e.g., the layout or dialog style. + * The {@link LoggingService} provides registration and access to MessageHandlers that are used to + * display * messages emitted from non-UI, i.e. model, plugins to the user. + * A {@link LogMessageHandler} knows how to present the given message to the user, e.g., the layout + * or dialog style. * * @author diewald * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 6CF449AC3BD02DA1CDF5DF3DCE59652B + * @ConQAT.Rating YELLOW Hash: 9909627404FCD6B6F29D0DCA4999E7B3 */ public interface LogMessageHandler<LM extends LogMessage> extends IObjectAware<LM> { /** Processes the {@link LogMessage} by the handler. */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java index 9662d79356accb78bf8053920fa6fa2add905b61..7b97207bcc7908244ae77af0d7f5fc5889d51a1f 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialBlacklistAllProvider.java @@ -26,7 +26,7 @@ import org.fortiss.tooling.kernel.extension.data.Prototype; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 8BFE9361BB1624D66EFB6AB3B1001ADB */ public class TutorialBlacklistAllProvider implements ITutorialWhitelistProvider { /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java index 62f6405a1ac6e6e2571f890ab73a86d4a0018067..4e4ae1294a5a82f01d810f5dcbb4c218c144c58d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/base/TutorialWhitelistAllProvider.java @@ -26,7 +26,7 @@ import org.fortiss.tooling.kernel.extension.data.Prototype; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: C5C59D1F876EB33BCEBF68BE41F58DA3 */ public class TutorialWhitelistAllProvider implements ITutorialWhitelistProvider { /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessage.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessage.java index c48dc694afe54074fe38ce02ff070f70aae600ed..c2a65bb5813c9881c6fafbe578bf7e17142ec331 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessage.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessage.java @@ -26,10 +26,9 @@ import org.fortiss.tooling.kernel.service.ILoggingService; * * @author diewald * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: FD6B9EE2F8A2182475DC31ECEFA5839F + * @ConQAT.Rating YELLOW Hash: 2458C952A5383F445F9B533E4866A1C9 */ public class LogMessage { - /** The message String transported my this {@link LogMessage}. */ protected final String messageString; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java index af5e3a620e5bbd72c5ab9161677e5bbd7dddead2..b974acfa4c95a849eed313f37dd3ad1b6fffdbd6 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/LogMessageWithException.java @@ -24,10 +24,9 @@ package org.fortiss.tooling.kernel.extension.data; * @author diewald * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 70592FC3E8F2B3D1519D992C107898ED + * @ConQAT.Rating YELLOW Hash: 0F5BD4EEFA0ECB7A0950426A4137042E */ public class LogMessageWithException extends LogMessage { - /** The transported Exception. */ protected final Exception exception; diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialAtomicStep.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialAtomicStep.java index 5bcf65aecbfc497c4d2122070c802e9d4095c690..e7defbb68d92f667779ef57e687f69c5324bd3b7 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialAtomicStep.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialAtomicStep.java @@ -20,15 +20,14 @@ package org.fortiss.tooling.kernel.extension.data; import org.fortiss.tooling.kernel.extension.ITutorialStepCompletionChecker; /** - * Data class for steps of tutorials. + * Data class for atomic steps of tutorials. * * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 96FEE362D965A940505750F3E6EC2485 */ public abstract class TutorialAtomicStep extends TutorialStepBase { - /** Constructor. */ public TutorialAtomicStep(String title, String description) { super(title, description); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialCompositeStep.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialCompositeStep.java index 68364b1a737f984676d07225d7299d4ff2bb483e..7e13e04aa05fc75d4699bd707573c438b4ea486e 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialCompositeStep.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialCompositeStep.java @@ -28,10 +28,9 @@ import java.util.List; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: F4D6F2B7F400B8EB9F4E5D5C0646F9E8 */ public class TutorialCompositeStep extends TutorialStepBase { - /** The list of contained steps. */ private final List<TutorialStepBase> steps = new LinkedList<TutorialStepBase>(); diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialStepBase.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialStepBase.java index bd17ffcf777f307c14c8f23badbbd38a9822f51a..196bfdce68bb0070bbe8ca98901133312bd5d4bf 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialStepBase.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/extension/data/TutorialStepBase.java @@ -20,12 +20,12 @@ package org.fortiss.tooling.kernel.extension.data; import org.fortiss.tooling.kernel.extension.ITutorialStep; /** - * Data class for steps of tutorials. + * Base class for steps of tutorials. * * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 819C147A0D803B54AE8DA31D9DC96D39 */ public abstract class TutorialStepBase implements ITutorialStep { /** The title of the tutorial. */ 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 07a86759044e49ee85e23d35ea9679e24d56679f..f089daf4d5913ebc209277883a9778f624595f9a 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 @@ -36,10 +36,9 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 82CCE7AD2F21B0F48DBC904FF10F1C60 + * @ConQAT.Rating YELLOW Hash: BD53C0B98DFD5D9DB32F7C0AE44E11A1 */ public class CommandStackService implements ICommandStackService { - /** {@inheritDoc} */ @Override public void addCommandStackListener(ITopLevelElement target, CommandStackListener listener) { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java index bc445876e6e5d18d5314a6bb699eae7ac197a6b0..3ec8d86d0e46b100afb4a110b30daac94437b732 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConnectionCompositorService.java @@ -18,6 +18,8 @@ $Id$ package org.fortiss.tooling.kernel.internal; import static java.util.Collections.emptyList; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import java.util.List; import java.util.Map; @@ -28,9 +30,9 @@ import org.fortiss.tooling.kernel.extension.data.IConnectionCompositionContext; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.ConnectionCompositorServiceIntrospectionDetailsItem; import org.fortiss.tooling.kernel.service.IConnectionCompositorService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.base.EObjectAware2ServiceBase; /** @@ -39,7 +41,7 @@ import org.fortiss.tooling.kernel.service.base.EObjectAware2ServiceBase; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 029E14FBF306EAD359C243A3F5E48DAD + * @ConQAT.Rating YELLOW Hash: 28946F5FCEECA8185B5F9D79DB533EAA */ public class ConnectionCompositorService extends EObjectAware2ServiceBase<IConnectionCompositor<EObject, EObject, EObject>> implements @@ -58,7 +60,10 @@ public class ConnectionCompositorService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java index cd98efae7907ed348fedb65bdbed949df9394718..56ab26389658b9d729f5f70d1774acd0bf18b439 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintCheckerService.java @@ -19,6 +19,8 @@ package org.fortiss.tooling.kernel.internal; import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableMap; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import java.util.ArrayList; import java.util.Collections; @@ -32,9 +34,9 @@ import org.fortiss.tooling.kernel.extension.data.IConstraintViolation; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.ConstraintCheckerServiceIntrospectionDetailsItem; import org.fortiss.tooling.kernel.service.IConstraintCheckerService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; /** @@ -43,7 +45,7 @@ import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: A7F7BA0AA690B48C2DA146587AA7F90B + * @ConQAT.Rating YELLOW Hash: 9C7103696FC522AEB2C9722F65B016C3 */ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstraintChecker<EObject>> implements IConstraintCheckerService, IIntrospectiveKernelService { @@ -61,7 +63,10 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java index b59eb8bf9027e30f85aafd38ae78ac601fb37fe9..a7166b3b949c122adb6f6d6580148700d700ce90 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ConstraintVerificationService.java @@ -26,7 +26,6 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator; import org.fortiss.tooling.kernel.extension.IConstraintVerifier; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.ConstraintVerificationServiceIntrospectionDetailsItem; import org.fortiss.tooling.kernel.model.INamedElement; import org.fortiss.tooling.kernel.model.constraints.ConstrainedWithChecksum; @@ -35,6 +34,7 @@ import org.fortiss.tooling.kernel.model.constraints.IConstrained; import org.fortiss.tooling.kernel.model.constraints.IConstraint; import org.fortiss.tooling.kernel.model.constraints.IConstraintVerificationStatus; import org.fortiss.tooling.kernel.service.IConstraintVerificationService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; import org.fortiss.tooling.kernel.utils.EcoreUtils; @@ -46,7 +46,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils; * @author aravantinos * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 159EDD10E24A64448987075B5F8B7B14 + * @ConQAT.Rating YELLOW Hash: DEF709B2A60B704890F683016225F042 */ public final class ConstraintVerificationService extends EObjectAwareServiceBase<IConstraintVerifier<IConstraint>> implements @@ -55,7 +55,10 @@ public final class ConstraintVerificationService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/DummyTopLevelElement.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/DummyTopLevelElement.java index 5c0b753240765ef141d34c417ef48613d07fb843..7ff1fc96b57a7eff183b016b6e983671deed36b4 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/DummyTopLevelElement.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/DummyTopLevelElement.java @@ -47,7 +47,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 64D330706835D3C03BC7487F87364627 + * @ConQAT.Rating YELLOW Hash: E7AE508D21E7F9EB4BB0ACFD9C6C01E6 */ final class DummyTopLevelElement implements ITopLevelElement, CommandStackListener { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java index 862109b8741a39462c026f9261e2881e6e251866..b1d9f6052a6a0d8d3e05b53d91048ecc580e1084 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ElementCompositorService.java @@ -31,10 +31,10 @@ import org.fortiss.tooling.kernel.extension.data.Prototype; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.ElementCompositorServiceIntrospectionDetailsItem; import org.fortiss.tooling.kernel.model.ILibraryElementReference; import org.fortiss.tooling.kernel.service.IElementCompositorService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase; import org.fortiss.tooling.kernel.utils.LoggingUtils; @@ -45,7 +45,7 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: A3C3DACAD6D38C54CBD29735646CB874 + * @ConQAT.Rating YELLOW Hash: D79B3FBBD3CE040D480E21E5137AB692 */ public final class ElementCompositorService extends EObjectAwareServiceBase<IElementCompositor<EObject>> implements IElementCompositorService, @@ -64,7 +64,10 @@ public final class ElementCompositorService extends /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java index 037a5260537a6ad666b9c1ee53a31a0a391282ee..12e1bb8a239bf43a7029239ac6628db301556559 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryPrototypeProvider.java @@ -17,6 +17,9 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; + import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,7 +39,7 @@ import org.fortiss.tooling.kernel.service.ILibraryService; * @author ratiu * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating GREEN Hash: 95B48E4539DB312738E530B05CE9483A + * @ConQAT.Rating YELLOW Hash: EB97A0E6362558D9D24A96B506096ECB */ public class LibraryPrototypeProvider extends PrototypeProviderBase { @@ -53,31 +56,31 @@ public class LibraryPrototypeProvider extends PrototypeProviderBase { /** {@inheritDoc} */ @Override protected void registerPrototypes() { + ILibraryService libs = getService(ILibraryService.class); PrototypeCategory libraryCategory = registerPrototypeCategory("Library"); Map<String, PrototypeCategory> registeredCategoriesMap = new HashMap<String, PrototypeCategory>(); - for(ILibraryElement libElem : ILibraryService.getInstance() - .getLibraryElementsFromAllWorkspaceLibraries()) { + for(ILibraryElement libElem : libs.getLibraryElementsFromAllWorkspaceLibraries()) { List<ILibraryElementHandler<EObject>> handlers = - ((LibraryService)ILibraryService.getInstance()).getRegisteredHandlers(libElem - .getWrappedElement().getClass()); - - ILibraryElementHandler<EObject> firstHandler = handlers.get(0); - - Prototype prot = firstHandler.createLibraryElementReferencePrototype(libElem); + ((LibraryService)libs).getRegisteredHandlers(libElem.getWrappedElement() + .getClass()); + // LibraryService#getRegisteredHandlers() returns at most first handler + if(!handlers.isEmpty()) { + ILibraryElementHandler<EObject> firstHandler = handlers.get(0); - prototypes.add(prot); + Prototype prot = firstHandler.createLibraryElementReferencePrototype(libElem); + prototypes.add(prot); - String categoryName = ((ILibraryPackage)libElem.eContainer()).getName(); - PrototypeCategory current = registeredCategoriesMap.get(categoryName); - - if(current == null) { - current = registerPrototypeCategory(libraryCategory, categoryName); - registeredCategoriesMap.put(categoryName, current); + String categoryName = ((ILibraryPackage)libElem.eContainer()).getName(); + PrototypeCategory current = registeredCategoriesMap.get(categoryName); + if(current == null) { + current = registerPrototypeCategory(libraryCategory, categoryName); + registeredCategoriesMap.put(categoryName, current); + } + current.add(prot); } - - current.add(prot); } + ungetService(ILibraryService.class); } } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java index ccaf988a57c7a8b86998b67377f79ac424ff6311..1a59a8b46b57fd5d9d193f6a201d42b330c722ed 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LibraryService.java @@ -42,12 +42,12 @@ import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.LibraryServiceIntrospectionDetailsItem; import org.fortiss.tooling.kernel.model.ILibrary; import org.fortiss.tooling.kernel.model.ILibraryElement; import org.fortiss.tooling.kernel.model.ILibraryElementReference; import org.fortiss.tooling.kernel.model.ILibraryPackage; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ILibraryService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.IPrototypeService; @@ -60,7 +60,7 @@ import org.fortiss.tooling.kernel.utils.UniqueIDUtils; * @author ratiu * @author $Author: ratiu $ * @version $Rev: 5274 $ - * @ConQAT.Rating YELLOW Hash: 151012A7790BCF5CA2B0A248793F2B74 + * @ConQAT.Rating YELLOW Hash: EDFE5ADB7C1335DDDB227B6E809AA1C5 */ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandler<EObject>> implements ILibraryService, IIntrospectiveKernelService { @@ -78,7 +78,10 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java index c3555674469b66069cdff0e630a10734091f1667..10e6635d1237f0295137898051d924ccd3694416 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/LoggingService.java @@ -17,12 +17,15 @@ $Id$ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.internal; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; + import java.util.List; import org.fortiss.tooling.kernel.extension.LogMessageHandler; import org.fortiss.tooling.kernel.extension.data.ILogMessageContext; import org.fortiss.tooling.kernel.extension.data.LogMessage; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ILoggingService; import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase; @@ -32,7 +35,7 @@ import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase; * @author diewald * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 9ECDE82C4BB6B22507A6AF8DA22C6A70 + * @ConQAT.Rating YELLOW Hash: 94EC4049462803F2EF9F9D1F5A5F1AB4 */ public class LoggingService extends ObjectAwareServiceBase<LogMessageHandler<LogMessage>> implements ILoggingService { @@ -56,10 +59,14 @@ public class LoggingService extends ObjectAwareServiceBase<LogMessageHandler<Log /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** Registers a handler for the given class of {@link LogMessage}s. */ + @Override @SuppressWarnings("unchecked") public <LM extends LogMessage> void registerLogMessageHandler(LogMessageHandler<LM> handler, Class<LM> logMessageClass) { @@ -69,8 +76,7 @@ public class LoggingService extends ObjectAwareServiceBase<LogMessageHandler<Log /** {@inheritDoc} */ @Override public String getIntrospectionDescription() { - // TODO (FH): implement - return ""; + return "This service allows the registration of logging message handlers."; } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java index 93717294fb97fb5c4f17357c9d74dd5ef06ded91..97926faa6882465ae3b6e06a21bf9e6ea500930d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/MigrationService.java @@ -18,6 +18,8 @@ $Id$ package org.fortiss.tooling.kernel.internal; import static java.util.Collections.emptyList; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import static org.fortiss.tooling.kernel.utils.LoggingUtils.error; import static org.fortiss.tooling.kernel.utils.MigrationUtils.featuresToStrings; @@ -33,8 +35,8 @@ import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.MigrationServiceIntrospectionDetailsItem; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IMigrationService; import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase; @@ -44,7 +46,7 @@ import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase; * @author mou * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 1254A36DBBFC6BE9E7C3DA9D964DA58E + * @ConQAT.Rating YELLOW Hash: A0E14967E2F44BD1E0C751808F6974BD */ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> implements IMigrationService, IIntrospectiveKernelService { @@ -62,7 +64,10 @@ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** Registers the migration provider with the service. */ 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 fcb7234ef00a9c53bf39a19d421dd6af5250974c..299ab9b067442a27380b3280cd17458a69a3cb45 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 @@ -20,6 +20,8 @@ package org.fortiss.tooling.kernel.internal; import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; import static org.conqat.lib.commons.collections.CollectionUtils.asUnmodifiable; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.getBundle; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.getConfigurationElements; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.loadClass; @@ -51,8 +53,8 @@ import org.fortiss.tooling.kernel.internal.storage.eclipse.EclipseResourceStorag import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.PersistencyServiceIntrospectionDetailsItem; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ILibraryService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.ITutorialService; @@ -66,7 +68,7 @@ import org.osgi.framework.Bundle; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 23E60A2C8958B99893C8108307551BBE + * @ConQAT.Rating YELLOW Hash: 8DA0BCD60BF820FAB0CD668B00AE24FD */ public class PersistencyService implements IPersistencyService, IIntrospectiveKernelService { @@ -111,8 +113,13 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe /** Starts the service. */ public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); + tutorialService = ToolingKernelActivator.getService(ITutorialService.class); + // never call unget, since persistency service never dies } /** Registers the given storage provider with the service. */ @@ -175,12 +182,12 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe /** {@inheritDoc} */ @Override public synchronized void doSave(IProgressMonitor monitor) { + ILibraryService libs = getService(ILibraryService.class); for(ITopLevelElement context : elementCache) { if(context.isDirty()) { try { EObject rootElement = context.getRootModelElement(); - ILibraryService.getInstance().ensureChildrenLibraryReferenceAreUpToDate( - rootElement); + libs.ensureChildrenLibraryReferenceAreUpToDate(rootElement); context.doSave(monitor); } catch(CoreException e) { error(ToolingKernelActivator.getDefault(), "Error during save operation.", e); @@ -189,6 +196,7 @@ public class PersistencyService implements IPersistencyService, IIntrospectiveKe } } } + ungetService(ILibraryService.class); } /** {@inheritDoc} */ 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 11c205ae7cb8960ab9429f096d830a20d2a92dc9..0af7d9f124cfec7f7662fa50461328c20f731773 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 @@ -20,6 +20,7 @@ package org.fortiss.tooling.kernel.internal; import static java.util.Collections.emptyList; import static org.conqat.lib.commons.collections.CollectionUtils.asUnmodifiable; import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.getBundle; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.getConfigurationElements; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.loadClass; @@ -41,9 +42,9 @@ import org.fortiss.tooling.kernel.extension.data.PrototypeCategory; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.PrototypeServiceIntrospectionDetailsItem; import org.fortiss.tooling.kernel.service.IElementCompositorService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IPrototypeService; import org.fortiss.tooling.kernel.service.ITutorialService; import org.osgi.framework.Bundle; @@ -54,7 +55,7 @@ import org.osgi.framework.Bundle; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 4920D4B8529316AF98B2E73ADDC25BA8 + * @ConQAT.Rating YELLOW Hash: D28AB292FC337CD52BDB261C2AD2EDA3 */ public class PrototypeService implements IPrototypeService, IIntrospectiveKernelService { @@ -78,8 +79,13 @@ public class PrototypeService implements IPrototypeService, IIntrospectiveKernel /** Starts the service. */ public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); - tutorialService = ToolingKernelActivator.getService(ITutorialService.class); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); + + tutorialService = getService(ITutorialService.class); + // never call unget, since prototype service never dies } /** Registers the given provider with the service. */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java index 20da94432007cfdf3640602a4d658fbacdd44ca7..a54d7d57721a9529306e6072ae3ff74f62f98b78 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/ToolingKernelInternal.java @@ -54,73 +54,148 @@ import org.fortiss.tooling.kernel.service.ITutorialService; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 11DFD3BDA7E63E3C5F9ACA49BA921A4F */ public final class ToolingKernelInternal { /** Initialize the kernel services. */ + // FIXME (FH): https://af3-developer.fortiss.org/issues/2590 + // initialization no longer needed after extension points are gone public static void initializeKernel() { printPhase("Tooling Kernel initializing ..."); - ((ConnectionCompositorService)IConnectionCompositorService.getInstance()) - .initializeService(); - ((ConstraintCheckerService)IConstraintCheckerService.getInstance()).initializeService(); - ((ConstraintVerificationService)IConstraintVerificationService.getInstance()) - .initializeService(); - ((ElementCompositorService)IElementCompositorService.getInstance()).initializeService(); - ((EclipseResourceStorageService)IEclipseResourceStorageService.getInstance()) - .initializeService(); - ((LibraryService)ILibraryService.getInstance()).initializeService(); - ((LoggingService)ILoggingService.getInstance()).initializeService(); - ((MigrationService)IMigrationService.getInstance()).initializeService(); - ((PersistencyService)IPersistencyService.getInstance()).initializeService(); - ((PrototypeService)IPrototypeService.getInstance()).initializeService(); - ((TransformationService)ITransformationService.getInstance()).initializeService(); - ((TutorialService)ITutorialService.getInstance()).initializeService(); + IConnectionCompositorService ccs = getService(IConnectionCompositorService.class); + ((ConnectionCompositorService)ccs).initializeService(); + ungetService(IConnectionCompositorService.class); + + IConstraintCheckerService cchs = getService(IConstraintCheckerService.class); + ((ConstraintCheckerService)cchs).initializeService(); + ungetService(IConstraintCheckerService.class); + + IConstraintVerificationService cvs = getService(IConstraintVerificationService.class); + ((ConstraintVerificationService)cvs).initializeService(); + ungetService(IConstraintVerificationService.class); + + IElementCompositorService ecs = getService(IElementCompositorService.class); + ((ElementCompositorService)ecs).initializeService(); + ungetService(IElementCompositorService.class); + + IEclipseResourceStorageService erss = getService(IEclipseResourceStorageService.class); + ((EclipseResourceStorageService)erss).initializeService(); + ungetService(IEclipseResourceStorageService.class); + + ILibraryService libs = getService(ILibraryService.class); + ((LibraryService)libs).initializeService(); + ungetService(ILibraryService.class); + + ILoggingService logs = getService(ILoggingService.class); + ((LoggingService)logs).initializeService(); + ungetService(ILoggingService.class); + + IMigrationService migs = getService(IMigrationService.class); + ((MigrationService)migs).initializeService(); + ungetService(IMigrationService.class); + + IPersistencyService ps = getService(IPersistencyService.class); + ((PersistencyService)ps).initializeService(); + ungetService(IPersistencyService.class); + + IPrototypeService protos = getService(IPrototypeService.class); + ((PrototypeService)protos).initializeService(); + ungetService(IPrototypeService.class); + + ITransformationService trans = getService(ITransformationService.class); + ((TransformationService)trans).initializeService(); + ungetService(ITransformationService.class); + + ITutorialService tuts = getService(ITutorialService.class); + ((TutorialService)tuts).initializeService(); + ungetService(ITutorialService.class); printPhase("Tooling Kernel initialized."); } /** Starts the kernel services. */ + // FIXME (FH): https://af3-developer.fortiss.org/issues/2590 + // starting no longer needed after extension points are gone public static void startKernel() { printPhase("Tooling Kernel starting ..."); - ((ConnectionCompositorService)IConnectionCompositorService.getInstance()).startService(); - ((ConstraintCheckerService)IConstraintCheckerService.getInstance()).startService(); - ((ConstraintVerificationService)IConstraintVerificationService.getInstance()) - .startService(); - ((ElementCompositorService)IElementCompositorService.getInstance()).startService(); - ((EclipseResourceStorageService)IEclipseResourceStorageService.getInstance()) - .startService(); - ((LibraryService)ILibraryService.getInstance()).startService(); - ((LoggingService)ILoggingService.getInstance()).startService(); - ((MigrationService)IMigrationService.getInstance()).startService(); - ((PersistencyService)IPersistencyService.getInstance()).startService(); - ((PrototypeService)IPrototypeService.getInstance()).startService(); - ((TransformationService)ITransformationService.getInstance()).startService(); - ((TutorialService)ITutorialService.getInstance()).startService(); + IConnectionCompositorService ccs = getService(IConnectionCompositorService.class); + ((ConnectionCompositorService)ccs).startService(); + ungetService(IConnectionCompositorService.class); + + IConstraintCheckerService cchs = getService(IConstraintCheckerService.class); + ((ConstraintCheckerService)cchs).startService(); + ungetService(IConstraintCheckerService.class); + + IConstraintVerificationService cvs = getService(IConstraintVerificationService.class); + ((ConstraintVerificationService)cvs).startService(); + ungetService(IConstraintVerificationService.class); + + IElementCompositorService ecs = getService(IElementCompositorService.class); + ((ElementCompositorService)ecs).startService(); + ungetService(IElementCompositorService.class); + + IEclipseResourceStorageService erss = getService(IEclipseResourceStorageService.class); + ((EclipseResourceStorageService)erss).startService(); + ungetService(IEclipseResourceStorageService.class); + + ILibraryService libs = getService(ILibraryService.class); + ((LibraryService)libs).startService(); + ungetService(ILibraryService.class); + + ILoggingService logs = getService(ILoggingService.class); + ((LoggingService)logs).startService(); + ungetService(ILoggingService.class); + + IMigrationService migs = getService(IMigrationService.class); + ((MigrationService)migs).startService(); + ungetService(IMigrationService.class); + + IPersistencyService ps = getService(IPersistencyService.class); + ((PersistencyService)ps).startService(); + ungetService(IPersistencyService.class); + + IPrototypeService protos = getService(IPrototypeService.class); + ((PrototypeService)protos).startService(); + ungetService(IPrototypeService.class); + + ITransformationService trans = getService(ITransformationService.class); + ((TransformationService)trans).startService(); + ungetService(ITransformationService.class); + + ITutorialService tuts = getService(ITutorialService.class); + ((TutorialService)tuts).startService(); + ungetService(ITutorialService.class); printPhase("Tooling Kernel started."); } /** Registers the given transformation with the kernel. */ public static void registerTransformationProvider(ITransformationProvider provider, Class<?> sourceClass, Class<?> targetClass) { - ((TransformationService)ITransformationService.getInstance()) - .registerTransformationProvider(provider, sourceClass, targetClass); + ITransformationService trans = getService(ITransformationService.class); + ((TransformationService)trans).registerTransformationProvider(provider, sourceClass, + targetClass); + ungetService(ITransformationService.class); } /** Registers the given provider with the kernel. */ public static void registerPrototypeProvider(IPrototypeProvider provider) { - ((PrototypeService)IPrototypeService.getInstance()).registerPrototypeProvider(provider); + IPrototypeService protos = getService(IPrototypeService.class); + ((PrototypeService)protos).registerPrototypeProvider(provider); + ungetService(IPrototypeService.class); } /** Registers the given storage provider with the kernel. */ public static void registerModelStorageProvider(IStorageProvider provider) { - ((PersistencyService)IPersistencyService.getInstance()) - .registerModelStorageProvider(provider); + IPersistencyService ps = getService(IPersistencyService.class); + ((PersistencyService)ps).registerModelStorageProvider(provider); + ungetService(IPersistencyService.class); } /** Registers the migration provider with the service. */ public static void registerMigrationProvider(IMigrationProvider provider, Class<?> modelElementClass) { - ((MigrationService)IMigrationService.getInstance()).registerMigrationProvider(provider, - modelElementClass); + IMigrationService migs = getService(IMigrationService.class); + ((MigrationService)migs).registerMigrationProvider(provider, modelElementClass); + ungetService(IMigrationService.class); } /** Registers the given handler with the kernel. */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java index 17b120a0271e03b70b65143ee22a3e17e49d1167..da650bbcb7f08f1116cd9912d8b311429e311553 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TransformationService.java @@ -18,6 +18,8 @@ $Id$ package org.fortiss.tooling.kernel.internal; import static java.util.Collections.emptyList; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import java.util.HashSet; import java.util.LinkedList; @@ -33,8 +35,8 @@ import org.fortiss.tooling.kernel.extension.exception.TransformationFailedExcept import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.TransformationServiceIntrospectionDetailsItem; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ITransformationService; import org.fortiss.tooling.kernel.service.base.ObjectAware2ServiceBase; @@ -44,7 +46,7 @@ import org.fortiss.tooling.kernel.service.base.ObjectAware2ServiceBase; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 8103981E123D9C0A6ACD17989FCF2BD9 + * @ConQAT.Rating YELLOW Hash: A751A1A270F031A831E22184498CF27F */ public class TransformationService extends ObjectAware2ServiceBase<ITransformationProvider> implements ITransformationService, IIntrospectiveKernelService { @@ -62,7 +64,10 @@ public class TransformationService extends ObjectAware2ServiceBase<ITransformati /** {@inheritDoc} */ @Override public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java index fd5f78b4a4d36bbc20d69927966526cc3c86cba1..11fa1e85b1d15fb852cdb3c6fc6a68e6cb808aac 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/TutorialService.java @@ -44,8 +44,8 @@ import org.fortiss.tooling.kernel.extension.data.TutorialStepBase; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.ICommandStackService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.fortiss.tooling.kernel.service.ITutorialService; import org.fortiss.tooling.kernel.service.listener.ITutorialServiceListener; @@ -56,7 +56,7 @@ import org.fortiss.tooling.kernel.service.listener.ITutorialServiceListener; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 803DA41C788F94DA5EB4545D0B883AFD */ public final class TutorialService implements ITutorialService, CommandStackListener, IIntrospectiveKernelService { @@ -90,7 +90,10 @@ public final class TutorialService implements ITutorialService, CommandStackList /** Starts the service. */ public void startService() { - KernelIntrospectionSystemService.getInstance().registerService(this); + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** {@inheritDoc} */ diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageService.java index abaa85703832a98ecb432665d800464c2768e722..e102ef957b8b11d7ffa8eb8841f5b43cf0ee7c38 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/internal/storage/eclipse/EclipseResourceStorageService.java @@ -25,6 +25,8 @@ import static org.eclipse.core.resources.IResourceDelta.CHANGED; import static org.eclipse.core.resources.IResourceDelta.REMOVED; import static org.eclipse.core.resources.ResourcesPlugin.getWorkspace; import static org.fortiss.tooling.kernel.ToolingKernel.registerModelStorageProvider; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.getBundle; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.getConfigurationElements; import static org.fortiss.tooling.kernel.utils.ExtensionPointUtils.loadClass; @@ -65,9 +67,9 @@ import org.fortiss.tooling.kernel.extension.data.ModelStorageError; import org.fortiss.tooling.kernel.introspection.IIntrospectionDetailsItem; import org.fortiss.tooling.kernel.introspection.IIntrospectionItem; import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; -import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; import org.fortiss.tooling.kernel.introspection.items.EclipseResourceStorageServiceIntrospectionDetailsItem; import org.fortiss.tooling.kernel.service.IEclipseResourceStorageService; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; import org.fortiss.tooling.kernel.service.IMigrationService; import org.fortiss.tooling.kernel.service.IPersistencyService; import org.osgi.framework.Bundle; @@ -79,7 +81,7 @@ import org.osgi.framework.Bundle; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: 369A922C7BD5B691476B472467231494 + * @ConQAT.Rating YELLOW Hash: E8733BA8E0B7A0F99049950162914903 */ public class EclipseResourceStorageService implements IEclipseResourceStorageService, IResourceChangeListener, IResourceDeltaVisitor, IStorageProvider, @@ -107,11 +109,6 @@ public class EclipseResourceStorageService implements IEclipseResourceStorageSer private final Map<EObject, ModelContext> rootElementContexts = new IdentityHashMap<EObject, ModelContext>(); - /** Activates the service. Called by OSGi. */ - public void activate() { - // TODO Auto-generated method stub - } - /** Starts the storage provider. */ public void initializeService() { setupLocationProviders(); @@ -125,7 +122,11 @@ public class EclipseResourceStorageService implements IEclipseResourceStorageSer // are discovered during workspace search, thus introducing a possible // cyclic call during provider initialization getWorkspace().addResourceChangeListener(this); - KernelIntrospectionSystemService.getInstance().registerService(this); + + IKernelIntrospectionSystemService kiss = + getService(IKernelIntrospectionSystemService.class); + kiss.registerService(this); + ungetService(IKernelIntrospectionSystemService.class); } /** Searches existing models in Eclipse project roots. */ @@ -204,6 +205,7 @@ public class EclipseResourceStorageService implements IEclipseResourceStorageSer new WorkspaceJob("ModelFileChangedJob") { @Override public IStatus runInWorkspace(IProgressMonitor monitor) { + IPersistencyService ps = getService(IPersistencyService.class); synchronized(EclipseResourceStorageService.this) { // Model file that is managed by kernel has been changed if(checkLocationProvider(file)) { @@ -219,13 +221,11 @@ public class EclipseResourceStorageService implements IEclipseResourceStorageSer } } // Refresh the top-level elements - IPersistencyService.getInstance().refreshTopLevelElements( - EclipseResourceStorageService.this); + ps.refreshTopLevelElements(EclipseResourceStorageService.this); } else if(changeKind == REMOVED) { // A file has been removed. Remove it from one of the ResourceSets owned by // the kernel. - for(ITopLevelElement topLevelElement : IPersistencyService.getInstance() - .getTopLevelElements()) { + for(ITopLevelElement topLevelElement : ps.getTopLevelElements()) { final ResourceSet resourceSet = topLevelElement.getResourceSet(); final List<Resource> toRemove = new ArrayList<Resource>(); for(Resource resource : resourceSet.getResources()) { @@ -255,6 +255,7 @@ public class EclipseResourceStorageService implements IEclipseResourceStorageSer } } } + ungetService(IPersistencyService.class); return Status.OK_STATUS; } }.schedule(); @@ -293,9 +294,11 @@ public class EclipseResourceStorageService implements IEclipseResourceStorageSer public void postLoadContext(ModelContext mc) { // Note: migration could be treated as a "post load" provider, but it is important that it // runs before the other providers so it is handled separately. - if(IMigrationService.getInstance().needMigration(mc, mc.getUnknownFeatures())) { - IMigrationService.getInstance().migrate(mc, mc.getUnknownFeatures()); + IMigrationService migs = getService(IMigrationService.class); + if(migs.needMigration(mc, mc.getUnknownFeatures())) { + migs.migrate(mc, mc.getUnknownFeatures()); } + ungetService(IMigrationService.class); } /** Unloads the context and destroys it. */ 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 a88c25dda4ac09eb57a589960a3486434e6be95c..1b7e61065b10cce3fe58f228a3009d8969514bac 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 @@ -18,6 +18,8 @@ $Id$ package org.fortiss.tooling.kernel.internal.storage.eclipse; import static org.eclipse.emf.ecore.util.EcoreUtil.resolveAll; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; +import static org.fortiss.tooling.kernel.ToolingKernelActivator.ungetService; import static org.fortiss.tooling.kernel.utils.EMFResourceUtils.buildOptionsMap; import static org.fortiss.tooling.kernel.utils.LoggingUtils.error; import static org.fortiss.tooling.kernel.utils.LoggingUtils.warning; @@ -69,7 +71,7 @@ import org.fortiss.tooling.kernel.utils.UniqueIDUtils; * @author hummel * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: C1F1C761A2C49CC4FBCD0E558AFC97B3 + * @ConQAT.Rating YELLOW Hash: C738998168AE1BAF98965627C8DF5ABC */ class ModelContext implements ITopLevelElement, CommandStackListener { @@ -339,9 +341,11 @@ class ModelContext implements ITopLevelElement, CommandStackListener { ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone(); performNotifyListeners(editingDomain.getCommandStack()); - if(IPersistencyService.getInstance() != null) { - IPersistencyService.getInstance().notifyTopLevelElementChanged(ModelContext.this); + IPersistencyService ps = getService(IPersistencyService.class); + if(ps != null) { + ps.notifyTopLevelElementChanged(ModelContext.this); } + ungetService(IPersistencyService.class); } else { // Throw first caught IOException or CoreException if(exception instanceof IOException) { diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java index abb5484d4d693111faba95c6be78e9137067412f..bb6f340cabacc7c636667a05d89e0bc653ba4015 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/introspection/KernelIntrospectionSystemService.java @@ -22,45 +22,31 @@ import static java.util.Collections.unmodifiableSet; import java.util.HashSet; import java.util.Set; +import org.fortiss.tooling.kernel.service.IKernelIntrospectionSystemService; + /** * Implementation of the kernel introspection system service (KISS). * * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: C400126DE53F54010FFB761CAFAE2BE4 + * @ConQAT.Rating YELLOW Hash: 3BF3954DD5EDA881F462C8216649229C */ -public final class KernelIntrospectionSystemService implements IIntrospectiveKernelService { - - /** Returns the singleton instance of the service. */ - @Deprecated - public static final KernelIntrospectionSystemService INSTANCE = - new KernelIntrospectionSystemService(); - - /** Returns the service instance. */ - public static KernelIntrospectionSystemService getInstance() { - return INSTANCE; - } - +public final class KernelIntrospectionSystemService implements IKernelIntrospectionSystemService, + IIntrospectiveKernelService { /** The introspective services of the kernel. */ private final HashSet<IIntrospectiveKernelService> services = new HashSet<IIntrospectiveKernelService>(); - /** Singleton constructor. */ - private KernelIntrospectionSystemService() { - // nothing to do here - } - - /** - * Registers the given {@link IIntrospectiveKernelService} service with - * {@link KernelIntrospectionSystemService KISS}. - */ + /** {@inheritDoc} */ + @Override public void registerService(IIntrospectiveKernelService service) { System.out.println("[KISS] " + service.getIntrospectionLabel() + " registered."); services.add(service); } - /** Unregisters the given service. */ + /** {@inheritDoc} */ + @Override public void unregisterService(IIntrospectiveKernelService service) { services.remove(service); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java index a3a67e1b1ad7c4d5d9a10c8565eab36ae1c507d9..600909dfe84084f2343e8c22b1ecd9bbaa426424 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ICommandStackService.java @@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 4C95EE2A596AF30B31457E6C6FC6CFED + * @ConQAT.Rating YELLOW Hash: D13D89A5CD3F856D67DC82D0BD4E678F */ public interface ICommandStackService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java index e10635a833a3ba411812d8a11109746b77d0b8fb..1607c8eef9dad4f8bb5466eeae169012872575dd 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConnectionCompositorService.java @@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: CB088BC7AB8F3FD044A2774FCF348E6A + * @ConQAT.Rating YELLOW Hash: EE581819E4CD4789B0095452DE1616F6 */ public interface IConnectionCompositorService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java index 1763e947b533b6f6f37ffd5a99eec50c7a7e286b..ead14c38de18c034b12117278690a949955b0a38 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintCheckerService.java @@ -37,7 +37,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: D4A3843E367D0EA5A550B2ECBAEA0F38 + * @ConQAT.Rating YELLOW Hash: E606354147FACA58D63B4E3A0959205A */ public interface IConstraintCheckerService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java index 67ce95a00688c76cd9f881416f59d3b75719048f..31767ea483ced0dc0c5c90028d738063154bf806 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IConstraintVerificationService.java @@ -20,7 +20,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author aravantinos * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: B9E308FF26316341AC1B379A00443A22 + * @ConQAT.Rating YELLOW Hash: 8F4CB2B6F1586468BBE44C0F17488DB8 */ public interface IConstraintVerificationService { /** @@ -129,8 +129,8 @@ public interface IConstraintVerificationService { */ /** Gets a general description for the constraint type. */ - public <T extends IConstraint> String getDescription(Class<T> constraintEltClass); + <T extends IConstraint> String getDescription(Class<T> constraintEltClass); /** Gets the constraint types which can be used for constraint-based development process. */ - public <T extends IConstraint> Set<Class<T>> getDevelopmentProcessConstraintTypes(); + <T extends IConstraint> Set<Class<T>> getDevelopmentProcessConstraintTypes(); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IEclipseResourceStorageService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IEclipseResourceStorageService.java index 622af1c51fa33cad4c539d349d5ba6377bc4cbf8..691e3579820b61f1ee1a0ff29f2b5add1ad62ac0 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IEclipseResourceStorageService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IEclipseResourceStorageService.java @@ -35,7 +35,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzlf * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 26E0088D8A6BEE1C9F68BD77E4AE7A55 + * @ConQAT.Rating YELLOW Hash: 697ACFB0298C038B51A8EBDC362FEE7E */ public interface IEclipseResourceStorageService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java index ccb5f0cd08caf4db4aa27a5e26a99e6146b0a78d..bd245b17cb01bc6ab3913860859f0d5bb8f5f484 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IElementCompositorService.java @@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 133F80DB408CFA904C4FBB8B7BFC9F47 + * @ConQAT.Rating YELLOW Hash: 69445335D2F6396C5216854D57AE36D5 */ public interface IElementCompositorService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IKernelIntrospectionSystemService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IKernelIntrospectionSystemService.java new file mode 100644 index 0000000000000000000000000000000000000000..6de27b0c8b1ebb4d82717a336fbe15fa92e89297 --- /dev/null +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IKernelIntrospectionSystemService.java @@ -0,0 +1,58 @@ +/*--------------------------------------------------------------------------+ +$Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $ +| | +| Copyright 2016 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.service; + +import static org.fortiss.tooling.kernel.ToolingKernelActivator.getService; + +import org.fortiss.tooling.kernel.ToolingKernelActivator; +import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService; +import org.fortiss.tooling.kernel.introspection.KernelIntrospectionSystemService; +import org.fortiss.tooling.kernel.utils.ServicesUtils; + +/** + * Interface for the Kernel Introspection System Service, which + * provides access to kernel state information and registered services. + * + * @author hoelzl + * @author $Author: hoelzl $ + * @version $Rev: 18709 $ + * @ConQAT.Rating YELLOW Hash: 8CA57DA0D41C818EBFDF99012AB6121A + */ +public interface IKernelIntrospectionSystemService { + /** + * Returns the service instance. + * + * @deprecated use {@link ServicesUtils#getService(org.osgi.framework.Bundle, Class)} and + * {@link ServicesUtils#ungetService(org.osgi.framework.Bundle, Class)}, instead. + * See also {@link ToolingKernelActivator#getService(Class)} and + * {@link ToolingKernelActivator#ungetService(Class)} + */ + @Deprecated + public static IKernelIntrospectionSystemService getInstance() { + return getService(IKernelIntrospectionSystemService.class); + } + + /** + * Registers the given {@link IIntrospectiveKernelService} service with + * {@link KernelIntrospectionSystemService KISS}. + */ + void registerService(IIntrospectiveKernelService service); + + /** Unregisters the given service. */ + void unregisterService(IIntrospectiveKernelService service); +} diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java index f313a64df1ce4cc91e11de371bca24cc5fa75639..c496e8c4617d191c04f3217a0992f710f1f34770 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILibraryService.java @@ -36,7 +36,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author ratiu * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating GREEN Hash: B512269C9F0DFC44C45930CCAC191AEE + * @ConQAT.Rating YELLOW Hash: C18F72F7D644B9CE2F6D233280D297A7 */ public interface ILibraryService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java index 5a214e250d7dd9bf53f13ea848789ba68a78de65..63d482dc22a4706ebbac2825ab2294e65dfa7c87 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ILoggingService.java @@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author diewald * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: CC2F51320ADEBD539F3522C30A12C974 + * @ConQAT.Rating YELLOW Hash: BA011CDA51C740F0686DC9C44FB879C2 */ public interface ILoggingService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java index f2b0edd747270a16c4ae89e76538be211c7bb8a4..5b278679c1b8145204c444cb0d421454986bac5d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IMigrationService.java @@ -33,7 +33,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author mou * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 872F825EEDD44952AD6012AFC47B07C6 + * @ConQAT.Rating YELLOW Hash: FF92295E6B6683E2FB1375F007E77232 */ public interface IMigrationService { /** 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 cd4d9495cc197b911f136773907cfbbad74d1096..10de727cf98641f3e6bd7d91ded42791b66b19d3 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 @@ -43,7 +43,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 74906795F7A3AA1D94476D9B0538052C + * @ConQAT.Rating YELLOW Hash: CB1879923E074C166A125BEE07303C1B */ public interface IPersistencyService { /** @@ -99,14 +99,14 @@ public interface IPersistencyService { * Adds the given EObject as a dummy top-level element. This method is * intended for JUnit testing purposes only. */ - public ITopLevelElement addDummyEObjectAsTopLevelElement(EObject dummy); + ITopLevelElement addDummyEObjectAsTopLevelElement(EObject dummy); /** * Removes the given EObject from the dummy top-level elements. This method * is intended for JUnit testing purposes only. */ - public void removeDummyTopLevelElement(EObject dummy); + void removeDummyTopLevelElement(EObject dummy); /** Returns all model storage errors from all storage providers. */ - public List<ModelStorageError> getAllStorageErrors(); + List<ModelStorageError> getAllStorageErrors(); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java index 77e9d414a891fe58d7bca7b2d68e9d4363251839..d0cb9808427011332f41d10433af3c2db36f706d 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/IPrototypeService.java @@ -42,7 +42,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 1C9772CADE247390A9D85336F0747D74 + * @ConQAT.Rating YELLOW Hash: 002E06C523B6CA456062444F8BDC66FE */ public interface IPrototypeService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java index 0f85541a07b46a07999581d21fc133edbb9e56e6..04ff1a29d79c6f8c83755b6c76d6a335c65f5012 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITransformationService.java @@ -39,7 +39,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author$ * @version $Rev$ - * @ConQAT.Rating GREEN Hash: 1A3F5C9BB18ACEB99A11FDC5321D3CA7 + * @ConQAT.Rating YELLOW Hash: 1978D6CC1BDA37619DB7BEA84FD958A3 */ public interface ITransformationService { /** diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java index e711b3acb7ba57ce6a143d1f59218cc0d287d2d9..2710c026ada3655660fef82754a4a1a656fef10b 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/ITutorialService.java @@ -44,7 +44,7 @@ import org.fortiss.tooling.kernel.utils.ServicesUtils; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating YELLOW Hash: 8B35EC00B8606A9B29816DA8E6F94D1F + * @ConQAT.Rating YELLOW Hash: 8DEA5F045D1346D19885029B7CDAB277 */ public interface ITutorialService extends ITutorialWhitelistProvider { /** @@ -61,42 +61,42 @@ public interface ITutorialService extends ITutorialWhitelistProvider { } /** Returns whether any tutorial is currently enabled. */ - public boolean isTutorialActive(); + boolean isTutorialActive(); /** Returns the current tutorial definition or <code>null</code> if no tutorial is active. */ - public ITutorialProvider getActiveTutorial(); + ITutorialProvider getActiveTutorial(); /** * Returns the list of all atomic tutorial steps, i.e., a flattening of the hierarchical * tutorial definition. */ - public List<TutorialAtomicStep> getAtomicTutorialSteps(); + List<TutorialAtomicStep> getAtomicTutorialSteps(); /** Starts the given tutorial. */ - public void startTutorial(Class<? extends ITutorialProvider> provider); + void startTutorial(Class<? extends ITutorialProvider> provider); /** Stops the current tutorial. */ - public void stopTutorial(); + void stopTutorial(); /** Returns the active tutorial step. */ - public TutorialStepBase getActiveTutorialStep(); + TutorialStepBase getActiveTutorialStep(); /** Returns whether the given step is completed. */ - public boolean isCompletedStep(TutorialStepBase step); + boolean isCompletedStep(TutorialStepBase step); /** Returns all registered tutorial providers for the given category. */ - public Map<String, Class<? extends ITutorialProvider>> getAllTutorialProviders(String category); + Map<String, Class<? extends ITutorialProvider>> getAllTutorialProviders(String category); /** Returns all category names, which have at least one provider. */ - public Collection<String> getProviderCategories(); + Collection<String> getProviderCategories(); /** Programmatically register a tutorial provider. */ - public void registerTutorialProvider(Class<? extends ITutorialProvider> provider, - String displayName, String category); + void registerTutorialProvider(Class<? extends ITutorialProvider> provider, String displayName, + String category); /** Adds a listener with this service. */ - public void addTutorialServiceListener(ITutorialServiceListener l); + void addTutorialServiceListener(ITutorialServiceListener l); /** Removes a listener from this service. */ - public void removeTutorialServiceListener(ITutorialServiceListener l); + void removeTutorialServiceListener(ITutorialServiceListener l); } diff --git a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/ITutorialServiceListener.java b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/ITutorialServiceListener.java index e68df66d0d18e3689c99f673269848f229076700..ea6447db77f9275af724bbdf6786bccd1675bfe1 100644 --- a/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/ITutorialServiceListener.java +++ b/org.fortiss.tooling.kernel/trunk/src/org/fortiss/tooling/kernel/service/listener/ITutorialServiceListener.java @@ -27,16 +27,15 @@ import org.fortiss.tooling.kernel.service.ITutorialService; * @author hoelzl * @author $Author: hoelzl $ * @version $Rev: 18709 $ - * @ConQAT.Rating RED Hash: + * @ConQAT.Rating YELLOW Hash: 95AFFE19C0C91CBAAD314886CA58BDEA */ public interface ITutorialServiceListener { - /** Fired when the given tutorial is started. */ - public void tutorialStarted(ITutorialProvider provider); + void tutorialStarted(ITutorialProvider provider); /** Fired when the tutorial step changed to the given step. */ - public void tutorialStepChanged(TutorialAtomicStep step); + void tutorialStepChanged(TutorialAtomicStep step); /** Fired when the given tutorial is stopped. */ - public void tutorialStopped(ITutorialProvider provider); + void tutorialStopped(ITutorialProvider provider); }