jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Initializing Jackrabbit ...
Date Tue, 01 Aug 2006 12:32:49 GMT
Hi,

On 8/1/06, JavaJ <ponfar99@yahoo.com> wrote:
> Is it possible to initialize Jackrabbit manually on the startup of your
> webapp?  For example, in a Servlet.init() method, calling
> RepositoryImpl.create() or using a framework like Spring for initialization?
> Or do you have to use one of the Deployment Models for initalization of the
> repository?

You can follow the deployment model 1 HOWTO. The
BindableRepositoryFactory bound in JNDI will automatically initialize
the repository when it's first accessed. Note that even though the
HOWTO doesn't currently mention it, you need to explicitly shutdown()
the repository in a Servlet.destroy() method to correctly clean things
up.

As you asked, you can also use RepositoryImpl.create() or even an IoC
framework to start the repository if you don't want to use JNDI. Note
that also in this case you generally want to make sure that the
repository gets shut down when your webapp is closed.

BR,

Jukka Zitting

-- 
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Mime
View raw message