[MOBY-dev] New MobyServlet methodology

Paul Gordon gordonp at ucalgary.ca
Wed Dec 6 17:30:52 UTC 2006


Hi all,

FYI, I have made a major change to the way MobyServlet works.  It now 
uses Java annotations to define service meta-data.  For those of you not 
familiar with this Java 1.5 feature, here is how you'd write a service:

import org.biomoby.shared.data.*;
import org.biomoby.service.*;

@mobyService(name="ConvertAAtoFASTA_AA",
             type="FormatConversion", 
	     provider="moby.ucalgary.ca", 
	     author="gordonp at ucalgary.ca",
	     in={"inseq:AminoAcidSequence"},
	     out={"outseq:FASTA_AA"},
	     description={"Converts amino acid objects into FastA formatted records, ", 
			  "primarily to increase inter-service compatibility"})

public class ConvertAAtoFASTA_AA extends MobyServlet{

    public void processRequest(MobyDataJob request, MobyDataJob result) throws Exception{
       // insert your code here...
    }
}

That's it!  We've created an Ant build file (and an associated 
properties file) to support this, the highlights being:

ant test
ant war
ant registerService

Please see the detailed tutorial at 
http://biomoby.open-bio.org/CVS_CONTENT/moby-live/Java/docs/deployingServices.html
If anyone's got an Oracle or IBM servlet engine to test this on, I'd 
appreciate the feedback.

Regards,

Paul (with Quang Trinh's help on the Ant stuff)



More information about the MOBY-dev mailing list