Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

METRICS-3054(related): Use singleton pattern for exported tomcat plug…

…in analyzers and generators
  • Loading branch information...
commit a0a485ace051832f541f729d02fd592d45b832f6 1 parent 31f27a7
@lgoldstein lgoldstein authored
View
27 collection-plugins/tomcat/build.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="insight-plugin-tomcat" default="install">
+ <description>
+ Provides some useful ANT tasks involving the entire project
+ </description>
+
+ <dirname property="module.root.folder" file="${ant.file}" />
+ <dirname property="collection.plugins.folder" file="${module.root.folder}" />
+ <dirname property="insight.community.folder" file="${collection.plugins.folder}" />
+ <dirname property="insight.root.folder" file="${insight.community.folder}" />
+ <property name="insight.parent.folder" value="${insight.root.folder}${file.separator}parent" />
+ <property name="module.artifact.name" value="${ant.project.name}" />
+ <import file="${insight.parent.folder}${file.separator}build-insight.xml" />
+
+ <target name="compile" depends="run-module-mvn" description="Runs the mvn install command - including all the tests" />
+ <target name="uncompile" depends="clean-module-mvn" description="Runs the mvn clean command - including un-install the artifact from Maven local repository" />
+
+ <!-- ############### Generic targets ############## -->
+ <target name="install" depends="compile,copy-collection-plugin-artifact"
+ description="Compiles (including all the tests) and deploys the required artifacts" />
+
+ <target name="clean" depends="clean-module-mvn,clean-collection-plugin-artifact"
+ description="Runs the mvn clean command + undeploys the generated artifacts" />
+
+ <target name="re-install" depends="clean,install"
+ description="Cleans the artifacts and re-creates them from scratch (including all the tests)" />
+</project>
View
11 ...ugins/tomcat/src/main/java/com/springsource/insight/plugin/tomcat/jsp/TomcatPluginRuntimeDescriptor.java
@@ -21,10 +21,16 @@
public class TomcatPluginRuntimeDescriptor extends PluginRuntimeDescriptor {
public static final String PLUGIN_NAME = "tomcat";
- public TomcatPluginRuntimeDescriptor () {
+ private static final TomcatPluginRuntimeDescriptor INSTANCE=new TomcatPluginRuntimeDescriptor();
+
+ private TomcatPluginRuntimeDescriptor () {
super();
}
-
+
+ public static final TomcatPluginRuntimeDescriptor getInstance() {
+ return INSTANCE;
+ }
+
@Override
public EndPointAnalyzer[] getEndPointAnalyzers() {
return null;
@@ -34,5 +40,4 @@ public TomcatPluginRuntimeDescriptor () {
public String getPluginName() {
return PLUGIN_NAME;
}
-
}
View
6 collection-plugins/tomcat/src/main/resources/META-INF/insight-plugin-tomcat.xml
@@ -10,4 +10,10 @@
<insight:operation-view operation="jsp-compiler" template="com/springsource/insight/plugin/tomcat/jsp/jsp-compiler.ftl"/>
<insight:operation-group group="Web" operation="jsp-compiler" />
+
+ <bean id="tomcatPluginRuntimeDescriptor"
+ class="com.springsource.insight.plugin.tomcat.jsp.TomcatPluginRuntimeDescriptor"
+ factory-method="getInstance"
+ lazy-init="true"
+ />
</beans>
Please sign in to comment.
Something went wrong with that request. Please try again.