# HG changeset patch # User Omair Majid # Date 1358272850 18000 # Node ID 03948c38134a506b57e2c38bb3556cb7e78aa6f4 # Parent 421d8a954893c30089ad0db1df25f6aeaa2c1024 Introduce Service and ExtensionPoint annotations Thermostat currently has a large number of interfaces that are meant to be used as services (where a client obtains an instance of the interface from OSGi) or as extension points (where a client registers an instance of the interface as an OSGi service and thermostat makes use of it). There is no clear indication of which interfaces are what. Clarify this by introducing two annotations @Service and @ExtensionPoint that should be used to document the purpose of the interface. These annotations do not imply any behaviour and are for documentation purposes only. Also introduce an annotation processor that writes "plugin-docs.xml" files containing some basic documentation about classes marked with @Service or @ExtensionPoint. Nothing explicit needs to be done to invoke the annotation processor, simply including a dependency on thermostat-annotations (needed to use @Service/@ExtensionPoint anyway) is enough. These xml files are not included in the jars. Reviewed-by: ebaron, jerboaa, vanaltj Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-January/004983.html PR1255 diff -r 421d8a954893 -r 03948c38134a agent/command/src/main/java/com/redhat/thermostat/agent/command/RequestReceiver.java --- a/agent/command/src/main/java/com/redhat/thermostat/agent/command/RequestReceiver.java Tue Jan 15 11:38:58 2013 -0500 +++ b/agent/command/src/main/java/com/redhat/thermostat/agent/command/RequestReceiver.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,6 +36,7 @@ package com.redhat.thermostat.agent.command; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.common.command.Request; import com.redhat.thermostat.common.command.Response; @@ -48,6 +49,7 @@ * * @see ReceiverRegistry#registerReceiver(RequestReceiver) */ +@ExtensionPoint public interface RequestReceiver { public Response receive(Request request); diff -r 421d8a954893 -r 03948c38134a agent/core/src/main/java/com/redhat/thermostat/agent/VmStatusListener.java --- a/agent/core/src/main/java/com/redhat/thermostat/agent/VmStatusListener.java Tue Jan 15 11:38:58 2013 -0500 +++ b/agent/core/src/main/java/com/redhat/thermostat/agent/VmStatusListener.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,13 +36,15 @@ package com.redhat.thermostat.agent; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** * A listener that is notified when a JVM starts or is stopped. *

* Register an instance of this class as an OSGi service, and it will be * notified of all VM {@link Status} events. */ -//@ExtensionPoint +@ExtensionPoint public interface VmStatusListener { enum Status { diff -r 421d8a954893 -r 03948c38134a agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java --- a/agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java Tue Jan 15 11:38:58 2013 -0500 +++ b/agent/core/src/main/java/com/redhat/thermostat/backend/Backend.java Tue Jan 15 13:00:50 2013 -0500 @@ -40,6 +40,7 @@ import java.util.Map; import java.util.Map.Entry; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.common.LaunchException; import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.common.dao.DAOFactory; @@ -48,7 +49,11 @@ /** * Represents a plugin that runs on the agent and performs monitoring of host * and applications. + *

+ * To register a new backend, register an instance of the class with the OSGi + * service registry. */ +@ExtensionPoint public abstract class Backend implements Ordered { private boolean initialConfigurationComplete = false; diff -r 421d8a954893 -r 03948c38134a annotations/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annotations/pom.xml Tue Jan 15 13:00:50 2013 -0500 @@ -0,0 +1,104 @@ + + + + 4.0.0 + + + com.redhat.thermostat + thermostat + 0.5.0-SNAPSHOT + + + thermostat-annotations + bundle + + Thermostat Annotations + ${project.parent.url} + + + + + org.apache.felix + maven-bundle-plugin + true + + + com.redhat.thermostat.annotations + Red Hat, Inc. + + com.redhat.thermostat.annotations, + + + com.redhat.thermostat.annotations.internal, + + + <_nouses>true + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + -proc:none + + + + + + + + + + junit + junit + test + + + org.mockito + mockito-core + test + + + + diff -r 421d8a954893 -r 03948c38134a annotations/src/main/java/com/redhat/thermostat/annotations/ExtensionPoint.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annotations/src/main/java/com/redhat/thermostat/annotations/ExtensionPoint.java Tue Jan 15 13:00:50 2013 -0500 @@ -0,0 +1,57 @@ +/* + * Copyright 2013 Red Hat, Inc. + * + * This file is part of Thermostat. + * + * Thermostat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * Thermostat is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Thermostat; see the file COPYING. If not see + * . + * + * Linking this code with other modules is making a combined work + * based on this code. Thus, the terms and conditions of the GNU + * General Public License cover the whole combination. + * + * As a special exception, the copyright holders of this code give + * you permission to link this code with independent modules to + * produce an executable, regardless of the license terms of these + * independent modules, and to copy and distribute the resulting + * executable under terms of your choice, provided that you also + * meet, for each linked independent module, the terms and conditions + * of the license of that module. An independent module is a module + * which is not derived from or based on this code. If you modify + * this code, you may extend this exception to your version of the + * library, but you are not obligated to do so. If you do not wish + * to do so, delete this exception statement from your version. + */ + +package com.redhat.thermostat.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Indicates a point where the functionality can be extended by a plugin. + * To register the plugin, register a new instance of the class annotated by + * {@link ExtensionPoint} as an OSGi service. + *

+ * To register a class as an OSGi service, use + * {@link BundleContext#registerService}. + *

+ * This is the whiteboard pattern. + */ +@Documented +@Retention(RetentionPolicy.SOURCE) +public @interface ExtensionPoint { + +} diff -r 421d8a954893 -r 03948c38134a annotations/src/main/java/com/redhat/thermostat/annotations/Service.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annotations/src/main/java/com/redhat/thermostat/annotations/Service.java Tue Jan 15 13:00:50 2013 -0500 @@ -0,0 +1,58 @@ +/* + * Copyright 2013 Red Hat, Inc. + * + * This file is part of Thermostat. + * + * Thermostat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * Thermostat is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Thermostat; see the file COPYING. If not see + * . + * + * Linking this code with other modules is making a combined work + * based on this code. Thus, the terms and conditions of the GNU + * General Public License cover the whole combination. + * + * As a special exception, the copyright holders of this code give + * you permission to link this code with independent modules to + * produce an executable, regardless of the license terms of these + * independent modules, and to copy and distribute the resulting + * executable under terms of your choice, provided that you also + * meet, for each linked independent module, the terms and conditions + * of the license of that module. An independent module is a module + * which is not derived from or based on this code. If you modify + * this code, you may extend this exception to your version of the + * library, but you are not obligated to do so. If you do not wish + * to do so, delete this exception statement from your version. + */ + +package com.redhat.thermostat.annotations; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +/** + * Indicates that the annotated class is a service available through OSGi. + * Clients can obtain an instance of this service and use it directly. + *

+ * An instance of this service (if one is registered) can be obtained using + * {@link BundleContext#getService(ServiceReference)} or + * {@link OSGIUtils#getService(Class)}. + *

+ * This does not infer any behaviour on a class; this is for documentation + * purposes only. + */ +@Documented +@Retention(RetentionPolicy.SOURCE) +public @interface Service { + +} diff -r 421d8a954893 -r 03948c38134a annotations/src/main/java/com/redhat/thermostat/annotations/internal/AnnotationProcessor.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annotations/src/main/java/com/redhat/thermostat/annotations/internal/AnnotationProcessor.java Tue Jan 15 13:00:50 2013 -0500 @@ -0,0 +1,167 @@ +/* + * Copyright 2013 Red Hat, Inc. + * + * This file is part of Thermostat. + * + * Thermostat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * Thermostat is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Thermostat; see the file COPYING. If not see + * . + * + * Linking this code with other modules is making a combined work + * based on this code. Thus, the terms and conditions of the GNU + * General Public License cover the whole combination. + * + * As a special exception, the copyright holders of this code give + * you permission to link this code with independent modules to + * produce an executable, regardless of the license terms of these + * independent modules, and to copy and distribute the resulting + * executable under terms of your choice, provided that you also + * meet, for each linked independent module, the terms and conditions + * of the license of that module. An independent module is a module + * which is not derived from or based on this code. If you modify + * this code, you may extend this exception to your version of the + * library, but you are not obligated to do so. If you do not wish + * to do so, delete this exception statement from your version. + */ + +package com.redhat.thermostat.annotations.internal; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.annotation.processing.AbstractProcessor; +import javax.annotation.processing.ProcessingEnvironment; +import javax.annotation.processing.RoundEnvironment; +import javax.annotation.processing.SupportedAnnotationTypes; +import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; +import javax.lang.model.element.Element; +import javax.lang.model.element.TypeElement; +import javax.tools.Diagnostic.Kind; +import javax.tools.FileObject; +import javax.tools.StandardLocation; + +/** + * An annotation processor that runs and finds @Service and @ExtensionPoint + * annotations. A list of classes using these annotations are written to + * a META-INF/thermostat/plugin-docs.xml file. + */ +@SupportedAnnotationTypes("com.redhat.thermostat.*") +@SupportedSourceVersion(SourceVersion.RELEASE_7) +public class AnnotationProcessor extends AbstractProcessor { + + private enum ExposedAs { EXTENSION_POINT, SERVICE } + + private boolean firstRound = false; + + @Override + public synchronized void init(ProcessingEnvironment processingEnv) { + super.init(processingEnv); + firstRound = true; + } + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + if (!firstRound) { + return false; + } + + firstRound = false; + + processingEnv.getMessager().printMessage(Kind.NOTE, "Searching for Service and ExtensionPoint annotations"); + + List points = findPluginPoints(annotations, roundEnv); + + processingEnv.getMessager().printMessage(Kind.NOTE, "found " + points.size() + " classes useful for plugins"); + + Element[] sourceElements = new Element[points.size()]; + for (int i = 0; i < points.size(); i++) { + sourceElements[i] = points.get(i).annotatedClass; + } + + if (points.size() > 0) { + try { + FileObject filer = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, + "", + "META-INF" + File.separator + "thermostat" + File.separator + "plugin-docs.xml", + sourceElements); + try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(filer.openOutputStream(), "UTF-8"))) { + writeXml(writer, points); + } + } catch (IOException e) { + processingEnv.getMessager().printMessage(Kind.ERROR, "Error writing to docs file: " + e.getMessage()); + } + } + + return false; + } + + private List findPluginPoints(Set annotations, RoundEnvironment roundEnv) { + List pluginPointInfo = new ArrayList<>(); + + for (TypeElement annotation : annotations) { + ExposedAs exposedType = null; + if (annotation.getSimpleName().toString().contains("Service")) { + exposedType = ExposedAs.SERVICE; + } else if (annotation.getSimpleName().toString().contains("ExtensionPoint")) { + exposedType = ExposedAs.EXTENSION_POINT; + } else { + processingEnv.getMessager().printMessage(Kind.WARNING, "Unrecognized annotation: " + annotation.getSimpleName()); + continue; + } + + Set elements = roundEnv.getElementsAnnotatedWith(annotation); + for (Element element : elements) { + TypeElement te = (TypeElement) element; + pluginPointInfo.add(new PluginPointInformation(te, exposedType, processingEnv.getElementUtils().getDocComment(te))); + } + } + return pluginPointInfo; + } + + private void writeXml(PrintWriter writer, List points) { + writer.println(""); + + writer.println(""); + + for (PluginPointInformation info: points) { + String tag = info.exposedAs == ExposedAs.SERVICE ? "service" : "extension-point"; + + writer.println(" <" + tag + ">"); + writer.println(" " + info.annotatedClass.getQualifiedName() + ""); + if (info.javadoc != null) { + writer.println(" "); + } + writer.println(" "); + } + } + + private static class PluginPointInformation { + private TypeElement annotatedClass; + private ExposedAs exposedAs; + private String javadoc; + + public PluginPointInformation(TypeElement annotatedClass, ExposedAs exposedAs, String javadoc) { + this.annotatedClass = annotatedClass; + this.exposedAs = exposedAs; + this.javadoc = javadoc; + } + } +} diff -r 421d8a954893 -r 03948c38134a annotations/src/main/resources/META-INF/services/javax.annotation.processing.Processor --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annotations/src/main/resources/META-INF/services/javax.annotation.processing.Processor Tue Jan 15 13:00:50 2013 -0500 @@ -0,0 +1,2 @@ +# This jar provides the following annotation processors: +com.redhat.thermostat.annotations.internal.AnnotationProcessor diff -r 421d8a954893 -r 03948c38134a annotations/src/test/java/com/redhat/thermostat/annotations/internal/AnnotationProcessorTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annotations/src/test/java/com/redhat/thermostat/annotations/internal/AnnotationProcessorTest.java Tue Jan 15 13:00:50 2013 -0500 @@ -0,0 +1,205 @@ +/* + * Copyright 2013 Red Hat, Inc. + * + * This file is part of Thermostat. + * + * Thermostat is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2, or (at your + * option) any later version. + * + * Thermostat is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Thermostat; see the file COPYING. If not see + * . + * + * Linking this code with other modules is making a combined work + * based on this code. Thus, the terms and conditions of the GNU + * General Public License cover the whole combination. + * + * As a special exception, the copyright holders of this code give + * you permission to link this code with independent modules to + * produce an executable, regardless of the license terms of these + * independent modules, and to copy and distribute the resulting + * executable under terms of your choice, provided that you also + * meet, for each linked independent module, the terms and conditions + * of the license of that module. An independent module is a module + * which is not derived from or based on this code. If you modify + * this code, you may extend this exception to your version of the + * library, but you are not obligated to do so. If you do not wish + * to do so, delete this exception statement from your version. + */ + +package com.redhat.thermostat.annotations.internal; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verifyZeroInteractions; +import static org.mockito.Mockito.when; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; +import java.util.TreeSet; + +import javax.annotation.processing.Filer; +import javax.annotation.processing.Messager; +import javax.annotation.processing.ProcessingEnvironment; +import javax.annotation.processing.RoundEnvironment; +import javax.lang.model.element.Element; +import javax.lang.model.element.Name; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; +import javax.tools.FileObject; +import javax.tools.StandardLocation; + +import org.junit.Before; +import org.junit.Test; + +import com.redhat.thermostat.annotations.ExtensionPoint; +import com.redhat.thermostat.annotations.Service; + +public class AnnotationProcessorTest { + + private ProcessingEnvironment processingEnv; + private RoundEnvironment roundEnv; + private FileObject procesorOutputFile; + private Messager messager; + private Elements elementUtils; + + private static final String AUTO_GENERATED_COMMENT = ""; + + @Before + public void setUp() throws IOException { + procesorOutputFile = mock(FileObject.class); + Filer filer = mock(Filer.class); + when(filer.createResource( + eq(StandardLocation.CLASS_OUTPUT), + eq(""), + eq("META-INF/thermostat/plugin-docs.xml"), + any(Element.class))) + .thenReturn(procesorOutputFile); + + messager = mock(Messager.class); + + elementUtils = mock(Elements.class); + + processingEnv = mock(ProcessingEnvironment.class); + when(processingEnv.getFiler()).thenReturn(filer); + when(processingEnv.getMessager()).thenReturn(messager); + when(processingEnv.getElementUtils()).thenReturn(elementUtils); + + roundEnv = mock(RoundEnvironment.class); + } + + @Test + public void testNoAnnotationProducesNoFile() { + Set annotations = new TreeSet<>(); + + AnnotationProcessor processor = new AnnotationProcessor(); + processor.init(processingEnv); + processor.process(annotations, roundEnv); + + verifyZeroInteractions(procesorOutputFile); + } + + @Test + public void testProcessOnServiceClass() throws IOException { + final String CLASS_NAME = "c.r.t.annotations.Test"; + final String JAVADOC = "some javadoc"; + final String ANNOTATION_CLASS_NAME = Service.class.getName(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + when(procesorOutputFile.openOutputStream()).thenReturn(out); + + TypeElement serviceAnnotation = mock(TypeElement.class); + Name serviceAnnotationName = mock(Name.class); + when(serviceAnnotationName.toString()).thenReturn(ANNOTATION_CLASS_NAME); + when(serviceAnnotation.getSimpleName()).thenReturn(serviceAnnotationName); + + TypeElement annotatedClass = mock(TypeElement.class); + Name annotatedClassName = mock(Name.class); + when(annotatedClass.getQualifiedName()).thenReturn(annotatedClassName); + when(annotatedClassName.toString()).thenReturn(CLASS_NAME); + + Set annotations = new HashSet(); + annotations.add(serviceAnnotation); + + Set annotatedClasses = new HashSet(); + annotatedClasses.add(annotatedClass); + + when(roundEnv.getElementsAnnotatedWith(serviceAnnotation)).thenReturn(annotatedClasses); + + when(elementUtils.getDocComment(annotatedClass)).thenReturn(JAVADOC); + + AnnotationProcessor processor = new AnnotationProcessor(); + processor.init(processingEnv); + processor.process(annotations, roundEnv); + + String actualFileContents = out.toString("UTF-8"); + String expectedFileContents = "\n" + + AUTO_GENERATED_COMMENT + "\n" + + " \n" + + " " + CLASS_NAME + "\n" + + " \n" + + " \n" + + ""; + + assertEquals(expectedFileContents, actualFileContents); + } + + @Test + public void testProcessOnExtensionPointClass() throws IOException { + final String CLASS_NAME = "c.r.t.annotations.Test"; + final String JAVADOC = "some javadoc"; + final String ANNOTATION_CLASS_NAME = ExtensionPoint.class.getName(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + when(procesorOutputFile.openOutputStream()).thenReturn(out); + + TypeElement serviceAnnotation = mock(TypeElement.class); + Name serviceAnnotationName = mock(Name.class); + when(serviceAnnotationName.toString()).thenReturn(ANNOTATION_CLASS_NAME); + when(serviceAnnotation.getSimpleName()).thenReturn(serviceAnnotationName); + + TypeElement annotatedClass = mock(TypeElement.class); + Name annotatedClassName = mock(Name.class); + when(annotatedClass.getQualifiedName()).thenReturn(annotatedClassName); + when(annotatedClassName.toString()).thenReturn(CLASS_NAME); + + Set annotations = new HashSet(); + annotations.add(serviceAnnotation); + + Set annotatedClasses = new HashSet(); + annotatedClasses.add(annotatedClass); + + when(roundEnv.getElementsAnnotatedWith(serviceAnnotation)).thenReturn(annotatedClasses); + + when(elementUtils.getDocComment(annotatedClass)).thenReturn(JAVADOC); + + AnnotationProcessor processor = new AnnotationProcessor(); + processor.init(processingEnv); + processor.process(annotations, roundEnv); + + String actualFileContents = out.toString("UTF-8"); + String expectedFileContents = "\n" + + AUTO_GENERATED_COMMENT + "\n" + + " \n" + + " " + CLASS_NAME + "\n" + + " \n" + + " \n" + + ""; + + assertEquals(expectedFileContents, actualFileContents); + } + +} diff -r 421d8a954893 -r 03948c38134a client/command/src/main/java/com/redhat/thermostat/client/command/RequestQueue.java --- a/client/command/src/main/java/com/redhat/thermostat/client/command/RequestQueue.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/command/src/main/java/com/redhat/thermostat/client/command/RequestQueue.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,6 +36,7 @@ package com.redhat.thermostat.client.command; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.command.Request; /** @@ -45,6 +46,7 @@ * and response (if any) are processed asynchronously. An instance of this can * be obtained from OSGi. */ +@Service public interface RequestQueue { public void putRequest(Request request); diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/core/InformationService.java --- a/client/core/src/main/java/com/redhat/thermostat/client/core/InformationService.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/core/InformationService.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,6 +36,7 @@ package com.redhat.thermostat.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.controllers.InformationServiceController; import com.redhat.thermostat.common.Ordered; import com.redhat.thermostat.common.dao.Ref; @@ -46,7 +47,13 @@ *

* An {@code InformationService} provides some sort of information about * something. Plug-ins should normally implement this as a entry point. + *

+ * To provide an implementation of {@link InformationService}, register an + * instance of this interface as an OSGi service with the property + * {@link Constants#GENERIC_SERVICE_CLASSNAME} set to the name of the Class + * that this {@link InformationService} provides information for. */ +@ExtensionPoint public interface InformationService extends Ordered { /** diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/core/views/AgentInformationViewProvider.java --- a/client/core/src/main/java/com/redhat/thermostat/client/core/views/AgentInformationViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/core/views/AgentInformationViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,9 +36,12 @@ package com.redhat.thermostat.client.core.views; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** - * Provides an AgentInformationViewProvider + * Provides an {@link AgentInformationDisplayView} */ +@ExtensionPoint public interface AgentInformationViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/core/views/ClientConfigViewProvider.java --- a/client/core/src/main/java/com/redhat/thermostat/client/core/views/ClientConfigViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/core/views/ClientConfigViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,9 +36,12 @@ package com.redhat.thermostat.client.core.views; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** * A services that provides {@link ClientConfigurationView}s. */ +@ExtensionPoint public interface ClientConfigViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/core/views/HostInformationViewProvider.java --- a/client/core/src/main/java/com/redhat/thermostat/client/core/views/HostInformationViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/core/views/HostInformationViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,9 +36,12 @@ package com.redhat.thermostat.client.core.views; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** * This services provides an appropriate {@link HostInformationView}. */ +@ExtensionPoint public interface HostInformationViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/core/views/VmInformationViewProvider.java --- a/client/core/src/main/java/com/redhat/thermostat/client/core/views/VmInformationViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/core/views/VmInformationViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,9 +36,12 @@ package com.redhat.thermostat.client.core.views; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** * A service that provides a {@link VmInformationView} */ +@ExtensionPoint public interface VmInformationViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/osgi/service/ContextAction.java --- a/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/ContextAction.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/ContextAction.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,6 +36,8 @@ package com.redhat.thermostat.client.osgi.service; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** * Marker service for context menu actions. *

@@ -56,6 +58,7 @@ * * Exported entry point: com.redhat.thermostat.client.osgi.service.ContextAction */ +@ExtensionPoint public interface ContextAction { String getName(); diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/osgi/service/MenuAction.java --- a/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/MenuAction.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/MenuAction.java Tue Jan 15 13:00:50 2013 -0500 @@ -35,6 +35,8 @@ */ package com.redhat.thermostat.client.osgi.service; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** * Allows plugins to register menu items. *

@@ -42,6 +44,7 @@ * register a service that implements this class with the property * "parentMenu" set to "File". */ +@ExtensionPoint public interface MenuAction extends ContextAction { public static enum Type { diff -r 421d8a954893 -r 03948c38134a client/core/src/main/java/com/redhat/thermostat/client/osgi/service/VMContextAction.java --- a/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/VMContextAction.java Tue Jan 15 11:38:58 2013 -0500 +++ b/client/core/src/main/java/com/redhat/thermostat/client/osgi/service/VMContextAction.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,12 +36,14 @@ package com.redhat.thermostat.client.osgi.service; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.Filter; import com.redhat.thermostat.common.dao.VmRef; /** * A context action for VMs */ +@ExtensionPoint public interface VMContextAction extends ContextAction { void execute(VmRef referece); diff -r 421d8a954893 -r 03948c38134a common/core/pom.xml --- a/common/core/pom.xml Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/pom.xml Tue Jan 15 13:00:50 2013 -0500 @@ -160,6 +160,12 @@ ${java.home}/../lib/tools.jar + com.redhat.thermostat + thermostat-annotations + ${project.version} + compile + + com.redhat.thermostat thermostat-keyring ${project.version} diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/ApplicationService.java --- a/common/core/src/main/java/com/redhat/thermostat/common/ApplicationService.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/ApplicationService.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,6 +38,9 @@ import java.util.concurrent.ExecutorService; +import com.redhat.thermostat.annotations.Service; + +@Service public interface ApplicationService { ApplicationCache getApplicationCache(); diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/CommandLoadingBundleActivator.java --- a/common/core/src/main/java/com/redhat/thermostat/common/CommandLoadingBundleActivator.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/CommandLoadingBundleActivator.java Tue Jan 15 13:00:50 2013 -0500 @@ -45,7 +45,7 @@ import com.redhat.thermostat.common.cli.CommandRegistry; import com.redhat.thermostat.common.cli.CommandRegistryImpl; -/* +/** * Superclass for activators that need to register commands. The bundle for this * activator should contain a META-INF/services/com.redhat.thermostat.common.cli.Command * file containing the class names that should be loaded as commands. If this activator diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/DbService.java --- a/common/core/src/main/java/com/redhat/thermostat/common/DbService.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/DbService.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.common; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.storage.core.ConnectionException; +@Service public interface DbService { /** diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/TimerFactory.java --- a/common/core/src/main/java/com/redhat/thermostat/common/TimerFactory.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/TimerFactory.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,6 +36,9 @@ package com.redhat.thermostat.common; +/** + * An instance of this can be obtained from {@link ApplicationService}. + */ public interface TimerFactory { Timer createTimer(); diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/cli/Command.java --- a/common/core/src/main/java/com/redhat/thermostat/common/cli/Command.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/cli/Command.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,6 +38,8 @@ import org.apache.commons.cli.Options; +import com.redhat.thermostat.annotations.ExtensionPoint; + /** * Represents a command on the command line. *

@@ -51,6 +53,7 @@ *

* @see CommandRegistry */ +@ExtensionPoint public interface Command { public static final String NAME = "COMMAND_NAME"; diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/dao/AgentInfoDAO.java --- a/common/core/src/main/java/com/redhat/thermostat/common/dao/AgentInfoDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/dao/AgentInfoDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,10 +38,12 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.AgentInformation; +@Service public interface AgentInfoDAO extends Countable { static final Key START_TIME_KEY = new Key<>("startTime", false); diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/dao/BackendInfoDAO.java --- a/common/core/src/main/java/com/redhat/thermostat/common/dao/BackendInfoDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/dao/BackendInfoDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,10 +38,12 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.BackendInformation; +@Service public interface BackendInfoDAO { static final Key BACKEND_NAME = new Key<>("name", true); diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/dao/HostInfoDAO.java --- a/common/core/src/main/java/com/redhat/thermostat/common/dao/HostInfoDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/dao/HostInfoDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,10 +38,12 @@ import java.util.Collection; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.HostInfo; +@Service public interface HostInfoDAO extends Countable { static Key hostNameKey = new Key<>("hostname", true); diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAO.java --- a/common/core/src/main/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/dao/NetworkInterfaceInfoDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,10 +38,12 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.NetworkInterfaceInfo; +@Service public interface NetworkInterfaceInfoDAO { static Key ifaceKey = new Key<>("interfaceName", true); diff -r 421d8a954893 -r 03948c38134a common/core/src/main/java/com/redhat/thermostat/common/dao/VmInfoDAO.java --- a/common/core/src/main/java/com/redhat/thermostat/common/dao/VmInfoDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/common/core/src/main/java/com/redhat/thermostat/common/dao/VmInfoDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -40,10 +40,12 @@ import java.util.List; import java.util.Map; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.VmInfo; +@Service public interface VmInfoDAO extends Countable { static final Key vmPidKey = new Key<>("vmPid", false); diff -r 421d8a954893 -r 03948c38134a host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/HostCpuViewProvider.java --- a/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/HostCpuViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/host-cpu/client-core/src/main/java/com/redhat/thermostat/host/cpu/client/core/HostCpuViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.host.cpu.client.core; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.client.core.views.ViewProvider; +@Service public interface HostCpuViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/CpuStatDAO.java --- a/host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/CpuStatDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/host-cpu/common/src/main/java/com/redhat/thermostat/host/cpu/common/CpuStatDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,12 +38,14 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.dao.Countable; import com.redhat.thermostat.common.dao.HostRef; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.CpuStat; +@Service public interface CpuStatDAO extends Countable { static Key> cpuLoadKey = new Key<>("perProcessorUsage", false); diff -r 421d8a954893 -r 03948c38134a host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/HostMemoryViewProvider.java --- a/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/HostMemoryViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/host-memory/client-core/src/main/java/com/redhat/thermostat/host/memory/client/core/HostMemoryViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.host.memory.client.core; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.client.core.views.ViewProvider; +@Service public interface HostMemoryViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/MemoryStatDAO.java --- a/host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/MemoryStatDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/host-memory/common/src/main/java/com/redhat/thermostat/host/memory/common/MemoryStatDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,12 +38,14 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.dao.Countable; import com.redhat.thermostat.common.dao.HostRef; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.MemoryStat; +@Service public interface MemoryStatDAO extends Countable { static Key memoryTotalKey = new Key<>("total", false); diff -r 421d8a954893 -r 03948c38134a host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/HostOverviewViewProvider.java --- a/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/HostOverviewViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/host-overview/client-core/src/main/java/com/redhat/thermostat/host/overview/client/core/HostOverviewViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.host.overview.client.core; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.client.core.views.ViewProvider; +@Service public interface HostOverviewViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a keyring/pom.xml --- a/keyring/pom.xml Tue Jan 15 11:38:58 2013 -0500 +++ b/keyring/pom.xml Tue Jan 15 13:00:50 2013 -0500 @@ -115,6 +115,12 @@ org.osgi.compendium provided - + + + com.redhat.thermostat + thermostat-annotations + ${project.version} + compile + diff -r 421d8a954893 -r 03948c38134a keyring/src/main/java/com/redhat/thermostat/utils/keyring/Keyring.java --- a/keyring/src/main/java/com/redhat/thermostat/utils/keyring/Keyring.java Tue Jan 15 11:38:58 2013 -0500 +++ b/keyring/src/main/java/com/redhat/thermostat/utils/keyring/Keyring.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,9 +36,14 @@ package com.redhat.thermostat.utils.keyring; +import com.redhat.thermostat.annotations.Service; + /** * Manages sensitive data, like {@link Credentials}, securely. + *

+ * An instance of this class can be obtained from OSGi as a service. */ +@Service public interface Keyring { /** diff -r 421d8a954893 -r 03948c38134a launcher/src/main/java/com/redhat/thermostat/launcher/BundleManager.java --- a/launcher/src/main/java/com/redhat/thermostat/launcher/BundleManager.java Tue Jan 15 11:38:58 2013 -0500 +++ b/launcher/src/main/java/com/redhat/thermostat/launcher/BundleManager.java Tue Jan 15 13:00:50 2013 -0500 @@ -42,6 +42,7 @@ import org.osgi.framework.BundleException; import org.osgi.framework.launch.Framework; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.Configuration; import com.redhat.thermostat.common.cli.CommandInfoNotFoundException; import com.redhat.thermostat.common.cli.CommandInfoSource; @@ -50,6 +51,7 @@ /** * A Service that provides features to load bundles for given command names. */ +@Service public abstract class BundleManager { public abstract void setPrintOSGiInfo(boolean printOSGiInfo); diff -r 421d8a954893 -r 03948c38134a launcher/src/main/java/com/redhat/thermostat/launcher/Launcher.java --- a/launcher/src/main/java/com/redhat/thermostat/launcher/Launcher.java Tue Jan 15 11:38:58 2013 -0500 +++ b/launcher/src/main/java/com/redhat/thermostat/launcher/Launcher.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,12 +38,14 @@ import java.util.Collection; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.ActionListener; import com.redhat.thermostat.common.tools.ApplicationState; /** * Launcher is the main entry point for all Thermostat commands. */ +@Service public interface Launcher { /** diff -r 421d8a954893 -r 03948c38134a pom.xml --- a/pom.xml Tue Jan 15 11:38:58 2013 -0500 +++ b/pom.xml Tue Jan 15 13:00:50 2013 -0500 @@ -117,6 +117,7 @@ + annotations distribution main launcher diff -r 421d8a954893 -r 03948c38134a storage/core/pom.xml --- a/storage/core/pom.xml Tue Jan 15 11:38:58 2013 -0500 +++ b/storage/core/pom.xml Tue Jan 15 13:00:50 2013 -0500 @@ -84,6 +84,12 @@ org.apache.felix org.apache.felix.framework + + com.redhat.thermostat + thermostat-annotations + ${project.version} + compile + diff -r 421d8a954893 -r 03948c38134a storage/core/src/main/java/com/redhat/thermostat/storage/core/Storage.java --- a/storage/core/src/main/java/com/redhat/thermostat/storage/core/Storage.java Tue Jan 15 11:38:58 2013 -0500 +++ b/storage/core/src/main/java/com/redhat/thermostat/storage/core/Storage.java Tue Jan 15 13:00:50 2013 -0500 @@ -39,6 +39,7 @@ import java.io.InputStream; import java.util.UUID; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.storage.model.Pojo; /** @@ -46,6 +47,7 @@ * Implementations may use memory, a file, some database or even a network * server as the backing store. */ +@Service public interface Storage { void setAgentId(UUID id); diff -r 421d8a954893 -r 03948c38134a unix-process-handler/src/main/java/com/redhat/thermostat/service/process/UNIXProcessHandler.java --- a/unix-process-handler/src/main/java/com/redhat/thermostat/service/process/UNIXProcessHandler.java Tue Jan 15 11:38:58 2013 -0500 +++ b/unix-process-handler/src/main/java/com/redhat/thermostat/service/process/UNIXProcessHandler.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,6 +36,9 @@ package com.redhat.thermostat.service.process; +import com.redhat.thermostat.annotations.Service; + +@Service public interface UNIXProcessHandler { public static String ID = "com.redhat.thermostat.service.process.UNIXProcessHandler"; diff -r 421d8a954893 -r 03948c38134a vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/VmClassStatViewProvider.java --- a/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/VmClassStatViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-classstat/client-core/src/main/java/com/redhat/thermostat/vm/classstat/client/core/VmClassStatViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,9 +36,10 @@ package com.redhat.thermostat.vm.classstat.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; - +@ExtensionPoint public interface VmClassStatViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/VmClassStatDAO.java --- a/vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/VmClassStatDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-classstat/common/src/main/java/com/redhat/thermostat/vm/classstat/common/VmClassStatDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,11 +38,13 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.dao.VmRef; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.VmClassStat; +@Service public interface VmClassStatDAO { static final Key loadedClassesKey = new Key<>("loadedClasses", false); @@ -54,4 +56,4 @@ public void putVmClassStat(VmClassStat stat); -} \ No newline at end of file +} diff -r 421d8a954893 -r 03948c38134a vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/VmCpuViewProvider.java --- a/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/VmCpuViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-cpu/client-core/src/main/java/com/redhat/thermostat/vm/cpu/client/core/VmCpuViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.cpu.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface VmCpuViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/VmCpuStatDAO.java --- a/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/VmCpuStatDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-cpu/common/src/main/java/com/redhat/thermostat/vm/cpu/common/VmCpuStatDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,11 +38,13 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.dao.VmRef; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.VmCpuStat; +@Service public interface VmCpuStatDAO { static final Key vmCpuLoadKey = new Key<>("cpuLoad", false); diff -r 421d8a954893 -r 03948c38134a vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/VmGcViewProvider.java --- a/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/VmGcViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-gc/client-core/src/main/java/com/redhat/thermostat/vm/gc/client/core/VmGcViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.gc.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface VmGcViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/VmGcStatDAO.java --- a/vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/VmGcStatDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-gc/common/src/main/java/com/redhat/thermostat/vm/gc/common/VmGcStatDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,11 +38,13 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.dao.VmRef; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.VmGcStat; +@Service public interface VmGcStatDAO { static final Key collectorKey = new Key<>("collectorName", false); diff -r 421d8a954893 -r 03948c38134a vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapDumpDetailsViewProvider.java --- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapDumpDetailsViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapDumpDetailsViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.heap.analysis.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface HeapDumpDetailsViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapHistogramViewProvider.java --- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapHistogramViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapHistogramViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.heap.analysis.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface HeapHistogramViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapViewProvider.java --- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/HeapViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.heap.analysis.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface HeapViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/ObjectDetailsViewProvider.java --- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/ObjectDetailsViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/ObjectDetailsViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.heap.analysis.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface ObjectDetailsViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/ObjectRootsViewProvider.java --- a/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/ObjectRootsViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-heap-analysis/client-core/src/main/java/com/redhat/thermostat/vm/heap/analysis/client/core/ObjectRootsViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.heap.analysis.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface ObjectRootsViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/HeapDAO.java --- a/vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/HeapDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-heap-analysis/common/src/main/java/com/redhat/thermostat/vm/heap/analysis/common/HeapDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -41,11 +41,13 @@ import java.io.InputStream; import java.util.Collection; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.dao.VmRef; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.HeapInfo; +@Service public interface HeapDAO { static final Key heapIdKey = new Key("heapId", false); diff -r 421d8a954893 -r 03948c38134a vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/MemoryStatsViewProvider.java --- a/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/MemoryStatsViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-memory/client-core/src/main/java/com/redhat/thermostat/vm/memory/client/core/MemoryStatsViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.memory.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface MemoryStatsViewProvider extends ViewProvider { @Override diff -r 421d8a954893 -r 03948c38134a vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/VmMemoryStatDAO.java --- a/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/VmMemoryStatDAO.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-memory/common/src/main/java/com/redhat/thermostat/vm/memory/common/VmMemoryStatDAO.java Tue Jan 15 13:00:50 2013 -0500 @@ -38,12 +38,14 @@ import java.util.List; +import com.redhat.thermostat.annotations.Service; import com.redhat.thermostat.common.dao.VmRef; import com.redhat.thermostat.storage.core.Category; import com.redhat.thermostat.storage.core.Key; import com.redhat.thermostat.storage.model.VmMemoryStat; import com.redhat.thermostat.storage.model.VmMemoryStat.Generation; +@Service public interface VmMemoryStatDAO { static final Key generationsKey = new Key<>("generations", false); diff -r 421d8a954893 -r 03948c38134a vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/VmOverviewViewProvider.java --- a/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/VmOverviewViewProvider.java Tue Jan 15 11:38:58 2013 -0500 +++ b/vm-overview/client-core/src/main/java/com/redhat/thermostat/vm/overview/client/core/VmOverviewViewProvider.java Tue Jan 15 13:00:50 2013 -0500 @@ -36,8 +36,10 @@ package com.redhat.thermostat.vm.overview.client.core; +import com.redhat.thermostat.annotations.ExtensionPoint; import com.redhat.thermostat.client.core.views.ViewProvider; +@ExtensionPoint public interface VmOverviewViewProvider extends ViewProvider { @Override