continuum-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <niko...@active-lynx.com>
Subject Instantiating the ContinuumStore
Date Mon, 19 Nov 2007 10:12:11 GMT
Hi

I am trying to create a kind of a plugin for Continuum, that is a servlet which provides some
statistical information about the projects. 

In order to achieve that I need to connect to the database of the Continuum, which I'm trying
to do by getting the right      org.apache.maven.continuum.store.ContinuumStore implementation
from the plexus environment, but I just can't get my reference instantiated. It is still null
 (the field store from the class that is shown) when I start the  servlet.

Since I have no experience with plexus and writing Continuum plugins I assume that I'm missing
something substantial. Here is what I'm trying to do:

My class looks like:
public class AtomServlet extends HttpServlet {

	String ROLE = AtomServlet.class.getName();
	/**
	 * @plexus.requirement
	 */
	private IContinuumInfo getInfo;

	@Override
	protected void service(HttpServletRequest arg0, HttpServletResponse res)
			throws ServletException, IOException {

		// setting the type of the response
		res.setContentType("text/html");
		// getting the response writer
		PrintWriter writeResponse = res.getWriter();
					   			  		 writeResponse.write(getInfo.getInfo(ContinuumInfo.FeedType.ATOM));
	}	

}

I define my component through a components.xml that looks like this :
<component-set>
  <components>
    <component>
      <role>cotinuuminfo.IContinuumInfo</role>
      <role-hint>info</role-hint>
      <implementation>cotinuuminfo.ContinuumInfo</implementation>
      <description>A utility class for parsing the build information of the projects
of the Continuum</description>
      <isolated-realm>false</isolated-realm>
      <requirements>
        <requirement>
          <role>org.apache.maven.continuum.store.ContinuumStore</role>
          <role-hint>jdo</role-hint>
          <field-name>store</field-name>
        </requirement>
      </requirements>
    </component>
  </components>
</component-set> 

Any help will be appreciated.

regards: Nikolay
Mime
View raw message