users@glassfish.java.net

Re: Standard way of initializing an application

From: Sahoo <sahoo_at_sun.com>
Date: Tue, 27 Jan 2009 16:46:38 +0530

heapifyman wrote:
> glassfish_at_javadesktop.org schrieb:
>
>> Hi Sahoo,
>>
>> thanks for your reply.
>>
>> The cache is a very simple Apache JCS cache containing round about 500MB of data. The cache should not necessarily survive a server restart.
>>
>> The reason for my question is that I want users access a data model which is approved to be integrity checked.
>>
>> What I planned to do is to have a MDB for that processing a cache rebuild message. This is not the problem-
>> My problem is when and where to send the cache rebuild message from.
>>
>> I don't know what is the recommended here.
>>
>
> I don't know if this is recommended and I don't really know about your
> application but couldn't you use a servlet with <load-on-startup> ?
>
>
>
Yes, a servlet with load-on-startup can be used to do application level
initialization in a portable way. In EJB 3.1 (part of Java EE 6 and
GlassFish v3), you can also use singleton EJB with eager initilzation
feature to do it as well. If you are looking for something that works
now in most containers, servlet is the one you should use.

Thanks,
Sahoo