Sascha Fröhlich wrote on 19 February 2008 15:43: > Hi there, > > is there any possibility to create threads from a mailet or to dispose > non time-critical operations into a spool or something? > > I've got a couple of scenarios where it would be best practice IMHO. > > Greetings, > Sascha
I don't recall the Mailet Spec. having anything to say on the matter, though perhaps it should. >From a practical point of view creating or acquiring new resources, such as threads, message queues and so forth, in a Mailet should be fine in James as long as they are fully managed by the Mailet lifecycle methods, init() and destroy(). An alternative is to delegate the creation/acquistion work to the environement in which the Mailet is deployed, Avalon in the case of James. In this scenario the Mailet simply performs a service lookup to obtain the resource from the environment. The first strategy is fine when just one Mailet needs the resource, the second is perhaps better when several Mailets need the same resource. Recent discussions on the James User List explored some of this. See the thread "Where should I put my initialization code?" Cheers -- Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]