Skip to content
Snippets Groups Projects
Commit 4fefebe0 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Started Kernel Introspection System Service implementation.

refs 2460
parent a2787a66
No related branches found
No related tags found
No related merge requests found
Showing
with 251 additions and 9 deletions
......@@ -20,6 +20,8 @@ Export-Package: org.fortiss.tooling.kernel;uses:="org.eclipse.core.runtime,org.o
org.fortiss.tooling.kernel.extension.base,
org.fortiss.tooling.kernel.extension.data,
org.fortiss.tooling.kernel.extension.exception,
org.fortiss.tooling.kernel.introspection,
org.fortiss.tooling.kernel.introspection.items,
org.fortiss.tooling.kernel.model;uses:="org.eclipse.emf.ecore",
org.fortiss.tooling.kernel.model.impl;uses:="org.fortiss.tooling.kernel.model",
org.fortiss.tooling.kernel.model.util;
......
......@@ -24,6 +24,7 @@ import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.kernel.ToolingKernelActivator;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
......@@ -36,7 +37,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService;
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 82CCE7AD2F21B0F48DBC904FF10F1C60
*/
public class CommandStackService implements ICommandStackService {
public class CommandStackService implements ICommandStackService, IIntrospectiveKernelService {
/** {@inheritDoc} */
@Override
......@@ -110,4 +111,10 @@ public class CommandStackService implements ICommandStackService {
}
}
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -23,6 +23,7 @@ import java.util.Map;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.kernel.extension.IConnectionCompositor;
import org.fortiss.tooling.kernel.extension.data.IConnectionCompositionContext;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
import org.fortiss.tooling.kernel.service.base.EObjectAware2ServiceBase;
......@@ -36,7 +37,7 @@ import org.fortiss.tooling.kernel.service.base.EObjectAware2ServiceBase;
*/
public class ConnectionCompositorService extends
EObjectAware2ServiceBase<IConnectionCompositor<EObject, EObject, EObject>> implements
IConnectionCompositorService {
IConnectionCompositorService, IIntrospectiveKernelService {
/** The connector extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -176,4 +177,10 @@ public class ConnectionCompositorService extends
protected String getHandlerClassAttribute() {
return ATTRIBUTE_NAME;
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -26,6 +26,7 @@ import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.tooling.kernel.extension.IConstraintChecker;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.IConstraintCheckerService;
import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
......@@ -38,7 +39,7 @@ import org.fortiss.tooling.kernel.service.base.EObjectAwareServiceBase;
* @ConQAT.Rating GREEN Hash: 22CF78E8282A1AAAE396C2AB6873A953
*/
public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstraintChecker<EObject>>
implements IConstraintCheckerService {
implements IConstraintCheckerService, IIntrospectiveKernelService {
/** The constraint checker extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -122,4 +123,10 @@ public class ConstraintCheckerService extends EObjectAwareServiceBase<IConstrain
protected String getHandlerClassAttribute() {
return HANDLER_CLASS_ATTRIBUTE_NAME;
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -24,6 +24,7 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator;
import org.fortiss.tooling.kernel.extension.IElementCompositor;
import org.fortiss.tooling.kernel.extension.data.IElementCompositionContext;
import org.fortiss.tooling.kernel.extension.data.Prototype;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.model.ILibraryElementReference;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
......@@ -39,7 +40,8 @@ import org.fortiss.tooling.kernel.utils.LoggingUtils;
* @ConQAT.Rating YELLOW Hash: 53DE129E073FF9BDACE271D26C3D257F
*/
public final class ElementCompositorService extends
EObjectAwareServiceBase<IElementCompositor<EObject>> implements IElementCompositorService {
EObjectAwareServiceBase<IElementCompositor<EObject>> implements IElementCompositorService,
IIntrospectiveKernelService {
/** The compositor extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -151,4 +153,10 @@ public final class ElementCompositorService extends
protected String getHandlerClassAttribute() {
return HANDLER_CLASS_ATTRIBUTE_NAME;
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -36,6 +36,7 @@ import org.eclipse.emf.ecore.util.EContentAdapter;
import org.fortiss.tooling.kernel.extension.ILibraryElementHandler;
import org.fortiss.tooling.kernel.extension.IPrototypeProvider;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.model.ILibrary;
import org.fortiss.tooling.kernel.model.ILibraryElement;
import org.fortiss.tooling.kernel.model.ILibraryElementReference;
......@@ -55,7 +56,7 @@ import org.fortiss.tooling.kernel.utils.UniqueIDUtils;
* @ConQAT.Rating YELLOW Hash: B077293D3E6DC66CD4E8383B8FDEEB43
*/
public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandler<EObject>>
implements ILibraryService {
implements ILibraryService, IIntrospectiveKernelService {
/** The library service extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -280,4 +281,10 @@ public class LibraryService extends EObjectAwareServiceBase<ILibraryElementHandl
protected String getHandlerClassAttribute() {
return HANDLER_CLASS_ATTRIBUTE_NAME;
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.xml.type.AnyType;
import org.fortiss.tooling.kernel.ToolingKernelActivator;
import org.fortiss.tooling.kernel.extension.IMigrationProvider;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.IMigrationService;
import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase;
......@@ -40,7 +41,7 @@ import org.fortiss.tooling.kernel.service.base.ObjectAwareServiceBase;
* @ConQAT.Rating YELLOW Hash: 20D69C0AFD8A28767285B21F9096DF2D
*/
public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider> implements
IMigrationService {
IMigrationService, IIntrospectiveKernelService {
/** The connector extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -117,4 +118,10 @@ public class MigrationService extends ObjectAwareServiceBase<IMigrationProvider>
protected String getHandlerClassAttribute() {
return ATTRIBUTE_NAME;
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -42,6 +42,7 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator;
import org.fortiss.tooling.kernel.extension.IStorageProvider;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.extension.data.ModelStorageError;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.ILibraryService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import org.fortiss.tooling.kernel.service.listener.IPersistencyServiceListener;
......@@ -56,7 +57,7 @@ import org.osgi.framework.Bundle;
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 3CBB6E12FCF1DC7E65F09D4C3CFDE9CE
*/
public class PersistencyService implements IPersistencyService {
public class PersistencyService implements IPersistencyService, IIntrospectiveKernelService {
/** The prototype provider extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -281,4 +282,10 @@ public class PersistencyService implements IPersistencyService {
}
return errors;
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -34,6 +34,7 @@ import org.fortiss.tooling.kernel.ToolingKernelActivator;
import org.fortiss.tooling.kernel.extension.IPrototypeProvider;
import org.fortiss.tooling.kernel.extension.data.Prototype;
import org.fortiss.tooling.kernel.extension.data.PrototypeCategory;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPrototypeService;
import org.osgi.framework.Bundle;
......@@ -46,7 +47,7 @@ import org.osgi.framework.Bundle;
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 47EA5AEA9815E24CDD14DCA8AC02AF08
*/
public class PrototypeService implements IPrototypeService {
public class PrototypeService implements IPrototypeService, IIntrospectiveKernelService {
/** The prototype provider extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -138,4 +139,10 @@ public class PrototypeService implements IPrototypeService {
return result;
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
......@@ -28,6 +28,7 @@ import org.fortiss.tooling.kernel.extension.ITransformationProvider;
import org.fortiss.tooling.kernel.extension.data.ITransformationContext;
import org.fortiss.tooling.kernel.extension.data.TransformationProviderChain;
import org.fortiss.tooling.kernel.extension.exception.TransformationFailedException;
import org.fortiss.tooling.kernel.introspection.IIntrospectiveKernelService;
import org.fortiss.tooling.kernel.service.ITransformationService;
import org.fortiss.tooling.kernel.service.base.ObjectAware2ServiceBase;
......@@ -40,7 +41,7 @@ import org.fortiss.tooling.kernel.service.base.ObjectAware2ServiceBase;
* @ConQAT.Rating GREEN Hash: 6B458E38F49D0A7A496096B0A265405D
*/
public class TransformationService extends ObjectAware2ServiceBase<ITransformationProvider>
implements ITransformationService {
implements ITransformationService, IIntrospectiveKernelService {
/** The connector extension point ID. */
private static final String EXTENSION_POINT_NAME =
......@@ -157,4 +158,10 @@ public class TransformationService extends ObjectAware2ServiceBase<ITransformati
}
}
}
/** {@inheritDoc} */
@Override
public String getIntrospectiveName() {
return getClass().getSimpleName();
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| 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.introspection;
import java.util.List;
/**
* Generic interface for introspection items provided by kernel services to
* {@link KernelIntrospectionSystemService KISS}.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public interface IIntrospectionItem {
/** The label of the introspection item. */
public String getLabel();
/** Returns whether this item is supposed to be shown in the KISS navigation tree. */
public boolean showInNavigation();
/**
* Returns the list of child items provided by this item. May return {@code null} or empty list.
*/
public List<IIntrospectionItem> getChildItems();
}
......@@ -29,5 +29,7 @@ package org.fortiss.tooling.kernel.introspection;
* @ConQAT.Rating RED Hash:
*/
public interface IIntrospectiveKernelService {
/** Returns the name of the service. */
public String getIntrospectiveName();
}
/*--------------------------------------------------------------------------+
$Id$
| |
| 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.introspection;
import static java.util.Collections.unmodifiableCollection;
import java.util.Collection;
import java.util.HashSet;
/**
* Implementation of the kernel introspection system service (KISS).
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public final class KernelIntrospectionSystemService {
/** Returns the singleton instance of the service. */
public static final KernelIntrospectionSystemService INSTANCE =
new KernelIntrospectionSystemService();
/** The introspective services of the kernel. */
private final Collection<IIntrospectiveKernelService> services =
new HashSet<IIntrospectiveKernelService>();
/** Singleton constructor. */
private KernelIntrospectionSystemService() {
// nothing to do here
}
/**
* Registers the given {@link IIntrospectiveKernelService} service with
* {@link KernelIntrospectionSystemService KISS}.
*/
public void registerService(IIntrospectiveKernelService service) {
services.add(service);
}
/**
* Returns all {@link IIntrospectiveKernelService} registered with
* {@link KernelIntrospectionSystemService KISS}
*/
public Collection<IIntrospectiveKernelService> getAllServices() {
return unmodifiableCollection(services);
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| 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.introspection.items;
import static java.util.Collections.emptyList;
import java.util.List;
import org.fortiss.tooling.kernel.introspection.IIntrospectionItem;
/**
* Base class implementing {@link IIntrospectionItem}.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public abstract class IntrospectionItemBase implements IIntrospectionItem {
/** The item label. */
private final String label;
/** Constructor. */
public IntrospectionItemBase(String label) {
this.label = label;
}
/** {@inheritDoc} */
@Override
public final String getLabel() {
return label;
}
/** {@inheritDoc} */
@Override
public List<IIntrospectionItem> getChildItems() {
return emptyList();
}
}
<!--
$Id$
@version $Rev$
@ConQAT.Rating GREEN Hash: D1F74AF2CA514F3B272F63D5DC9757CB
-->
<body>
Item definitions for the kernel introspection system service (KISS).
<P>
Each kernel service may provide specific runtime information items, which<BR>
are presented by some tool developer view or console.
<P>
Classes in this package are public, since they need to be shared by the user<BR>
interface implementation.
</body>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment