You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Philip Tomlinson <ph...@pot.co.nz> on 2006/04/06 15:30:08 UTC
Circular Dependency
Hi,
I have a mailet in which I want to schedule a job.
I am using James 2.2.0.
I have found the fulcrum-quartz package which shows how to configure the
quartz scheduler in an avalon container.
I have added in a new block into the assembly.xml for the quartz
scheduler and added it into the James block as a provider.
Now in a mailet I can schedule a job.
However I want the job to send an email.
I have tried adding in a the James block as a provide of the quartz
block I defined (and added in the dependency in the .xinfo) file.
Now I have a circular dependency which the server duly tells me.
In the case where I have 2 blocks that "use" the services of each other,
how can one set up the assembly.xml and .xinfo files to facilitate this
and avoid the circular dependency.
I cant see how to do it other than using the service method in the
container (James) to potentially set itself into the component
(QuartzScheduler).
Is there a better way?
Rgds,
Phil
-------------------------
Philip Tomlinson
PJT Consulting
Email: phil@pot.co.nz
Mobile: 021 707 385
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org
Re: Circular Dependency
Posted by Stefano Bagnara <ap...@bago.org>.
The mailet is a multithreaded component started at james initialization
and disposed just before the james stop.
You can create the scheduler just inside the Mailet with no need to use
an avalon-component.
The fulcrum-quartz package is useful if you need to schedule processes
in the container not starting from the mailet.
Stefano
Philip Tomlinson wrote:
> Hi,
>
> I have a mailet in which I want to schedule a job.
> I am using James 2.2.0.
>
> I have found the fulcrum-quartz package which shows how to configure the
> quartz scheduler in an avalon container.
>
> I have added in a new block into the assembly.xml for the quartz
> scheduler and added it into the James block as a provider.
> Now in a mailet I can schedule a job.
>
> However I want the job to send an email.
>
> I have tried adding in a the James block as a provide of the quartz
> block I defined (and added in the dependency in the .xinfo) file.
>
> Now I have a circular dependency which the server duly tells me.
>
> In the case where I have 2 blocks that "use" the services of each other,
> how can one set up the assembly.xml and .xinfo files to facilitate this
> and avoid the circular dependency.
> I cant see how to do it other than using the service method in the
> container (James) to potentially set itself into the component
> (QuartzScheduler).
> Is there a better way?
>
> Rgds,
> Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org