jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: User Managed Transactions...
Date Tue, 28 Jul 2009 18:01:09 GMT
On Tue, Jul 28, 2009 at 7:01 PM, Gadbury<gadbury@googlemail.com> wrote:
> I'm confused - please excuse me for being a novice.  All of my repository
> read / write code uses Interfaces form javax.jcr.* imports.  So I am
> importing the JCR spec Interfaces... but where is the Jackrabbit
> implementation?  I assume there is some magic that I cannot comprehend going
> on behind the scenes, driven by the Jackrabbit configuration file.

The trick is Java's interfaces ;-) Your code is written against the
JCR API Interfaces, but at runtime the underlying objects will be
Jackrabbits implementation classes.

You need a starting point, though. This is the Repository interface,
which can be retrieved in many ways. In simple standalone code, you
might explicitly get it by creating an instance of Jackrabbit's
TransientRepository. But in a webapp/J2EE container scenario it might
be provided globally through RMI or JNDI. Jackrabbit's default webapp
for example internally creates such a repository and registers it with
RMI or JNDI (depending on config). The client code, which might reside
in another webapp, will be using only the jcr-1.0.jar with the
interfaces for accessing that Repository object and all other
following stuff (Repository.login -> Session -> getRootNode -> Node

Hope that helps,

Alexander Klimetschek

View raw message