james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: Removing spam after 15 days
Date Thu, 27 Sep 2007 07:31:03 GMT
Kevin Jackson ha scritto:
> Hi Norman,
> 
>> what about writing a "small" service which get wired via assembly.xml ?
>> So it will automatic startet via james and do the job until james is
>> stopped..
>> Does this sound better ?
> 
> This does sound like the kind of thing we want, which apis should I be
> looking at (presumably not the mailet api)
> 
>> If you have questions i can probaly assist you...
> 
> Do you have a skeleton code for a service and the assembly wiring?
> 
> Kev

Look at the fetchmail scheduler component:

This is the avalon component descriptor.
http://svn.apache.org/repos/asf/james/server/trunk/fetchmail-function/src/main/java/org/apache/james/fetchmail/FetchScheduler.xinfo
You notice that it declares
org.apache.avalon.cornerstone.services.scheduler.TimeScheduler as a
dependency.

You will also have to add a dependency on the repository (or the store
that allow you to access the repository) if you want to work with mails.

Then in the code it takes the dependency and it use the TimeScheduler to
schedule its own tasks:
http://svn.apache.org/repos/asf/james/server/trunk/fetchmail-function/src/main/java/org/apache/james/fetchmail/FetchScheduler.java

The it's added to the assembly to make it active and scheduling:
http://svn.apache.org/repos/asf/james/server/trunk/phoenix-deployment/src/conf/james-assembly.xml

It's easier with an external cron and direct mysql commands, but this is
more integrated.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message