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 "Martijn Brinkers (List)" <ma...@gmail.com> on 2008/08/22 20:20:52 UTC

Access to mail spool and repositories (like error etc.)

I need some advice. I would like to add a soap webservice to James which
I can use to query the spool and other repositories (like the error) and
make it possible to respool certain messages.

I therefore need to have access to the Store instance which I retrieve
from the ServiceManager. Afaik it's not possible to get an instance of
the (global) ServiceManager (there isn't probably any) so I was
wondering whether I can store the ServiceManager instance that gets set
when Serviceable#service is called. I already have my own James service
which I use to initialize some server wide registries (Spring registry
etc.) and register some (cxf) soap services and I can make this service
a Serviceable service and store the ServiceManager upon load.

Is this possible or ar there better ways to get a reference to the Store
(and other James services)?

Thanks,

Martijn Brinkers




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


Re: Access to mail spool and repositories (like error etc.)

Posted by Stefano Bagnara <ap...@bago.org>.
Martijn Brinkers (List) ha scritto:
> I need some advice. I would like to add a soap webservice to James which
> I can use to query the spool and other repositories (like the error) and
> make it possible to respool certain messages.
> 
> I therefore need to have access to the Store instance which I retrieve
> from the ServiceManager. Afaik it's not possible to get an instance of
> the (global) ServiceManager (there isn't probably any) so I was
> wondering whether I can store the ServiceManager instance that gets set
> when Serviceable#service is called. I already have my own James service
> which I use to initialize some server wide registries (Spring registry
> etc.) and register some (cxf) soap services and I can make this service
> a Serviceable service and store the ServiceManager upon load.
> 
> Is this possible or ar there better ways to get a reference to the Store
> (and other James services)?

You can't make this assumption. Each component receives it's own 
ServiceManager expecially configured to provide dependencies to that 
module. It could be wrapped to only show you some service (the one that 
the component required) and it could override some global dependency 
with local dependencies.

You should better write your own Avalon component and declare it's 
dependencies so that you receive the right service manager and the right 
dependencies directly from phoenix.

The org.apache.james.mailrepository.MailStoreSpoolRepository class is a 
very simple avalon block that you can use a templace.

The MailStoreSpoolRepository.xinfo file declare the dependencies, the 
assembly.xml file declares how to wire dependencies of the 
services/components.

You can create your own service/component, put it in a jar (together 
with its xinfo file) and add it to SAR-INF/lib folder.

Stefano

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