james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luc Saulière <luc.sauli...@gmail.com>
Subject Re: Inject a living instance of MailboxManager in a standalone application...
Date Mon, 07 Feb 2011 14:36:21 GMT

My purpose was to access to James db in order to write some mail in it.
Those mail comes from another mail account so I didn't want them to go threw
James to be put in the DB...
By this way, I have to restart the James server to be able to read my new
messages threw IMAP or POP.
Moreover, the transaction is slow and it takes several second for each 100ko
of message.

I would like to embed my app in James but I need to access it from the
outside, i.e. something like a tomcat server. Then I didn't want my entire
James to be accessible from the app server...

What exactly does the boolean refresh arg in ClassPathXmlApplicationContext?


2011/2/3 Eric Charles <eric@apache.org>

> Hi Luc,
> From you previous posts, I understand that you access mailbox with a
> reduced spring context (around 5 beans).
> You say that it is very slow and does not refresh automatically.
> Can you give more information : in which way is it slow (insert, read,
> ...), what do you mean with "refresh"  (james is loaded with
> ClassPathXmlApplicationContext(String... configLocations), not with
> ClassPathXmlApplicationContext(String[] configLocations, boolean refresh),
> is this what you mean?)
> If you want to retrieve an instance of the james instanciated
> mailboxmanager, you need to act in the "james spring context", meaning that
> you must access the SpringContext created by the james main. Of well, you
> embed james in your app, of well your app is embedded in james. The keypoint
> is that you need a common spring context: this can be achieved with separate
> xml spring files that you load at the same time with
> ClassPathXmlApplicationContext(String[] configLocations, boolean refresh).
> Tks,
> - Eric
> On 2/02/2011 12:14, Luc Sauličre wrote:
>> Hello,
>> I'm trying to build an application based on James DB acces (jdbc mysql).
>> I've dev a solution (thank's to james dev mailing list:) with a
>> MailboxManager instance. But it is very slow and it does not refresh
>> automaticaly...
>> I was thinking that maybe I could inject directly a living instance of
>> MailboxManager (instancied by James itself) into my own independent app
>> (like a tomcat serv app).
>> Is this possible?
>> Thx,
>> Luc.
>> Response to Norman's answer dated of 2011/1/19 :
>> Sure there is.. But to be honest I would not do this as you will
>> always need to look out for db changes etc. So I think the prefered
>> way would be to inject an instance of MailboxManager in your custom
>> app and store the mails via it. Or is this not possible ?
>> Bye,
>> Norman
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message