[jboss-cvs] JBossAS SVN: r90851 - in projects/mc-tools/grapher/trunk: src and 9 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 6 12:22:37 EDT 2009


Author: alesj
Date: 2009-07-06 12:22:37 -0400 (Mon, 06 Jul 2009)
New Revision: 90851

Added:
   projects/mc-tools/grapher/trunk/pom.xml
   projects/mc-tools/grapher/trunk/src/
   projects/mc-tools/grapher/trunk/src/main/
   projects/mc-tools/grapher/trunk/src/main/java/
   projects/mc-tools/grapher/trunk/src/main/java/org/
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/GrapherServlet.java
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AbstractRenderer.java
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AllRenderer.java
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/BeanRenderer.java
   projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/Renderer.java
   projects/mc-tools/grapher/trunk/src/main/webapp/
   projects/mc-tools/grapher/trunk/src/main/webapp/WEB-INF/
   projects/mc-tools/grapher/trunk/src/main/webapp/WEB-INF/web.xml
Log:
Initial Grapher commit.

Added: projects/mc-tools/grapher/trunk/pom.xml
===================================================================
--- projects/mc-tools/grapher/trunk/pom.xml	                        (rev 0)
+++ projects/mc-tools/grapher/trunk/pom.xml	2009-07-06 16:22:37 UTC (rev 90851)
@@ -0,0 +1,138 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.jboss</groupId>
+    <artifactId>jboss-parent</artifactId>
+    <version>4</version>
+  </parent>
+  <groupId>org.jboss.microcontainer.tools</groupId>
+  <artifactId>grapher</artifactId>
+  <packaging>war</packaging>
+  <version>0.0.1-SNAPSHOT</version>
+  <name>JBoss Microcontainer Tools</name>
+  <url>http://www.jboss.com/products/jbossmc</url>
+  <description>JBoss Microcontainer tools.</description>
+  <scm>
+    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/mc-tools/grapher/trunk</connection>
+    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/mc-tools/grapher/trunk</developerConnection>    
+  </scm>
+   
+  <dependencies>
+    <dependency>
+       <groupId>batik</groupId>
+       <artifactId>batik-svg-dom</artifactId>
+       <version>1.6</version>
+    </dependency>
+    <dependency>
+       <groupId>batik</groupId>
+       <artifactId>batik-svggen</artifactId>
+       <version>1.6</version>
+    </dependency>
+    <dependency>
+       <groupId>batik</groupId>
+       <artifactId>batik-util</artifactId>
+       <version>1.6</version>
+    </dependency>
+    <dependency>
+       <groupId>batik</groupId>
+       <artifactId>batik-dom</artifactId>
+       <version>1.6</version>
+    </dependency>
+    <dependency>
+       <groupId>batik</groupId>
+       <artifactId>batik-awt-util</artifactId>
+       <version>1.6</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jgraph</groupId>
+      <artifactId>jgraph</artifactId>
+      <version>5.12.4</version>
+    </dependency>
+
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-common-core</artifactId>
+      <version>2.2.14.GA</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.microcontainer</groupId>
+      <artifactId>jboss-kernel</artifactId>
+      <version>2.0.7.GA</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+       <groupId>jboss.web</groupId>
+       <artifactId>servlet-api</artifactId>
+       <version>2.1.2.GA</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+       <groupId>org.jboss.mc-int</groupId>
+       <artifactId>jboss-mc-int-servlet</artifactId>
+       <version>2.2.0.Alpha1</version>
+       <exclusions>
+         <exclusion>
+           <groupId>org.jboss.deployers</groupId>
+           <artifactId>jboss-deployers-vfs-spi</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>apache-xerces</groupId>
+           <artifactId>xml-apis</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss</groupId>
+           <artifactId>jboss-vfs</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss</groupId>
+           <artifactId>jboss-common-core</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.logging</groupId>
+           <artifactId>jboss-logging-spi</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.logging</groupId>
+           <artifactId>jboss-logging-log4j</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.microcontainer</groupId>
+           <artifactId>jboss-dependency</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.deployers</groupId>
+           <artifactId>jboss-deployers-spi</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.deployers</groupId>
+           <artifactId>jboss-deployers-structure-spi</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.deployers</groupId>
+           <artifactId>jboss-deployers-vfs</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.deployers</groupId>
+           <artifactId>jboss-deployers-core-spi</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>org.jboss.microcontainer</groupId>
+           <artifactId>jboss-kernel</artifactId>
+         </exclusion>
+         <exclusion>
+           <groupId>javax.servlet</groupId>
+           <artifactId>servlet-api</artifactId>
+         </exclusion>
+       </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-log4j</artifactId>
+      <version>2.0.5.GA</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+  
+</project>
\ No newline at end of file

Added: projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/GrapherServlet.java
===================================================================
--- projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/GrapherServlet.java	                        (rev 0)
+++ projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/GrapherServlet.java	2009-07-06 16:22:37 UTC (rev 90851)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mctools.grapher;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.mc.servlet.vdf.api.KernelControllerVDFConnector;
+import org.jboss.mctools.grapher.render.AllRenderer;
+import org.jboss.mctools.grapher.render.BeanRenderer;
+import org.jboss.mctools.grapher.render.Renderer;
+
+/**
+ * Grapher servlet.
+ *
+ * It knows how to render all of MC components,
+ * or you can specify just a single bean via parameter.
+ * e.g. grapher/?bean=TransactionManager
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class GrapherServlet extends HttpServlet
+{
+   private KernelController controller;
+   private Renderer ALL = new AllRenderer();
+
+   @Override
+   public void init(ServletConfig config) throws ServletException
+   {
+      ServletContext context = config.getServletContext();
+      KernelControllerVDFConnector connector = new KernelControllerVDFConnector(context);
+      if (connector.isValid() == false)
+         throw new ServletException("Illegal VDF component, no MC Kernel present.");
+
+      controller = connector.getUtility();
+   }
+
+   /**
+    * Do render MC graph.
+    *
+    * @param request the http request
+    * @param response the http response
+    * @throws ServletException the servlet exception
+    * @throws IOException the io exception
+    */
+   protected void doRenderGraph(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+   {
+      String bean = request.getParameter("bean");
+      Renderer renderer;
+      if (bean != null)
+         renderer = new BeanRenderer(bean);
+      else
+         renderer = ALL;
+
+      PrintWriter writer = response.getWriter();
+      try
+      {
+         renderer.render(controller, writer);
+      }
+      finally
+      {
+         writer.close();
+      }
+   }
+
+   @Override
+   protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+   {
+      doRenderGraph(request, response);
+   }
+
+   @Override
+   protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+   {
+      doRenderGraph(request, response);
+   }
+}

Added: projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AbstractRenderer.java
===================================================================
--- projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AbstractRenderer.java	                        (rev 0)
+++ projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AbstractRenderer.java	2009-07-06 16:22:37 UTC (rev 90851)
@@ -0,0 +1,222 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mctools.grapher.render;
+
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.swing.*;
+
+import org.apache.batik.dom.GenericDOMImplementation;
+import org.apache.batik.svggen.SVGGraphics2D;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.dependency.spi.DependencyInfo;
+import org.jboss.dependency.spi.DependencyItem;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jgraph.JGraph;
+import org.jgraph.graph.DefaultEdge;
+import org.jgraph.graph.DefaultGraphCell;
+import org.jgraph.graph.Edge;
+import org.jgraph.graph.GraphConstants;
+import org.w3c.dom.DOMImplementation;
+import org.w3c.dom.Document;
+
+/**
+ * Abstract MC components renderer.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractRenderer implements Renderer
+{
+   public void render(KernelController controller, Writer writer) throws IOException
+   {
+      Map<Object, DefaultGraphCell> cells = new HashMap<Object, DefaultGraphCell>();
+      Set<Object> objects = new HashSet<Object>();
+      render(controller, cells, objects);
+
+      // change to array
+      Object[] graph = new Object[objects.size()];
+      int i = 0;
+      for (Object object : objects)
+         graph[i++] = object;
+
+      render(graph, writer, 0);
+   }
+
+   /**
+    * Do render.
+    *
+    * @param controller the controller
+    * @param cells the cells
+    * @param objects the graph's objects
+    * @throws IOException for any IO exception
+    */
+   protected abstract void render(KernelController controller, Map<Object, DefaultGraphCell> cells, Set<Object> objects) throws IOException;
+
+   /**
+    * Create the cell.
+    *
+    * @param label the cell's label
+    * @return new cell instance
+    */
+   protected DefaultGraphCell createCell(Object label)
+   {
+      DefaultGraphCell cell = new DefaultGraphCell(label);
+      cell.addPort();
+      // TODO - add html link
+      return cell;
+   }
+
+   /**
+    * Render single context.
+    *
+    * @param controller the controller
+    * @param cells the cells
+    * @param objects the graph's objects
+    * @param context the context to render
+    */
+   protected void renderContext(KernelController controller, Map<Object, DefaultGraphCell> cells, Set<Object> objects, ControllerContext context)
+   {
+      DefaultGraphCell owner = getCell(cells, objects, context);
+
+      DependencyInfo info = context.getDependencyInfo();
+      Set<DependencyItem> items = info.getIDependOn(null);
+      if (items != null && items.isEmpty() == false)
+      {
+         for(DependencyItem item : items)
+         {
+            DefaultGraphCell dependency;
+
+            Object iDependOn = item.getIDependOn();
+            if (iDependOn instanceof Class)
+            {
+               ControllerContext cc = controller.getContextByClass(Class.class.cast(iDependOn));
+               dependency = getCell(cells, objects, cc);
+            }
+            else
+            {
+               dependency = cells.get(iDependOn);
+               if (dependency == null)
+               {
+                  dependency = createCell(iDependOn);
+                  cells.put(iDependOn, dependency);
+                  objects.add(dependency);
+               }
+            }
+
+            Edge edge = new DefaultEdge();
+            edge.setSource(owner.getChildAt(0));
+            edge.setTarget(dependency.getChildAt(0));
+
+            int arrow = GraphConstants.ARROW_CLASSIC;
+            GraphConstants.setLineEnd(edge.getAttributes(), arrow);
+            GraphConstants.setEndFill(edge.getAttributes(), true);
+
+            objects.add(edge);
+         }
+      }
+   }
+
+   /**
+    * Get the cell for the param context.
+    *
+    * @param cells the current cells
+    * @param objects all of graph's objects
+    * @param context the context
+    * @return context's cell
+    */
+   protected DefaultGraphCell getCell(Map<Object, DefaultGraphCell> cells, Set<Object> objects, ControllerContext context)
+   {
+      Object name = context.getName();
+      DefaultGraphCell cell = cells.get(name);
+      if (cell == null)
+      {
+         cell = createCell(name);
+         cells.put(name, cell);
+         objects.add(cell);
+         // fill in aliases as well
+         Set<Object> aliases = context.getAliases();
+         if (aliases != null && aliases.isEmpty() == false)
+         {
+            for(Object alias : aliases)
+            {
+               if (cells.containsKey(alias) == false)
+               {
+                  cells.put(alias, cell);
+               }
+            }
+         }
+      }
+
+      enhanceCell(cell, context);
+
+      return cell;
+   }
+
+   /**
+    * Enhance cell rendering.
+    *
+    * @param cell the cell to enhance
+    * @param context the context to get info from
+    */
+   protected void enhanceCell(DefaultGraphCell cell, ControllerContext context)
+   {
+      // TODO - enhance cell rendering with context's info
+   }
+
+   /**
+    * Do render graph.
+    *
+    * @param cells the cells
+    * @param writer the writter
+    * @param inset the inset
+    * @throws IOException for any IO error
+    */
+   protected static void render(Object[] cells, Writer writer, int inset) throws IOException
+   {
+      JGraph graph = new JGraph();
+      graph.getGraphLayoutCache().insert(cells);
+
+      Object[] roots = graph.getRoots();
+      Rectangle2D bounds = graph.toScreen(graph.getCellBounds(roots));
+      if (bounds != null)
+      {
+         // Constructs the svg generator used for painting the graph to
+         DOMImplementation domImpl = GenericDOMImplementation.getDOMImplementation();
+         Document document = domImpl.createDocument(null, "svg", null);
+         SVGGraphics2D svgGenerator = new SVGGraphics2D(document);
+         svgGenerator.translate(-bounds.getX() + inset, -bounds.getY() + inset);
+         // Paints the graph to the svg generator with no double
+         // buffering enabled to make sure we get a vector image.
+         RepaintManager currentManager = RepaintManager.currentManager(graph);
+         currentManager.setDoubleBufferingEnabled(false);
+         graph.paint(svgGenerator);
+         // Writes the graph to the specified file as an SVG stream
+         svgGenerator.stream(writer, false);
+         currentManager.setDoubleBufferingEnabled(true);
+      }
+   }
+}
\ No newline at end of file

Added: projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AllRenderer.java
===================================================================
--- projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AllRenderer.java	                        (rev 0)
+++ projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/AllRenderer.java	2009-07-06 16:22:37 UTC (rev 90851)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mctools.grapher.render;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.dependency.spi.ControllerStateModel;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.dependency.spi.ControllerContext;
+import org.jgraph.graph.DefaultGraphCell;
+
+/**
+ * Render all MC components.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class AllRenderer extends AbstractRenderer
+{
+   protected void render(KernelController controller, Map<Object, DefaultGraphCell> cells, Set<Object> objects) throws IOException
+   {
+      ControllerStateModel model = controller.getStates();
+      for (ControllerState state : model)
+      {
+         Set<ControllerContext> contexts = controller.getContextsByState(state);
+         for (ControllerContext context : contexts)
+         {
+            renderContext(controller, cells, objects, context);
+         }
+      }
+   }
+}

Added: projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/BeanRenderer.java
===================================================================
--- projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/BeanRenderer.java	                        (rev 0)
+++ projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/BeanRenderer.java	2009-07-06 16:22:37 UTC (rev 90851)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mctools.grapher.render;
+
+import java.io.IOException;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jgraph.graph.DefaultGraphCell;
+
+/**
+ * Render single bean.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class BeanRenderer extends AbstractRenderer
+{
+   private Object bean;
+
+   public BeanRenderer(Object bean)
+   {
+      if (bean == null)
+         throw new IllegalArgumentException("Null bean name");
+
+      this.bean = bean;
+   }
+
+   protected void render(KernelController controller, Map<Object, DefaultGraphCell> cells, Set<Object> objects) throws IOException
+   {
+      ControllerContext context = controller.getContext(bean, null);
+      if (context == null)
+         throw new IllegalArgumentException("No such context: " + bean);
+
+      renderContext(controller, cells, objects, context);
+   }
+}
\ No newline at end of file

Added: projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/Renderer.java
===================================================================
--- projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/Renderer.java	                        (rev 0)
+++ projects/mc-tools/grapher/trunk/src/main/java/org/jboss/mctools/grapher/render/Renderer.java	2009-07-06 16:22:37 UTC (rev 90851)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.mctools.grapher.render;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.jboss.kernel.spi.dependency.KernelController;
+
+/**
+ * Renderer interface.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface Renderer
+{
+   /**
+    * Do render.
+    *
+    * @param controller the MC controller
+    * @param writer the writer to rende into
+    * @throws IOException for any error
+    */
+   void render(KernelController controller, Writer writer) throws IOException;
+}

Added: projects/mc-tools/grapher/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- projects/mc-tools/grapher/trunk/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ projects/mc-tools/grapher/trunk/src/main/webapp/WEB-INF/web.xml	2009-07-06 16:22:37 UTC (rev 90851)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5"
+    xmlns="http://java.sun.com/xml/ns/javaee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+	<servlet>
+		<servlet-name>Grapher Servlet</servlet-name>
+		<servlet-class>org.jboss.mctools.grapher.GrapherServlet</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>Grapher Servlet</servlet-name>
+		<url-pattern>*.mc</url-pattern>
+	</servlet-mapping>
+	
+</web-app>




More information about the jboss-cvs-commits mailing list