Class ShowServiceGraphConsolePlugin
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.composum.sling.nodes.consoleplugin.ShowServiceGraphConsolePlugin
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class ShowServiceGraphConsolePlugin extends javax.servlet.http.HttpServlet
Plots a graph of service usages. Use as console plugin: http://localhost:9090/system/console/servicegraph. Use with graphviz tools http://graphviz.org/ e.g. with
curl -u admin:admin 'http://localhost:9090/system/console/servicegraph.dot?classregex=%5Ecom.composum&type=dotty&bundle=true' | ccomps -x | unflatten -f -l 6 -c 3 | dot | gvpack | neato -Tpng -n2 > $TMPDIR/services.png ; open $TMPDIR/services.png
- See Also:
- "https://github.com/magjac/d3-graphviz", Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.framework.BundleContext
bundleContext
protected static String
LOC_CSS
Location for the CSS.static String
PARAM_BUNDLE
Parameter that determines whether we should insert the bundles as subgraphs in dotty.static String
PARAM_CLASSREGEX
A regex to limit the service classes to.static String
PARAM_TYPE
Parameter that gives the type of the output: text or dotty / gv.
-
Constructor Summary
Constructors Constructor Description ShowServiceGraphConsolePlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static void
collectReferredClasses(Type type, List<Class> referredClasses, Set<Type> visited)
protected void
doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected void
writeForm(PrintWriter writer, javax.servlet.http.HttpServletRequest request, String classRegex)
protected void
writeReferences(PrintWriter writer, Map<Class<?>,org.osgi.framework.ServiceReference<?>> classes, Pattern classPattern, boolean showBundles)
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
-
-
-
-
Field Detail
-
PARAM_CLASSREGEX
public static final String PARAM_CLASSREGEX
A regex to limit the service classes to. Default:^com.composum
.- See Also:
- Constant Field Values
-
PARAM_TYPE
public static final String PARAM_TYPE
Parameter that gives the type of the output: text or dotty / gv. Default: dotty.- See Also:
- Constant Field Values
-
PARAM_BUNDLE
public static final String PARAM_BUNDLE
Parameter that determines whether we should insert the bundles as subgraphs in dotty.- See Also:
- Constant Field Values
-
LOC_CSS
protected static final String LOC_CSS
Location for the CSS.- See Also:
- Constant Field Values
-
bundleContext
protected org.osgi.framework.BundleContext bundleContext
-
-
Method Detail
-
writeForm
protected void writeForm(PrintWriter writer, javax.servlet.http.HttpServletRequest request, String classRegex)
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
writeReferences
protected void writeReferences(PrintWriter writer, Map<Class<?>,org.osgi.framework.ServiceReference<?>> classes, Pattern classPattern, boolean showBundles)
-
-