But the 'problem' with mailet init is that there is no guranteed order.
Lets suppose I need to access the global resource from within the init
of a more than one mailet. Which mailet should initialize the global
resource? I can, of course, initialize it in every init to make sure
that the global resource is initialize but that's not something I like.

As an experiment I added my own 'service' to assembly.xml which is
configured upon startup (the service implements Configurable). This
seems to be working but somewhere on the WIKI I read that this
functionality will be 'removed' by giving mailets their own classloader.

Martijn   

On Tue, 2008-02-12 at 22:09 +0000, Steve Brewin wrote:
> Hi
> 
> The Mailet init() method offers the oppurtunity to set things up. As
> documented here - http://james.apache.org/server/2.3.1/custom_mailet.html -
> it is called just once as the mailet container is started.
> 
> -- Steve
> 
> 
> 
> > -----Original Message-----
> > From: Martijn Brinkers [mailto:[EMAIL PROTECTED]
> > Sent: 12 February 2008 20:45
> > To: James Users List
> > Subject: Where should I put my initialization code?
> >
> >
> > Hi,
> >
> > For my mailets/matchers I need to initialize some global objects upon
> > start of James. One way to solve this would be to initialize
> > on demand,
> > ie when a getter is called for the global object. I would
> > however prefer
> > to initialize the objects beforehand because it makes testing somewhat
> > easier. Is there a way to do this differently with James?
> > Should I write
> > a James service for this?
> >
> > Martijn
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to